source: trunk/classes/c/c_video/cwmpg.c

Last change on this file was 4, checked in by stevenhl, 8 years ago

Import modifications from cwmm-0_2_9-work-01_10_2006.zip dated 2006-08-27

File size: 8.4 KB
Line 
1/*
2 * (C) Chris Wohlgemuth 2002-2005
3 *
4 */
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20/*
21 * If you need another license for your project/product contact me at
22 *
23 * http://www.os2world.com/cdwriting
24 * http://www.geocities.com/SiliconValley/Sector/5785/
25 */
26
27/*
28 * This file was generated by the SOM Compiler and Emitter Framework.
29 * Generated using:
30 * SOM Emitter emitctm: 2.42
31 */
32
33#ifndef SOM_Module_cwmpg_Source
34#define SOM_Module_cwmpg_Source
35#endif
36#define CWMPG_Class_Source
37#define M_CWMPG_Class_Source
38
39#define INCL_PM
40#include <os2.h>
41#include "helpid.h"
42#include "cwmpg.ih"
43#include "cwaudioinc.h" /* For REXX script name */
44#include "sys_funcs.h"
45
46extern char chrHelpLibrary[CCHMAXPATH];
47char chrMMMPGExt[400]={0};/* Array holding the extensions for wpclsQueryInstanceFilter() */
48
49HMODULE queryResModuleHandle(void);
50HMODULE queryModuleHandle(void);
51BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
52ULONG launchPMProg(PSZ pszTitle, PSZ wrapperExe, PSZ parameters, CWMMDataFile *thisPtr, ULONG ulView);
53BOOL getStringFromRexxScript(PSZ rexxFile, char* chrResult, ULONG ulSize);
54
55/*
56 * SOM_Scope HWND SOMLINK cwmpg_wpOpen(CWMPG *somSelf, HWND hwndCnr,
57 * ULONG ulView, ULONG param)
58 */
59
60/*
61 * The prototype for cwmpg_wpOpen was replaced by the following prototype:
62 */
63SOM_Scope HWND SOMLINK cwmpg_wpOpen(MMMPG *somSelf, HWND hwndCnr,
64 ULONG ulView, ULONG param)
65{
66 /* CWMPGData *somThis = CWMPGGetData(somSelf); */
67 MMMPGMethodDebug("MMMPG","cwmpg_wpOpen");
68
69 switch(ulView)
70 {
71 case ID_MENU_START:
72 case ID_MENU_PLAYER:
73 /*case 0xbbe5: Player */
74 {
75 char chrPlayer[CCHMAXPATH]={0};
76 char chrParams[CCHMAXPATH+2]="\"";
77 char chrTitle[50];
78 char *chrPtr=chrParams;
79 ULONG ulSize;
80 ULONG ulRc;
81
82 if(!PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "mpgplayer", NULLHANDLE, chrPlayer,
83 sizeof(chrPlayer)))
84 PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "vb", "vb.exe", chrPlayer,
85 sizeof(chrPlayer));
86
87 chrPtr++;
88 ulSize=sizeof(chrParams)-2;
89 _wpQueryRealName(somSelf, chrPtr, &ulSize, TRUE);
90 strcat(chrPtr,"\"");
91
92 /* Get the Title for the window list */
93 if(!getMessage(chrTitle, IDSTR_VIDPLAYERTITLE, sizeof(chrTitle), queryResModuleHandle(), HWND_DESKTOP))
94 strcpy(chrTitle, "Player");
95
96 if((ulRc=launchPMProg(chrTitle, chrPlayer, chrParams, somSelf, ulView))==NULLHANDLE) {
97 break;
98 }
99 return NULLHANDLE;
100 }
101 default:
102 break;
103 }
104
105 return (MMMPG_parent_MMVideo_wpOpen(somSelf, hwndCnr, ulView,
106 param));
107}
108
109
110
111/*
112 * SOM_Scope PSZ SOMLINK cwmpgM_wpclsQueryTitle(M_CWMPG *somSelf)
113 */
114
115/*
116 * The prototype for cwmpgM_wpclsQueryTitle was replaced by the following prototype:
117 */
118SOM_Scope PSZ SOMLINK cwmpgM_wpclsQueryTitle(M_MMMPG *somSelf)
119{
120 static char chrTitle[20]={0};
121 /* M_CWMPGData *somThis = M_CWMPGGetData(somSelf); */
122 M_MMMPGMethodDebug("M_MMMPG","cwmpgM_wpclsQueryTitle");
123
124 if(chrTitle[0]==0)
125 if(!getMessage(chrTitle, IDSTR_MPGTITLE, sizeof(chrTitle), queryResModuleHandle(), HWND_DESKTOP))
126 strcpy(chrTitle,"MPGVideo.MPG");
127
128 return chrTitle;
129}
130
131
132/*
133 * SOM_Scope PSZ SOMLINK cwmpgM_wpclsQueryInstanceType(M_CWMPG *somSelf)
134 */
135
136/*
137 * The prototype for cwmpgM_wpclsQueryInstanceType was replaced by the following prototype:
138 */
139SOM_Scope PSZ SOMLINK cwmpgM_wpclsQueryInstanceType(M_MMMPG *somSelf)
140{
141 /* M_CWMPGData *somThis = M_CWMPGGetData(somSelf); */
142 M_MMMPGMethodDebug("M_MMMPG","cwmpgM_wpclsQueryInstanceType");
143
144 return "MPEG";
145}
146
147
148/*
149 * SOM_Scope PSZ SOMLINK cwmpgM_wpclsQueryInstanceFilter(M_CWMPG *somSelf)
150 */
151
152/*
153 * The prototype for cwmpgM_wpclsQueryInstanceFilter was replaced by the following prototype:
154 */
155SOM_Scope PSZ SOMLINK cwmpgM_wpclsQueryInstanceFilter(M_MMMPG *somSelf)
156{
157 /* M_CWMPGData *somThis = M_CWMPGGetData(somSelf); */
158 M_MMMPGMethodDebug("M_MMMPG","cwmpgM_wpclsQueryInstanceFilter");
159
160 /* This list is build in wpclsInitData() */
161 return chrMMMPGExt;
162}
163
164
165/*
166 * SOM_Scope ULONG SOMLINK cwmpgM_wpclsQueryIconData(M_CWMPG *somSelf,
167 * PICONINFO pIconInfo)
168 */
169
170/*
171 * The prototype for cwmpgM_wpclsQueryIconData was replaced by the following prototype:
172 */
173SOM_Scope ULONG SOMLINK cwmpgM_wpclsQueryIconData(M_MMMPG *somSelf,
174 PICONINFO pIconInfo)
175{
176 HMODULE hmod;
177 /* M_CWMPGData *somThis = M_CWMPGGetData(somSelf); */
178 M_MMMPGMethodDebug("M_MMMPG","cwmpgM_wpclsQueryIconData");
179
180 hmod=queryModuleHandle();
181 if(!hmod)
182 return M_MMMPG_parent_M_MMVideo_wpclsQueryIconData(somSelf, pIconInfo);
183
184 if (pIconInfo) {
185 pIconInfo->fFormat = ICON_RESOURCE;
186 pIconInfo->hmod = hmod;
187 pIconInfo->resid = ID_ICONMPGFILE;
188 } /* endif */
189
190 return ( sizeof(ICONINFO) );
191}
192
193
194
195SOM_Scope void SOMLINK cwmpgM_wpclsInitData(M_MMMPG *somSelf)
196{
197 static BOOL bGotMPEGExt=FALSE;
198
199 /* M_MMMPGData *somThis = M_MMMPGGetData(somSelf); */
200 M_MMMPGMethodDebug("M_MMMPG","cwmpgM_wpclsInitData");
201
202 /*
203 Taken from the audio classes. I suspect the same is true for the video classes.
204 Anyway it wont hurt having this here.
205
206 Get extensions of additional audio procs. These extensions may be specified by
207 newly installed IO procs in MMPM2.INI or by using the Multimedia setup. For
208 example the MMIOMP3 procedure for reading MP3 files adds the MP3 extension this
209 way to the system. Extensions already handled by a specialized class will be
210 filtered in the called REXX script e.g. MP3 so only unknown extensions end up here.
211
212 Strangely enough wpclsQueryInstanceFilter() is called during wpclsInitData() so
213 we query the extensions here before calling the parent.
214
215 FIXME:
216 The check is only done once during initialization. This is a little annoyance for
217 the user because new extension specified in the settings will only be picked up
218 on next WPS start.
219 */
220 if(!bGotMPEGExt)
221 {
222 /* REXX script: "mpegext.rx" */
223 getStringFromRexxScript(MMMPG_GETEXT_RX, chrMMMPGExt, sizeof(chrMMMPGExt));
224 /* Add our default extension *.MPG */
225 if(chrMMMPGExt[0]==0)
226 /* It's the first one */
227 strcpy(chrMMMPGExt,"*.MPG,*.VBS");
228 else
229 strlcat(chrMMMPGExt, ",*.MPG,*.VBS", sizeof(chrMMMPGExt));
230 bGotMPEGExt=TRUE;
231 }
232
233 M_MMMPG_parent_M_MMVideo_wpclsInitData(somSelf);
234}
235
236/*
237 * SOM_Scope BOOL SOMLINK cwmpgM_wpclsQueryDefaultHelp(M_CWMPG *somSelf,
238 * PULONG pHelpPanelId,
239 * PSZ pszHelpLibrary)
240 */
241
242/*
243 * The prototype for cwmpgM_wpclsQueryDefaultHelp was replaced by the following prototype:
244 */
245SOM_Scope BOOL SOMLINK cwmpgM_wpclsQueryDefaultHelp(M_MMMPG *somSelf,
246 PULONG pHelpPanelId,
247 PSZ pszHelpLibrary)
248{
249 /* M_CWMPGData *somThis = M_CWMPGGetData(somSelf); */
250 M_MMMPGMethodDebug("M_MMMPG","cwmpgM_wpclsQueryDefaultHelp");
251
252 if(pHelpPanelId)
253 *pHelpPanelId=MPGFILE_HELP_PANEL;
254 if(pszHelpLibrary)
255 strncpy(pszHelpLibrary, chrHelpLibrary, CCHMAXPATH);
256 return TRUE;
257}
258
259
260
261
262
263
264
Note: See TracBrowser for help on using the repository browser.