| 1 | /*
|
|---|
| 2 | * (C) Chris Wohlgemuth 2002-2003
|
|---|
| 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 | * This file was generated by the SOM Compiler and Emitter Framework.
|
|---|
| 28 | * Generated using:
|
|---|
| 29 | * SOM Emitter emitctm: 2.42
|
|---|
| 30 | */
|
|---|
| 31 |
|
|---|
| 32 | #ifndef SOM_Module_cwvideo_Source
|
|---|
| 33 | #define SOM_Module_cwvideo_Source
|
|---|
| 34 | #endif
|
|---|
| 35 | #define CWVideo_Class_Source
|
|---|
| 36 | #define M_CWVideo_Class_Source
|
|---|
| 37 |
|
|---|
| 38 | #define INCL_PM
|
|---|
| 39 | #include <os2.h>
|
|---|
| 40 | #include "cwvideo.ih"
|
|---|
| 41 | //#include "cwmmres.h"
|
|---|
| 42 | //#include "mmres.h"
|
|---|
| 43 |
|
|---|
| 44 | HMODULE queryResModuleHandle(void);
|
|---|
| 45 | HMODULE queryModuleHandle(void);
|
|---|
| 46 | BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
|
|---|
| 47 | ULONG launchPMProg(PSZ pszTitle, PSZ wrapperExe, PSZ parameters, CWMMDataFile *thisPtr, ULONG ulView);
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 | /*
|
|---|
| 51 | * SOM_Scope BOOL SOMLINK cwvideo_wpModifyPopupMenu(CWVideo *somSelf,
|
|---|
| 52 | * HWND hwndMenu,
|
|---|
| 53 | * HWND hwndCnr,
|
|---|
| 54 | * ULONG iPosition)
|
|---|
| 55 | */
|
|---|
| 56 |
|
|---|
| 57 | /*
|
|---|
| 58 | * The prototype for cwvideo_wpModifyPopupMenu was replaced by the following prototype:
|
|---|
| 59 | */
|
|---|
| 60 | SOM_Scope BOOL SOMLINK cwvideo_wpModifyPopupMenu(MMVideo *somSelf,
|
|---|
| 61 | HWND hwndMenu,
|
|---|
| 62 | HWND hwndCnr,
|
|---|
| 63 | ULONG iPosition)
|
|---|
| 64 | {
|
|---|
| 65 | /* CWVideoData *somThis = CWVideoGetData(somSelf); */
|
|---|
| 66 | MMVideoMethodDebug("MMVideo","cwvideo_wpModifyPopupMenu");
|
|---|
| 67 |
|
|---|
| 68 | _wpInsertPopupMenuItems(somSelf, hwndMenu, 1, queryResModuleHandle(), ID_MENU_PLAYER, 1);
|
|---|
| 69 | _wpInsertPopupMenuItems(somSelf, hwndMenu, 1, queryResModuleHandle(), ID_MENU_START, 1);
|
|---|
| 70 | return (MMVideo_parent_CWMMDataFile_wpModifyPopupMenu(somSelf,
|
|---|
| 71 | hwndMenu,
|
|---|
| 72 | hwndCnr,
|
|---|
| 73 | iPosition));
|
|---|
| 74 | }
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 | /*
|
|---|
| 78 | * SOM_Scope BOOL SOMLINK cwvideo_wpMenuItemSelected(CWVideo *somSelf,
|
|---|
| 79 | * HWND hwndFrame,
|
|---|
| 80 | * ULONG ulMenuId)
|
|---|
| 81 | */
|
|---|
| 82 |
|
|---|
| 83 | /*
|
|---|
| 84 | * The prototype for cwvideo_wpMenuItemSelected was replaced by the following prototype:
|
|---|
| 85 | */
|
|---|
| 86 | SOM_Scope BOOL SOMLINK cwvideo_wpMenuItemSelected(MMVideo *somSelf,
|
|---|
| 87 | HWND hwndFrame,
|
|---|
| 88 | ULONG ulMenuId)
|
|---|
| 89 | {
|
|---|
| 90 | /* CWVideoData *somThis = CWVideoGetData(somSelf); */
|
|---|
| 91 | MMVideoMethodDebug("MMVideo","cwvideo_wpMenuItemSelected");
|
|---|
| 92 |
|
|---|
| 93 | switch(ulMenuId)
|
|---|
| 94 | {
|
|---|
| 95 | case ID_MENU_PLAYER:
|
|---|
| 96 | case ID_MENU_START:
|
|---|
| 97 | //_wpViewObject(somSelf, NULLHANDLE, ID_MENU_PLAYER ,0);
|
|---|
| 98 | _wpViewObject(somSelf, NULLHANDLE, ulMenuId,0);
|
|---|
| 99 | return TRUE;
|
|---|
| 100 | default:
|
|---|
| 101 | break;
|
|---|
| 102 | }
|
|---|
| 103 |
|
|---|
| 104 | return (MMVideo_parent_CWMMDataFile_wpMenuItemSelected(somSelf,
|
|---|
| 105 | hwndFrame,
|
|---|
| 106 | ulMenuId));
|
|---|
| 107 | }
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 | /*
|
|---|
| 112 | * SOM_Scope HWND SOMLINK cwvideo_wpOpen(CWVideo *somSelf, HWND hwndCnr,
|
|---|
| 113 | * ULONG ulView, ULONG param)
|
|---|
| 114 | */
|
|---|
| 115 |
|
|---|
| 116 | /*
|
|---|
| 117 | * The prototype for cwvideo_wpOpen was replaced by the following prototype:
|
|---|
| 118 | */
|
|---|
| 119 | SOM_Scope HWND SOMLINK cwvideo_wpOpen(MMVideo *somSelf, HWND hwndCnr,
|
|---|
| 120 | ULONG ulView, ULONG param)
|
|---|
| 121 | {
|
|---|
| 122 | /* CWVideoData *somThis = CWVideoGetData(somSelf); */
|
|---|
| 123 | MMVideoMethodDebug("MMVideo","cwvideo_wpOpen");
|
|---|
| 124 |
|
|---|
| 125 | switch(ulView)
|
|---|
| 126 | {
|
|---|
| 127 | case ID_MENU_START:
|
|---|
| 128 | case ID_MENU_PLAYER:
|
|---|
| 129 | /*case 0xbbe5: Player */
|
|---|
| 130 | {
|
|---|
| 131 | char chrPlayer[CCHMAXPATH]={0};
|
|---|
| 132 | char chrParams[CCHMAXPATH+2]="\"";
|
|---|
| 133 | char chrTitle[50];
|
|---|
| 134 | char *chrPtr=chrParams;
|
|---|
| 135 | ULONG ulSize;
|
|---|
| 136 | ULONG ulRc;
|
|---|
| 137 |
|
|---|
| 138 | if(!PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "videoplayer", NULLHANDLE, chrPlayer,
|
|---|
| 139 | sizeof(chrPlayer)))
|
|---|
| 140 | PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "vb", "vb.exe", chrPlayer,
|
|---|
| 141 | sizeof(chrPlayer));
|
|---|
| 142 |
|
|---|
| 143 | chrPtr++;
|
|---|
| 144 | ulSize=sizeof(chrParams)-2;
|
|---|
| 145 | _wpQueryRealName(somSelf, chrPtr, &ulSize, TRUE);
|
|---|
| 146 | strcat(chrPtr,"\"");
|
|---|
| 147 |
|
|---|
| 148 | /* Get the Title for the window list */
|
|---|
| 149 | if(!getMessage(chrTitle, IDSTR_VIDPLAYERTITLE, sizeof(chrTitle), queryResModuleHandle(), HWND_DESKTOP))
|
|---|
| 150 | strcpy(chrTitle, "Player");
|
|---|
| 151 |
|
|---|
| 152 | if((ulRc=launchPMProg(chrTitle, chrPlayer, chrParams, somSelf, ulView))==NULLHANDLE) {
|
|---|
| 153 | break;
|
|---|
| 154 | }
|
|---|
| 155 | return NULLHANDLE;
|
|---|
| 156 | }
|
|---|
| 157 |
|
|---|
| 158 | default:
|
|---|
| 159 | break;
|
|---|
| 160 | }
|
|---|
| 161 |
|
|---|
| 162 | return (MMVideo_parent_CWMMDataFile_wpOpen(somSelf, hwndCnr,
|
|---|
| 163 | ulView, param));
|
|---|
| 164 | }
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
|
|---|
| 168 | /*
|
|---|
| 169 | * SOM_Scope BOOL SOMLINK cwvideoM_wpclsCreateDefaultTemplates(M_CWVideo *somSelf,
|
|---|
| 170 | * WPObject* Folder)
|
|---|
| 171 | */
|
|---|
| 172 |
|
|---|
| 173 | /*
|
|---|
| 174 | * The prototype for cwvideoM_wpclsCreateDefaultTemplates was replaced by the following prototype:
|
|---|
| 175 | */
|
|---|
| 176 | SOM_Scope BOOL SOMLINK cwvideoM_wpclsCreateDefaultTemplates(M_MMVideo *somSelf,
|
|---|
| 177 | WPObject* Folder)
|
|---|
| 178 | {
|
|---|
| 179 | /* M_CWVideoData *somThis = M_CWVideoGetData(somSelf); */
|
|---|
| 180 | M_MMVideoMethodDebug("M_MMVideo","cwvideoM_wpclsCreateDefaultTemplates");
|
|---|
| 181 |
|
|---|
| 182 | return TRUE;
|
|---|
| 183 | }
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 | /*
|
|---|
| 187 | * SOM_Scope PSZ SOMLINK cwvideoM_wpclsQueryTitle(M_CWVideo *somSelf)
|
|---|
| 188 | */
|
|---|
| 189 |
|
|---|
| 190 | /*
|
|---|
| 191 | * The prototype for cwvideoM_wpclsQueryTitle was replaced by the following prototype:
|
|---|
| 192 | */
|
|---|
| 193 | SOM_Scope PSZ SOMLINK cwvideoM_wpclsQueryTitle(M_MMVideo *somSelf)
|
|---|
| 194 | {
|
|---|
| 195 | static char chrTitle[20]={0};
|
|---|
| 196 | /* M_CWVideoData *somThis = M_CWVideoGetData(somSelf); */
|
|---|
| 197 | M_MMVideoMethodDebug("M_MMVideo","cwvideoM_wpclsQueryTitle");
|
|---|
| 198 |
|
|---|
| 199 | if(chrTitle[0]==0)
|
|---|
| 200 | if(!getMessage(chrTitle, IDSTR_CWVIDEOTITLE, sizeof(chrTitle), queryResModuleHandle(), HWND_DESKTOP))
|
|---|
| 201 | strcpy(chrTitle,"Digital video");
|
|---|
| 202 |
|
|---|
| 203 | return chrTitle;
|
|---|
| 204 | }
|
|---|
| 205 |
|
|---|
| 206 |
|
|---|
| 207 | /*
|
|---|
| 208 | * SOM_Scope ULONG SOMLINK cwvideoM_wpclsQueryDefaultView(M_CWVideo *somSelf)
|
|---|
| 209 | */
|
|---|
| 210 |
|
|---|
| 211 | /*
|
|---|
| 212 | * The prototype for cwvideoM_wpclsQueryDefaultView was replaced by the following prototype:
|
|---|
| 213 | */
|
|---|
| 214 | SOM_Scope ULONG SOMLINK cwvideoM_wpclsQueryDefaultView(M_MMVideo *somSelf)
|
|---|
| 215 | {
|
|---|
| 216 | /* M_CWVideoData *somThis = M_CWVideoGetData(somSelf); */
|
|---|
| 217 | M_MMVideoMethodDebug("M_MMVideo","cwvideoM_wpclsQueryDefaultView");
|
|---|
| 218 |
|
|---|
| 219 | return ID_MENU_START;
|
|---|
| 220 | /* return (M_CWVideo_parent_M_CWMMDataFile_wpclsQueryDefaultView(somSelf));*/
|
|---|
| 221 | }
|
|---|
| 222 |
|
|---|
| 223 |
|
|---|
| 224 | /*
|
|---|
| 225 | * SOM_Scope ULONG SOMLINK cwvideoM_wpclsQueryIconData(M_CWVideo *somSelf,
|
|---|
| 226 | * PICONINFO pIconInfo)
|
|---|
| 227 | */
|
|---|
| 228 |
|
|---|
| 229 | /*
|
|---|
| 230 | * The prototype for cwvideoM_wpclsQueryIconData was replaced by the following prototype:
|
|---|
| 231 | */
|
|---|
| 232 | SOM_Scope ULONG SOMLINK cwvideoM_wpclsQueryIconData(M_MMVideo *somSelf,
|
|---|
| 233 | PICONINFO pIconInfo)
|
|---|
| 234 | {
|
|---|
| 235 | HMODULE hmod;
|
|---|
| 236 |
|
|---|
| 237 | /* M_CWVideoData *somThis = M_CWVideoGetData(somSelf); */
|
|---|
| 238 | M_MMVideoMethodDebug("M_MMVideo","cwvideoM_wpclsQueryIconData");
|
|---|
| 239 |
|
|---|
| 240 | hmod=queryModuleHandle();
|
|---|
| 241 | if(!hmod)
|
|---|
| 242 | return M_MMVideo_parent_M_CWMMDataFile_wpclsQueryIconData(somSelf, pIconInfo);
|
|---|
| 243 |
|
|---|
| 244 | if (pIconInfo) {
|
|---|
| 245 | pIconInfo->fFormat = ICON_RESOURCE;
|
|---|
| 246 | pIconInfo->hmod = hmod;
|
|---|
| 247 | pIconInfo->resid = ID_ICONCWVIDEOFILE;
|
|---|
| 248 | } /* endif */
|
|---|
| 249 |
|
|---|
| 250 | return ( sizeof(ICONINFO) );
|
|---|
| 251 | }
|
|---|
| 252 |
|
|---|