Changeset 108 for trunk/classes/idl/idl_audio
- Timestamp:
- Oct 4, 2023, 6:18:02 PM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/classes/idl/idl_audio/cwaudio.c
r93 r108 266 266 WinSendMsg(WinWindowFromID(hwnd,IDEF_ID3ALBUM),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)30),0); 267 267 WinSendMsg(WinWindowFromID(hwnd,IDEF_ID3COMMENT),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)30),0); 268 WinSendMsg(WinWindowFromID(hwnd,IDEF_ID3YEAR),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)4) -1),0);268 WinSendMsg(WinWindowFromID(hwnd,IDEF_ID3YEAR),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)4),0); 269 269 #endif 270 270 /* Fill drop downlist with knwon genres */ … … 977 977 978 978 if(_somIsA(thisPtr, mmMIDIClass)) 979 strncpy(chrDevice,"SEQUENCER", sizeof(chrDevice) );979 strncpy(chrDevice,"SEQUENCER", sizeof(chrDevice) - 1); 980 980 else 981 strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice) );981 strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice) - 1); 982 982 983 983 ulNameSize=sizeof(name); … … 985 985 986 986 /* Start audio file */ 987 sprintf(chrCommand,"open \"%s\" type %s alias wave% dSHAREABLE wait",name, chrDevice, thisPtr);987 sprintf(chrCommand,"open \"%s\" type %s alias wave%p SHAREABLE wait",name, chrDevice, thisPtr); 988 988 rc = mciSendString( chrCommand, retMsg, sizeof(retMsg), hwnd, 0); 989 989 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { … … 993 993 994 994 /* Set time format */ 995 sprintf(chrCommand,"SET wave% dTIME FORMAT MILLISECONDS wait", thisPtr);995 sprintf(chrCommand,"SET wave%p TIME FORMAT MILLISECONDS wait", thisPtr); 996 996 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 997 997 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { … … 1000 1000 } 1001 1001 1002 sprintf(chrCommand,"STATUS wave% dLENGTH WAIT", thisPtr);1002 sprintf(chrCommand,"STATUS wave%p LENGTH WAIT", thisPtr); 1003 1003 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1004 1004 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { … … 1009 1009 iTime=atoi(retMsg); 1010 1010 1011 // sprintf(chrCommand,"SETPOSITIONADVISE wave% dON EVERY %d NOTIFY", thisPtr, 3000);1011 // sprintf(chrCommand,"SETPOSITIONADVISE wave%p ON EVERY %d NOTIFY", thisPtr, 3000); 1012 1012 // rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), hwnd, 0); 1013 1013 … … 1020 1020 iTime=100; 1021 1021 1022 sprintf(chrCommand,"SETCUEPOINT wave% dON at %d WAIT", thisPtr, iTime);1022 sprintf(chrCommand,"SETCUEPOINT wave%p ON at %d WAIT", thisPtr, iTime); 1023 1023 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), hwnd, 0); 1024 1024 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { … … 1028 1028 1029 1029 /* Set volume */ 1030 sprintf(chrCommand,"SET wave% dAUDIO VOLUME %d wait", thisPtr, globalClassVolume);1030 sprintf(chrCommand,"SET wave%p AUDIO VOLUME %d wait", thisPtr, globalClassVolume); 1031 1031 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1032 1032 /* Not able to set the volume isn't that bad so don't quit in case of an error. */ … … 1040 1040 WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, 1, 100); 1041 1041 1042 sprintf(chrCommand,"play wave% d", thisPtr);1042 sprintf(chrCommand,"play wave%p ", thisPtr); 1043 1043 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1044 1044 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { … … 1080 1080 1081 1081 /* Set volume */ 1082 sprintf(chrCommand,"SET wave% dAUDIO VOLUME %d ", thisPtr, globalClassVolume);1082 sprintf(chrCommand,"SET wave%p AUDIO VOLUME %d ", thisPtr, globalClassVolume); 1083 1083 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1084 1084 /* Not able to set the volume isn't that bad so don't quit in case of an error. */ … … 1095 1095 WinStopTimer(WinQueryAnchorBlock(hwnd),hwnd,1 ); 1096 1096 1097 sprintf(chrCommand,"stop wave% dwait", thisPtr);1097 sprintf(chrCommand,"stop wave%p wait", thisPtr); 1098 1098 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1099 1099 1100 sprintf(chrCommand,"close wave% dwait", thisPtr);1100 sprintf(chrCommand,"close wave%p wait", thisPtr); 1101 1101 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1102 1102 … … 1114 1114 // CWMMDataFileData *mmdf_somThis = CWMMDataFileGetData(thisPtr); 1115 1115 1116 sprintf(chrCommand,"STATUS wave% dMODE WAIT", thisPtr);1116 sprintf(chrCommand,"STATUS wave%p MODE WAIT", thisPtr); 1117 1117 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1118 1118 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { … … 1123 1123 if(!stricmp(retMsg, "playing")) 1124 1124 { 1125 sprintf(chrCommand,"PAUSE wave% dwait", thisPtr);1125 sprintf(chrCommand,"PAUSE wave%p wait", thisPtr); 1126 1126 rc=mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1127 1127 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { … … 1142 1142 // CWMMDataFileData *mmdf_somThis = CWMMDataFileGetData(thisPtr); 1143 1143 1144 sprintf(chrCommand,"STATUS wave% dMODE WAIT", thisPtr);1144 sprintf(chrCommand,"STATUS wave%p MODE WAIT", thisPtr); 1145 1145 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1146 1146 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { … … 1151 1151 if(!stricmp(retMsg, "paused")) 1152 1152 { 1153 sprintf(chrCommand,"RESUME wave% dwait", thisPtr);1153 sprintf(chrCommand,"RESUME wave%p wait", thisPtr); 1154 1154 rc=mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1155 1155 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { … … 1191 1191 } 1192 1192 /* Get current play position */ 1193 sprintf(chrCommand,"STATUS wave% dPOSITION WAIT", thisPtr);1193 sprintf(chrCommand,"STATUS wave%p POSITION WAIT", thisPtr); 1194 1194 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1195 1195 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { … … 1240 1240 char retMsg[20]; 1241 1241 1242 sprintf(chrCommand,"STATUS wave% dMODE WAIT", thisPtr);1242 sprintf(chrCommand,"STATUS wave%p MODE WAIT", thisPtr); 1243 1243 do { 1244 1244 APIRET rc; … … 3260 3260 // HlpWriteToTrapLog("File: %s\n", fName); 3261 3261 /* open the file */ 3262 sprintf(chrCommand,"open \"%s\" type SEQUENCER alias wave% dSHAREABLE wait",fName, somSelf);3262 sprintf(chrCommand,"open \"%s\" type SEQUENCER alias wave%p SHAREABLE wait",fName, somSelf); 3263 3263 rc = mciSendString( chrCommand, retMsg, sizeof(retMsg), NULLHANDLE, 0); 3264 3264 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { … … 3267 3267 3268 3268 /* Set time format */ 3269 sprintf(chrCommand,"SET wave% dTIME FORMAT MILLISECONDS wait", somSelf);3269 sprintf(chrCommand,"SET wave%p TIME FORMAT MILLISECONDS wait", somSelf); 3270 3270 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 3271 3271 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { 3272 3272 /* close the file */ 3273 sprintf(chrCommand,"close wave% dwait", somSelf);3273 sprintf(chrCommand,"close wave%p wait", somSelf); 3274 3274 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 3275 3275 break; … … 3277 3277 3278 3278 /* Get midi info */ 3279 sprintf(chrCommand,"STATUS wave% dLENGTH WAIT", somSelf);3279 sprintf(chrCommand,"STATUS wave%p LENGTH WAIT", somSelf); 3280 3280 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 3281 3281 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { 3282 3282 /* close the file */ 3283 sprintf(chrCommand,"close wave% dwait", somSelf);3283 sprintf(chrCommand,"close wave%p wait", somSelf); 3284 3284 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 3285 3285 break; … … 3298 3298 3299 3299 // HlpWriteToTrapLog("Midi-Time ulPlaySecs: %d\n", _ulPlaySecs); 3300 sprintf(chrCommand,"STATUS wave% dNUMBER OF TRACKS WAIT", somSelf);3300 sprintf(chrCommand,"STATUS wave%p NUMBER OF TRACKS WAIT", somSelf); 3301 3301 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 3302 3302 if((rc & 0x0000ffff)==MCIERR_SUCCESS) { … … 3306 3306 3307 3307 /* close the file */ 3308 sprintf(chrCommand,"close wave% dwait", somSelf);3308 sprintf(chrCommand,"close wave%p wait", somSelf); 3309 3309 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 3310 3310 }/* else is MMMIDI */
Note:
See TracChangeset
for help on using the changeset viewer.