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

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

Import sources from cwmm-full.zip dated 2005-03-21

File size: 5.9 KB
Line 
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_mmwav_Source
35#define SOM_Module_mmwav_Source
36#endif
37#define MMWAV_Class_Source
38#define M_MMWAV_Class_Source
39
40#include <os2.h>
41#include "helpid.h"
42#include "mmwav.ih"
43#include "cwaudioinc.h"
44
45extern char chrHelpLibrary[CCHMAXPATH];
46
47HMODULE queryResModuleHandle(void);
48HMODULE queryModuleHandle(void);
49BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
50void HlpWriteToTrapLog(const char* chrFormat, ...);
51
52/*
53 * SOM_Scope BOOL SOMLINK mmwav_wpSaveState(CWWAV *somSelf)
54 */
55
56/*
57 * The prototype for mmwav_wpSaveState was replaced by the following prototype:
58 */
59SOM_Scope BOOL SOMLINK mmwav_wpSaveState(MMWAV *somSelf)
60{
61 char chrBuf[256];
62 ULONG ulLength;
63 BOOL rc;
64
65 /* CWWAVData *somThis = CWWAVGetData(somSelf); */
66 MMWAVMethodDebug("MMWAV","mmwav_wpSaveState");
67
68 /* call parent first. By doing so, the MP3 type is written after the Digital Audio type.
69 This way the default class the WPS picks is MMWAV and not MMAudio. */
70 rc=(MMWAV_parent_MMAudio_wpSaveState(somSelf));
71 return rc;
72 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
73
74 /* Set .TYPE EA so the editor and the player are happy. */
75 strncpy(chrBuf, _wpQueryType(somSelf), sizeof(chrBuf));
76 chrBuf[sizeof(chrBuf)-1]=0;
77
78 //HlpWriteToTrapLog("%x %x %s\n",strstr(chrBuf, TYPE_WAV), chrBuf, chrBuf);
79 if(!strstr(chrBuf, TYPE_WAV) && strlen(chrBuf)) {
80 ulLength=strlen(chrBuf);
81 if(ulLength) {
82 if(ulLength+2+sizeof(TYPE_WAV) < sizeof(chrBuf)) {
83 strcat(chrBuf, "\n");
84 strcat(chrBuf, TYPE_WAV);
85 }
86 }
87 else
88 strcpy(chrBuf, TYPE_WAV);
89 /* Set .TYPE EA so the editor and the player are happy. */
90 }
91 /* Write it to the EA */
92 _wpSetType(somSelf, chrBuf , NULL);
93 return rc;
94}
95
96/*
97 * The prototype for mmwavM_wpclsQueryTitle was replaced by the following prototype:
98 */
99SOM_Scope PSZ SOMLINK mmwavM_wpclsQueryTitle(M_MMWAV *somSelf)
100{
101 static char chrTitle[20]={0};
102 /* M_MMWAVData *somThis = M_MMWAVGetData(somSelf); */
103 /* M_MMWAVMethodDebug("M_MMWAV","mmwavM_wpclsQueryTitle");*/
104 M_MMWAVMethodDebug("M_MMWAV","mmwavM_wpclsQueryTitle");
105
106 if(chrTitle[0]==0)
107 if(!getMessage(chrTitle, IDSTR_WAVTITLE, sizeof(chrTitle), queryResModuleHandle(), HWND_DESKTOP))
108 strcpy(chrTitle, CLSTITLE_WAV);
109
110 return chrTitle;
111}
112
113/*
114 * The prototype for mmwavM_wpclsQueryInstanceType was replaced by the following prototype:
115 */
116SOM_Scope PSZ SOMLINK mmwavM_wpclsQueryInstanceType(M_MMWAV *somSelf)
117{
118 /* M_MMWAVData *somThis = M_MMWAVGetData(somSelf); */
119 /* M_MMWAVMethodDebug("M_MMWAV","mmwavM_wpclsQueryInstanceType");*/
120 M_MMWAVMethodDebug("M_MMWAV","mmwavM_wpclsQueryInstanceType");
121
122 return TYPE_WAV;
123 // return "WAV,Digital Audio";
124}
125
126/*
127 * The prototype for mmwavM_wpclsQueryInstanceFilter was replaced by the following prototype:
128 */
129SOM_Scope PSZ SOMLINK mmwavM_wpclsQueryInstanceFilter(M_MMWAV *somSelf)
130{
131 /* M_MMWAVData *somThis = M_MMWAVGetData(somSelf); */
132 M_MMWAVMethodDebug("M_MMWAV","mmwavM_wpclsQueryInstanceFilter");
133 /* M_MMWAVMethodDebug("M_MMWAV","mmwavM_wpclsQueryInstanceFilter");*/
134
135 return "*.WAV";
136}
137
138/*
139 * The prototype for mmwavM_wpclsQueryIconData was replaced by the following prototype:
140 */
141SOM_Scope ULONG SOMLINK mmwavM_wpclsQueryIconData(M_MMWAV *somSelf,
142 PICONINFO pIconInfo)
143{
144 HMODULE hmod;
145 /* M_MMWAVData *somThis = M_MMWAVGetData(somSelf); */
146 /* M_MMWAVMethodDebug("M_MMWAV","mmwavM_wpclsQueryIconData");*/
147 M_MMWAVMethodDebug("M_MMWAV","mmwavM_wpclsQueryIconData");
148
149 hmod=queryModuleHandle();
150 if(!hmod)
151 return M_MMWAV_parent_M_MMAudio_wpclsQueryIconData(somSelf, pIconInfo);
152
153 if (pIconInfo) {
154 pIconInfo->fFormat = ICON_RESOURCE;
155 pIconInfo->hmod = hmod;
156 pIconInfo->resid = ID_ICONWAVFILE;
157 } /* endif */
158
159 return ( sizeof(ICONINFO) );
160}
161
162/*
163 * The prototype for mmwavM_wpclsQueryDefaultHelp was replaced by the following prototype:
164 */
165SOM_Scope BOOL SOMLINK mmwavM_wpclsQueryDefaultHelp(M_MMWAV *somSelf,
166 PULONG pHelpPanelId,
167 PSZ pszHelpLibrary)
168{
169 /* M_MMWAVData *somThis = M_MMWAVGetData(somSelf); */
170 /* M_MMWAVMethodDebug("M_MMWAV","mmwavM_wpclsQueryDefaultHelp");*/
171 M_MMWAVMethodDebug("M_MMWAV","mmwavM_wpclsQueryDefaultHelp");
172
173 if(pHelpPanelId)
174 *pHelpPanelId=WAVFILE_HELP_PANEL;
175 if(pszHelpLibrary)
176 strncpy(pszHelpLibrary, chrHelpLibrary, CCHMAXPATH);
177 return TRUE;
178}
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
Note: See TracBrowser for help on using the repository browser.