source: branches/classes/c/c_audio/cwogg.c

Last change on this file was 104, checked in by gyoung, 2 years ago

Remaining changes from merge with Lars 2.9 branch

File size: 7.7 KB
Line 
1
2/*
3 * This file was generated by the SOM Compiler.
4 * Generated using:
5 * SOM incremental update: 2.47
6 */
7
8
9/*
10 * (C) Chris Wohlgemuth 2002-2004
11 *
12 */
13/*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2, or (at your option)
17 * any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; see the file COPYING. If not, write to
26 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28/*
29 * If you need another license for your project/product contact me at
30 *
31 * http://www.os2world.com/cdwriting
32 * http://www.geocities.com/SiliconValley/Sector/5785/
33 */
34
35/*
36 * This file was generated by the SOM Compiler and Emitter Framework.
37 * Generated using:
38 * SOM Emitter emitctm: 2.42
39 */
40
41#ifndef SOM_Module_cwogg_Source
42#define SOM_Module_cwogg_Source
43#endif
44#define CWOGG_Class_Source
45#define M_CWOGG_Class_Source
46
47#include "os2.h"
48#include "cwogginc.h"
49#include "cwogg.ih"
50#include "cwaudio.h"
51//#include "cwmmres.h"
52#include "mmres.h"
53#include "cwaudioinc.h"
54
55#include "sys_funcs.h"
56
57extern char classDLLPath[CCHMAXPATH];
58
59HMODULE queryResModuleHandle(void);
60HMODULE queryModuleHandle(void);
61BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
62
63static PSZ _queryHelpLibraryName(void)
64{
65 static char helpLibraryName[CCHMAXPATH];
66 BOOL bDone=FALSE;
67
68 if(!bDone) {
69 if(queryModuleHandle()) {
70 char *ptr;
71 strncpy(helpLibraryName, classDLLPath, sizeof(helpLibraryName)-1);
72 if((ptr=strrchr(helpLibraryName, '\\'))!=NULLHANDLE) {
73 *(++ptr)=0;
74 if(strlen(helpLibraryName)+strlen(OGGFILE_HELP_LIBRARY)<sizeof(helpLibraryName)) {
75 strcat(helpLibraryName, OGGFILE_HELP_LIBRARY );
76 bDone=TRUE;
77 return helpLibraryName;
78 }
79 }
80 }
81 return NULLHANDLE;
82 }
83
84 return helpLibraryName;
85}
86
87
88/*
89 * SOM_Scope ULONG SOMLINK cwogg_cwmmQueryTrackInfo(MMOGG *somSelf,
90 * char** chrString,
91 * ULONG ulSize,
92 * int iWhich)
93 */
94
95/*
96 * The prototype for cwogg_cwmmQueryTrackInfo was replaced by the following prototype:
97 */
98
99/*
100 * SOM_Scope ULONG SOMLINK cwogg_cwmmQueryTrackInfo(MMOGG *somSelf,
101 * PSZ chrString,
102 * ULONG ulSize,
103 * int iWhich)
104 */
105
106/*
107 * The prototype for cwogg_cwmmQueryTrackInfo was replaced by the following prototype:
108 */
109SOM_Scope ULONG SOMLINK cwogg_cwmmQueryTrackInfo(MMOGG *somSelf,
110 PSZ chrString,
111 ULONG ulSize,
112 ULONG iWhich)
113{
114 /* MMOGGData *somThis = MMOGGGetData(somSelf); */
115 /* MMAudioData *somThis = MMAudioGetData(somSelf); */
116 MMOGGMethodDebug("MMOGG","cwogg_cwmmQueryTrackInfo");
117
118 if(iWhich<1||iWhich>IDINFO_LASTINFO)
119 return FALSE;
120 /*
121 switch(iWhich)
122 {
123 case IDINFO_BITRATE:
124 return _ulBitRate;
125 default:
126 break;
127 }
128 */
129 return (MMOGG_parent_MMAudio_cwmmQueryTrackInfo(somSelf,
130 chrString,
131 ulSize, iWhich));
132}
133
134/*
135 * The prototype for cwogg_wpSaveState was replaced by the following prototype:
136 */
137SOM_Scope BOOL SOMLINK cwogg_wpSaveState(MMOGG *somSelf)
138{
139 // char chrBuf[256];
140 // ULONG ulLength;
141 BOOL rc;
142
143 /* MMAudioData *somThis = MMAudioGetData(somSelf);*/
144 MMOGGMethodDebug("MMOGG","cwogg_wpSaveState");
145
146 /* call parent first. By doing so, the MP3 type is written after the Digital Audio type.
147 This way the default class the WPS picks is MMOGG and not MMAudio. */
148 rc=(MMOGG_parent_MMAudio_wpSaveState(somSelf));
149
150 return rc;
151
152#if 0
153 strncpy(chrBuf, _wpQueryType(somSelf), sizeof(chrBuf));
154 chrBuf[sizeof(chrBuf)-1]=0;
155
156 if(!strstr(chrBuf, TYPE_OGG)) {
157 ulLength=strlen(chrBuf);
158 if(ulLength) {
159 if(ulLength+6 < sizeof(chrBuf)) {
160 strcat(chrBuf, "\n");
161 strcat(chrBuf, TYPE_OGG);
162 }
163 }
164 else
165 strcpy(chrBuf, TYPE_OGG);
166 }
167 return rc;
168#endif
169}
170
171/*
172 * The prototype for cwoggM_wpclsQueryTitle was replaced by the following prototype:
173 */
174SOM_Scope PSZ SOMLINK cwoggM_wpclsQueryTitle(M_MMOGG *somSelf)
175{
176 static char chrTitle[20]={0};
177 /* M_CWOGGData *somThis = M_CWOGGGetData(somSelf); */
178 M_MMOGGMethodDebug("M_MMOGG","cwoggM_wpclsQueryTitle");
179
180 if(chrTitle[0]==0)
181 if(!getMessage(chrTitle, IDSTR_OGGTITLE, sizeof(chrTitle), queryResModuleHandle(), HWND_DESKTOP))
182 strcpy(chrTitle, CLSTITLE_OGG);
183
184 return chrTitle;
185}
186
187/*
188 * The prototype for cwoggM_wpclsQueryInstanceType was replaced by the following prototype:
189 */
190SOM_Scope PSZ SOMLINK cwoggM_wpclsQueryInstanceType(M_MMOGG *somSelf)
191{
192 /* M_CWOGGData *somThis = M_CWOGGGetData(somSelf); */
193 M_MMOGGMethodDebug("M_MMOGG","cwoggM_wpclsQueryInstanceType");
194
195 return TYPE_OGG;
196 // return "OGGS,Digital Audio";
197}
198
199/*
200 * The prototype for cwoggM_wpclsQueryInstanceFilter was replaced by the following prototype:
201 */
202SOM_Scope PSZ SOMLINK cwoggM_wpclsQueryInstanceFilter(M_MMOGG *somSelf)
203{
204 /* M_CWOGGData *somThis = M_CWOGGGetData(somSelf); */
205 M_MMOGGMethodDebug("M_MMOGG","cwoggM_wpclsQueryInstanceFilter");
206
207 return "*.OGG";
208}
209
210/*
211 * The prototype for cwoggM_wpclsQueryIconData was replaced by the following prototype:
212 */
213SOM_Scope ULONG SOMLINK cwoggM_wpclsQueryIconData(M_MMOGG *somSelf,
214 PICONINFO pIconInfo)
215{
216 HMODULE hmod;
217 /* M_CWOGGData *somThis = M_CWOGGGetData(somSelf); */
218 M_MMOGGMethodDebug("M_MMOGG","cwoggM_wpclsQueryIconData");
219
220 hmod=queryModuleHandle();
221 if(!hmod)
222 return M_MMOGG_parent_M_MMAudio_wpclsQueryIconData(somSelf, pIconInfo);
223
224 if (pIconInfo) {
225 pIconInfo->fFormat = ICON_RESOURCE;
226 pIconInfo->hmod = hmod;
227 pIconInfo->resid = ID_ICONOGGFILE;
228 } /* endif */
229
230 return ( sizeof(ICONINFO) );
231}
232
233/*
234 * The prototype for cwoggM_wpclsQueryDefaultHelp was replaced by the following prototype:
235 */
236SOM_Scope BOOL SOMLINK cwoggM_wpclsQueryDefaultHelp(M_MMOGG *somSelf,
237 PULONG pHelpPanelId,
238 PSZ pszHelpLibrary)
239{
240 PSZ pszHelpLibName;
241
242 /* M_CWOGGData *somThis = M_CWOGGGetData(somSelf); */
243 M_MMOGGMethodDebug("M_MMOGG","cwoggM_wpclsQueryDefaultHelp");
244
245 if((pszHelpLibName=_queryHelpLibraryName())!=NULLHANDLE)
246 {
247 if(pHelpPanelId)
248 *pHelpPanelId=OGGFILE_HELP_PANEL;
249 if(pszHelpLibrary)
250 strncpy(pszHelpLibrary, pszHelpLibName, CCHMAXPATH);
251 return TRUE;
252 }
253
254 return (M_MMOGG_parent_M_MMAudio_wpclsQueryDefaultHelp(somSelf,
255 pHelpPanelId,
256 pszHelpLibrary));
257}
258
259
Note: See TracBrowser for help on using the repository browser.