Changeset 60


Ignore:
Timestamp:
Sep 22, 2023, 8:14:23 PM (23 months ago)
Author:
gyoung
Message:

Fix time being appended to title instead of replacing the last line

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/classes/c/c_audio/cwaudio.c

    r58 r60  
    12301230            OPENPARAMS * pParams;
    12311231            MMAudio * thisPtr;
     1232            char *s;
    12321233           
    12331234            pParams=PVOIDFROMMP(mp2);/* Get parameter block */
     
    13961397                /* Set Time in icon title to 00:00 */
    13971398                strncpy(chrCommand, _wpQueryTitle(thisPtr), CCHMAXPATH);
     1399                s = strchr(chrCommand, '\n');
     1400                if (s)
     1401                  *s = 0;
    13981402                if(_ulPlaySecs) {
    13991403                  sprintf(retMsg, "%02d:%02d", _ulPlaySecs/60, _ulPlaySecs%60);                 
     
    15181522
    15191523        if(somIsObj(thisPtr)) {
    1520           char retMsg[50];
    1521           unsigned char chrCommand[CCHMAXPATH+20];
     1524          char retMsg[50] = {0};
     1525          unsigned char chrCommand[CCHMAXPATH+20] = {0};
    15221526          APIRET rc;
    15231527          ULONG ulCur;
    15241528          MMAudioData *somThis = MMAudioGetData(thisPtr);
    1525 
     1529          char *s;
    15261530
    15271531          /*@@CHANGE 0.2.8:
     
    15491553
    15501554          strncpy(chrCommand, _wpQueryTitle(thisPtr), CCHMAXPATH);
    1551           strncat(chrCommand,"\n",sizeof(chrCommand)-1-strlen(chrCommand));
     1555          s = strchr(chrCommand, '\n');
     1556              if (s)
     1557               *s = 0;
     1558          strncat(chrCommand,"\n",sizeof(chrCommand)-1-strlen(chrCommand));
    15521559          if(_ulPlaySecs) {
    15531560            sprintf(retMsg, "%02d:%02d / %02d:%02d", ulCur/60, ulCur%60, _ulPlaySecs/60, _ulPlaySecs%60);
     
    29462953        {
    29472954          if(iRunningAudioFiles<MAX_AUDIOFILE_STARTS) {
    2948             /*
    2949               @@CHANGE 0.2.8
    2950 
    2951               Workaround for WPS chrash with Timidity: Open 'ID_MENU_START' disabled.
    2952              */
    2953             //if(globalHaveTimidity && somObjectIsA(somSelf, "MMMidi"))
    2954             //  return NULLHANDLE,
     2955           
    29552956            /* Another audio file running */
    29562957            iRunningAudioFiles++;
    29572958
    2958             __set_ulPreviousView(somSelf, _wpQueryDefaultView(somSelf));/* Save the view set by the user                  */
    2959             _cwmmPlayTrack(somSelf, hwndCnr, TRUE);      /* Start playing 
     2959            __set_ulPreviousView(somSelf, _wpQueryDefaultView(somSelf));/* Save the view set by the user */
     2960            _cwmmPlayTrack(somSelf, hwndCnr, TRUE);      /* Start playing*/
    29602961            _wpSetDefaultView(somSelf, ID_MENU_STOP);    /* Set new view so doubleclick stops the playing. */
    29612962          }
     
    29642965      case ID_MENU_STOP:
    29652966        {
    2966           _cwmmPlayTrack(somSelf, hwndCnr, FALSE);     /* Stop playing                                   */
     2967          _cwmmPlayTrack(somSelf, hwndCnr, FALSE);     /* Stop playing */
    29672968          _wpSetDefaultView(somSelf, __get_ulPreviousView(somSelf)); /* Restore the user view                          */
    29682969          return NULLHANDLE;
     
    35243525    /* Default view for audio objects is 'Start' so on doubleclick the playing starts
    35253526       immediately. */
    3526     /*
    3527       @@CHANGE 0.2.8
    3528 
    3529       Set default view for midi files to player when Timidity is installed. 'Start'
    3530       menu isn't available then (see cwmidi.c).
    3531      */
    3532     //if(globalHaveTimidity && somObjectIsA(somSelf, "M_MMMidi"))
    3533       //return ID_MENU_PLAYER;
    35343527
    35353528    return ID_MENU_START;
    3536     //    return (M_CWAudio_parent_M_MMAudio_wpclsQueryDefaultView(somSelf));
    35373529}
    35383530
Note: See TracChangeset for help on using the changeset viewer.