Changeset 65
- Timestamp:
- Sep 22, 2023, 8:23:34 PM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/classes/c/c_video/cwavi.c
r2 r65 37 37 #define M_CWAVI_Class_Source 38 38 39 #define INCL_DOSFILEMGR 40 #define INCL_DOSMISC 39 41 #define INCL_PM 40 42 #include <os2.h> 43 #include <stdarg.h> 44 #include <stdio.h> 41 45 #include "helpid.h" 42 46 #include "cwavi.ih" … … 72 76 char chrPlayer[CCHMAXPATH]={0}; 73 77 char chrParams[CCHMAXPATH+2]="\""; 78 char chrTempParams[CCHMAXPATH+2]={0}; 74 79 char chrTitle[50]; 75 80 char *chrPtr=chrParams; 76 81 ULONG ulSize; 77 ULONG ulRc; 78 79 if(!PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "aviplayer", NULLHANDLE, chrPlayer, 80 sizeof(chrPlayer))) 81 PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "vb", "vb.exe", chrPlayer, 82 sizeof(chrPlayer)); 83 84 chrPtr++; 82 ULONG ulRc; 83 char szFullFilename[CCHMAXPATH]; 84 85 chrPtr++; 85 86 ulSize=sizeof(chrParams)-2; 86 87 _wpQueryRealName(somSelf, chrPtr, &ulSize, TRUE); 87 88 strcat(chrPtr,"\""); 89 strcpy(chrTempParams, chrParams); 90 ulSize =PrfQueryProfileInt(HINI_USERPROFILE, "CWMM", "nomodvid", 0); 91 if(strstr(strlwr(chrTempParams), ".avi")) { 92 if(!PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "aviplayer", NULLHANDLE, chrPlayer, 93 sizeof(chrPlayer))) 94 PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "vb", "vb.exe", chrPlayer, 95 sizeof(chrPlayer)); 96 } 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[200]; 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"); 121 122 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, text, "Missing video player", 123 1234, MB_OK|MB_MOVEABLE); 124 return NULLHANDLE; 125 } 126 } 127 } 88 128 /* Get the Title for the window list */ 89 129 if(!getMessage(chrTitle, IDSTR_VIDPLAYERTITLE, sizeof(chrTitle), queryResModuleHandle(), HWND_DESKTOP)) … … 135 175 SOM_Scope PSZ SOMLINK cwaviM_wpclsQueryInstanceType(M_MMAVI *somSelf) 136 176 { 177 ULONG ulSize; 178 137 179 /* M_CWAVIData *somThis = M_CWAVIGetData(somSelf); */ 138 180 M_MMAVIMethodDebug("M_MMAVI","cwaviM_wpclsQueryInstanceType"); 139 181 140 return "AVI"; 182 ulSize = PrfQueryProfileInt(HINI_USERPROFILE, "CWMM", "nomodvid", 0); 183 if(ulSize) 184 return "AVI"; 185 else 186 return "AVI/FLV/3GP/M4V/MKV/MP4/MTS/VOB/WMV/WEBM"; 141 187 } 142 188 … … 151 197 SOM_Scope PSZ SOMLINK cwaviM_wpclsQueryInstanceFilter(M_MMAVI *somSelf) 152 198 { 199 ULONG ulSize; 200 153 201 /* M_CWAVIData *somThis = M_CWAVIGetData(somSelf); */ 154 202 M_MMAVIMethodDebug("M_MMAVI","cwaviM_wpclsQueryInstanceFilter"); 155 203 156 return "*.AVI"; 204 ulSize =PrfQueryProfileInt(HINI_USERPROFILE, "CWMM", "nomodvid", 0); 205 if(ulSize) 206 return "*.AVI"; 207 else 208 return "*.AVI,*.FLV,*.3GP,*.M4V,*.MKV,*.MP4,*.MTS,*.VOB,*.WMV,*.WEBM"; 157 209 } 158 210
Note:
See TracChangeset
for help on using the changeset viewer.