Changeset 165
- Timestamp:
- Mar 27, 2024, 10:32:40 PM (17 months ago)
- Location:
- trunk/classes/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/classes/c/c_common/helper.c
r104 r165 53 53 54 54 HMODULE queryModuleHandle(void); 55 55 void writeLog(const char* chrFormat, ...); 56 56 57 57 MRESULT EXPENTRY appTerminateHandlerProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); … … 102 102 } 103 103 /* Start the application */ 104 happ = WinStartApp( hwndAppTerminateHandler, &pDetails,NULL, NULL, SAF_INSTALLEDCMDLINE); 105 // happ = WinStartApp( hwndAppTerminateHandler, &pDetails, parameters, NULL, 0); 104 if(strstr(strlwr(parameters), "mplayer") /*|| strstr(strlwr(parameters), "ffplay")*/) 105 happ = WinStartApp( hwndAppTerminateHandler, &pDetails, NULL, NULL, SAF_INSTALLEDCMDLINE | SAF_MINIMIZED); 106 else 107 happ = WinStartApp( hwndAppTerminateHandler, &pDetails, NULL, NULL, SAF_INSTALLEDCMDLINE); 108 //happ = WinStartApp( hwndAppTerminateHandler, &pDetails, parameters, NULL, 0); 106 109 if(happ) { 107 110 /* Application started. Add the object to inuse list. */ -
trunk/classes/c/c_video/cwavi.c
r108 r165 42 42 #include <os2.h> 43 43 #include <stdarg.h> 44 #include <stdio.h> 44 #include <stdio.h> 45 45 #include "helpid.h" 46 46 #include "cwavi.ih" … … 52 52 BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd); 53 53 ULONG launchPMProg(PSZ pszTitle, PSZ wrapperExe, PSZ parameters, CWMMDataFile *thisPtr, ULONG ulView); 54 54 void writeLog(const char* chrFormat, ...); 55 55 56 56 /* … … 75 75 { 76 76 char chrPlayer[CCHMAXPATH]={0}; 77 char chrParams[ CCHMAXPATH+2]="\"";78 char chrTempParams[ CCHMAXPATH+2]={0};77 char chrParams[(CCHMAXPATH*2)+2]="\""; 78 char chrTempParams[(CCHMAXPATH*2)+2]={0}; 79 79 char chrTitle[50]; 80 80 char *chrPtr=chrParams; 81 81 ULONG ulSize; 82 ULONG ulRc; 83 char szFullFilename[CCHMAXPATH]; 82 ULONG ulRc = 0; 83 char szFullFilename[CCHMAXPATH]={0}; 84 BOOL ffplay=FALSE; 85 BOOL found=FALSE; 84 86 85 87 chrPtr++; … … 88 90 strcat(chrPtr,"\""); 89 91 strcpy(chrTempParams, chrParams); 90 ulSize=PrfQueryProfileInt(HINI_USERPROFILE, "CWMM", "nomodvid", 0);91 if( strstr(strlwr(chrTempParams), ".avi")) {92 ulSize=PrfQueryProfileInt(HINI_USERPROFILE, "CWMM", "nomodvid", 0); 93 if(ulSize && strstr(strlwr(chrTempParams), ".avi")) { 92 94 if(!PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "aviplayer", NULLHANDLE, chrPlayer, 93 95 sizeof(chrPlayer))) … … 95 97 sizeof(chrPlayer)); 96 98 } 97 else if(!ulSize) { 98 if(!PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "mvidplayer", NULLHANDLE, chrPlayer, 99 sizeof(chrPlayer))) { 100 if(!DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | SEARCH_CUR_DIRECTORY, 101 "PATH", 102 "ffplay.exe", 103 (PBYTE) szFullFilename, 104 CCHMAXPATH - 1)) 105 strcpy(chrPlayer, szFullFilename); 106 else if(!DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | SEARCH_CUR_DIRECTORY, 107 "PATH", 108 "smplayer.exe", 109 (PBYTE) szFullFilename, 110 CCHMAXPATH - 1)) 111 strcpy(chrPlayer, szFullFilename); 112 else if(!DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | SEARCH_CUR_DIRECTORY, 113 "PATH", 114 "mplayer.exe", 115 (PBYTE) szFullFilename, 116 CCHMAXPATH - 1)) 117 strcpy(chrPlayer, szFullFilename); 118 else { 119 char text[300]; 120 sprintf(text, "No suitable video player could be found. Please install ffplay (part of ffmpeg) or smplayer/mplayer somewhere in your path or in OS2.INI add the key mvidplayer under CWMM application containing the full path to an appropriate video player"); 99 else { 100 ULONG ulLength = PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "mvidplayer", NULLHANDLE, chrPlayer, 101 sizeof(chrPlayer)); 102 if((ulLength == 0) || (!strchr(chrPlayer, ":") && (!strstr(strlwr(chrPlayer), "smplayer") && 103 strstr(strlwr(chrPlayer), "mplayer")))) { 104 char tempFilePath[CCHMAXPATH]; 105 char newPath[2048]; 106 char *path; 107 108 //Prevent us from getting the mplayer.exe in the winos2 directory 109 path=getenv("PATH"); 110 strcpy(newPath, path); 111 chrPtr=strstr(strlwr(newPath), ":\\os2\\mdos\\winos2"); 112 if(chrPtr) 113 strcpy(chrPtr - 1, chrPtr + 18); 114 path = strtok(newPath, ";"); 115 while(path != NULL) { 116 strcpy(tempFilePath, path); 117 strcat(tempFilePath, "\\mplayer.exe"); 118 if(!DosQueryPathInfo(tempFilePath, FIL_STANDARD, (PVOID)szFullFilename, (ULONG)CCHMAXPATH-1)) { 119 strcpy(chrPlayer, tempFilePath); 120 found=TRUE; 121 break; 122 } 123 path = strtok(NULL, ";"); 124 } 125 } 126 if(!ulLength && !found && 127 !DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | SEARCH_CUR_DIRECTORY, "PATH", 128 "smplayer.exe", (PBYTE) szFullFilename, CCHMAXPATH - 1)){ 129 found=TRUE; 130 strcpy(chrPlayer, szFullFilename); 131 } 132 if(!ulLength && !found && 133 !DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | SEARCH_CUR_DIRECTORY, "PATH", 134 "ffplay.exe", (PBYTE) szFullFilename, CCHMAXPATH - 1)) { 135 found=TRUE; 136 strcpy(chrPlayer, szFullFilename); 137 } 138 if(!ulLength && !found) { 139 char text[300]; 140 sprintf(text, "No suitable video player could be found. Please install ffplay (part of ffmpeg)"\ 141 "or smplayer/mplayer somewhere in your path or in OS2.INI add the key mvidplayer"\ 142 "under CWMM application containing the full path to an appropriate video player"); 121 143 122 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, text, "Missing video player", 123 1234, MB_OK|MB_MOVEABLE); 124 return NULLHANDLE; 125 } 126 } 144 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, text, "Missing video player", 145 1234, MB_OK|MB_MOVEABLE); 146 return NULLHANDLE; 147 } 148 } 149 /* Eliminate the noise with mplayer and ffplay and get them to close gracefully*/ 150 if(strstr(strlwr(chrPlayer), "ffplay")) 151 ffplay = TRUE; 152 if((!strstr(strlwr(chrPlayer), "smplayer") && strstr(strlwr(chrPlayer), "mplayer")) || ffplay) { 153 strcpy(chrTempParams, " /c \""); 154 strcat(chrTempParams, chrPlayer); 155 strcat(chrTempParams, " "); 156 if(ffplay) 157 strcat(chrTempParams, "-autoexit "); 158 strcat(chrTempParams, chrParams); 159 strcat(chrTempParams, "\""); 160 strcpy(chrParams, chrTempParams); 161 strcpy(chrPlayer, "CMD.EXE"); 127 162 } 128 163 /* Get the Title for the window list */ … … 131 166 132 167 if((ulRc=launchPMProg(chrTitle, chrPlayer, chrParams, somSelf, ulView))==NULLHANDLE) { 133 168 break; 134 169 } 135 170 return NULLHANDLE; 136 171 } 137 172 default: 138 173 break; 139 174 } 140 141 return (MMAVI_parent_MMVideo_wpOpen(somSelf, hwndCnr, ulView, 142 param)); 175 return (MMAVI_parent_MMVideo_wpOpen(somSelf, hwndCnr, ulView, param)); 143 176 } 144 177 … … 184 217 return "AVI"; 185 218 else 186 return "AVI/FLV/3GP/M4V/MKV/M P4/MTS/VOB/WMV/WEBM";219 return "AVI/FLV/3GP/M4V/MKV/MOV/MP4/MPEG/MTS/VOB/WMV/WEBM"; 187 220 } 188 221 … … 202 235 M_MMAVIMethodDebug("M_MMAVI","cwaviM_wpclsQueryInstanceFilter"); 203 236 204 ulSize 237 ulSize=PrfQueryProfileInt(HINI_USERPROFILE, "CWMM", "nomodvid", 0); 205 238 if(ulSize) 206 239 return "*.AVI"; 207 240 else 208 return "*.AVI,*.FL V,*.3GP,*.M4V,*.MKV,*.MP4,*.MTS,*.VOB,*.WMV,*.WEBM";241 return "*.AVI,*.FLI,*.FLC,*.FLV,*.3GP,*.M4V,*.MKV,*.MOV,*.MP4,*.MPEG,*.MTS,*.VOB,*.WMV,*.WEBM"; 209 242 } 210 243 … … 229 262 return M_MMAVI_parent_M_MMVideo_wpclsQueryIconData(somSelf, pIconInfo); 230 263 231 if (pIconInfo) { 264 if(pIconInfo) { 265 ULONG ulSize=PrfQueryProfileInt(HINI_USERPROFILE, "CWMM", "nomodvid", 0); 232 266 pIconInfo->fFormat = ICON_RESOURCE; 233 267 pIconInfo->hmod = hmod; 234 pIconInfo->resid = ID_ICONAVIFILE; 235 } /* endif */ 268 if(ulSize) 269 pIconInfo->resid = ID_ICONAVIFILE; 270 else 271 pIconInfo->resid = ID_ICONCWVIDEOFILE; 272 } /* endif */ 236 273 237 274 return ( sizeof(ICONINFO) );
Note:
See TracChangeset
for help on using the changeset viewer.