Changeset 104 for trunk/classes/mm-progs
- Timestamp:
- Oct 2, 2023, 11:34:35 PM (23 months ago)
- Location:
- trunk
- Files:
-
- 16 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/v2.9 merged eligible /branches/v2.9_Lars merged eligible
-
Property svn:mergeinfo
set to
-
trunk/classes/mm-progs/MMPlayer/customprocs.c
r2 r104 21 21 * If you need another license for your project/product (commercial, 22 22 * noncommercial, whatever) contact me at 23 * 23 * 24 24 * http://www.os2world.com/cdwriting 25 25 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 43 43 #include <stdio.h> 44 44 #include <stdlib.h> 45 #include <string.h> 45 46 46 47 … … 70 71 { 71 72 PDRAGINFO pdi=PVOIDFROMMP(mp1); 72 73 73 74 return handleDrag0ver( pdi, WinQueryWindow(hwnd, QW_PARENT)); 74 75 } … … 76 77 { 77 78 PDRAGINFO pdi=PVOIDFROMMP(mp1); 78 79 79 80 return handleDrop( pdi, WinQueryWindow(hwnd, QW_PARENT)); 80 81 } … … 104 105 if(swp.fl & SWP_MINIMIZE) 105 106 break; 106 107 107 108 hps=WinBeginPaint(hwnd, NULLHANDLE, NULLHANDLE); 108 109 WinQueryWindowRect(hwnd, &rcl); 109 110 WinDrawBitmap(hps, allBMPs[MAIN_BMP_IDX].hbm, 110 NULLHANDLE, 111 NULLHANDLE, 111 112 (PPOINTL)&rcl, 112 113 0, 0, 113 DBM_IMAGEATTRS); 114 DBM_IMAGEATTRS); 114 115 WinEndPaint(hps); 115 116 return MRFALSE; … … 183 184 184 185 WinDrawBitmap(ubPtr->hps, ci.hbmSource, 185 &ci.rclSource, 186 &ci.rclSource, 186 187 (PPOINTL)&rcl, 187 188 0, 0, … … 211 212 if(ulShowFeedback==2) 212 213 return 1; 213 214 214 215 switch(usControl) 215 216 { … … 237 238 hps=WinGetPS(hwnd); 238 239 WinDrawBitmap(hps, ci.hbmSource, 239 &ci.rclSource, 240 &ci.rclSource, 240 241 (PPOINTL)&rcl, 241 242 0, 0, … … 255 256 256 257 switch (msg) 257 { 258 { 258 259 #if 0 259 260 /* Drag and drop of audio files */ … … 330 331 USHORT usWidth=WinQueryWindowUShort(hwnd, SLIDERARMWIDTH); 331 332 332 if(x<=lPos+usWidth+SLOFFSET && x>=lPos+SLOFFSET && 333 if(x<=lPos+usWidth+SLOFFSET && x>=lPos+SLOFFSET && 333 334 y<=WinQueryWindowUShort(hwnd, SLIDERY)+WinQueryWindowUShort(hwnd, SLIDERCY) 334 335 && y>=WinQueryWindowUShort(hwnd, SLIDERY)) { … … 346 347 if(SHORT1FROMMP(mp2)) { 347 348 hps=WinGetPS(hwnd); 348 WinQueryWindowRect(hwnd, &rcl); 349 WinQueryWindowRect(hwnd, &rcl); 349 350 GpiSetLineType(hps, LINETYPE_DOT); 350 351 ptl.x=rcl.xLeft; … … 369 370 if(WinQueryFocus(HWND_DESKTOP)==hwnd) { 370 371 if(SHORT2FROMMP(mp2)==VK_TAB && (SHORT1FROMMP(mp1) & KC_VIRTUALKEY)) 371 if(SHORT1FROMMP(mp1) & (KC_KEYUP|KC_PREVDOWN)) 372 if(SHORT1FROMMP(mp1) & (KC_KEYUP|KC_PREVDOWN)) 372 373 return (MRESULT)TRUE; 373 374 … … 486 487 USHORT usWidth=WinQueryWindowUShort(hwnd, SLIDERARMWIDTH); 487 488 488 if(x<=lPos+usWidth+SLOFFSET && x>=lPos+SLOFFSET && 489 if(x<=lPos+usWidth+SLOFFSET && x>=lPos+SLOFFSET && 489 490 y<=WinQueryWindowUShort(hwnd, SLIDERY)+WinQueryWindowUShort(hwnd, SLIDERCY) 490 491 && y>=WinQueryWindowUShort(hwnd, SLIDERY)){ … … 522 523 USHORT usWidth=WinQueryWindowUShort(hwnd, SLIDERARMWIDTH); 523 524 524 525 525 526 lTemp=lPos; 526 527 527 528 rcl.xLeft=WinQueryWindowULong(hwnd, SLIDERX); 528 529 rcl.yBottom=WinQueryWindowULong(hwnd, SLIDERY); … … 624 625 LONG lPos=WinQueryWindowULong(hwnd, SLIDERARMPOS); 625 626 USHORT usWidth=WinQueryWindowUShort(hwnd, SLIDERARMWIDTH); 626 if(x<=lPos+usWidth+SLOFFSET && x>=lPos+SLOFFSET && 627 if(x<=lPos+usWidth+SLOFFSET && x>=lPos+SLOFFSET && 627 628 y<=WinQueryWindowUShort(hwnd, SLIDERY)+WinQueryWindowUShort(hwnd, SLIDERCY) 628 629 && y>=WinQueryWindowUShort(hwnd, SLIDERY)) { … … 689 690 hps=WinBeginPaint(hwnd, NULLHANDLE, NULLHANDLE); 690 691 rcl3=rcl=rcl2; 691 /* Arm pos */ 692 /* Arm pos */ 692 693 rcl2.xLeft+=lPos; 693 /* Arm size */ 694 /* Arm size */ 694 695 rcl2.xRight=rcl2.xLeft+usWidth; 695 696 696 697 /* Shaft */ 697 698 /* Left part */ … … 742 743 if(!rc) 743 744 { 744 WinFillRect(hps,&rcl2, CLR_PALEGRAY); 745 WinFillRect(hps,&rcl2, CLR_PALEGRAY); 745 746 WinDrawBorder(hps, &rcl2, 2, 2, 0, 0 ,0x0400); 746 747 } … … 779 780 return (MRESULT)FALSE; 780 781 } 781 782 782 783 switch(poi->idItem) 783 784 { … … 786 787 //DosBeep(5000, 50); 787 788 WinDrawBitmap(poi->hps, ciArm.hbmSource, 788 &ciArm.rclSource, 789 &ciArm.rclSource, 789 790 (PPOINTL)&poi->rclItem, 790 791 0, 0, … … 796 797 WinDrawBitmap(poi->hps, 797 798 ci.hbmSource, 798 &ci.rclSource, 799 &ci.rclSource, 799 800 (PPOINTL)&poi->rclItem, 800 801 0, 0, … … 815 816 if(!WinDrawBitmap(poi->hps, ci.hbmSource, 816 817 &rcl, 817 //&ci.rclSource, 818 //&ci.rclSource, 818 819 (PPOINTL)&poi->rclItem, 819 820 0, 0, … … 863 864 char text[100]; 864 865 CONTROLINFO ci; 865 866 866 867 ci=ciControls[CTRLIDX_PLAYTIME];//ciVolSliderArm; 867 868 868 869 hps=WinBeginPaint(hwnd, NULLHANDLE, NULL); 869 870 if(WinQueryWindowText(hwnd, sizeof(text), text)) … … 871 872 POINTL ptl= {0}; 872 873 WinDrawBitmap(hps, ci.hbmSource, 873 &ci.rclSource, 874 &ci.rclSource, 874 875 &ptl, 875 876 0, 0, -
trunk/classes/mm-progs/MMPlayer/display.c
r2 r104 21 21 * If you need another license for your project/product (commercial, 22 22 * noncommercial, whatever) contact me at 23 * 23 * 24 24 * http://www.os2world.com/cdwriting 25 25 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 42 42 #include <stdio.h> 43 43 #include <stdlib.h> 44 #include <string.h> 44 45 45 46 /* 0: time, 1: remaining, 2: filename */ … … 88 89 89 90 90 /* This fun ktion sets the playtime display according to the user settings.91 /* This function sets the playtime display according to the user settings. 91 92 Supported are remaining time, elapsed time and ID3-tag display */ 92 void setPlayTimeText( hwndFrame)93 void setPlayTimeText(HWND hwndFrame) 93 94 { 94 95 char text[CCHMAXPATH]; … … 112 113 /* Show filename */ 113 114 text[0]=0; 114 115 115 116 if(ulTemp>=3) 116 117 text[0]=0; 117 118 else if(ulTemp>=0) 118 119 strcpy(text, chrPtrName); 119 120 120 121 #if 0 121 122 else 122 123 ulTemp=15; /* Show playtime for midi files */ 123 124 #endif 124 125 125 126 if(ulTemp>=3||!strlen(text)) { 126 127 /* Play time */ … … 135 136 ulDisplayTimer=ulTemp; 136 137 break; 137 138 138 139 #if 0 139 140 /* Show ID3 tag */ … … 149 150 if(ulTemp>=15) 150 151 text[0]=0; 151 else if(ulTemp>=12) 152 else if(ulTemp>=12) 152 153 methodPtr(cwAudio, &chrPtr, sizeof(text), IDINFO_GENRE); 153 154 else if(ulTemp>=9) … … 162 163 else 163 164 ulTemp=15; /* Show playtime for midi files */ 164 165 165 166 if(ulTemp>=15||!strlen(text)) { 166 167 /* Play time */ -
trunk/classes/mm-progs/MMPlayer/mmplayer.c
r46 r104 21 21 * If you need another license for your project/product (commercial, 22 22 * noncommercial, whatever) contact me at 23 * 23 * 24 24 * http://www.os2world.com/cdwriting 25 25 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 52 52 #include "sys_funcs.h" 53 53 54 #ifndef OPEN_DEFAULT 54 #ifndef OPEN_DEFAULT 55 55 /* Open views for the wpOpen() method */ 56 56 … … 135 135 136 136 /* Every folder has one running play thread to handle play commands */ 137 void _OptlinkplayThreadFunc (void *arg);137 void playThreadFunc (void *arg); 138 138 void controlPlaying(HWND hwndDialog, ULONG ulAction, ULONG ulReserved); 139 139 BOOL stopAudioFile(HWND hwndFrame); … … 211 211 WinQueryPointerPos(HWND_DESKTOP, &ptl) ; 212 212 WinMapWindowPoints(HWND_DESKTOP,hwnd,&ptl,1); 213 WinPopupMenu(hwnd, hwnd, hwndPopup, 213 WinPopupMenu(hwnd, hwnd, hwndPopup, 214 214 ptl.x, ptl.y, 0, PU_HCONSTRAIN | PU_VCONSTRAIN | 215 PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_MOUSEBUTTON2 | PU_NONE ); 216 215 PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_MOUSEBUTTON2 | PU_NONE ); 216 217 217 } 218 218 … … 227 227 hResource=BMP_RESSOURCEHANDLE; //_queryResModuleHandle(); 228 228 hps=WinGetPS(HWND_DESKTOP); 229 229 230 230 /* The main BMP */ 231 231 allBMPs[MAIN_BMP_IDX].hbm=GpiLoadBitmap(hps, hResource, IDBMP_TOPMIDDLE, 0, 0); … … 327 327 WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclSource.xLeft,ci.rclSource.yBottom, 328 328 ci.rclSource.xRight-ci.rclSource.xLeft, 329 ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE|SWP_SIZE); 329 ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE|SWP_SIZE); 330 330 oldPlayTimeProc=WinSubclassWindow(WinWindowFromID(hwnd, IDST_MMPLAYERPLAYTIME), playTimeTextProc); 331 331 332 332 /* Pos slider */ 333 333 ci=ciControls[CTRLIDX_POSSLIDER];//ciPosSlider; 334 WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 334 WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 335 335 hwnd, HWND_TOP, ci.id, NULLHANDLE, NULLHANDLE); 336 336 WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclDest.xLeft, ci.rclDest.yBottom, 337 337 ci.rclSource.xRight-ci.rclSource.xLeft, 338 338 ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE | SWP_SIZE); 339 339 340 340 WinSendMsg(WinWindowFromID(hwnd, ci.id),SLM_SETSLIDERINFO, 341 341 MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS,0), 342 MPFROM2SHORT( 9, 9)); 342 MPFROM2SHORT( 9, 9)); 343 343 344 344 /* Vol slider */ 345 345 ci=ciControls[CTRLIDX_VOLSLIDER];//ciVolSlider; 346 WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 346 WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 347 347 hwnd, HWND_TOP, ci.id, NULLHANDLE, NULLHANDLE); 348 348 WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclDest.xLeft, ci.rclDest.yBottom, … … 351 351 WinSendMsg(WinWindowFromID(hwnd, ci.id),SLM_SETSLIDERINFO, 352 352 MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS,0), 353 MPFROM2SHORT( 9, 9)); 353 MPFROM2SHORT( 9, 9)); 354 354 355 355 } … … 370 370 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { 371 371 /* Problem with MCI. Clean up. The Timer will be stopped in the method */ 372 stopAudioFile(hwndFrame); 372 stopAudioFile(hwndFrame); 373 373 } 374 374 else { 375 375 if(!stricmp(retMsg, "stopped")) { 376 376 /* Audio file played. */ 377 stopAudioFile(hwndFrame); 377 stopAudioFile(hwndFrame); 378 378 } 379 379 showPlayTimeDisplay(hwndFrame, TRUE);/* Ensure display is visible */ … … 391 391 return usItems; 392 392 } 393 393 394 394 return 0; 395 395 } … … 397 397 BOOL DrgVerifyTypeCW(PDRAGITEM pDragItem, char * chrType) 398 398 { 399 /* DrgVerifyType() seems not to work when several types are in the list?? 399 /* DrgVerifyType() seems not to work when several types are in the list?? 400 400 Dokumentation says, it works... */ 401 401 /* Only check for a single type for now */ … … 467 467 for(ulHash=0;*theString!='\0'; theString++) 468 468 ulHash=*theString+37*ulHash; 469 469 470 470 return ulHash%HASHSIZE; 471 471 } … … 538 538 MRESULT handleDrag0ver(PDRAGINFO pdi, HWND hwnd) 539 539 { 540 540 541 541 /* Only accept one file */ 542 542 if(DrgGetNumObjects(pdi)!=1) { … … 546 546 if(DrgCheckForKnownType(pdi, hwnd)) 547 547 return MRFROM2SHORT(DOR_DROP, DO_COPY); 548 549 return MRFROM2SHORT(DOR_NEVERDROP, DO_COPY); 548 549 return MRFROM2SHORT(DOR_NEVERDROP, DO_COPY); 550 550 } 551 551 … … 562 562 char chrFile[CCHMAXPATH]; 563 563 PDRAGITEM pDragItem; 564 564 565 565 pDragItem=DrgQueryDragitemPtr(pdi, 0); 566 DrgQueryStrName(pDragItem->hstrSourceName,sizeof(chrFile), chrFile); 567 DrgQueryStrName(pDragItem->hstrContainerName,sizeof(chrSourceName), chrSourceName); 566 DrgQueryStrName(pDragItem->hstrSourceName,sizeof(chrFile), chrFile); 567 DrgQueryStrName(pDragItem->hstrContainerName,sizeof(chrSourceName), chrSourceName); 568 568 strcat(chrSourceName, chrFile); 569 569 570 570 /* Start new file */ 571 571 controlPlaying(hwnd, PLAY_FIRST, 0); … … 608 608 MPFROM2SHORT(SC_SIZE, TRUE), 609 609 MPFROMP(NULL)); 610 610 611 611 WinSendMsg(hwndMenu, /* Delete Minimize from the system menu */ 612 612 MM_DELETEITEM, 613 613 MPFROM2SHORT(SC_MINIMIZE, TRUE), 614 614 MPFROMP(NULL)); 615 615 616 616 WinSendMsg(hwndMenu, /* Delete Maximize from the system menu */ 617 617 MM_DELETEITEM, … … 648 648 649 649 switch (msg) 650 { 650 { 651 651 case DM_DRAGOVER: 652 652 { … … 676 676 swctl.fbJump=SWL_JUMPABLE; 677 677 WinAddSwitchEntry(&swctl); 678 678 679 679 adjustDialogControlPos(hwnd); 680 680 681 681 /* Set volume slider*/ 682 682 WinSendMsg( WinWindowFromID(hwnd, IDSL_MMPLAYERVOLUME), … … 684 684 MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_INCREMENTVALUE), 685 685 MPFROMLONG( ulVolume)); 686 686 687 687 /* Subclass buttons for DnD */ 688 688 orgButtonProc=WinSubclassWindow(WinWindowFromID(hwnd, IDPB_MMPLAYERPLAY), buttonProc); 689 689 WinSubclassWindow(WinWindowFromID(hwnd, IDPB_MMPLAYERPAUSE), buttonProc); 690 690 WinSubclassWindow(WinWindowFromID(hwnd, IDPB_MMPLAYERSTOP), buttonProc); 691 691 692 692 FixSysMenu(hwnd); 693 693 … … 695 695 if(allBMPs[MAIN_BMP_IDX].hbm) { 696 696 SWP swp; 697 698 WinQueryWindowPos(WinWindowFromID(hwnd, FID_TITLEBAR), &swp); 699 WinSetWindowPos(WinWindowFromID(hwnd, ID_CLIENT), NULLHANDLE, 700 WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME), 701 WinQuerySysValue(HWND_DESKTOP, SV_CYDLGFRAME), 697 698 WinQueryWindowPos(WinWindowFromID(hwnd, FID_TITLEBAR), &swp); 699 WinSetWindowPos(WinWindowFromID(hwnd, ID_CLIENT), NULLHANDLE, 700 WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME), 701 WinQuerySysValue(HWND_DESKTOP, SV_CYDLGFRAME), 702 702 allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cx, 703 703 allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cy, 704 704 SWP_SIZE|SWP_MOVE); 705 705 orgBgProc=WinSubclassWindow(WinWindowFromID(hwnd, ID_CLIENT), bgProc); 706 706 707 707 WinSetWindowPos(hwnd, NULLHANDLE, 0, 0, 708 708 allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cx+WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME)*2, … … 732 732 /*****************************************************/ 733 733 case WM_APPTERMINATENOTIFY: 734 734 735 735 switch(SHORT1FROMMP(mp1)) 736 736 { … … 745 745 return MRFALSE; 746 746 case NOTIFY_CONTEXT: 747 /* Show context menu. */ 747 /* Show context menu. */ 748 748 HlpContextMenu(hwnd, iWhichDisplay+ID_MENUITEMELAPSED, TRUE); 749 749 return MRFALSE; … … 752 752 } 753 753 return MRFALSE; 754 754 755 755 /*****************************************************/ 756 756 /* The following two messages are for device sharing */ … … 760 760 char chrCommand[100]; 761 761 int iWavePriv; 762 762 763 763 iWavePriv=ulPid; 764 764 … … 791 791 /* SETPOSITIONADVICE does not work for some reason, */ 792 792 /* so a timer is used. Yes, it's quit cumbersome... */ 793 /*****************************************************/ 793 /*****************************************************/ 794 794 case WM_TIMER: 795 795 if(SHORT1FROMMP(mp1)==IDTIMER_PLAY) { … … 812 812 /* Set slider position */ 813 813 814 WinPostMsg( WinWindowFromID(hwnd, IDSL_MMPLAYERPOSBAR), 814 WinPostMsg( WinWindowFromID(hwnd, IDSL_MMPLAYERPOSBAR), 815 815 SLM_SETSLIDERINFO, 816 816 MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_INCREMENTVALUE), … … 898 898 default: 899 899 break; 900 } 900 } 901 901 break; 902 902 … … 909 909 char chrCommand[50]; 910 910 char retMsg[20]; 911 911 912 912 switch(SHORT2FROMMP(mp1)) 913 913 { … … 939 939 static long lLastPos=0; 940 940 long lPos=LONGFROMMP(mp2); 941 941 942 942 bPosDragging=TRUE; 943 943 lPos*=ulTotalLength/100; 944 944 if(lPos/1000!=lLastPos) { 945 945 /* Prevent flickering */ 946 sprintf(chrCommand, "% d:%02d", lPos/1000/60, (lPos/1000)%60);946 sprintf(chrCommand, "%lu:%02lu", lPos/1000/60, (lPos/1000)%60); 947 947 WinSetWindowText(WinWindowFromID(hwnd, IDST_MMPLAYERPLAYTIME), chrCommand); 948 948 lLastPos=lPos/1000; … … 963 963 { 964 964 ULONG ulValue; 965 965 966 966 ulValue=LONGFROMMP(mp2); 967 967 ulVolume=ulValue; … … 975 975 976 976 bPosDragging=FALSE; 977 lPos*=1000; 977 lPos*=1000; 978 978 lPos*=ulTotalLength/100; 979 979 lPos/=1000;// Use only full seconds … … 982 982 seekAudioFile(lPos); 983 983 /* restart timer */ 984 WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, IDTIMER_PLAY, PLAYTIMER_DELAY); 984 WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, IDTIMER_PLAY, PLAYTIMER_DELAY); 985 985 ulPos=lPos/1000; 986 986 break; … … 999 999 break; 1000 1000 }/* switch */ 1001 1001 1002 1002 return WinDefDlgProc( hwnd, msg, mp1, mp2); 1003 1003 } … … 1019 1019 ))==NULLHANDLE) 1020 1020 return FALSE; 1021 1021 1022 1022 ulSize=sizeof(chrFileName); 1023 1023 1024 1024 if ((rc = DosOpen(chrFileName, &handle, &act, 1025 1025 0L, 0, OPEN_ACTION_OPEN_IF_EXISTS, … … 1085 1085 BOOL writeVolumeToIni(char * iniFile, char* chrApp, char *chrKey, ULONG ulVolume) 1086 1086 { 1087 1087 1088 1088 return IniSaveInt(iniFile, chrApp, chrKey, ulVolume); 1089 1089 } … … 1108 1108 if(MMIO_SUCCESS!=mmioIdentifyFile(chrFile, &mmioInfo, &mmFormatInfo, &fourCC, 0,0)) 1109 1109 { 1110 return 0; 1110 return 0; 1111 1111 } 1112 1112 1113 1113 if(mmFormatInfo.ulMediaType==MMIO_MEDIATYPE_MIDI) 1114 1114 return 1; /* Midi */ 1115 1115 1116 1116 /* Any other audio file */ 1117 1117 return 2; … … 1143 1143 if(hab) { 1144 1144 hmq=WinCreateMsgQueue(hab,0); 1145 if(hmq) { 1146 /* Check if user started prog by hand */ 1145 if(hmq) { 1146 /* Check if user started prog by hand */ 1147 1147 if(argc!=NUMPARAMS) {/* Not the right num of params */ 1148 1148 pmUsage(); … … 1161 1161 { 1162 1162 /* FIXME: Identify error !!!*/ 1163 1163 1164 1164 }; 1165 1165 1166 1166 if(rc==1) 1167 1167 { … … 1176 1176 strcpy(chrClassName, params[1]); 1177 1177 1178 /* Get our ressource dll */ 1178 /* Get our ressource dll */ 1179 1179 // RESSOURCEHANDLE=0; 1180 1180 RESSOURCEHANDLE=queryResModuleHandle(argv[0]); … … 1189 1189 WinRegisterClass(WinQueryAnchorBlock(HWND_DESKTOP), SLIDER_CLASS, privateSliderProc,0, SLADDBYTES); 1190 1190 1191 _loadBmps(); 1191 _loadBmps(); 1192 1192 DosGetInfoBlocks(&ptib, &ppib); 1193 1193 ulPid=ppib->pib_ulpid; 1194 1194 _beginthread(playThreadFunc,NULL,8192*16, NULLHANDLE); //Fehlerbehandlung fehlt 1195 1195 1196 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 1196 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 1197 1197 RESSOURCEHANDLE, IDDLG_MMPLAYER, 0) == DID_ERROR ) 1198 1198 { 1199 1199 /* 1200 Text: 1201 Title: "Installation problem" 1202 */ 1200 Text: 1201 Title: "Installation problem" 1202 */ 1203 1203 messageBox( text, IDSTR_CONVERTDIALOGERROR , sizeof(text), 1204 1204 title, IDSTR_INSTALLERRORTITLE , sizeof(title), -
trunk/classes/mm-progs/MMPlayer/playaudio.c
r57 r104 21 21 * If you need another license for your project/product (commercial, 22 22 * noncommercial, whatever) contact me at 23 * 23 * 24 24 * http://www.os2world.com/cdwriting 25 25 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 73 73 char chrCommand[50]; 74 74 char retMsg[100]; 75 ULONG rc;76 75 77 76 iWavePriv=ulPid; … … 79 78 if(bPaused) { 80 79 sprintf(chrCommand,"RESUME wave%d wait", iWavePriv); 81 rc =mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);80 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 82 81 bPaused=FALSE; 83 82 showPlayTimeDisplay( hwndFrame, TRUE); … … 85 84 else { 86 85 sprintf(chrCommand,"PAUSE wave%d wait", iWavePriv); 87 rc =mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);86 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 88 87 bPaused=TRUE; 89 88 } … … 96 95 char chrCommand[50]; 97 96 char retMsg[100]; 98 ULONG rc;99 97 100 98 iWavePriv=ulPid; 101 99 102 100 if(bIsPlaying) { 103 101 sprintf(chrCommand,"stop wave%d wait", iWavePriv); 104 rc =mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);105 102 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 103 106 104 sprintf(chrCommand,"close wave%d wait", iWavePriv); 107 rc =mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);108 105 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 106 109 107 _resetDisplay(hwndFrame); 110 108 showPlayTimeDisplay( hwndFrame, TRUE); 111 109 WinStopTimer(WinQueryAnchorBlock(hwndFrame), hwndFrame, IDTIMER_PLAY); 112 110 bIsPlaying=FALSE; 113 bPaused=FALSE; 111 bPaused=FALSE; 114 112 } 115 113 return TRUE; … … 155 153 hwndNotify=hwndFrame;//WinWindowFromID(hwndTop, IDDLG_TOPMIDDLE); 156 154 157 /* Start audio file */ 155 /* Start audio file */ 158 156 sprintf(chrCommand,"open \"%s\" type %s alias wave%d SHAREABLE wait", chrSourceName, chrDevice, iWavePriv); 159 157 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), hwndNotify, 0); 160 158 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) 161 159 return 0; 162 160 163 161 /* Set time format */ 164 162 sprintf(chrCommand,"SET wave%d TIME FORMAT MILLISECONDS wait", iWavePriv); … … 168 166 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 169 167 return 0; 170 } 168 } 171 169 172 170 #if 0 … … 219 217 char chrCommand[50]; 220 218 char retMsg[20]; 221 APIRET rc;222 219 223 220 sprintf(chrCommand,"PLAY wave%ld from %ld", ulPid, lPosSec); 224 rc=mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);221 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 225 222 // ulStartPosition=lPosSec; 226 223 bPaused=FALSE; … … 269 266 270 267 /* Every folder has one running play thread to handle play commands */ 271 void _OptlinkplayThreadFunc (void *arg)268 void playThreadFunc (void *arg) 272 269 { 273 270 HAB hab; -
trunk/classes/mm-progs/audioconverter/audconv.c
r48 r104 18 18 * along with this program; see the file COPYING. If not, write to 19 19 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 20 */ 20 */ 21 21 /* 22 22 * If you need another license for your project/product (commercial, 23 23 * noncommercial, whatever) contact me at 24 * 24 * 25 25 * http://www.os2world.com/cdwriting 26 26 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 70 70 //#define INI_NAME_COLOR "color" 71 71 72 void HlpSendCommandToObject( char* chrObject, char*command);72 void HlpSendCommandToObject(PSZ chrObject, PSZ command); 73 73 BOOL percentRegisterBarClass(void); 74 BOOL IniSaveWindowPos( char * iniFile, char* chrApp, char *chrKey, HWND hwnd);75 BOOL IniRestoreWindowPos( char * iniFile, char* chrApp, char *chrKey, HWND hwnd);76 BOOL IniSaveWindowClrs( char * chrIniFile, char*chrApp , HWND hwnd);77 BOOL IniRestoreWindowClrs( char * chrIniFile, char*chrApp , HWND hwnd);78 BOOL HlpBuildMMProgIniFileName( char* chrProgname, char *chrBuffer, ULONG ulBufferSize);79 HMODULE queryResModuleHandle( char *chrExePath);74 BOOL IniSaveWindowPos(PSZ iniFile, PSZ chrApp, PSZ chrKey, HWND hwnd); 75 BOOL IniRestoreWindowPos(PSZ iniFile, PSZ chrApp, PSZ chrKey, HWND hwnd); 76 BOOL IniSaveWindowClrs(PSZ chrIniFile, PSZ chrApp , HWND hwnd); 77 BOOL IniRestoreWindowClrs(PSZ chrIniFile, PSZ chrApp , HWND hwnd); 78 BOOL HlpBuildMMProgIniFileName(PSZ chrProgname, PSZ chrBuffer, ULONG ulBufferSize); 79 HMODULE queryResModuleHandle(PSZ chrExePath); 80 80 void freeResHandle(); 81 BOOL getMessage( char*text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);82 ULONG messageBox( char*text, ULONG ulTextID , LONG lSizeText,83 char*title, ULONG ulTitleID, LONG lSizeTitle,81 BOOL getMessage(PSZ text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd); 82 ULONG messageBox( PSZ text, ULONG ulTextID , LONG lSizeText, 83 PSZ title, ULONG ulTitleID, LONG lSizeTitle, 84 84 HMODULE hResource, HWND hwnd, ULONG ulFlags); 85 85 … … 90 90 BOOL bHaveWindowPos=FALSE; 91 91 92 charchrTargetName[CCHMAXPATH]={0};93 charchrSourceName[CCHMAXPATH]={0};94 charchrProcName[CCHMAXPATH]={0};95 charchrIniFile[CCHMAXPATH];92 UCHAR chrTargetName[CCHMAXPATH]={0}; 93 UCHAR chrSourceName[CCHMAXPATH]={0}; 94 UCHAR chrProcName[CCHMAXPATH]={0}; 95 UCHAR chrIniFile[CCHMAXPATH]; 96 96 97 97 int numArgs; … … 118 118 void pmUsage(); 119 119 120 BOOL createTargetName( char *sourceName, char *chrExt)120 BOOL createTargetName(PSZ sourceName, PSZ chrExt) 121 121 { 122 char *textPtr;123 124 strcpy( chrTargetName,sourceName);125 if((textPtr=strrchr( chrTargetName, '.'))!=NULLHANDLE)122 PCHAR textPtr=NULL; 123 124 strcpy((PCHAR)chrTargetName, (PCHAR)sourceName); 125 if((textPtr=strrchr((PCHAR)chrTargetName, '.'))!=NULL) 126 126 *textPtr=0; 127 127 else 128 textPtr= chrTargetName;128 textPtr=(PCHAR)chrTargetName; 129 129 strcat(textPtr,"."); 130 strcat(textPtr, chrExt);130 strcat(textPtr, (PCHAR)chrExt); 131 131 #if 0 132 132 WinMessageBox( HWND_DESKTOP, HWND_DESKTOP, textPtr, … … 153 153 '\0', 154 154 sizeof(MMFORMATINFO) ); 155 155 156 156 mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_AUDIO; 157 mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED; 157 mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED; 158 158 ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo, 159 159 &lNumIOProcs, 160 160 0, 161 161 0 ); 162 162 163 163 if( ulReturnCode != MMIO_SUCCESS ) 164 164 { … … 181 181 return FALSE; 182 182 } 183 183 184 184 /* 185 185 * call mmioGetFormats to get info on the formats supported. … … 199 199 return FALSE; 200 200 } 201 201 202 202 if( lFormatsRead != lNumIOProcs ) 203 203 { … … 214 214 for ( index = 0, sIdx=0; index <lNumIOProcs; index++ ) 215 215 { 216 charszName[CCHMAXPATH];217 218 mmioGetFormatName(pmmFormatInfoArray, szName, &lBytesRead, 0L, 0L); 216 UCHAR szName[CCHMAXPATH]; 217 218 mmioGetFormatName(pmmFormatInfoArray, szName, &lBytesRead, 0L, 0L); 219 219 /* Insert NULL string terminator */ 220 *( szName + lBytesRead ) = (CHAR)NULL;220 *( szName + lBytesRead ) = 0; 221 221 222 222 #ifdef DEBUG 223 SysWriteToTrapLog("%d IO-Proc: %s, %s\n", index, 223 SysWriteToTrapLog("%d IO-Proc: %s, %s\n", index, 224 224 pmmFormatInfoArray->szDefaultFormatExt, 225 225 szName); … … 231 231 WinSendMsg(hwndDrop, LM_INSERTITEM,(MPARAM)LIT_END, 232 232 (MPARAM)szName); 233 234 233 234 235 235 iPrivIOProc[sIdx]=index; 236 236 237 237 #ifdef DEBUG 238 238 SysWriteToTrapLog("-- %d %d, sIdx: %d %s\n", index, iPrivIOProc[sIdx], sIdx, … … 240 240 ); 241 241 #endif 242 243 242 243 244 244 /* Set text field */ 245 245 if(bNoProcGiven) { 246 246 WinSetWindowText(hwndDrop, szName); 247 createTargetName(chrSourceName, pmmFormatInfoArray->szDefaultFormatExt);247 createTargetName(chrSourceName, (PSZ)pmmFormatInfoArray->szDefaultFormatExt); 248 248 iIoProc=iPrivIOProc[sIdx]; 249 249 bNoProcGiven=FALSE; 250 250 } 251 251 else { 252 if(!stricmp( szName,chrProcName)) {252 if(!stricmp((PCHAR)szName, (PCHAR)chrProcName)) { 253 253 WinSetWindowText(hwndDrop, szName); 254 254 /* Create target name */ 255 createTargetName(chrSourceName, pmmFormatInfoArray->szDefaultFormatExt);255 createTargetName(chrSourceName, (PSZ)pmmFormatInfoArray->szDefaultFormatExt); 256 256 iIoProc=iPrivIOProc[sIdx]; 257 257 } … … 262 262 /* 263 263 * advance to next entry in mmFormatInfo array 264 */ 264 */ 265 265 pmmFormatInfoArray++; 266 266 } … … 268 268 } 269 269 270 BOOL queryAudioInfo( char *chrFile)270 BOOL queryAudioInfo(PSZ chrFile) 271 271 { 272 272 HMMIO hmmio; … … 275 275 LONG lBytesRead=0; 276 276 APIRET rc; 277 277 278 278 memset(&mmioinfo,0, sizeof(mmioinfo)); 279 279 mmioinfo.ulTranslate = MMIO_TRANSLATEHEADER; … … 321 321 #endif 322 322 323 void _OptlinkconvertThreadFunc (void *arg)323 void convertThreadFunc (void *arg) 324 324 { 325 325 HAB hab; … … 337 337 LONG lBytesWritten=0; 338 338 ULONG rc; 339 P BYTE buffer;339 PCHAR buffer=NULL; 340 340 341 341 do { … … 349 349 if((hmmio=mmioOpen(chrSourceName, &mmioinfo,MMIO_READ))==NULLHANDLE) 350 350 { 351 chartext[500];352 snprintf( text, sizeof(text)-1,"mmioOpen error with file %s\n", chrSourceName);353 WinMessageBox(hwnd, hwnd, "",351 UCHAR text[500]; 352 snprintf((PCHAR)text, sizeof(text)-1,"mmioOpen error with file %s\n", chrSourceName); 353 WinMessageBox(hwnd, hwnd, (PSZ)"", 354 354 text, 355 355 0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE ); … … 360 360 &lBytesRead, 0, 0); 361 361 if(rc!=MMIO_SUCCESS) { 362 chartext[500];362 UCHAR text[500]; 363 363 mmioClose(hmmio, 0); 364 snprintf( text, sizeof(text)-1,"mmioGetHeader error!");365 WinMessageBox(hwnd, hwnd, "",364 snprintf((PCHAR)text, sizeof(text)-1,"mmioGetHeader error!"); 365 WinMessageBox(hwnd, hwnd, (PSZ)"", 366 366 text, 367 367 0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE ); … … 380 380 if((hmmioTarget=mmioOpen(chrTargetName, &mmioinfo, MMIO_WRITE|MMIO_CREATE))==NULLHANDLE) 381 381 { 382 char chrError[CCHMAXPATH];383 char text[500];382 UCHAR chrError[64]; 383 UCHAR text[CCHMAXPATH*2]; 384 384 rc=mmioGetLastError(hmmioTarget); 385 mciGetErrorString(mmioinfo.ulErrorRet ,chrError, sizeof(chrError) );386 snprintf( text, sizeof(text)-1,"mmioOpen error with file %s:\n%s\n%d", chrTargetName, chrError,mmioinfo.ulErrorRet);385 mciGetErrorString(mmioinfo.ulErrorRet ,chrError, sizeof(chrError)-1); 386 snprintf((PCHAR)text, sizeof(text)-1,"mmioOpen error with file %s:\n%s\n%lu", chrTargetName, chrError,mmioinfo.ulErrorRet); 387 387 mmioClose(hmmio,0); 388 WinMessageBox(hwnd, hwnd, "",388 WinMessageBox(hwnd, hwnd, (PSZ)"", 389 389 text, 390 390 0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE ); … … 394 394 rc = mmioSetHeader(hmmioTarget, &mmAudioHeader,sizeof(MMAUDIOHEADER), 395 395 &lBytesWritten, 0, 0); 396 396 397 397 /* Get buffer */ 398 if((buffer=( void*)malloc(CONVERTBUFFERSIZE))==NULLHANDLE) {399 chartext[500];398 if((buffer=(PCHAR)malloc(CONVERTBUFFERSIZE))==NULLHANDLE) { 399 UCHAR text[500]; 400 400 mmioClose(hmmio, 0); 401 401 mmioClose(hmmioTarget,0); 402 snprintf( text, sizeof(text)-1,"Can't get memory buffer!");403 WinMessageBox(hwnd, hwnd, "",402 snprintf((PCHAR)text, sizeof(text)-1,"Can't get memory buffer!"); 403 WinMessageBox(hwnd, hwnd, (PSZ)"", 404 404 text, 405 405 0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE ); 406 406 407 407 break; 408 408 } … … 421 421 }while(rc!=0 && rc!=MMIO_ERROR && !bBreak/*&& lBytesWritten <1000000*/); 422 422 if(rc==MMIO_ERROR) { 423 chartext[500];424 snprintf( text, sizeof(text)-1,"Error while reading audio data!");425 WinMessageBox(hwnd, hwnd, "",423 UCHAR text[500]; 424 snprintf((PCHAR)text, sizeof(text)-1,"Error while reading audio data!"); 425 WinMessageBox(hwnd, hwnd, (PSZ)"", 426 426 text, 427 427 0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE ); 428 428 } 429 429 if(!bBreak) { 430 charchrCommand[CCHMAXPATH*2];430 UCHAR chrCommand[CCHMAXPATH*2]; 431 431 WinSendMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTPERCENT), MPFROMLONG(100)); 432 432 /* Refresh details view */ 433 HlpSendCommandToObject(chrTargetName, "CWAUDIOREFRESH=1");434 sprintf( chrCommand,"CWAUDIOCOPYTAGTO=%s;", chrTargetName);433 HlpSendCommandToObject(chrTargetName, (PSZ)"CWAUDIOREFRESH=1"); 434 sprintf((PCHAR)chrCommand,"CWAUDIOCOPYTAGTO=%s;", chrTargetName); 435 435 HlpSendCommandToObject(chrSourceName, chrCommand); 436 436 } … … 443 443 } 444 444 while(TRUE); 445 WinSendMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTDONE), 0); 445 WinSendMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTDONE), 0); 446 446 WinDestroyMsgQueue(hmq); 447 447 } … … 464 464 MRESULT EXPENTRY decodeStatusDialogProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 465 465 { 466 chartext[CCHMAXPATH*4 +10];467 chartitle[CCHMAXPATH*4];466 UCHAR text[CCHMAXPATH*4 +10]; 467 UCHAR title[CCHMAXPATH*4]; 468 468 SWCNTRL swctl; 469 469 PID pid; … … 471 471 472 472 switch (msg) 473 { 473 { 474 474 case WM_INITDLG: 475 475 … … 493 493 494 494 WinSendMsg(WinWindowFromID(hwnd,IDST_CONVERTNAME),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)CCHMAXPATH),0); 495 496 WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTCDBITS), "");497 495 496 WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTCDBITS), (PSZ)""); 497 498 498 /* Filename */ 499 499 WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTNAME), chrSourceName); 500 500 501 501 /* Set dialog font to WarpSans for Warp 4 and above */ 502 502 if(SysQueryOSRelease()>=40) { … … 507 507 508 508 /* Set percent bars to 0. */ 509 WinSetWindowText(WinWindowFromID(hwnd,IDBAR_CONVERTPROGRESS), "0#0%");509 WinSetWindowText(WinWindowFromID(hwnd,IDBAR_CONVERTPROGRESS),(PSZ)"0#0%"); 510 510 511 511 WinSendMsg(WinWindowFromID(hwnd,IDEF_CONVERTTARGETNAME), EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)CCHMAXPATH),0); … … 516 516 /* Channels */ 517 517 getMessage(title, IDSTR_CONVERTCHANNELS, sizeof(title), RESSOURCEHANDLE, hwnd); 518 sprintf( text,title, sChannels);518 sprintf((PCHAR)text, (PCHAR)title, sChannels); 519 519 WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTCHANNELS),text); 520 520 521 521 /* Samplerate */ 522 522 getMessage(title, IDSTR_CONVERTSAMPLERATE, sizeof(title), RESSOURCEHANDLE, hwnd); 523 sprintf( text,title, iSampleRate);523 sprintf((PCHAR)text, (PCHAR)title, iSampleRate); 524 524 WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTSAMPLERATE),text); 525 525 526 526 /* Playtime */ 527 527 getMessage(title, IDSTR_CONVERTPLAYTIME, sizeof(title), RESSOURCEHANDLE, hwnd); 528 sprintf( text,title, lSec/60, lSec%60);528 sprintf((PCHAR)text, (PCHAR)title, lSec/60, lSec%60); 529 529 WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTPLAYTIME),text); 530 530 … … 551 551 iPercent=0; 552 552 553 /* Update track percent bar value. The helper prog sends us the actual decoded %. */ 553 /* Update track percent bar value. The helper prog sends us the actual decoded %. */ 554 554 sprintf(text,"%d#%d%%", iPercent, iPercent); 555 555 WinSetWindowText(WinWindowFromID(hwnd,IDBAR_CONVERTPROGRESS), text); … … 593 593 594 594 createTargetName(chrSourceName, pMemFormatInfo[iIoProc].szDefaultFormatExt); 595 WinSetWindowText( WinWindowFromID(hwnd,IDEF_CONVERTTARGETNAME), chrTargetName ); 595 WinSetWindowText( WinWindowFromID(hwnd,IDEF_CONVERTTARGETNAME), chrTargetName ); 596 596 } 597 597 } … … 613 613 case IDPB_CONVERTBROWSE: 614 614 { 615 charchrTitle[200];615 UCHAR chrTitle[200]; 616 616 FILEDLG fd = { 0 }; 617 617 /* User pressed the browse button */ … … 652 652 ULONG ulDiskNum; 653 653 char cLetter; 654 654 655 655 WinQueryWindowText( WinWindowFromID(hwnd,IDEF_CONVERTTARGETNAME), sizeof(chrTargetName), chrTargetName ); 656 656 … … 669 669 if(lFreeSpace<lAudioSize) { 670 670 /* 671 Text: 672 Title: 673 */ 671 Text: 672 Title: 673 */ 674 674 getMessage(title, IDSTR_CONVERTNOSPACETEXT,sizeof(title), RESSOURCEHANDLE, hwnd); 675 675 sprintf(text,title,lAudioSize/1000000 ); … … 681 681 else { 682 682 /* Start decoding an audio file */ 683 WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTOK), FALSE); 683 WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTOK), FALSE); 684 684 WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTABORT), TRUE); 685 685 convertAudioFile(hwnd); 686 686 } 687 687 688 688 break; 689 689 } … … 695 695 break; 696 696 }/* switch */ 697 697 698 698 return WinDefDlgProc( hwnd, msg, mp1, mp2); 699 699 } … … 726 726 if(hab) { 727 727 hmq=WinCreateMsgQueue(hab,0); 728 if(hmq) { 729 /* Check if user started prog by hand */ 728 if(hmq) { 729 /* Check if user started prog by hand */ 730 730 if(argc<NUMPARAMS-1) {/* Not the actual num of params */ 731 731 pmUsage(); … … 740 740 strcpy(chrProcName, ""); 741 741 } 742 /* Get our ressource dll */ 742 /* Get our ressource dll */ 743 743 // RESSOURCEHANDLE=0; 744 744 RESSOURCEHANDLE=queryResModuleHandle(argv[0]); … … 751 751 { 752 752 /* 753 Text: 754 Title: "Installation problem" 755 */ 753 Text: 754 Title: "Installation problem" 755 */ 756 756 messageBox( text, IDSTR_CONVERTDIALOGERROR , sizeof(text), 757 757 title, IDSTR_INSTALLERRORTITLE , sizeof(title), … … 762 762 DosBeep(100,600); 763 763 return( 1 ); 764 } 764 } 765 765 } 766 766 } -
trunk/classes/mm-progs/imageconverter/imgconv.c
r2 r104 23 23 * If you need another license for your project/product (commercial, 24 24 * noncommercial, whatever) contact me at 25 * 25 * 26 26 * http://www.os2world.com/cdwriting 27 27 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 37 37 #define INCL_PM 38 38 39 #define USE_OS2_TOOLKIT_HEADERS 39 40 #include <os2.h> 40 41 … … 46 47 #include "os2me.h" 47 48 #include "mmioos2.h" 49 #include <mmio.h> 48 50 #include "common.h" 49 51 #include "mmres.h" … … 143 145 SIZEL ImageSize; 144 146 ULONG dwHeight, dwWidth; 145 SHORT wBitCount;146 147 FOURCC fccStorageSystem; 147 148 ULONG dwPadBytes; 148 149 ULONG dwRowBits; 149 150 ULONG ulReturnCode; 150 ULONG dwReturnCode;151 HBITMAP hbReturnCode;152 LONG lReturnCode;153 151 FOURCC fccIOProc; 154 152 HDC hdc; … … 212 210 213 211 214 dwReturnCode = mmioQueryHeaderLength ( hmmio,212 ulReturnCode = mmioQueryHeaderLength ( hmmio, 215 213 (PLONG)&ulImageHeaderLength, 216 214 0L, … … 247 245 dwHeight = mmImgHdr.mmXDIBHeader.BMPInfoHeader2.cy; 248 246 dwWidth = mmImgHdr.mmXDIBHeader.BMPInfoHeader2.cx; 249 wBitCount = mmImgHdr.mmXDIBHeader.BMPInfoHeader2.cBitCount;250 247 dwRowBits = dwWidth * mmImgHdr.mmXDIBHeader.BMPInfoHeader2.cBitCount; 251 248 dwNumRowBytes = dwRowBits >> 3; … … 288 285 return(0L); 289 286 } 290 287 291 288 292 289 // *************************************************** … … 294 291 // the memory device context obtained above. 295 292 // *************************************************** 296 293 297 294 ImageSize.cx = dwWidth; 298 295 ImageSize.cy = dwHeight; … … 312 309 (ULONG) MB_OK | MB_MOVEABLE | 313 310 MB_ERROR ); 314 #endif 311 #endif 315 312 DevCloseDC(hdc); 316 313 DosFreeMem(pRowBuffer); … … 350 347 // Select the bitmap into the memory device context. 351 348 // *************************************************** 352 hbReturnCode = GpiSetBitmap ( hps,349 ulReturnCode = GpiSetBitmap ( hps, 353 350 hbm ); 354 351 … … 371 368 * it to work. Perhaps will get to it when time is available... 372 369 */ 373 lReturnCode = GpiSetBitmapBits ( hps,370 ulReturnCode = GpiSetBitmapBits ( hps, 374 371 (LONG) dwRowCount, 375 372 (LONG) 1, … … 379 376 380 377 /* Clean up */ 381 hbReturnCode = GpiSetBitmap ( hps,378 ulReturnCode = GpiSetBitmap ( hps, 382 379 NULLHANDLE ); 383 380 ulReturnCode = mmioClose (hmmio, 0L); … … 396 393 PBITMAPINFOHEADER2 pBmpInfoHeader2, 397 394 HWND hwnd) 398 // ULONG ulWidth, 395 // ULONG ulWidth, 399 396 // ULONG ulHeight) 400 397 { 401 398 HBITMAP hbmTarget; 402 399 SIZEL ImageSize; 403 HBITMAP hbReturnCode;404 400 HDC hdc; 405 401 HPS hps; … … 413 409 */ 414 410 WinQueryWindowPos ( hwnd, &swp); 415 411 416 412 /* Image size */ 417 413 418 414 ulHeight = bmpInfoHeader2.cy; 419 415 ulWidth = bmpInfoHeader2.cx; … … 423 419 aptl[0].x=0; 424 420 aptl[1].x=aptl[0].x+ulWidth; 425 421 426 422 aptl[0].y=0; 427 423 aptl[1].y=aptl[0].y+ulHeight; … … 429 425 else { 430 426 float fWidth, fHeight, fRes; 431 427 432 428 fWidth=(float)swp.cx/(float)ulWidth; 433 429 fHeight=(float)swp.cy/(float)ulHeight; 434 430 fRes=( fWidth>fHeight ? fHeight : fWidth); 435 436 431 432 437 433 aptl[0].x=0; 438 434 aptl[1].x=aptl[0].x+ulWidth*fRes; 439 435 440 436 aptl[0].y=0; 441 437 aptl[1].y=aptl[0].y+ulHeight*fRes; 442 438 } 443 439 444 440 aptl[2].x = 0; // source lower left 445 441 aptl[2].y = 0; 446 442 447 443 aptl[3].x = ulWidth; // source upper right 448 444 aptl[3].y = ulHeight; … … 468 464 return(0L); 469 465 } 470 466 471 467 // *************************************************** 472 468 // Create a memory presentation space that includes … … 486 482 487 483 /* Now scale the bitmap */ 488 memcpy(&bmpih2, pBmpInfoHeader2, sizeof(BITMAPINFOHEADER2)); 484 memcpy(&bmpih2, pBmpInfoHeader2, sizeof(BITMAPINFOHEADER2)); 489 485 490 486 bmpih2.cx=aptl[1].x-aptl[0].x; … … 509 505 510 506 /* Blit it */ 511 hbReturnCode =GpiSetBitmap ( hps, hbmTarget );507 GpiSetBitmap ( hps, hbmTarget ); 512 508 513 509 GpiWCBitBlt(hps, hbm,4L, aptl, ROP_SRCCOPY, BBO_IGNORE); 514 510 515 hbReturnCode =GpiSetBitmap( hps, NULLHANDLE );511 GpiSetBitmap( hps, NULLHANDLE ); 516 512 GpiDestroyPS(hps); 517 513 DevCloseDC(hdc); … … 545 541 strcat(textPtr,"."); 546 542 strcat(textPtr, chrExt); 547 543 548 544 return TRUE; 549 545 } … … 564 560 '\0', 565 561 sizeof(MMFORMATINFO) ); 566 562 567 563 mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE; 568 mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED; 564 mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED; 569 565 ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo, 570 566 &lNumIOProcs, 571 567 0, 572 568 0 ); 573 569 574 570 if( ulReturnCode != MMIO_SUCCESS ) 575 571 { … … 592 588 return FALSE; 593 589 } 594 590 595 591 /* 596 592 * call mmioGetFormats to get info on the formats supported. … … 610 606 return FALSE; 611 607 } 612 608 613 609 if( lFormatsRead != lNumIOProcs ) 614 610 { … … 627 623 char szName[CCHMAXPATH]; 628 624 629 mmioGetFormatName(pmmFormatInfoArray, szName, &lBytesRead, 0L, 0L); 625 mmioGetFormatName(pmmFormatInfoArray, szName, &lBytesRead, 0L, 0L); 630 626 /* Insert NULL string terminator */ 631 *( szName + lBytesRead ) = (CHAR)NULL;627 *( szName + lBytesRead ) = 0; 632 628 633 629 … … 643 639 644 640 #ifdef DEBUG 645 HlpWriteToTrapLog("------ %d private idx: %d, IO-Proc: %s %s\n", index, sIdx, 641 HlpWriteToTrapLog("------ %d private idx: %d, IO-Proc: %s %s\n", index, sIdx, 646 642 pmmFormatInfoArray->szDefaultFormatExt, 647 643 szName); 648 644 #endif 649 645 650 646 iPrivIOProc[sIdx]=index; 651 647 … … 669 665 /* 670 666 * advance to next entry in mmFormatInfo array 671 */ 667 */ 672 668 pmmFormatInfoArray++; 673 669 } … … 700 696 ULONG iIndex, iCount, iCount2; 701 697 702 MMFORMATINFO mmFormatInfo; 698 MMFORMATINFO mmFormatInfo; 703 699 FOURCC fccSourceIOProc; 704 700 FOURCC fccStorageSystem; … … 728 724 mmioinfoSource.fccIOProc = fccSourceIOProc; 729 725 mmioinfoSource.ulTranslate = MMIO_TRANSLATEHEADER | MMIO_TRANSLATEDATA; 730 726 731 727 hmmioSource = mmioOpen ((PSZ)pszSource, &mmioinfoSource, 732 728 MMIO_READ | MMIO_DENYWRITE 733 729 | MMIO_NOIDENTIFY); 734 730 735 731 if (!hmmioSource) 736 732 return (FALSE); 737 733 738 734 /*******************************/ 739 735 /* Set up/open the TARGET file */ … … 743 739 mmioinfoTarget.fccIOProc = fccTargetIOProc; 744 740 mmioinfoTarget.ulTranslate = MMIO_TRANSLATEHEADER | MMIO_TRANSLATEDATA; 745 741 746 742 hmmioTarget = mmioOpen ((PSZ)pszTarget, 747 743 &mmioinfoTarget, 748 744 MMIO_CREATE | MMIO_WRITE | 749 745 MMIO_DENYWRITE | MMIO_NOIDENTIFY); 750 746 751 747 if (!hmmioTarget) 752 748 { … … 762 758 rcSrcQueryCount = mmioSendMessage(hmmioSource, MMIOM_QUERYIMAGECOUNT, (LONG)&iCount, (LONG)0); 763 759 if (rcSrcQueryCount) iCount = 1; 764 760 765 761 // find out if the target has multiple image support 766 762 rcTrgQueryCount = mmioSendMessage(hmmioTarget, MMIOM_QUERYIMAGECOUNT, (LONG)&iCount2, (LONG)0); 767 763 768 764 for (iIndex=0; iIndex<iCount; iIndex++) { /* loop through known images */ 769 765 770 766 if (!rcSrcQueryCount && !rcTrgQueryCount) { /* if Both support images */ 771 767 772 768 /* Determine if the target can write arrays, and if not */ 773 769 /* then write the the default image from the source */ 774 770 775 771 if (rcTrgSetImage && iIndex > 0) break; /* Target Can't Write array */ 776 772 777 773 /* Now, determine if the target can write arrays */ 778 774 rcTrgSetImage = mmioSendMessage (hmmioTarget, MMIOM_SETIMAGE, (LONG)iIndex, (LONG)0); 779 775 780 776 if (!rcTrgSetImage) mmioSendMessage (hmmioSource, MMIOM_SETIMAGE, (LONG)iIndex, (LONG)0); 781 777 782 778 } else if (!rcSrcQueryCount) { /* Source does but target doesn't */ 783 779 /* Use the default image from source to copy to target */ … … 806 802 (LONG)sizeof (MMIMAGEHEADER), (PLONG)&ulBytesRead, 807 803 0L, 0L); 808 804 809 805 if (rc != MMIO_SUCCESS) 810 806 /* Header unavailable */ … … 814 810 return (FALSE); 815 811 } 816 812 817 813 818 814 /*************************/ … … 828 824 } 829 825 830 826 831 827 /* Use the SAME data as came from the SOURCE FILE. It must be 832 828 compatible with the OS/2 bitmaps, etc. */ … … 834 830 (LONG)sizeof (MMIMAGEHEADER), (PLONG)&ulBytesRead, 835 831 0L, 0L); 836 832 837 833 if (rc != MMIO_SUCCESS) 838 834 /* Header unavailable */ … … 846 842 HlpWriteToTrapLog("Target header set.\n"); 847 843 #endif 848 844 849 845 /* Determine the number of bytes required, per row */ 850 846 /* PLANES MUST ALWAYS BE = 1 */ … … 853 849 dwRowBits = dwWidth * mmImgHdr.mmXDIBHeader.BMPInfoHeader2.cBitCount; 854 850 dwNumRowBytes = dwRowBits >> 3; 855 851 856 852 /* Account for odd bits used in 1bpp or 4bpp images that are NOT on byte boundaries. */ 857 853 if (dwRowBits % 8) 858 854 dwNumRowBytes++; 859 855 860 856 /* Ensure the row length in bytes accounts for byte padding. All bitmap data rows 861 857 must are aligned on LONG/4-BYTE boundaries. The data FROM an IOProc … … 880 876 881 877 if (ulBytesRead) { 882 LONG lWritten; 883 lWritten=mmioWrite (hmmioTarget, pRowBuffer, (ULONG)ulBytesRead); 878 mmioWrite (hmmioTarget, pRowBuffer, (ULONG)ulBytesRead); 884 879 #ifdef DEBUG 885 880 HlpWriteToTrapLog("ulBytesRead: %d, lWritten: %d.\n", ulBytesRead, lWritten); … … 898 893 mmioClose (hmmioSource, 0L); 899 894 DosFreeMem(pRowBuffer); 900 895 901 896 return(TRUE); 902 897 } 903 898 904 void _OptlinkconvertThreadFunc (void *arg)899 void convertThreadFunc (void *arg) 905 900 { 906 901 HAB hab; … … 916 911 chrSourceName, 917 912 chrTargetName, pMemFormatInfo[iIoProc].fccIOProc); 918 919 920 921 WinPostMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTDONE), 0); 913 914 915 916 WinPostMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTDONE), 0); 922 917 DosSleep(1000); 923 918 WinDestroyMsgQueue(hmq); … … 944 939 POINTL aptl[4]; 945 940 HPS hps; 946 BOOL bReturnCode;947 941 ULONG ulHeight; 948 942 ULONG ulWidth; … … 954 948 * Get position of image frame 955 949 */ 956 bReturnCode =WinQueryWindowPos ( hwnd, &swp);950 WinQueryWindowPos ( hwnd, &swp); 957 951 958 952 /* Center image */ … … 963 957 aptl[0].x=(swp.cx-ulWidth)/2; 964 958 aptl[1].x=aptl[0].x+ulWidth; 965 959 966 960 aptl[0].y=(swp.cy-ulHeight)/2; 967 961 aptl[1].y=aptl[0].y+ulHeight; … … 977 971 aptl[0].x=(swp.cx-ulWidth*fRes)/2; 978 972 aptl[1].x=aptl[0].x+ulWidth*fRes; 979 973 980 974 aptl[0].y=(swp.cy-ulHeight*fRes)/2; 981 975 aptl[1].y=aptl[0].y+ulHeight*fRes; 982 976 } 983 977 984 978 aptl[2].x = 0; // source lower left 985 979 aptl[2].y = 0; 986 980 987 981 aptl[3].x = ulWidth; // source upper right 988 982 aptl[3].y = ulHeight; … … 1004 998 // WinDrawBitmap(hps, hBitmap, NULLHANDLE, (PPOINTL)aptl, 0, 0, DBM_NORMAL/*|DBM_STRETCH*/); 1005 999 #endif 1006 bReturnCode =WinEndPaint (hps);1000 WinEndPaint (hps); 1007 1001 } 1008 1002 … … 1011 1005 1012 1006 switch (msg) 1013 { 1007 { 1014 1008 case WM_PAINT: 1015 1009 { … … 1036 1030 1037 1031 switch (msg) 1038 { 1032 { 1039 1033 case WM_INITDLG: 1040 1034 #if 0 … … 1047 1041 1048 1042 WinSendMsg(WinWindowFromID(hwnd,IDST_IMGCONVERTNAME),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)CCHMAXPATH),0); 1049 1043 1050 1044 /* Filename */ 1051 1045 WinSetWindowText(WinWindowFromID(hwnd,IDST_IMGCONVERTNAME), chrSourceName); 1052 1046 1053 1047 /* Set dialog font to WarpSans for Warp 4 and above */ 1054 1048 if(SysQueryOSRelease()>=40) { … … 1112 1106 iPercent=0; 1113 1107 1114 /* Update track percent bar value. The helper prog sends us the actual decoded %. */ 1108 /* Update track percent bar value. The helper prog sends us the actual decoded %. */ 1115 1109 sprintf(text,"%d#%d%%", iPercent, iPercent); 1116 1110 WinSetWindowText(WinWindowFromID(hwnd,IDBAR_IMGCONVERTPROGRESS), text); … … 1149 1143 1150 1144 createTargetName(chrSourceName, pMemFormatInfo[iIoProc].szDefaultFormatExt); 1151 WinSetWindowText( WinWindowFromID(hwnd,IDEF_IMGCONVERTTARGETNAME), chrTargetName ); 1145 WinSetWindowText( WinWindowFromID(hwnd,IDEF_IMGCONVERTTARGETNAME), chrTargetName ); 1152 1146 } 1153 1147 } … … 1210 1204 // ULONG ulDiskNum; 1211 1205 // char cLetter; 1212 1206 1213 1207 /* Get target name */ 1214 WinQueryWindowText( WinWindowFromID(hwnd,IDEF_IMGCONVERTTARGETNAME), 1208 WinQueryWindowText( WinWindowFromID(hwnd,IDEF_IMGCONVERTTARGETNAME), 1215 1209 sizeof(chrTargetName), chrTargetName ); 1216 1210 #if 0 … … 1225 1219 if(lFreeSpace<lAudioSize) { 1226 1220 /* 1227 Text: 1228 Title: 1229 */ 1221 Text: 1222 Title: 1223 */ 1230 1224 getMessage(title, IDSTR_CONVERTNOSPACETEXT,sizeof(title), RESSOURCEHANDLE, hwnd); 1231 1225 sprintf(text,title,lAudioSize/1000000 ); … … 1237 1231 else { 1238 1232 /* Start decoding an audio file */ 1239 WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTOK), FALSE); 1233 WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTOK), FALSE); 1240 1234 WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTABORT), TRUE); 1241 1235 convertAudioFile(hwnd); … … 1244 1238 /* Start converting image file */ 1245 1239 WinPostMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTPERCENT), MPFROMLONG(0)); 1246 WinEnableWindow( WinWindowFromID(hwnd,IDPB_IMGCONVERTOK), FALSE); 1240 WinEnableWindow( WinWindowFromID(hwnd,IDPB_IMGCONVERTOK), FALSE); 1247 1241 WinEnableWindow( WinWindowFromID(hwnd,IDPB_IMGCONVERTABORT), TRUE); 1248 1242 convertImageFile(hwnd); … … 1256 1250 break; 1257 1251 }/* switch */ 1258 1252 1259 1253 return WinDefDlgProc( hwnd, msg, mp1, mp2); 1260 1254 } … … 1283 1277 if(hab) { 1284 1278 hmq=WinCreateMsgQueue(hab,0); 1285 if(hmq) { 1286 /* Check if user started prog by hand */ 1279 if(hmq) { 1280 /* Check if user started prog by hand */ 1287 1281 if(argc<NUMPARAMS-1) {/* Not the right num of params */ 1288 1282 pmUsage(); … … 1297 1291 strcpy(chrProcName, ""); 1298 1292 } 1299 /* Get our ressource dll */ 1293 /* Get our ressource dll */ 1300 1294 // RESSOURCEHANDLE=0; 1301 1295 RESSOURCEHANDLE=queryResModuleHandle(argv[0]); … … 1304 1298 /* Register the percent bar window class */ 1305 1299 percentRegisterBarClass(); 1306 1307 globalHab=WinQueryAnchorBlock(HWND_DESKTOP); 1300 1301 globalHab=WinQueryAnchorBlock(HWND_DESKTOP); 1308 1302 hBitmap=loadBitmap ( chrSourceName, &bmpInfoHeader2); 1309 1310 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 1303 1304 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 1311 1305 RESSOURCEHANDLE, IDDLG_IMGCONVERT, 0) == DID_ERROR ) 1312 1306 { … … 1314 1308 char title[CCHMAXPATH]; 1315 1309 /* 1316 Text: 1317 Title: "Installation problem" 1318 */ 1310 Text: 1311 Title: "Installation problem" 1312 */ 1319 1313 messageBox( text, IDSTR_CONVERTDIALOGERROR , sizeof(text), 1320 1314 title, IDSTR_INSTALLERRORTITLE , sizeof(title), … … 1329 1323 return( 1 ); 1330 1324 } 1331 if(pMemFormatInfo) 1325 if(pMemFormatInfo) 1332 1326 free(pMemFormatInfo); 1333 1327 if(hBitmap) -
trunk/classes/mm-progs/include/mmprogs_defaults.h
r4 r104 17 17 * If you need another license for your project/product (commercial, 18 18 * noncommercial, whatever) contact me at 19 * 19 * 20 20 * http://www.os2world.com/cdwriting 21 21 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 34 34 /* Audio player */ 35 35 #define DEFAULT_VOLUME 75 /* Default volume for audio player (not volume object) */ 36 #define INI_MMPLAYER_APP "mmplayer" /* App name to use */37 #define INI_DISPLAY_KEY "displaytype" /* Key for storing which display to show */38 #define INI_VOLUME_KEY "volume" /* Key for storing the volume */36 #define INI_MMPLAYER_APP (PSZ)"mmplayer" /* App name to use */ 37 #define INI_DISPLAY_KEY (PSZ)"displaytype" /* Key for storing which display to show */ 38 #define INI_VOLUME_KEY (PSZ)"volume" /* Key for storing the volume */ 39 39 40 40 /* Image converter */ 41 #define INI_IMGCONV_APP 41 #define INI_IMGCONV_APP (PSZ)"imageconv" 42 42 43 43 /* Audio converter */ 44 #define INI_AUDIOCONV_APP 44 #define INI_AUDIOCONV_APP (PSZ)"audioconv" 45 45 46 46 /* Master volume */ 47 #define INI_VOLUME_APP "volume"47 #define INI_VOLUME_APP (PSZ)"volume" 48 48 49 49 /* Volume for classes */ 50 #define INI_CLASSVOLUME_APP 50 #define INI_CLASSVOLUME_APP (PSZ)"classvolume" 51 51 52 52 /* For setting volume */ 53 #define SETUP_MMAUDIOVOLUME 53 #define SETUP_MMAUDIOVOLUME (PSZ)"MMAUDIOVOLUME" -
trunk/classes/mm-progs/makefile
r2 r104 7 7 8 8 CC = gcc 9 LIB_DIR = $d:/emx/lib 10 #CPPFLAGS = -Ge- /Gm+ -G4 -Gl /O+ -Oc+ -Ol 11 CPPFLAGS = -O -Wall -Zomf -Zcrtdll -s 9 CPPFLAGS = -O -Wno-pointer-sign -Wall -Zomf -Zcrtdll -s 12 10 INC = ./include -I ../../classes/inc -I ../../common_functions/include 13 DEFS = 14 PROGS = 11 DEFS = 12 PROGS = 15 13 ODIR = . 16 14 CPPDIR = . … … 22 20 23 21 $(LIBDIR)/%.obj: $(COMMONSRC)/%.c 24 gcc -c -W all -o$@ -Zomf -I$(INC) $<22 gcc -c -Wno-pointer-sign -Wall -o$@ -Zomf -I$(INC) $< 25 23 26 24 all: $(LIBOBJS) … … 48 46 -cd ./mmplayer && make cleaner 49 47 -cd ./master_volume && make cleaner 50 -rm ./include/*.*~ 48 -rm ./include/*.*~ 51 49 52 50 -
trunk/classes/mm-progs/master_volume/makefile
r53 r104 17 17 volume.exe: volume.c $(OBJECTS) makefile def.tpl 18 18 cmd /C $(TOOLDIR)\create_MMPROG_def.cmd volume.def 19 $(CC) $(CPPFLAGS) -I$(INC) volume.c $(OBJECTS) - Zmt -lmmpm2.lib volume.def19 $(CC) $(CPPFLAGS) -I$(INC) volume.c $(OBJECTS) -lmmpm2.lib volume.def 20 20 rc -I $(INC) volume.rc volume.exe 21 21 -
trunk/classes/mm-progs/master_volume/volume.c
r2 r104 17 17 * along with this program; see the file COPYING. If not, write to 18 18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 19 */ 19 */ 20 20 /* 21 21 * If you need another license for your project/product (commercial, 22 22 * noncommercial, whatever) contact me at 23 * 23 * 24 24 * http://www.os2world.com/cdwriting 25 25 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 35 35 #define INCL_MMIOOS2 36 36 #define INCL_MCIOS2 37 #define INCL_SECONDARYWINDOW 38 #define INCL_GRAPHICBUTTON 37 #define INCL_SECONDARYWINDOW 38 #define INCL_GRAPHICBUTTON 39 39 #include <os2.h> 40 40 #include <sw.h> … … 73 73 BOOL bHaveWindowPos=FALSE; 74 74 75 BOOL bMute=FALSE; 75 BOOL bMute=FALSE; 76 76 HMODULE RESSOURCEHANDLE=0; 77 77 int bTBVisible=0; … … 134 134 135 135 /* Masteraudio does not support NOTIFY so use a thread to prevent PM freeze */ 136 MRESULT EXPENTRY volumeObjectProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 136 MRESULT EXPENTRY volumeObjectProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 137 137 { 138 138 switch(msg) … … 153 153 ULONG mastervolume; /* Set to master volumepercentage 154 154 percentage by this example */ 155 155 156 156 USHORT usDeviceID=0; 157 157 MCI_MASTERAUDIO_PARMS masteraudioparms; … … 161 161 memset(&openParms,0, sizeof(openParms)); 162 162 openParms.pszDeviceType="Masteraudio"; 163 163 164 164 rc=mciSendCommand(0, /* Device */ 165 165 MCI_OPEN, /* Master audio message */ … … 171 171 mciGetErrorString(rc,chrCommand, sizeof(chrCommand)); 172 172 //sprintf(chrCommand, "%x", rc); 173 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrCommand, "", 1234, MB_MOVEABLE); 173 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrCommand, "", 1234, MB_MOVEABLE); 174 174 DosBeep(5000, 10); 175 175 usDeviceID=openParms.usDeviceID; … … 178 178 /* Get current system master 179 179 volume setting */ 180 180 181 181 mciSendCommand(usDeviceID, /* Device */ 182 182 MCI_MASTERAUDIO, /* Master audio message */ … … 188 188 /* Get current system master 189 189 volume setting */ 190 190 191 191 mciSendCommand(usDeviceID, /* Device */ 192 192 MCI_MASTERAUDIO, /* Master audio message */ … … 195 195 (PVOID) &masteraudioparms, /* Data structure */ 196 196 0); /* User parm */ 197 197 198 198 mastervolume = masteraudioparms.ulReturn; 199 199 DosBeep(500, 10); … … 228 228 } 229 229 230 void _OptlinkvolumeThreadFunc (void *arg)230 void volumeThreadFunc (void *arg) 231 231 { 232 232 HAB hab; … … 238 238 hmq=WinCreateMsgQueue(hab,0); 239 239 if(hmq) { 240 240 241 241 if((hwndThread=WinCreateWindow(HWND_OBJECT, WC_STATIC, "", 0,0,0,0,0, NULLHANDLE, 242 242 HWND_BOTTOM, 1, NULLHANDLE, NULLHANDLE))==NULLHANDLE) { … … 245 245 } 246 246 WinSubclassWindow(hwndThread,&volumeObjectProc); 247 /* Window created. */ 247 /* Window created. */ 248 248 249 249 while(WinGetMsg(hab,&qmsg,(HWND)NULL,0,0)) 250 250 WinDispatchMsg(hab,&qmsg); 251 251 WinDestroyWindow(hwndThread); 252 252 253 253 WinDestroyMsgQueue(hmq); 254 254 } … … 267 267 if((hwndTitleBar=WinWindowFromID(hwnd, FID_TITLEBAR))==NULLHANDLE) 268 268 return; 269 269 270 270 hwndPopup = WinLoadMenu(hwnd, RESSOURCEHANDLE, IDM_POPUP); 271 271 if (hwndPopup == NULLHANDLE) 272 272 return; 273 273 274 274 bVisible=WinIsWindowVisible(hwndTitleBar); 275 275 276 276 if(!bVisible) 277 WinSendMsg(hwndPopup,MM_SETITEMATTR,MPFROM2SHORT(IDM_ITEMTITLEBAR,FALSE), 277 WinSendMsg(hwndPopup,MM_SETITEMATTR,MPFROM2SHORT(IDM_ITEMTITLEBAR,FALSE), 278 278 MPFROM2SHORT(MIA_CHECKED,MIA_CHECKED)); 279 279 280 280 WinQueryPointerPos(HWND_DESKTOP, &ptl) ; 281 281 WinMapWindowPoints(HWND_DESKTOP,hwnd,&ptl,1); 282 WinPopupMenu(hwnd, hwnd, hwndPopup, 282 WinPopupMenu(hwnd, hwnd, hwndPopup, 283 283 ptl.x, ptl.y, IDM_ITEMEXIT, PU_HCONSTRAIN | PU_VCONSTRAIN | 284 284 PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_MOUSEBUTTON2 | PU_NONE ); … … 296 296 if(!WinQueryWindowPos(hwndTitleBar,&swp)) 297 297 return FALSE; 298 298 299 299 if(!WinQueryWindowPos(hwnd,&swpFrame)) 300 300 return FALSE; 301 301 302 302 /* Shrink or expand the frame */ 303 303 if(!bTBVisible) { 304 WinSetWindowPos(hwnd, NULLHANDLE, swpFrame.x, swpFrame.y,//-swp.cy, 304 WinSetWindowPos(hwnd, NULLHANDLE, swpFrame.x, swpFrame.y,//-swp.cy, 305 305 swpFrame.cx, swpFrame.cy+swp.cy, SWP_SIZE|SWP_MOVE); 306 306 bTBVisible=TRUE; … … 308 308 else 309 309 { 310 WinSetWindowPos(hwnd, NULLHANDLE, swpFrame.x, swpFrame.y,//+swp.cy, 310 WinSetWindowPos(hwnd, NULLHANDLE, swpFrame.x, swpFrame.y,//+swp.cy, 311 311 swpFrame.cx, swpFrame.cy-swp.cy, SWP_SIZE|SWP_MOVE); 312 312 bTBVisible=FALSE; 313 313 } 314 314 } 315 WinSendMsg(hwnd,WM_UPDATEFRAME,0,0); 315 WinSendMsg(hwnd,WM_UPDATEFRAME,0,0); 316 316 return TRUE; 317 317 } … … 326 326 327 327 switch (msg) 328 { 328 { 329 329 case WM_INITDLG: 330 330 { … … 345 345 (MPARAM) 0L, 346 346 (MPARAM) 100L); 347 347 348 348 WinSendMsg( WinWindowFromID(hwnd, IDCS_VOLUME), 349 349 CSM_SETINCREMENT, 350 350 (MPARAM) 10L, 351 351 (MPARAM) 1L); 352 353 352 353 354 354 WinSendMsg( WinWindowFromID(hwnd, IDCS_VOLUME), 355 355 CSM_SETVALUE, 356 356 (MPARAM) queryMasterVolume(), 357 357 (MPARAM) NULL); 358 359 358 359 360 360 // getMessage(title, IDSTR_CONVERTCHANNELS, sizeof(title), RESSOURCEHANDLE, hwnd); 361 361 /* Set dialog font to WarpSans for Warp 4 and above */ … … 365 365 DEFAULT_DIALOG_FONT ); 366 366 } 367 367 368 368 hpProgramIcon = 369 369 WinLoadPointer( … … 371 371 (HMODULE) NULL, /* Resource is kept in .Exe file. */ 372 372 ID_ICONVOLUME ); /* Which icon to use. */ 373 373 374 374 WinSendMsg( 375 375 hwnd, /* Dialog window handle. */ … … 399 399 PP_BACKGROUNDCOLOR,(ULONG)sizeof(rgb), &rgb); 400 400 } 401 ulSize=sizeof(RGB); 401 ulSize=sizeof(RGB); 402 402 if(IniRestoreData(chrIniFile, INI_VOLUME_APP, INI_BTNFGCLR_KEY, &rgb, &ulSize)) 403 403 { … … 428 428 /* Remove top frame controls if titlebar is hidden */ 429 429 SHORT countSwp; 430 430 431 431 countSwp = (int) WinDefDlgProc(hwnd, msg, mp1, mp2); 432 432 if(countSwp) { 433 if(bTBVisible==0) { 434 /* Hide frame controls */ 433 if(bTBVisible==0) { 434 /* Hide frame controls */ 435 435 /* countSWP: number of standard framecontrols 436 436 pswp: Array of SWP describing the framecontrols. … … 439 439 PSWP pswpTB=NULLHANDLE; 440 440 PSWP pswp=(PSWP)mp1; 441 int y , cy;441 int y; 442 442 443 443 for (a = 0; a < countSwp; a++) … … 448 448 pswpTB=&pswp[a]; 449 449 y=pswp[a].y; 450 cy=pswp[a].cy;451 450 // DosBeep(500,600); 452 451 break; … … 485 484 case WM_BUTTON1MOTIONSTART: 486 485 /* Drag the window without titlebar */ 487 WinSendMsg(hwnd, WM_TRACKFRAME, 486 WinSendMsg(hwnd, WM_TRACKFRAME, 488 487 MPFROMSHORT(TF_MOVE /*| TF_SETPOINTERPOS */), NULL) ; 489 488 return (MRESULT) 0 ; … … 504 503 { 505 504 if (SHORT2FROMMP(mp1)==GBN_BUTTONDOWN) { 506 bMute=TRUE; 505 bMute=TRUE; 507 506 setMasterVolume(hwnd, 0); 508 507 } 509 508 else if (SHORT2FROMMP(mp1)==GBN_BUTTONUP) { 510 509 SHORT sValue; 511 510 512 511 bMute=FALSE; 513 512 WinSendMsg(WinWindowFromID(hwnd, IDCS_VOLUME),CSM_QUERYVALUE ,MPFROMP(&sValue) ,0); … … 524 523 memset(&masteraudioparms,0, sizeof(masteraudioparms)); 525 524 /* Save master audio level */ 526 mciSendCommand( 0, 525 mciSendCommand( 0, 527 526 MCI_MASTERAUDIO, /* Master audio message */ 528 527 MCI_WAIT | MCI_MASTERVOL | MCI_SAVESETTING, … … 594 593 bTBVisible=IniRestoreInt(chrIniFile, INI_VOLUME_APP, INI_TBVISIBLE_KEY, 1); 595 594 596 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, 595 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, 597 596 volumeDialogProc, RESSOURCEHANDLE, IDDLG_VOLUME, 0) == DID_ERROR ) 598 597 { 599 598 /* 600 Text: 601 Title: "Installation problem" 599 Text: 600 Title: "Installation problem" 602 601 */ 603 602 #if 0 … … 605 604 title, IDSTR_INSTALLERRORTITLE , sizeof(title), 606 605 RESSOURCEHANDLE, HWND_DESKTOP, MB_OK | MB_ICONEXCLAMATION | MB_MOVEABLE); 607 #endif 606 #endif 608 607 WinDestroyMsgQueue( hmq ); 609 608 WinTerminate( hab ); … … 637 636 (MPARAM) NULL); 638 637 while ( WinGetMsg( hab, (PQMSG) &qmsg, (HWND) NULL, 0, 0) ) 639 WinDispatchMsg( hab, (PQMSG) &qmsg ); 638 WinDispatchMsg( hab, (PQMSG) &qmsg ); 640 639 #endif 641 640 freeResHandle(); -
trunk/classes/mm-progs/mmfind/image.c
r4 r104 26 26 POINTL aptl[4]; 27 27 HPS hps; 28 BOOL bReturnCode;29 28 ULONG ulHeight; 30 29 ULONG ulWidth; … … 37 36 * Get position of image frame 38 37 */ 39 bReturnCode =WinQueryWindowPos ( hwnd, &swp);38 WinQueryWindowPos ( hwnd, &swp); 40 39 41 40 WinQueryWindowRect(hwnd, &rectl); … … 48 47 aptl[0].x=(swp.cx-ulWidth)/2; 49 48 aptl[1].x=aptl[0].x+ulWidth; 50 49 51 50 aptl[0].y=(swp.cy-ulHeight)/2; 52 51 aptl[1].y=aptl[0].y+ulHeight; … … 62 61 aptl[0].x=(swp.cx-ulWidth*fRes)/2; 63 62 aptl[1].x=aptl[0].x+ulWidth*fRes; 64 63 65 64 aptl[0].y=(swp.cy-ulHeight*fRes)/2; 66 65 aptl[1].y=aptl[0].y+ulHeight*fRes; 67 66 } 68 67 69 68 aptl[2].x = 0; // source lower left 70 69 aptl[2].y = 0; 71 70 72 71 aptl[3].x = ulWidth; // source upper right 73 72 aptl[3].y = ulHeight; … … 89 88 // WinDrawBitmap(hps, hBitmap, NULLHANDLE, (PPOINTL)aptl, 0, 0, DBM_NORMAL/*|DBM_STRETCH*/); 90 89 #endif 91 bReturnCode =WinEndPaint (hps);90 WinEndPaint (hps); 92 91 } 93 92 … … 96 95 97 96 switch (msg) 98 { 97 { 99 98 case WM_PAINT: 100 99 { … … 276 275 return(0L); 277 276 } 278 277 279 278 280 279 // *************************************************** … … 282 281 // the memory device context obtained above. 283 282 // *************************************************** 284 283 285 284 ImageSize.cx = dwWidth; 286 285 ImageSize.cy = dwHeight; … … 300 299 (ULONG) MB_OK | MB_MOVEABLE | 301 300 MB_ERROR ); 302 #endif 301 #endif 303 302 DevCloseDC(hdc); 304 303 DosFreeMem(pRowBuffer); -
trunk/classes/mm-progs/mmfind/mmfind.c
r4 r104 21 21 * If you need another license for your project/product (commercial, 22 22 * noncommercial, whatever) contact me at 23 * 23 * 24 24 * http://www.os2world.com/cdwriting 25 25 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 73 73 BOOL bIsMidi=FALSE; /* No MIDI support atm */ 74 74 BOOL bIsPlaying=FALSE; /* TRUE if currently playing */ 75 BOOL bPaused=FALSE; 75 BOOL bPaused=FALSE; 76 76 ULONG ulPos; 77 77 ULONG ulTotalLength; … … 120 120 hps=WinGetPS(HWND_DESKTOP); 121 121 122 /* Play */ 122 /* Play */ 123 123 hbmPlay=GpiLoadBitmap(hps, hResource, IDBMP_PLAY, 0, 0); 124 124 … … 143 143 ulStyle|=(BS_BITMAP); 144 144 ulStyle&=~BS_TEXT; 145 145 146 146 if(WinSetWindowULong(hwndTemp, QWL_STYLE, ulStyle)) { 147 147 memset(&btCtrl, 0, sizeof(btCtrl)); … … 163 163 ulStyle|=(BS_BITMAP); 164 164 ulStyle&=~BS_TEXT; 165 165 166 166 if(WinSetWindowULong(hwndTemp, QWL_STYLE, ulStyle)) { 167 167 memset(&btCtrl, 0, sizeof(btCtrl)); … … 199 199 if(!MsgGetMessage(audioText, IDSTR_AUDIOINFOTEXT, sizeof(audioText), hResMod,HWND_DESKTOP)) 200 200 strcpy(audioText, TEXT_INFOTEXT); 201 if(!MsgGetMessage(chrMediaFileTypes[MT_AUDIO], IDSTR_TYPEAUDIO, 201 if(!MsgGetMessage(chrMediaFileTypes[MT_AUDIO], IDSTR_TYPEAUDIO, 202 202 sizeof(chrMediaFileTypes[MT_AUDIO]), hResMod, HWND_DESKTOP)) 203 203 strcpy(chrMediaFileTypes[MT_AUDIO], TEXT_TYPEAUDIO); 204 if(!MsgGetMessage(chrMediaFileTypes[MT_IMAGE], IDSTR_TYPEIMAGE, 204 if(!MsgGetMessage(chrMediaFileTypes[MT_IMAGE], IDSTR_TYPEIMAGE, 205 205 sizeof(chrMediaFileTypes[MT_IMAGE]), hResMod, HWND_DESKTOP)) 206 206 strcpy(chrMediaFileTypes[MT_AUDIO], TEXT_TYPEIMAGE); 207 if(!MsgGetMessage(chrMediaFileTypes[MT_VIDEO], IDSTR_TYPEVIDEO, 207 if(!MsgGetMessage(chrMediaFileTypes[MT_VIDEO], IDSTR_TYPEVIDEO, 208 208 sizeof(chrMediaFileTypes[MT_VIDEO]), hResMod, HWND_DESKTOP)) 209 209 strcpy(chrMediaFileTypes[MT_VIDEO], TEXT_TYPEVIDEO); … … 272 272 char chrCommand[50]; 273 273 char retMsg[100]; 274 ULONG rc;275 274 276 275 if(bIsPlaying) { 277 276 sprintf(chrCommand,"stop wave%ld wait", hwndNotify); 278 rc =mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);279 277 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 278 280 279 sprintf(chrCommand,"close wave%ld wait", hwndNotify); 281 rc =mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);282 283 #if 0 280 mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 281 282 #if 0 284 283 _resetDisplay(hwndFrame); 285 284 showPlayTimeDisplay( hwndFrame, TRUE); … … 287 286 #endif 288 287 bIsPlaying=FALSE; 289 bPaused=FALSE; 288 bPaused=FALSE; 290 289 } 291 290 … … 319 318 strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice)); 320 319 321 /* Start audio file */ 320 /* Start audio file */ 322 321 sprintf(chrCommand,"open \"%s\" type %s alias wave%ld SHAREABLE wait", chrSourceName, chrDevice, hwndNotify); 323 322 … … 326 325 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) 327 326 return 0; 328 327 329 328 /* Set time format */ 330 329 sprintf(chrCommand,"SET wave%ld TIME FORMAT MILLISECONDS wait", hwndNotify); … … 334 333 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 335 334 return 0; 336 } 335 } 337 336 338 337 #if 0 … … 420 419 421 420 /* Every folder has one running play thread to handle play commands */ 422 void _OptlinkplayThreadFunc (void *arg)421 void playThreadFunc (void *arg) 423 422 { 424 423 HAB hab; … … 488 487 if(MMIO_SUCCESS!=mmioIdentifyFile(chrFile, &mmioInfo, &mmFormatInfo, &fourCC, 0,0)) 489 488 { 490 return MT_UNKNOWN; 489 return MT_UNKNOWN; 491 490 } 492 491 … … 539 538 } 540 539 /* Fill combo box with media types (audio, image, video) */ 541 for(a=0;a<NUMMEDIATYPES;a++) 542 WinSendMsg(WinWindowFromID(hwnd, IDCB_TYPEOFFILE), LM_INSERTITEM, MRFROMSHORT(LIT_SORTASCENDING), 540 for(a=0;a<NUMMEDIATYPES;a++) 541 WinSendMsg(WinWindowFromID(hwnd, IDCB_TYPEOFFILE), LM_INSERTITEM, MRFROMSHORT(LIT_SORTASCENDING), 543 542 MPFROMP(chrMediaFileTypes[a])); 544 543 WinSetWindowText(WinWindowFromID(hwnd, IDCB_TYPEOFFILE), chrMediaFileTypes[0]); … … 681 680 mmio.ulFlags=MMIO_READ; 682 681 mmio.ulTranslate=MMIO_TRANSLATEHEADER; 683 682 684 683 hmmio = mmioOpen(chrFullName, &mmio, MMIO_READ); 685 684 if(!hmmio) … … 689 688 rc = mmioGetHeader(hmmio, &mmAudioHeader,sizeof(MMAUDIOHEADER), 690 689 &lBytesRead, 0, 0); 691 690 692 691 mmioClose(hmmio, 0); 693 692 if(rc!=MMIO_SUCCESS) { … … 785 784 APIRET rc; /* return code from REXX */ 786 785 SHORT rexxrc = 0; /* return code from function */ 787 char theScript[CCHMAXPATH]; 786 char theScript[CCHMAXPATH]; 788 787 /* By setting the strlength of the output RXSTRING to zero, we */ 789 788 /* force the interpreter to allocate memory and return it to us. */ 790 789 /* We could provide a buffer for the interpreter to use instead. */ 791 790 rexxretval.strlength = 0L; /* initialize return to empty*/ 792 791 793 792 sprintf(theScript, "%s\\%s", pszBinDir, rexxFile); 794 793 … … 807 806 #if 0 808 807 if(rc) { 809 sprintf(text,"Error in the Rexx skript %s\n\n Get more information with 'help REX%04d'.\n", 808 sprintf(text,"Error in the Rexx skript %s\n\n Get more information with 'help REX%04d'.\n", 810 809 tPt->rexxSkript, rc*-1); 811 810 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, text, "", 1234, MB_OK|MB_MOVEABLE|MB_ERROR); … … 822 821 } 823 822 if(rexxretval.strptr) 824 DosFreeMem(rexxretval.strptr); /* Release storage given to us by REXX. */ 823 DosFreeMem(rexxretval.strptr); /* Release storage given to us by REXX. */ 825 824 if(!rc) 826 825 return TRUE; … … 845 844 '\0', 846 845 sizeof(MMFORMATINFO) ); 847 846 848 847 mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE; 849 mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/ 848 mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/ 850 849 ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo, 851 850 &lNumIOProcs, 852 851 0, 853 852 0 ); 854 853 855 854 if( ulReturnCode != MMIO_SUCCESS ) 856 855 { … … 873 872 return FALSE; 874 873 } 875 874 876 875 /* 877 876 * call mmioGetFormats to get info on the formats supported. … … 891 890 return FALSE; 892 891 } 893 892 894 893 if( lFormatsRead != lNumIOProcs ) 895 894 { … … 919 918 } 920 919 } 921 } 920 } 922 921 /* 923 922 * advance to next entry in mmFormatInfo array 924 */ 923 */ 925 924 pmmFormatInfoArray++; 926 925 } … … 952 951 if(hab) { 953 952 hmq=WinCreateMsgQueue(hab,0); 954 if(hmq) { 955 /* Check if user started prog by hand */ 953 if(hmq) { 954 /* Check if user started prog by hand */ 956 955 if(argc!=NUMPARAMS) {/* Not the right num of params */ 957 956 pmUsage(); 958 957 } 959 958 else { 960 HWND hwndDlg; 961 962 /* Get our ressource dll */ 959 HWND hwndDlg; 960 961 /* Get our ressource dll */ 963 962 RESSOURCEHANDLE=queryResModuleHandle(argv[0]); 964 963 /* Load NLV strings */ … … 1031 1030 { 1032 1031 if(hBitmap) 1033 GpiDeleteBitmap(hBitmap); 1032 GpiDeleteBitmap(hBitmap); 1034 1033 if( fd.lReturn == DID_OK ) 1035 1034 { … … 1056 1055 { 1057 1056 HOBJECT hObject; 1058 char *chr;1059 1057 if((hObject=WinQueryObject(fd.szFullFile))!=NULLHANDLE) 1060 1058 WinOpenObject(hObject, ID_MENU_PLAYER /* OPEN_DEFAULT */, TRUE); 1061 1059 #if 0 1062 1060 /* Open folder */ 1063 if((chr=strrchr(fd.szFullFile, '\\'))!=NULLHANDLE) { 1064 *chr=0; 1061 if(strrchr(fd.szFullFile, '\\')!=NULLHANDLE) { 1065 1062 if((hObject=WinQueryObject(fd.szFullFile))!=NULLHANDLE) 1066 1063 WinOpenObject(hObject, OPEN_CONTENTS, TRUE); -
trunk/classes/mm-progs/mmprog.inc
r53 r104 2 2 3 3 CC = gcc 4 CPPFLAGS = -O -W all -Zomf -Zmt -s4 CPPFLAGS = -O -Wno-pointer-sign -Wall -Zomf -Zmt -s 5 5 #CPPFLAGS = -O -Zomf -Zcrtdll -Zmtd -s 6 6 7 7 INC = ../include -I ../../../classes/inc -I $(COMMONSRC)/include 8 8 # Fixme GKY 4-15-23 9 LIB_DIR = $d:/emx/lib 9 LIB_DIR = $d:/emx/lib 10 10 TOOLDIR = .\.. 11 11 LIBDIR = ../lib 12 DEFS = 13 PROGS = 12 DEFS = 13 PROGS = 14 14 ODIR = 15 15 CPPDIR = 16 16 17 $(LIBDIR)/%.obj: $(COMMONSRC)/%.c 18 $(CC) -c -W all -o$@ -Zomf -I$(INC) $<17 $(LIBDIR)/%.obj: $(COMMONSRC)/%.c 18 $(CC) -c -Wno-pointer-sign -Wall -o$@ -Zomf -I$(INC) $< 19 19 20 20 %.obj: %.c 21 $(CC) -c -W all -o$@ -Zomf -I$(INC) $<21 $(CC) -c -Wno-pointer-sign -Wall -o$@ -Zomf -I$(INC) $< 22 22 23 23 -
trunk/classes/mm-progs/videoplayer/mmplayer.c
r46 r104 21 21 * If you need another license for your project/product (commercial, 22 22 * noncommercial, whatever) contact me at 23 * 23 * 24 24 * http://www.os2world.com/cdwriting 25 25 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 55 55 #include "sys_funcs.h" 56 56 57 #ifndef OPEN_DEFAULT 57 #ifndef OPEN_DEFAULT 58 58 /* Open views for the wpOpen() method */ 59 59 … … 140 140 141 141 /* Every folder has one running play thread to handle play commands */ 142 void _OptlinkplayThreadFunc (void *arg);142 void playThreadFunc (void *arg); 143 143 void controlPlaying(HWND hwndDialog, ULONG ulAction, ULONG ulReserved); 144 144 BOOL stopAudioFile(HWND hwndFrame); … … 216 216 WinQueryPointerPos(HWND_DESKTOP, &ptl) ; 217 217 WinMapWindowPoints(HWND_DESKTOP,hwnd,&ptl,1); 218 WinPopupMenu(hwnd, hwnd, hwndPopup, 218 WinPopupMenu(hwnd, hwnd, hwndPopup, 219 219 ptl.x, ptl.y, 0, PU_HCONSTRAIN | PU_VCONSTRAIN | 220 PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_MOUSEBUTTON2 | PU_NONE ); 221 220 PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_MOUSEBUTTON2 | PU_NONE ); 221 222 222 } 223 223 … … 232 232 hResource=BMP_RESSOURCEHANDLE; //_queryResModuleHandle(); 233 233 hps=WinGetPS(HWND_DESKTOP); 234 234 235 235 /* The main BMP */ 236 236 allBMPs[MAIN_BMP_IDX].hbm=GpiLoadBitmap(hps, hResource, IDBMP_TOPMIDDLE, 0, 0); … … 332 332 WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclSource.xLeft,ci.rclSource.yBottom, 333 333 ci.rclSource.xRight-ci.rclSource.xLeft, 334 ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE|SWP_SIZE); 334 ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE|SWP_SIZE); 335 335 oldPlayTimeProc=WinSubclassWindow(WinWindowFromID(hwnd, IDST_MMPLAYERPLAYTIME), playTimeTextProc); 336 336 337 337 /* Pos slider */ 338 338 ci=ciControls[CTRLIDX_POSSLIDER];//ciPosSlider; 339 WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 339 WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 340 340 hwnd, HWND_TOP, ci.id, NULLHANDLE, NULLHANDLE); 341 341 WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclDest.xLeft, ci.rclDest.yBottom, 342 342 ci.rclSource.xRight-ci.rclSource.xLeft, 343 343 ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE | SWP_SIZE); 344 344 345 345 WinSendMsg(WinWindowFromID(hwnd, ci.id),SLM_SETSLIDERINFO, 346 346 MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS,0), 347 MPFROM2SHORT( 9, 9)); 347 MPFROM2SHORT( 9, 9)); 348 348 349 349 /* Vol slider */ 350 350 ci=ciControls[CTRLIDX_VOLSLIDER];//ciVolSlider; 351 WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 351 WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 352 352 hwnd, HWND_TOP, ci.id, NULLHANDLE, NULLHANDLE); 353 353 WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclDest.xLeft, ci.rclDest.yBottom, … … 356 356 WinSendMsg(WinWindowFromID(hwnd, ci.id),SLM_SETSLIDERINFO, 357 357 MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS,0), 358 MPFROM2SHORT( 9, 9)); 358 MPFROM2SHORT( 9, 9)); 359 359 360 360 } … … 375 375 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { 376 376 /* Problem with MCI. Clean up. The Timer will be stopped in the method */ 377 stopAudioFile(hwndFrame); 377 stopAudioFile(hwndFrame); 378 378 } 379 379 else { 380 380 if(!stricmp(retMsg, "stopped")) { 381 381 /* Audio file played. */ 382 stopAudioFile(hwndFrame); 382 stopAudioFile(hwndFrame); 383 383 } 384 384 showPlayTimeDisplay(hwndFrame, TRUE);/* Ensure display is visible */ … … 396 396 return usItems; 397 397 } 398 398 399 399 return 0; 400 400 } … … 402 402 BOOL DrgVerifyTypeCW(PDRAGITEM pDragItem, char * chrType) 403 403 { 404 /* DrgVerifyType() seems not to work when several types are in the list?? 404 /* DrgVerifyType() seems not to work when several types are in the list?? 405 405 Dokumentation says, it works... */ 406 406 /* Only check for a single type for now */ … … 472 472 for(ulHash=0;*theString!='\0'; theString++) 473 473 ulHash=*theString+37*ulHash; 474 474 475 475 return ulHash%HASHSIZE; 476 476 } … … 543 543 MRESULT handleDrag0ver(PDRAGINFO pdi, HWND hwnd) 544 544 { 545 545 546 546 /* Only accept one file */ 547 547 if(DrgGetNumObjects(pdi)!=1) { … … 551 551 if(DrgCheckForKnownType(pdi, hwnd)) 552 552 return MRFROM2SHORT(DOR_DROP, DO_COPY); 553 554 return MRFROM2SHORT(DOR_NEVERDROP, DO_COPY); 553 554 return MRFROM2SHORT(DOR_NEVERDROP, DO_COPY); 555 555 } 556 556 … … 567 567 char chrFile[CCHMAXPATH]; 568 568 PDRAGITEM pDragItem; 569 569 570 570 pDragItem=DrgQueryDragitemPtr(pdi, 0); 571 DrgQueryStrName(pDragItem->hstrSourceName,sizeof(chrFile), chrFile); 572 DrgQueryStrName(pDragItem->hstrContainerName,sizeof(chrSourceName), chrSourceName); 571 DrgQueryStrName(pDragItem->hstrSourceName,sizeof(chrFile), chrFile); 572 DrgQueryStrName(pDragItem->hstrContainerName,sizeof(chrSourceName), chrSourceName); 573 573 strcat(chrSourceName, chrFile); 574 574 575 575 /* Start new file */ 576 576 controlPlaying(hwnd, PLAY_FIRST, 0); … … 613 613 MPFROM2SHORT(SC_SIZE, TRUE), 614 614 MPFROMP(NULL)); 615 615 616 616 WinSendMsg(hwndMenu, /* Delete Minimize from the system menu */ 617 617 MM_DELETEITEM, 618 618 MPFROM2SHORT(SC_MINIMIZE, TRUE), 619 619 MPFROMP(NULL)); 620 620 621 621 WinSendMsg(hwndMenu, /* Delete Maximize from the system menu */ 622 622 MM_DELETEITEM, … … 653 653 654 654 switch (msg) 655 { 655 { 656 656 case DM_DRAGOVER: 657 657 { … … 682 682 swctl.fbJump=SWL_JUMPABLE; 683 683 WinAddSwitchEntry(&swctl); 684 684 685 685 adjustDialogControlPos(hwnd); 686 686 687 687 /* Set volume slider*/ 688 688 WinSendMsg( WinWindowFromID(hwnd, IDSL_MMPLAYERVOLUME), … … 690 690 MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_INCREMENTVALUE), 691 691 MPFROMLONG( ulVolume)); 692 692 693 693 /* Subclass buttons for DnD */ 694 694 orgButtonProc=WinSubclassWindow(WinWindowFromID(hwnd, IDPB_MMPLAYERPLAY), buttonProc); 695 695 WinSubclassWindow(WinWindowFromID(hwnd, IDPB_MMPLAYERPAUSE), buttonProc); 696 696 WinSubclassWindow(WinWindowFromID(hwnd, IDPB_MMPLAYERSTOP), buttonProc); 697 697 698 698 FixSysMenu(hwnd); 699 699 … … 701 701 if(allBMPs[MAIN_BMP_IDX].hbm) { 702 702 SWP swp; 703 704 WinQueryWindowPos(WinWindowFromID(hwnd, FID_TITLEBAR), &swp); 705 WinSetWindowPos(WinWindowFromID(hwnd, ID_CLIENT), NULLHANDLE, 706 WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME), 707 WinQuerySysValue(HWND_DESKTOP, SV_CYDLGFRAME), 703 704 WinQueryWindowPos(WinWindowFromID(hwnd, FID_TITLEBAR), &swp); 705 WinSetWindowPos(WinWindowFromID(hwnd, ID_CLIENT), NULLHANDLE, 706 WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME), 707 WinQuerySysValue(HWND_DESKTOP, SV_CYDLGFRAME), 708 708 allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cx, 709 709 allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cy, 710 710 SWP_SIZE|SWP_MOVE); 711 711 orgBgProc=WinSubclassWindow(WinWindowFromID(hwnd, ID_CLIENT), bgProc); 712 712 713 713 WinSetWindowPos(hwnd, NULLHANDLE, 0, 0, 714 714 allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cx+WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME)*2, … … 741 741 /*****************************************************/ 742 742 case WM_APPTERMINATENOTIFY: 743 743 744 744 switch(SHORT1FROMMP(mp1)) 745 745 { … … 754 754 return MRFALSE; 755 755 case NOTIFY_CONTEXT: 756 /* Show context menu. */ 756 /* Show context menu. */ 757 757 HlpContextMenu(hwnd, iWhichDisplay+ID_MENUITEMELAPSED, TRUE); 758 758 return MRFALSE; … … 761 761 } 762 762 return MRFALSE; 763 763 764 764 /*****************************************************/ 765 765 /* The following two messages are for device sharing */ … … 769 769 char chrCommand[100]; 770 770 int iWavePriv; 771 771 772 772 iWavePriv=ulPid; 773 773 … … 800 800 /* SETPOSITIONADVICE does not work for some reason, */ 801 801 /* so a timer is used. Yes, it's quit cumbersome... */ 802 /*****************************************************/ 802 /*****************************************************/ 803 803 case WM_TIMER: 804 804 if(SHORT1FROMMP(mp1)==IDTIMER_PLAY) { … … 821 821 /* Set slider position */ 822 822 823 WinPostMsg( WinWindowFromID(hwnd, IDSL_MMPLAYERPOSBAR), 823 WinPostMsg( WinWindowFromID(hwnd, IDSL_MMPLAYERPOSBAR), 824 824 SLM_SETSLIDERINFO, 825 825 MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_INCREMENTVALUE), … … 908 908 default: 909 909 break; 910 } 910 } 911 911 break; 912 912 … … 919 919 char chrCommand[50]; 920 920 char retMsg[20]; 921 921 922 922 switch(SHORT2FROMMP(mp1)) 923 923 { … … 949 949 static long lLastPos=0; 950 950 long lPos=LONGFROMMP(mp2); 951 951 952 952 bPosDragging=TRUE; 953 953 lPos*=ulTotalLength/100; … … 973 973 { 974 974 ULONG ulValue; 975 975 976 976 ulValue=LONGFROMMP(mp2); 977 977 ulVolume=ulValue; … … 985 985 986 986 bPosDragging=FALSE; 987 lPos*=1000; 987 lPos*=1000; 988 988 lPos*=ulTotalLength/100; 989 989 lPos/=1000;// Use only full seconds … … 992 992 seekAudioFile(lPos); 993 993 /* restart timer */ 994 WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, IDTIMER_PLAY, PLAYTIMER_DELAY); 994 WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, IDTIMER_PLAY, PLAYTIMER_DELAY); 995 995 ulPos=lPos/1000; 996 996 break; … … 1009 1009 break; 1010 1010 }/* switch */ 1011 1011 1012 1012 return WinDefDlgProc( hwnd, msg, mp1, mp2); 1013 1013 } … … 1029 1029 ))==NULLHANDLE) 1030 1030 return FALSE; 1031 1031 1032 1032 ulSize=sizeof(chrFileName); 1033 1033 1034 1034 if ((rc = DosOpen(chrFileName, &handle, &act, 1035 1035 0L, 0, OPEN_ACTION_OPEN_IF_EXISTS, … … 1095 1095 BOOL writeVolumeToIni(char * iniFile, char* chrApp, char *chrKey, ULONG ulVolume) 1096 1096 { 1097 1097 1098 1098 return IniSaveInt(iniFile, chrApp, chrKey, ulVolume); 1099 1099 } … … 1145 1145 if(hab) { 1146 1146 hmq=WinCreateMsgQueue(hab,0); 1147 if(hmq) { 1148 /* Check if user started prog by hand */ 1147 if(hmq) { 1148 /* Check if user started prog by hand */ 1149 1149 if(argc!=NUMPARAMS) {/* Not the right num of params */ 1150 1150 pmUsage(); … … 1164 1164 strcpy(chrClassName, params[1]); 1165 1165 1166 /* Get our ressource dll */ 1166 /* Get our ressource dll */ 1167 1167 RESSOURCEHANDLE=queryResModuleHandle(argv[0]); 1168 1168 /* Get data from INI file */ … … 1176 1176 WinRegisterClass(WinQueryAnchorBlock(HWND_DESKTOP), SLIDER_CLASS, privateSliderProc,0, SLADDBYTES); 1177 1177 1178 _loadBmps(); 1178 _loadBmps(); 1179 1179 DosGetInfoBlocks(&ptib, &ppib); 1180 1180 ulPid=ppib->pib_ulpid; … … 1183 1183 //DosBeep(5000, 400); 1184 1184 1185 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 1185 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 1186 1186 RESSOURCEHANDLE, IDDLG_MMPLAYER, 0) == DID_ERROR ) 1187 1187 { 1188 1188 /* 1189 Text: 1190 Title: "Installation problem" 1191 */ 1189 Text: 1190 Title: "Installation problem" 1191 */ 1192 1192 messageBox( text, IDSTR_CONVERTDIALOGERROR , sizeof(text), 1193 1193 title, IDSTR_INSTALLERRORTITLE , sizeof(title), -
trunk/classes/mm-progs/volume/classvol.c
r2 r104 22 22 * If you need another license for your project/product (commercial, 23 23 * noncommercial, whatever) contact me at 24 * 24 * 25 25 * http://www.os2world.com/cdwriting 26 26 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 54 54 //#include "cwaudioinc.h" 55 55 56 #ifndef OPEN_DEFAULT 56 #ifndef OPEN_DEFAULT 57 57 /* Open views for the wpOpen() method */ 58 58 #define OPEN_UNKNOWN -1 … … 162 162 hResource=BMP_RESSOURCEHANDLE; //_queryResModuleHandle(); 163 163 hps=WinGetPS(HWND_DESKTOP); 164 164 165 165 /* The main BMP */ 166 166 allBMPs[MAIN_BMP_IDX].hbm=GpiLoadBitmap(hps, hResource, IDBMP_MAIN, 0, 0); … … 265 265 WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclSource.xLeft,ci.rclSource.yBottom, 266 266 ci.rclSource.xRight-ci.rclSource.xLeft, 267 ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE|SWP_SIZE); 267 ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE|SWP_SIZE); 268 268 oldPlayTimeProc=WinSubclassWindow(WinWindowFromID(hwnd, IDST_MMPLAYERPLAYTIME), playTimeTextProc); 269 269 270 270 /* Pos slider */ 271 271 ci=ciControls[CTRLIDX_POSSLIDER];//ciPosSlider; 272 WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 272 WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 273 273 hwnd, HWND_TOP, ci.id, NULLHANDLE, NULLHANDLE); 274 274 WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclDest.xLeft, ci.rclDest.yBottom, 275 275 ci.rclSource.xRight-ci.rclSource.xLeft, 276 276 ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE | SWP_SIZE); 277 277 278 278 WinSendMsg(WinWindowFromID(hwnd, ci.id),SLM_SETSLIDERINFO, 279 279 MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS,0), 280 MPFROM2SHORT( 9, 9)); 280 MPFROM2SHORT( 9, 9)); 281 281 #endif 282 282 283 283 /* Vol slider */ 284 284 ci=ciControls[CTRLIDX_VOLSLIDER];//ciVolSlider; 285 WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 285 WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 286 286 hwnd, HWND_TOP, ci.id, NULLHANDLE, NULLHANDLE); 287 287 WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclDest.xLeft, ci.rclDest.yBottom, … … 290 290 WinSendMsg(WinWindowFromID(hwnd, ci.id),SLM_SETSLIDERINFO, 291 291 MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS,0), 292 MPFROM2SHORT( 9, 9)); 292 MPFROM2SHORT( 9, 9)); 293 293 294 294 } … … 328 328 MPFROM2SHORT(SC_SIZE, TRUE), 329 329 MPFROMP(NULL)); 330 330 331 331 WinSendMsg(hwndMenu, /* Delete Minimize from the system menu */ 332 332 MM_DELETEITEM, 333 333 MPFROM2SHORT(SC_MINIMIZE, TRUE), 334 334 MPFROMP(NULL)); 335 335 336 336 WinSendMsg(hwndMenu, /* Delete Maximize from the system menu */ 337 337 MM_DELETEITEM, … … 368 368 369 369 switch (msg) 370 { 370 { 371 371 case WM_INITDLG: 372 372 { … … 381 381 swctl.fbJump=SWL_JUMPABLE; 382 382 WinAddSwitchEntry(&swctl); 383 383 384 384 adjustDialogControlPos(hwnd); 385 385 386 386 /* Set volume slider*/ 387 387 WinSendMsg( WinWindowFromID(hwnd, IDSL_MMPLAYERVOLUME), … … 389 389 MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_INCREMENTVALUE), 390 390 MPFROMLONG( ulVolume)); 391 391 392 392 FixSysMenu(hwnd); 393 393 … … 397 397 POINTL ptl; 398 398 399 WinQueryWindowPos(WinWindowFromID(hwnd, FID_TITLEBAR), &swp); 400 WinSetWindowPos(WinWindowFromID(hwnd, ID_CLASSVOLCLIENT), NULLHANDLE, 401 WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME), 402 WinQuerySysValue(HWND_DESKTOP, SV_CYDLGFRAME), 399 WinQueryWindowPos(WinWindowFromID(hwnd, FID_TITLEBAR), &swp); 400 WinSetWindowPos(WinWindowFromID(hwnd, ID_CLASSVOLCLIENT), NULLHANDLE, 401 WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME), 402 WinQuerySysValue(HWND_DESKTOP, SV_CYDLGFRAME), 403 403 allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cx, 404 404 allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cy, 405 405 SWP_SIZE|SWP_MOVE); 406 406 orgBgProc=WinSubclassWindow(WinWindowFromID(hwnd, ID_CLASSVOLCLIENT), bgProc); 407 407 408 408 /* Get mouse position */ 409 409 WinQueryPointerPos(HWND_DESKTOP, &ptl); … … 459 459 default: 460 460 break; 461 } 461 } 462 462 break; 463 463 … … 468 468 { 469 469 SWP swp; 470 470 471 471 switch(SHORT2FROMMP(mp1)) 472 472 { … … 492 492 493 493 ulVolume=ulValue; 494 sprintf(command,"MMAUDIOVOLUME=% d", ulVolume);494 sprintf(command,"MMAUDIOVOLUME=%lu", ulVolume); 495 495 sendCommandToObject(chrSourceName, command); 496 496 break; … … 509 509 { 510 510 ULONG ulValue; 511 511 512 512 ulValue=LONGFROMMP(mp2); 513 513 ulVolume=ulValue; … … 529 529 break; 530 530 }/* switch */ 531 531 532 532 return WinDefDlgProc( hwnd, msg, mp1, mp2); 533 533 } … … 541 541 BOOL writeVolumeToIni(char * iniFile, ULONG ulVolume) 542 542 { 543 543 544 544 return IniSaveInt(iniFile, INI_CLASSVOLUME_APP, INI_VOLUME_KEY, ulVolume); 545 545 } … … 580 580 if(hab) { 581 581 hmq=WinCreateMsgQueue(hab,0); 582 if(hmq) { 583 /* Check if user started prog by hand */ 582 if(hmq) { 583 /* Check if user started prog by hand */ 584 584 if(argc!=NUMPARAMS ) {/* Not the right num of params */ 585 585 pmUsage(); … … 591 591 // ++chrPtrName; 592 592 //SysWriteToTrapLog("Name: %s\n", chrSourceName); 593 /* Get our ressource dll */ 593 /* Get our ressource dll */ 594 594 RESSOURCEHANDLE=queryResModuleHandle(argv[0]); 595 595 /* Get data from INI file */ … … 604 604 _loadBmps(); 605 605 606 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 606 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 607 607 RESSOURCEHANDLE, IDDLG_CLASSVOLUME, 0) == DID_ERROR ) 608 608 { 609 609 /* 610 Text: 611 Title: "Installation problem" 612 */ 610 Text: 611 Title: "Installation problem" 612 */ 613 613 messageBox( text, IDSTR_CONVERTDIALOGERROR , sizeof(text), 614 614 title, IDSTR_INSTALLERRORTITLE , sizeof(title),
Note:
See TracChangeset
for help on using the changeset viewer.