1 | /*
|
---|
2 | * (C) Chris Wohlgemuth 2002-2004
|
---|
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 (commercial,
|
---|
22 | * noncommercial, whatever) contact me at
|
---|
23 | *
|
---|
24 | * http://www.os2world.com/cdwriting
|
---|
25 | * http://www.geocities.com/SiliconValley/Sector/5785/
|
---|
26 | *
|
---|
27 | */
|
---|
28 | /*
|
---|
29 | * This file was generated by the SOM Compiler and Emitter Framework.
|
---|
30 | * Generated using:
|
---|
31 | * SOM Emitter emitctm: 2.42
|
---|
32 | */
|
---|
33 |
|
---|
34 | #ifndef SOM_Module_cwastream_Source
|
---|
35 | #define SOM_Module_cwastream_Source
|
---|
36 | #endif
|
---|
37 | #define CWAudioStream_Class_Source
|
---|
38 | #define M_CWAudioStream_Class_Source
|
---|
39 |
|
---|
40 | #define INCL_PM
|
---|
41 | #define INCL_MCIOS2
|
---|
42 | #include <os2.h>
|
---|
43 | #include <stdio.h>
|
---|
44 | #include <io.h>
|
---|
45 | #include <fcntl.h>
|
---|
46 | #include <sys\stat.h>
|
---|
47 | #include "os2me.h"
|
---|
48 | #include "cwastream.ih"
|
---|
49 | #include "cwaudioinc.h"
|
---|
50 | #include "helpid.h"
|
---|
51 |
|
---|
52 |
|
---|
53 | HMODULE queryResModuleHandle(void);
|
---|
54 | HMODULE queryModuleHandle(void);
|
---|
55 | BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
|
---|
56 | void SysWriteToTrapLog(const char* chrFormat, ...);
|
---|
57 | BOOL cwMoveNotebookButtonsWarp4(HWND hwndDlg, USHORT usID, USHORT usDelta);
|
---|
58 |
|
---|
59 | PSZ _queryMp3HelpLibraryName(void); /* Get help library name for introduced classes */
|
---|
60 |
|
---|
61 | static BOOL _getUrlFromFile(WPFileSystem * wpFS, char *chrBuf, ULONG ulBufSize)
|
---|
62 | {
|
---|
63 | ULONG ulSize;
|
---|
64 | char* pChr;
|
---|
65 | FILE* fStream;
|
---|
66 |
|
---|
67 | for(;;)
|
---|
68 | {
|
---|
69 | ulSize=ulBufSize;
|
---|
70 | if(!_wpQueryRealName(wpFS, chrBuf, &ulSize, TRUE))
|
---|
71 | break;
|
---|
72 |
|
---|
73 | if((fStream=fopen( chrBuf, "r"))==NULLHANDLE)
|
---|
74 | break;
|
---|
75 |
|
---|
76 | if(!fgets(chrBuf, ulBufSize, fStream)) {
|
---|
77 | fclose(fStream);
|
---|
78 | sprintf(chrBuf, DEFAULT_AUDIOSTREAM_SERVER);
|
---|
79 | }
|
---|
80 | fclose(fStream);
|
---|
81 | if((pChr=strchr(chrBuf, '\n'))!=NULLHANDLE)
|
---|
82 | *pChr=0;
|
---|
83 | // HlpWriteToTrapLog("%s\n", chrBuf);
|
---|
84 | return TRUE;
|
---|
85 | }
|
---|
86 | return FALSE;
|
---|
87 | }
|
---|
88 |
|
---|
89 | static BOOL _saveUrlToFile(WPFileSystem * wpFS, char *chrUrl)
|
---|
90 | {
|
---|
91 | ULONG ulSize;
|
---|
92 | int fHandle;
|
---|
93 | char chrPath[CCHMAXPATH];
|
---|
94 |
|
---|
95 | for(;;)
|
---|
96 | {
|
---|
97 | ulSize=sizeof(chrPath);
|
---|
98 | if(!_wpQueryRealName(wpFS, chrPath, &ulSize, TRUE))
|
---|
99 | break;
|
---|
100 |
|
---|
101 | if((fHandle=open(chrPath, O_TEXT | O_WRONLY, S_IWRITE)) == -1)
|
---|
102 | break;
|
---|
103 |
|
---|
104 | _chsize(fHandle, 0);
|
---|
105 |
|
---|
106 | if(-1 == write(fHandle , chrUrl, strlen(chrUrl)))
|
---|
107 | break;
|
---|
108 |
|
---|
109 | close(fHandle);
|
---|
110 | return TRUE;
|
---|
111 | }
|
---|
112 | close(fHandle);
|
---|
113 | return FALSE;
|
---|
114 | }
|
---|
115 |
|
---|
116 | /************************************************************/
|
---|
117 | /* */
|
---|
118 | /* */
|
---|
119 | /* */
|
---|
120 | /************************************************************/
|
---|
121 | MRESULT EXPENTRY playStreamProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
122 | {
|
---|
123 |
|
---|
124 | switch (msg)
|
---|
125 | {
|
---|
126 | case WM_APPTERMINATENOTIFY:
|
---|
127 | {
|
---|
128 | MMAudio * thisPtr;
|
---|
129 | OPENPARAMS * pParams;
|
---|
130 |
|
---|
131 | /* Depending on mp1 the parameter in mp2 is either a pointer
|
---|
132 | to OPENPARAMS (mp1==ACKEY_START) or the object pointer (mp1==ACK_STOP) */
|
---|
133 | if(ACKEY_START==LONGFROMMP(mp1)) {
|
---|
134 | pParams=PVOIDFROMMP(mp2);/* Get parameter block */
|
---|
135 | if(!pParams)
|
---|
136 | {
|
---|
137 | WinPostMsg(hwnd,WM_QUIT,0,0);
|
---|
138 | return MRFALSE;
|
---|
139 | }
|
---|
140 | WinSetWindowULong(hwnd, QWL_USER, (ULONG)pParams);
|
---|
141 | thisPtr=pParams->wpObject;
|
---|
142 | }
|
---|
143 | else
|
---|
144 | thisPtr=(MMAudio*)PVOIDFROMMP(mp2);
|
---|
145 |
|
---|
146 | if(somIsObj(thisPtr)) {
|
---|
147 | switch(LONGFROMMP(mp1))
|
---|
148 | {
|
---|
149 | case ACKEY_START:
|
---|
150 | {
|
---|
151 | unsigned char chrCommand[CCHMAXPATH*2];
|
---|
152 | unsigned char chrURL[CCHMAXPATH];
|
---|
153 | char retMsg[20];
|
---|
154 | APIRET rc;
|
---|
155 |
|
---|
156 | _cwmmSetRecordTitles(thisPtr, "Connecting to server...", TRUE);
|
---|
157 |
|
---|
158 | /* Read URL from file */
|
---|
159 | if(!_getUrlFromFile(thisPtr, chrURL, sizeof(chrURL)))
|
---|
160 | {
|
---|
161 | WinPostMsg(hwnd,WM_QUIT,0,0);
|
---|
162 | return MRFALSE;
|
---|
163 | };
|
---|
164 |
|
---|
165 | /* Try to open stream. A usable storage proc is not yet available but maybe in the future... */
|
---|
166 | sprintf(chrCommand,"open stream:%s type WAVEAUDIO alias wave%d SHAREABLE wait", chrURL, thisPtr);
|
---|
167 | rc = mciSendString( chrCommand, retMsg, sizeof(retMsg), hwnd, 0);
|
---|
168 | if((rc & 0x0000ffff)!=MCIERR_SUCCESS) {
|
---|
169 | /* No success so try storage procedure from plugin pack. */
|
---|
170 |
|
---|
171 | sprintf(chrCommand,"open ipipe:%s type WAVEAUDIO alias wave%d SHAREABLE wait", chrURL, thisPtr);
|
---|
172 | rc = mciSendString( chrCommand, retMsg, sizeof(retMsg), hwnd, 0);
|
---|
173 | if((rc & 0x0000ffff)!=MCIERR_SUCCESS) {
|
---|
174 | _cwmmSetRecordTitles(thisPtr, "Can't connect to server!", TRUE);
|
---|
175 | WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, 2, 4000);
|
---|
176 | return MRFALSE;
|
---|
177 | }
|
---|
178 |
|
---|
179 | }
|
---|
180 |
|
---|
181 | /* Set time format */
|
---|
182 | sprintf(chrCommand,"SET wave%d TIME FORMAT MILLISECONDS wait", thisPtr);
|
---|
183 | rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
|
---|
184 | if((rc & 0x0000ffff)!=MCIERR_SUCCESS) {
|
---|
185 | WinPostMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(ACKEY_STOP), MPFROMP(thisPtr));
|
---|
186 | return MRFALSE;
|
---|
187 | }
|
---|
188 |
|
---|
189 | sprintf(chrCommand,"play wave%d ", thisPtr);
|
---|
190 | rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
|
---|
191 | if((rc & 0x0000ffff)!=MCIERR_SUCCESS) {
|
---|
192 | WinPostMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(ACKEY_STOP), MPFROMP(thisPtr));
|
---|
193 | return MRFALSE;
|
---|
194 | }
|
---|
195 |
|
---|
196 | WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, 1, 1000);
|
---|
197 | _cwmmSetRecordTitles(thisPtr, "00:00", TRUE);
|
---|
198 |
|
---|
199 | break;
|
---|
200 | }
|
---|
201 | case ACKEY_STOP:
|
---|
202 | {
|
---|
203 | /* Stop playing */
|
---|
204 | unsigned char chrCommand[CCHMAXPATH];
|
---|
205 | char retMsg[20];
|
---|
206 |
|
---|
207 | WinStopTimer(WinQueryAnchorBlock(hwnd),hwnd,1 );
|
---|
208 |
|
---|
209 | sprintf(chrCommand,"stop wave%d wait", thisPtr);
|
---|
210 | mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
|
---|
211 |
|
---|
212 | sprintf(chrCommand,"close wave%d wait", thisPtr);
|
---|
213 | mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
|
---|
214 |
|
---|
215 | WinPostMsg(hwnd,WM_QUIT,0,0);
|
---|
216 | }
|
---|
217 | default:
|
---|
218 | break;
|
---|
219 | }
|
---|
220 | }/* if(thisPtr) */
|
---|
221 | return MRFALSE;
|
---|
222 | }
|
---|
223 | case WM_TIMER:
|
---|
224 | switch(SHORT1FROMMP(mp1))
|
---|
225 | {
|
---|
226 | case 1:
|
---|
227 | {
|
---|
228 | MMAudio * thisPtr;
|
---|
229 | OPENPARAMS * pParams;
|
---|
230 |
|
---|
231 |
|
---|
232 | pParams=(OPENPARAMS*)WinQueryWindowULong(hwnd, QWL_USER);
|
---|
233 | thisPtr=pParams->wpObject;
|
---|
234 |
|
---|
235 | if(somIsObj(thisPtr)) {
|
---|
236 | char retMsg[20];
|
---|
237 | unsigned char chrCommand[CCHMAXPATH];
|
---|
238 | APIRET rc;
|
---|
239 | ULONG ulCur;
|
---|
240 |
|
---|
241 | /* Get current play position */
|
---|
242 | sprintf(chrCommand,"STATUS wave%d POSITION WAIT", thisPtr);
|
---|
243 | rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
|
---|
244 | if((rc & 0x0000ffff)!=MCIERR_SUCCESS) {
|
---|
245 | return MRFALSE;
|
---|
246 | }
|
---|
247 |
|
---|
248 | ulCur=atoi(retMsg)/1000;
|
---|
249 | sprintf(chrCommand, "%02d:%02d", ulCur/60, ulCur%60);
|
---|
250 |
|
---|
251 | /* Set new time in icon title */
|
---|
252 | _cwmmSetRecordTitles(thisPtr, chrCommand, TRUE);
|
---|
253 |
|
---|
254 | sprintf(chrCommand,"STATUS wave%d MODE WAIT", thisPtr);
|
---|
255 | rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
|
---|
256 | if((rc & 0x0000ffff)!=MCIERR_SUCCESS) {
|
---|
257 | WinPostMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(ACKEY_STOP), MPFROMP(thisPtr));
|
---|
258 | return MRFALSE;
|
---|
259 | }
|
---|
260 | if(stricmp(retMsg, "playing")) {
|
---|
261 | /* Not playing anymore. Try to reconnect */
|
---|
262 | WinPostMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(ACKEY_STOP), MPFROMP(thisPtr));
|
---|
263 | WinPostMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(ACKEY_START), MPFROMP(thisPtr));
|
---|
264 | }
|
---|
265 | return MRFALSE;
|
---|
266 | }
|
---|
267 | }
|
---|
268 | case 2:
|
---|
269 | WinStopTimer(WinQueryAnchorBlock(hwnd),hwnd, 2);
|
---|
270 | WinPostMsg(hwnd,WM_QUIT,0,0);
|
---|
271 | return MRFALSE;
|
---|
272 | default:
|
---|
273 | break;
|
---|
274 | }
|
---|
275 | break;
|
---|
276 | default:
|
---|
277 | break;
|
---|
278 | }
|
---|
279 | return WinDefWindowProc( hwnd, msg, mp1, mp2);
|
---|
280 | }
|
---|
281 |
|
---|
282 |
|
---|
283 | MRESULT EXPENTRY streamUrlDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
284 | {
|
---|
285 | MMAudioStream *cwAudioStream;
|
---|
286 |
|
---|
287 | switch(msg)
|
---|
288 | {
|
---|
289 | case WM_INITDLG :
|
---|
290 | {
|
---|
291 | char chrURL[CCHMAXPATH];
|
---|
292 | cwAudioStream=(MMAudio*)PVOIDFROMMP(mp2);
|
---|
293 | WinSetWindowULong(WinWindowFromID(hwnd,IDEF_URL),
|
---|
294 | QWL_USER,(ULONG)cwAudioStream);//Save object ptr.
|
---|
295 |
|
---|
296 | WinSendMsg(WinWindowFromID(hwnd,IDEF_URL),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)sizeof(chrURL)),0);
|
---|
297 |
|
---|
298 | /* Move default buttons on Warp 4 */
|
---|
299 | cwMoveNotebookButtonsWarp4(hwnd, IDPB_STREAMHELP, 15);
|
---|
300 |
|
---|
301 | if(somIsObj(cwAudioStream)) {
|
---|
302 |
|
---|
303 | /* CWAudioStreamData *somThis = CWAudioStreamGetData(cwAudioStream); */
|
---|
304 |
|
---|
305 | /* Move default buttons on Warp 4 */
|
---|
306 | // cwMoveNotebookButtonsWarp4(hwnd, IDPB_ID3HELP, 15);
|
---|
307 |
|
---|
308 | if(_getUrlFromFile(cwAudioStream, chrURL, sizeof(chrURL)))
|
---|
309 | {
|
---|
310 | WinSetWindowText(WinWindowFromID(hwnd,IDEF_URL),chrURL);
|
---|
311 | }
|
---|
312 | WinSendMsg(WinWindowFromID(hwnd,IDEF_URL),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)CCHMAXPATH),0);
|
---|
313 | }
|
---|
314 |
|
---|
315 | WinSetWindowULong(WinQueryWindow(hwnd, QW_PARENT), QWL_HWNDFOCUSSAVE, hwnd);
|
---|
316 | return (MRESULT)TRUE;
|
---|
317 | }
|
---|
318 | /* This prevents switching the notebook page behind the open folder */
|
---|
319 | case WM_WINDOWPOSCHANGED:
|
---|
320 | {
|
---|
321 | MRESULT mr;
|
---|
322 |
|
---|
323 | if(WinQueryFocus(HWND_DESKTOP)!=
|
---|
324 | WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT)) {
|
---|
325 | mp2=MPFROMLONG(LONGFROMMP(mp2)|0x80000);/*AWP_ACTIVATE 0x00080000L*/
|
---|
326 | mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
327 | return mr;
|
---|
328 | }
|
---|
329 | break;
|
---|
330 | }
|
---|
331 | case WM_FOCUSCHANGE:
|
---|
332 | {
|
---|
333 | if(!SHORT1FROMMP(mp2)) {
|
---|
334 | if(HWNDFROMMP(mp1)==hwnd) {
|
---|
335 | MRESULT mr;
|
---|
336 |
|
---|
337 | mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
338 | WinSendMsg(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT), WM_SETFOCUS, MPFROMHWND(hwnd),
|
---|
339 | (MPARAM)TRUE);
|
---|
340 | return mr;
|
---|
341 | }
|
---|
342 | }
|
---|
343 | break;
|
---|
344 | }
|
---|
345 | case WM_DESTROY:
|
---|
346 | /* The notebook closes and gets destroyed */
|
---|
347 | cwAudioStream=(MMAudioStream*) WinQueryWindowULong(WinWindowFromID(hwnd, IDEF_URL), QWL_USER);
|
---|
348 | if(somIsObj(cwAudioStream)) {
|
---|
349 | char fName[CCHMAXPATH];
|
---|
350 |
|
---|
351 | WinQueryWindowText(WinWindowFromID(hwnd,IDEF_URL), sizeof(fName), fName);
|
---|
352 | _saveUrlToFile(cwAudioStream, fName);
|
---|
353 | }
|
---|
354 |
|
---|
355 | /* Set focus to desktop to prevent PM freeze */
|
---|
356 | WinSetFocus(HWND_DESKTOP, HWND_DESKTOP);
|
---|
357 | break;
|
---|
358 | #if 0
|
---|
359 | case WM_COMMAND:
|
---|
360 | cwAudio=(CWAudio*) WinQueryWindowULong(WinWindowFromID(hwnd, IDEF_ID3NAME),QWL_USER);
|
---|
361 | if(somIsObj(cwAudio)) {
|
---|
362 | char fName[100];
|
---|
363 |
|
---|
364 | switch(SHORT1FROMMP(mp1))
|
---|
365 | {
|
---|
366 | case IDPB_CANCEL:
|
---|
367 | break;
|
---|
368 | default:
|
---|
369 | break;
|
---|
370 | }
|
---|
371 | }
|
---|
372 | return (MRESULT) TRUE;
|
---|
373 | #endif
|
---|
374 | default:
|
---|
375 | break;
|
---|
376 | }
|
---|
377 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
378 | }
|
---|
379 |
|
---|
380 | /*
|
---|
381 | * The prototype for cwastream_cwmmAddURLPage was replaced by the following prototype:
|
---|
382 | */
|
---|
383 | SOM_Scope ULONG SOMLINK cwastream_cwmmAddURLPage(MMAudioStream *somSelf,
|
---|
384 | HWND hwndNotebook)
|
---|
385 | {
|
---|
386 | PAGEINFO pageinfo;
|
---|
387 | char pageName[100];
|
---|
388 |
|
---|
389 | /* CWAudioStreamData *somThis = CWAudioStreamGetData(somSelf); */
|
---|
390 | MMAudioStreamMethodDebug("MMAudioStream","cwastream_cwmmAddURLPage");
|
---|
391 |
|
---|
392 | //Clear the pageinfo structure
|
---|
393 | memset((PCH)&pageinfo, 0, sizeof(PAGEINFO));
|
---|
394 | //Fill the pageinfo structure
|
---|
395 | pageinfo.cb = sizeof(PAGEINFO);
|
---|
396 | pageinfo.hwndPage = NULLHANDLE;
|
---|
397 | pageinfo.usPageStyleFlags = BKA_MAJOR | BKA_STATUSTEXTON;
|
---|
398 | pageinfo.usPageInsertFlags = BKA_FIRST;
|
---|
399 | //We want page numbers
|
---|
400 | pageinfo.usSettingsFlags = SETTINGS_PAGE_NUMBERS;
|
---|
401 | //The dialog procedure for this page
|
---|
402 | pageinfo.pfnwp = streamUrlDlgProc;
|
---|
403 | //The resource DLL
|
---|
404 | pageinfo.resid = queryResModuleHandle();
|
---|
405 | //The ID of the dialog template
|
---|
406 | pageinfo.dlgid = IDDLG_STREAMURLPAGE;
|
---|
407 | //We need a pointer to our WPS-object in the dialog procedure
|
---|
408 | //to call class functions
|
---|
409 | pageinfo.pCreateParams = somSelf;
|
---|
410 | //The ID of the help panel for this page
|
---|
411 | pageinfo.idDefaultHelpPanel = AUDIOSTREAM_SETTINGS_PANEL;
|
---|
412 | //Tell the WPS the help library name
|
---|
413 | pageinfo.pszHelpLibraryName = _queryMp3HelpLibraryName();
|
---|
414 | //We have a major tab so we need a name
|
---|
415 | if(!getMessage(pageName, IDSTR_STREAMURLPAGENAME, sizeof(pageName), queryResModuleHandle(), hwndNotebook))
|
---|
416 | strcpy(pageName, "Stream ~URL");
|
---|
417 | pageinfo.pszName = pageName;
|
---|
418 | //Insert the page into the settings notebook
|
---|
419 |
|
---|
420 | return _wpInsertSettingsPage(somSelf,hwndNotebook,&pageinfo);
|
---|
421 | }
|
---|
422 |
|
---|
423 |
|
---|
424 | SOM_Scope void SOMLINK cwastream_wpCopiedFromTemplate(MMAudioStream *somSelf)
|
---|
425 | {
|
---|
426 | /* MMAudioStreamData *somThis = MMAudioStreamGetData(somSelf); */
|
---|
427 | MMAudioStreamMethodDebug("MMAudioStream","cwastream_wpCopiedFromTemplate");
|
---|
428 |
|
---|
429 | MMAudioStream_parent_MMAudio_wpCopiedFromTemplate(somSelf);
|
---|
430 |
|
---|
431 | _wpViewObject(somSelf, NULLHANDLE, OPEN_SETTINGS,0);
|
---|
432 | }
|
---|
433 |
|
---|
434 | /*
|
---|
435 | * The prototype for cwastream_wpModifyPopupMenu was replaced by the following prototype:
|
---|
436 | */
|
---|
437 | SOM_Scope BOOL SOMLINK cwastream_wpModifyPopupMenu(MMAudioStream *somSelf,
|
---|
438 | HWND hwndMenu,
|
---|
439 | HWND hwndCnr,
|
---|
440 | ULONG iPosition)
|
---|
441 | {
|
---|
442 | BOOL bRC;
|
---|
443 | /* CWAudioStreamData *somThis = CWAudioStreamGetData(somSelf); */
|
---|
444 | MMAudioStreamMethodDebug("MMAudioStream","cwastream_wpModifyPopupMenu");
|
---|
445 |
|
---|
446 | bRC=(MMAudioStream_parent_MMAudio_wpModifyPopupMenu(somSelf,
|
---|
447 | hwndMenu,
|
---|
448 | hwndCnr,
|
---|
449 | iPosition));
|
---|
450 | WinSendMsg(hwndMenu,MM_DELETEITEM,MPFROM2SHORT( ID_MENU_PLAYER, TRUE),
|
---|
451 | 0L);
|
---|
452 | WinSendMsg(hwndMenu,MM_DELETEITEM,MPFROM2SHORT( ID_MENU_EDITOR, TRUE),
|
---|
453 | 0L);
|
---|
454 | WinSendMsg(hwndMenu,MM_DELETEITEM,MPFROM2SHORT( ID_MENU_CONVERT, FALSE),
|
---|
455 | 0L);
|
---|
456 |
|
---|
457 | return bRC;
|
---|
458 | }
|
---|
459 |
|
---|
460 | /*
|
---|
461 | * The prototype for cwastream_wpAddSettingsPages was replaced by the following prototype:
|
---|
462 | */
|
---|
463 | SOM_Scope BOOL SOMLINK cwastream_wpAddSettingsPages(MMAudioStream *somSelf,
|
---|
464 | HWND hwndNotebook)
|
---|
465 | {
|
---|
466 | BOOL bRc;
|
---|
467 | /* CWAudioStreamData *somThis = CWAudioStreamGetData(somSelf); */
|
---|
468 | MMAudioStreamMethodDebug("MMAudioStream","cwastream_wpAddSettingsPages");
|
---|
469 |
|
---|
470 | bRc=MMAudioStream_parent_MMAudio_wpAddSettingsPages(somSelf,
|
---|
471 | hwndNotebook);
|
---|
472 | _cwmmAddURLPage(somSelf, hwndNotebook);
|
---|
473 | return bRc;
|
---|
474 | }
|
---|
475 |
|
---|
476 | /*
|
---|
477 | * The prototype for cwastream_wpInitData was replaced by the following prototype:
|
---|
478 | */
|
---|
479 | SOM_Scope void SOMLINK cwastream_wpInitData(MMAudioStream *somSelf)
|
---|
480 | {
|
---|
481 | /* CWAudioStreamData *somThis = CWAudioStreamGetData(somSelf); */
|
---|
482 | MMAudioStreamMethodDebug("MMAudioStream","cwastream_wpInitData");
|
---|
483 |
|
---|
484 | MMAudioStream_parent_MMAudio_wpInitData(somSelf);
|
---|
485 | _cwmmSetObjWindowProc(somSelf, &playStreamProc);
|
---|
486 | }
|
---|
487 |
|
---|
488 | SOM_Scope ULONG SOMLINK cwastream_cwmmAddAudioInformationPage(MMAudioStream *somSelf,
|
---|
489 | HWND hwndNotebook)
|
---|
490 | {
|
---|
491 | /* MMAudioStreamData *somThis = MMAudioStreamGetData(somSelf); */
|
---|
492 | MMAudioStreamMethodDebug("MMAudioStream","cwastream_cwmmAddAudioInformationPage");
|
---|
493 |
|
---|
494 | return SETTINGS_PAGE_REMOVED;
|
---|
495 | // return (MMAudioStream_parent_MMAudio_cwmmAddAudioInformationPage(somSelf,
|
---|
496 | // hwndNotebook));
|
---|
497 | }
|
---|
498 |
|
---|
499 | /*
|
---|
500 | * The prototype for cwastream_cwmmAddTrackNamePage was replaced by the following prototype:
|
---|
501 | */
|
---|
502 | SOM_Scope ULONG SOMLINK cwastream_cwmmAddTrackNamePage(MMAudioStream *somSelf,
|
---|
503 | HWND hwndNotebook)
|
---|
504 | {
|
---|
505 | /* CWAudioStreamData *somThis = CWAudioStreamGetData(somSelf); */
|
---|
506 | MMAudioStreamMethodDebug("MMAudioStream","cwastream_cwmmAddTrackNamePage");
|
---|
507 |
|
---|
508 | return SETTINGS_PAGE_REMOVED;
|
---|
509 | }
|
---|
510 |
|
---|
511 | /*
|
---|
512 | * The prototype for cwastreamM_wpclsQueryInstanceType was replaced by the following prototype:
|
---|
513 | */
|
---|
514 | SOM_Scope PSZ SOMLINK cwastreamM_wpclsQueryInstanceType(M_MMAudioStream *somSelf)
|
---|
515 | {
|
---|
516 | // static char chrTitle[20]={0};
|
---|
517 | /* M_CWAudioStreamData *somThis = M_CWAudioStreamGetData(somSelf); */
|
---|
518 | M_MMAudioStreamMethodDebug("M_MMAudioStream","cwastreamM_wpclsQueryInstanceType");
|
---|
519 | #if 0
|
---|
520 | if(chrTitle[0]==0)
|
---|
521 | if(!getMessage(chrTitle, IDSTR_AUDIOSTREAMTITLE, sizeof(chrTitle), queryModuleHandle(), HWND_DESKTOP))
|
---|
522 | strcpy(chrTitle,"Audio-Stream");
|
---|
523 | return chrTitle;
|
---|
524 | #endif
|
---|
525 | return TYPE_AUDIOSTREAM;
|
---|
526 | }
|
---|
527 |
|
---|
528 | /*
|
---|
529 | * The prototype for cwastreamM_wpclsQueryDefaultHelp was replaced by the following prototype:
|
---|
530 | */
|
---|
531 | SOM_Scope BOOL SOMLINK cwastreamM_wpclsQueryDefaultHelp(M_MMAudioStream *somSelf,
|
---|
532 | PULONG pHelpPanelId,
|
---|
533 | PSZ pszHelpLibrary)
|
---|
534 | {
|
---|
535 | PSZ pszHelpLibName;
|
---|
536 | /* M_CWAudioStreamData *somThis = M_CWAudioStreamGetData(somSelf); */
|
---|
537 | M_MMAudioStreamMethodDebug("M_MMAudioStream","cwastreamM_wpclsQueryDefaultHelp");
|
---|
538 |
|
---|
539 | if((pszHelpLibName=_queryMp3HelpLibraryName())!=NULLHANDLE)
|
---|
540 | {
|
---|
541 | if(pHelpPanelId)
|
---|
542 | *pHelpPanelId=AUDIOSTREAM_HELP_PANEL;
|
---|
543 | if(pszHelpLibrary)
|
---|
544 | strncpy(pszHelpLibrary, pszHelpLibName, CCHMAXPATH);
|
---|
545 | return TRUE;
|
---|
546 | }
|
---|
547 |
|
---|
548 | return (M_MMAudioStream_parent_M_MMAudio_wpclsQueryDefaultHelp(somSelf,
|
---|
549 | pHelpPanelId,
|
---|
550 | pszHelpLibrary));
|
---|
551 | }
|
---|
552 |
|
---|
553 | /*
|
---|
554 | * The prototype for cwastreamM_wpclsQueryTitle was replaced by the following prototype:
|
---|
555 | */
|
---|
556 | SOM_Scope PSZ SOMLINK cwastreamM_wpclsQueryTitle(M_MMAudioStream *somSelf)
|
---|
557 | {
|
---|
558 | static char chrTitle[20]={0};
|
---|
559 |
|
---|
560 | /* M_CWAudioStreamData *somThis = M_CWAudioStreamGetData(somSelf); */
|
---|
561 | M_MMAudioStreamMethodDebug("M_MMAudioStream","cwastreamM_wpclsQueryTitle");
|
---|
562 |
|
---|
563 | if(chrTitle[0]==0)
|
---|
564 | if(!getMessage(chrTitle, IDSTR_AUDIOSTREAMTITLE, sizeof(chrTitle), queryResModuleHandle(), HWND_DESKTOP))
|
---|
565 | strcpy(chrTitle, CLSTITLE_AUDIOSTREAM);
|
---|
566 |
|
---|
567 | return chrTitle;
|
---|
568 | }
|
---|
569 |
|
---|
570 | /*
|
---|
571 | * The prototype for cwastreamM_wpclsQueryIconData was replaced by the following prototype:
|
---|
572 | */
|
---|
573 | SOM_Scope ULONG SOMLINK cwastreamM_wpclsQueryIconData(M_MMAudioStream *somSelf,
|
---|
574 | PICONINFO pIconInfo)
|
---|
575 | {
|
---|
576 | HMODULE hmod;
|
---|
577 |
|
---|
578 | /* M_CWAudioStreamData *somThis = M_CWAudioStreamGetData(somSelf); */
|
---|
579 | M_MMAudioStreamMethodDebug("M_MMAudioStream","cwastreamM_wpclsQueryIconData");
|
---|
580 |
|
---|
581 | hmod=queryModuleHandle();
|
---|
582 | if(!hmod)
|
---|
583 | return M_MMAudioStream_parent_M_MMAudio_wpclsQueryIconData(somSelf, pIconInfo);
|
---|
584 |
|
---|
585 | if (pIconInfo) {
|
---|
586 | pIconInfo->fFormat = ICON_RESOURCE;
|
---|
587 | pIconInfo->hmod = hmod;
|
---|
588 | pIconInfo->resid = ID_ICONAUDIOSTREAM;
|
---|
589 | } /* endif */
|
---|
590 |
|
---|
591 | return ( sizeof(ICONINFO) );
|
---|
592 | }
|
---|
593 |
|
---|