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