Changeset 570 for trunk/dll/defview.c
- Timestamp:
- Mar 19, 2007, 4:19:33 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/defview.c
r557 r570 5 5 6 6 Copyright (c) 1993-98 M. Kimes 7 Copyright (c) 2003, 200 6Steven H.Levine7 Copyright (c) 2003, 2007 Steven H.Levine 8 8 9 9 Default file viewer … … 11 11 20 Nov 03 SHL ShowMultimedia: try to convince fmplay to not play exes (Gregg Young) 12 12 14 Jul 06 SHL Use Runtime_Error 13 18 Mar 07 GKY Fixed misindentifycation of nonmultimedia files by ShowMultiMedia 14 18 Mar 07 GKY Open mp3, ogg & flac files with OS2 object default since fm2play fails 13 15 14 16 ***********************************************************************/ … … 41 43 HMODULE MMIOModHandle = NULLHANDLE; 42 44 PMMIOIDENTIFYFILE pMMIOIdentifyFile = NULL; 45 PMMIOGETINFO pMMIOGetInfo = NULL; 46 PMMIOCLOSE pMMIOClose = NULL; 47 PMMIOOPEN pMMIOOpen = NULL; 48 MMIOINFO mmioinfo; 49 HMMIO hmmio; 43 50 FOURCC fccStorageSystem = 0; 44 51 MMFORMATINFO mmFormatInfo; 45 APIRET rc; 52 APIRET rc, rc1; 53 HWND hwnd; 54 char *p; 46 55 47 56 if (no_mmos2 || !filename || !*filename) … … 63 72 return played; 64 73 } 74 if (DosQueryProcAddr(MMIOModHandle, 75 0, 76 "mmioGetInfo", (PFN *) & pMMIOGetInfo)) { 77 DosFreeModule(MMIOModHandle); 78 no_mmos2 = TRUE; 79 return played; 80 } 81 if (DosQueryProcAddr(MMIOModHandle, 82 0, 83 "mmioClose", (PFN *) & pMMIOClose)) { 84 DosFreeModule(MMIOModHandle); 85 no_mmos2 = TRUE; 86 return played; 87 } 88 if (DosQueryProcAddr(MMIOModHandle, 89 0, 90 "mmioOpen", (PFN *) & pMMIOOpen)) { 91 DosFreeModule(MMIOModHandle); 92 no_mmos2 = TRUE; 93 return played; 94 } 65 95 } 66 96 67 97 /* attempt to identify the file using MMPM/2 */ 98 //printf("%s %d\n ", __FILE__, __LINE__); fflush(stdout); 99 memset( &mmioinfo, '\0', sizeof(MMIOINFO) ); 100 /*Eliminate non multimedia files*/ 101 hmmio = pMMIOOpen(filename, 102 &mmioinfo, 103 MMIO_READ); 104 /*printf("%s %d %d %d %d %d\n", 105 __FILE__, __LINE__,mmioinfo.ulFlags, mmioinfo.ulErrorRet, 106 mmioinfo.pIOProc, mmioinfo.aulInfo); fflush(stdout);*/ 107 if (!hmmio){ 108 p = strrchr(filename, '.'); //Added to save mp3, ogg & flac which fail above test 109 if (!p) 110 p = "."; 111 /* printf("%s %d %s\n", 112 __FILE__, __LINE__, p); fflush(stdout);*/ 113 if (!stricmp(p, ".OGG") || !stricmp(p, ".MP3") || !stricmp(p, ".FLAC")){ 114 hmmio = pMMIOOpen(filename, 115 &mmioinfo, 116 MMIO_READ | MMIO_NOIDENTIFY); 117 if (!hmmio){ 118 DosFreeModule(MMIOModHandle); 119 printf("%s %d\n ", __FILE__, __LINE__); fflush(stdout); 120 return played; 121 } 122 } 123 else { 124 DosFreeModule(MMIOModHandle); 125 // printf("%s %d\n ", __FILE__, __LINE__); fflush(stdout); 126 return played; 127 } 128 } 129 if (!hmmio){ 130 DosFreeModule(MMIOModHandle); 131 // printf("%s %d\n ", __FILE__, __LINE__); fflush(stdout); 132 return played; 133 } 134 135 rc1 = pMMIOGetInfo( hmmio, 136 &mmioinfo, 137 0L); // 138 //printf("%s %d\n ", __FILE__, __LINE__); fflush(stdout); 68 139 memset(&mmFormatInfo, 0, sizeof(MMFORMATINFO)); 69 140 mmFormatInfo.ulStructLen = sizeof(MMFORMATINFO); 70 141 rc = pMMIOIdentifyFile(filename, 71 0L,142 &mmioinfo, 72 143 &mmFormatInfo, 73 &fccStorageSystem, 0L, MMIO_FORCE_IDENTIFY_SS | MMIO_FORCE_IDENTIFY_FF); 144 &fccStorageSystem, 0L, 145 MMIO_FORCE_IDENTIFY_FF); 146 /*printf("%s %d %d %d %d\n %d %d %d %s\n", 147 __FILE__, __LINE__,mmioinfo.ulFlags, 148 mmioinfo.pIOProc, mmioinfo.aulInfo, 149 mmFormatInfo.fccIOProc, mmFormatInfo.fccIOProc, 150 mmFormatInfo.ulIOProcType, mmFormatInfo.szDefaultFormatExt); fflush(stdout);*/ 74 151 /* free module handle */ 152 rc1 = pMMIOClose(hmmio, 0L); 75 153 DosFreeModule(MMIOModHandle); 76 154 … … 89 167 } 90 168 else if (mmFormatInfo.ulMediaType != MMIO_MEDIATYPE_IMAGE) { 91 /* is a multimedia file (WAV, MID, AVI, etc.) */ 92 runemf2(SEPARATE | WINDOWED, 93 HWND_DESKTOP, 94 NULL, 95 NULL, 96 "%sFM2PLAY.EXE \"%s\"", 97 (fAddUtils) ? "UTILS\\" : NullStr, filename); 169 /* is a multimedia file (WAV, MID, AVI, etc.) */ 170 p = strrchr(filename, '.'); 171 if (!p) 172 p = "."; 173 /* printf("%s %d %s\n", 174 __FILE__, __LINE__, p); fflush(stdout);*/ 175 if (!stricmp(p, ".OGG") || !stricmp(p, ".MP3") || !stricmp(p, ".FLAC")) 176 OpenObject(filename, Default, hwnd); //FM2Play fails to play these 177 else 178 runemf2(SEPARATE | WINDOWED, 179 HWND_DESKTOP, 180 NULL, 181 NULL, 182 "%sFM2PLAY.EXE \"%s\"", 183 (fAddUtils) ? "UTILS\\" : NullStr, filename); 98 184 played = TRUE; 99 185 }
Note:
See TracChangeset
for help on using the changeset viewer.