Changeset 104 for trunk/classes/mm-progs/mmfind
- Timestamp:
- Oct 2, 2023, 11:34:35 PM (23 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
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/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);
Note:
See TracChangeset
for help on using the changeset viewer.