Authors: Martin Fuchs <martin-fuchs@gmx.net>, Ge van Geldorp <gvg@reactos.com>
[wine] / dlls / msacm / wineacm.h
1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
2 /*
3  * Copyright 2000 Eric Pouech
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20 #ifndef __WINE_WINEACM_H
21 #define __WINE_WINEACM_H
22
23 #include "wine/windef16.h"
24 #include "wine/mmsystem16.h"
25
26 /***********************************************************************
27  * Win16 definitions
28  */
29 typedef BOOL16 (CALLBACK *ACMDRIVERENUMCB16)(
30   HACMDRIVERID16 hadid, DWORD dwInstance, DWORD fdwSupport
31 );
32 typedef UINT (CALLBACK *ACMFILTERCHOOSEHOOKPROC16)(
33   HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
34 );
35 typedef UINT16 (CALLBACK *ACMFORMATCHOOSEHOOKPROC16)(
36   HWND16 hwnd, UINT16 uMsg, WPARAM16 wParam, LPARAM lParam
37 );
38
39 typedef struct _ACMDRIVERDETAILS16
40 {
41   DWORD   cbStruct;
42
43   FOURCC  fccType;
44   FOURCC  fccComp;
45
46   WORD    wMid;
47   WORD    wPid;
48
49   DWORD   vdwACM;
50   DWORD   vdwDriver;
51
52   DWORD   fdwSupport;
53   DWORD   cFormatTags;
54   DWORD   cFilterTags;
55
56   HICON16 hicon;
57
58   CHAR    szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS];
59   CHAR    szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS];
60   CHAR    szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS];
61   CHAR    szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS];
62   CHAR    szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS];
63 } ACMDRIVERDETAILS16, *NPACMDRIVERDETAILS16, *LPACMDRIVERDETAILS16;
64
65 typedef struct _ACMFILTERCHOOSE16
66 {
67   DWORD          cbStruct;
68   DWORD          fdwStyle;
69
70   HWND16         hwndOwner;
71
72   LPWAVEFILTER   pwfltr;
73   DWORD          cbwfltr;
74
75   LPCSTR         pszTitle;
76
77   char           szFilterTag[ACMFILTERTAGDETAILS_FILTERTAG_CHARS];
78   char           szFilter[ACMFILTERDETAILS_FILTER_CHARS];
79   LPSTR          pszName;
80   DWORD          cchName;
81
82   DWORD          fdwEnum;
83   LPWAVEFILTER   pwfltrEnum;
84
85   HINSTANCE16    hInstance;
86   LPCSTR         pszTemplateName;
87   LPARAM         lCustData;
88   ACMFILTERCHOOSEHOOKPROC16 pfnHook;
89 } ACMFILTERCHOOSE16, *NPACMFILTERCHOOSE16, *LPACMFILTERCHOOSE16;
90
91 typedef struct _ACMFILTERDETAILS16
92 {
93   DWORD          cbStruct;
94   DWORD          dwFilterIndex;
95   DWORD          dwFilterTag;
96   DWORD          fdwSupport;
97   LPWAVEFILTER   pwfltr;
98   DWORD          cbwfltr;
99   CHAR           szFilter[ACMFILTERDETAILS_FILTER_CHARS];
100 } ACMFILTERDETAILS16, *NPACMFILTERDETAILS16, *LPACMFILTERDETAILS16;
101
102 typedef struct _ACMFILTERTAGDETAILS16
103 {
104   DWORD cbStruct;
105   DWORD dwFilterTagIndex;
106   DWORD dwFilterTag;
107   DWORD cbFilterSize;
108   DWORD fdwSupport;
109   DWORD cStandardFilters;
110   CHAR  szFilterTag[ACMFILTERTAGDETAILS_FILTERTAG_CHARS];
111 } ACMFILTERTAGDETAILS16, *NPACMFILTERTAGDETAILS16, *LPACMFILTERTAGDETAILS16;
112
113 typedef struct _ACMFORMATCHOOSE16
114 {
115   DWORD            cbStruct;
116   DWORD            fdwStyle;
117
118   HWND16           hwndOwner;
119
120   LPWAVEFORMATEX   pwfx;
121   DWORD            cbwfx;
122   LPCSTR           pszTitle;
123
124   CHAR             szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
125   CHAR             szFormat[ACMFORMATDETAILS_FORMAT_CHARS];
126
127   LPSTR            pszName;
128   DWORD            cchName;
129
130   DWORD            fdwEnum;
131   LPWAVEFORMATEX   pwfxEnum;
132
133   HINSTANCE16      hInstance;
134   LPCSTR           pszTemplateName;
135   LPARAM           lCustData;
136   ACMFORMATCHOOSEHOOKPROC16 pfnHook;
137 } ACMFORMATCHOOSE16, *NPACMFORMATCHOOSE16, *LPACMFORMATCHOOSE16;
138
139 typedef struct _ACMFORMATDETAILS16
140 {
141     DWORD            cbStruct;
142     DWORD            dwFormatIndex;
143     DWORD            dwFormatTag;
144     DWORD            fdwSupport;
145     LPWAVEFORMATEX   pwfx;
146     DWORD            cbwfx;
147     CHAR             szFormat[ACMFORMATDETAILS_FORMAT_CHARS];
148 } ACMFORMATDETAILS16, *NPACMFORMATDETAILS16, *LPACMFORMATDETAILS16;
149
150 typedef struct _ACMFORMATTAGDETAILS16
151 {
152   DWORD cbStruct;
153   DWORD dwFormatTagIndex;
154   DWORD dwFormatTag;
155   DWORD cbFormatSize;
156   DWORD fdwSupport;
157   DWORD cStandardFormats;
158   CHAR  szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
159 } ACMFORMATTAGDETAILS16, *NPACMFORMATTAGDETAILS16, *LPACMFORMATTAGDETAILS16;
160
161 typedef ACMSTREAMHEADER ACMSTREAMHEADER16, *NPACMSTREAMHEADER16, *LPACMSTREAMHEADER16;
162
163 typedef BOOL16 (CALLBACK *ACMFILTERENUMCB16)(
164  HACMDRIVERID16 hadid, LPACMFILTERDETAILS16 pafd,
165  DWORD dwInstance, DWORD fdwSupport
166 );
167
168 typedef BOOL16 (CALLBACK *ACMFILTERTAGENUMCB16)(
169   HACMDRIVERID16 hadid, LPACMFILTERTAGDETAILS16 paftd,
170   DWORD dwInstance, DWORD fdwSupport
171 );
172
173 typedef BOOL16 (CALLBACK *ACMFORMATENUMCB16)(
174   HACMDRIVERID16 hadid, LPACMFORMATDETAILS16 pafd,
175   DWORD dwInstance, DWORD fdwSupport
176 );
177
178 typedef BOOL16 (CALLBACK *ACMFORMATTAGENUMCB16)(
179   HACMDRIVERID16 hadid, LPACMFORMATTAGDETAILS16 paftd,
180   DWORD dwInstance, DWORD fdwSupport
181 );
182
183 /***********************************************************************
184  * Functions - Win16
185  */
186
187 DWORD WINAPI acmGetVersion16(
188 );
189 MMRESULT16 WINAPI acmMetrics16(
190   HACMOBJ16 hao, UINT16 uMetric, LPVOID pMetric
191 );
192 MMRESULT16 WINAPI acmDriverEnum16(
193   ACMDRIVERENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
194 );
195 MMRESULT16 WINAPI acmDriverDetails16(
196   HACMDRIVERID16 hadid, LPACMDRIVERDETAILS16 padd, DWORD fdwDetails
197 );
198 MMRESULT16 WINAPI acmDriverAdd16(
199   LPHACMDRIVERID16 phadid, HINSTANCE16 hinstModule,
200   LPARAM lParam, DWORD dwPriority, DWORD fdwAdd
201 );
202 MMRESULT16 WINAPI acmDriverRemove16(
203   HACMDRIVERID16 hadid, DWORD fdwRemove
204 );
205 MMRESULT16 WINAPI acmDriverOpen16(
206   LPHACMDRIVER16 phad, HACMDRIVERID16 hadid, DWORD fdwOpen
207 );
208 MMRESULT16 WINAPI acmDriverClose16(
209   HACMDRIVER16 had, DWORD fdwClose
210 );
211 LRESULT WINAPI acmDriverMessage16(
212   HACMDRIVER16 had, UINT16 uMsg, LPARAM lParam1, LPARAM lParam2
213 );
214 MMRESULT16 WINAPI acmDriverID16(
215   HACMOBJ16 hao, LPHACMDRIVERID16 phadid, DWORD fdwDriverID
216 );
217 MMRESULT16 WINAPI acmDriverPriority16(
218  HACMDRIVERID16 hadid, DWORD dwPriority, DWORD fdwPriority
219 );
220 MMRESULT16 WINAPI acmFormatTagDetails16(
221   HACMDRIVER16 had, LPACMFORMATTAGDETAILS16 paftd, DWORD fdwDetails
222 );
223 MMRESULT16 WINAPI acmFormatTagEnum16(
224   HACMDRIVER16 had, LPACMFORMATTAGDETAILS16 paftd,
225   ACMFORMATTAGENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
226 );
227 MMRESULT16 WINAPI acmFormatChoose16(
228   LPACMFORMATCHOOSE16 pafmtc
229 );
230 MMRESULT16 WINAPI acmFormatDetails16(
231   HACMDRIVER16 had, LPACMFORMATDETAILS16 pafd, DWORD fdwDetails
232 );
233 MMRESULT16 WINAPI acmFormatEnum16(
234   HACMDRIVER16 had, LPACMFORMATDETAILS16 pafd,
235   ACMFORMATENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
236 );
237 MMRESULT16 WINAPI acmFormatSuggest16(
238   HACMDRIVER16 had, LPWAVEFORMATEX pwfxSrc,
239   LPWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest
240 );
241 MMRESULT16 WINAPI acmFilterTagDetails16(
242   HACMDRIVER16 had, LPACMFILTERTAGDETAILS16 paftd, DWORD fdwDetails
243 );
244 MMRESULT16 WINAPI acmFilterTagEnum16(
245   HACMDRIVER16 had, LPACMFILTERTAGDETAILS16 paftd,
246   ACMFILTERTAGENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
247 );
248 MMRESULT16 WINAPI acmFilterChoose16(
249   LPACMFILTERCHOOSE16 pafltrc
250 );
251 MMRESULT16 WINAPI acmFilterDetails16(
252   HACMDRIVER16 had, LPACMFILTERDETAILS16 pafd, DWORD fdwDetails
253 );
254 MMRESULT16 WINAPI acmFilterEnum16(
255   HACMDRIVER16 had, LPACMFILTERDETAILS16 pafd,
256   ACMFILTERENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
257 );
258 MMRESULT16 WINAPI acmStreamOpen16(
259   LPHACMSTREAM16 phas, HACMDRIVER16 had,
260   LPWAVEFORMATEX pwfxSrc, LPWAVEFORMATEX pwfxDst,
261   LPWAVEFILTER pwfltr, DWORD dwCallback,
262   DWORD dwInstance, DWORD fdwOpen
263 );
264 MMRESULT16 WINAPI acmStreamClose16(
265   HACMSTREAM16 has, DWORD fdwClose
266 );
267 MMRESULT16 WINAPI acmStreamSize16(
268   HACMSTREAM16 has, DWORD cbInput,
269   LPDWORD pdwOutputBytes, DWORD fdwSize
270 );
271 MMRESULT16 WINAPI acmStreamConvert16(
272   HACMSTREAM16 has, LPACMSTREAMHEADER16 pash, DWORD fdwConvert
273 );
274 MMRESULT16 WINAPI acmStreamReset16(
275   HACMSTREAM16 has, DWORD fdwReset
276 );
277 MMRESULT16 WINAPI acmStreamPrepareHeader16(
278   HACMSTREAM16 has, LPACMSTREAMHEADER16 pash, DWORD fdwPrepare
279 );
280 MMRESULT16 WINAPI acmStreamUnprepareHeader16(
281   HACMSTREAM16 has, LPACMSTREAMHEADER16 pash, DWORD fdwUnprepare
282 );
283
284
285 /***********************************************************************
286  * Wine specific - Win32
287  */
288 typedef struct _WINE_ACMDRIVERID *PWINE_ACMDRIVERID;
289 typedef struct _WINE_ACMDRIVER   *PWINE_ACMDRIVER;
290
291 #define WINE_ACMOBJ_DONTCARE    0x5EED0000
292 #define WINE_ACMOBJ_DRIVERID    0x5EED0001
293 #define WINE_ACMOBJ_DRIVER      0x5EED0002
294 #define WINE_ACMOBJ_STREAM      0x5EED0003
295
296 typedef struct _WINE_ACMOBJ
297 {
298     DWORD               dwType;
299     PWINE_ACMDRIVERID   pACMDriverID;
300 } WINE_ACMOBJ, *PWINE_ACMOBJ;
301
302 typedef struct _WINE_ACMDRIVER
303 {
304     WINE_ACMOBJ         obj;
305     HDRVR               hDrvr;
306     PWINE_ACMDRIVER     pNextACMDriver;
307 } WINE_ACMDRIVER;
308
309 typedef struct _WINE_ACMSTREAM
310 {
311     WINE_ACMOBJ         obj;
312     PWINE_ACMDRIVER     pDrv;
313     ACMDRVSTREAMINSTANCE drvInst;
314     HACMDRIVER          hAcmDriver;
315 } WINE_ACMSTREAM, *PWINE_ACMSTREAM;
316
317 typedef struct _WINE_ACMDRIVERID
318 {
319     WINE_ACMOBJ         obj;
320     LPWSTR              pszDriverAlias;
321     LPWSTR              pszFileName;
322     HINSTANCE           hInstModule;          /* NULL if global */
323     PWINE_ACMDRIVER     pACMDriverList;
324     PWINE_ACMDRIVERID   pNextACMDriverID;
325     PWINE_ACMDRIVERID   pPrevACMDriverID;
326     /* information about the driver itself, either gotten from registry or driver itself */
327     DWORD               cFilterTags;
328     DWORD               cFormatTags;
329     DWORD               fdwSupport;
330     struct {
331         DWORD                   dwFormatTag;
332         DWORD                   cbwfx;
333     }*                  aFormatTag;
334 } WINE_ACMDRIVERID;
335
336 /* From internal.c */
337 extern HANDLE MSACM_hHeap;
338 extern PWINE_ACMDRIVERID MSACM_pFirstACMDriverID;
339 extern PWINE_ACMDRIVERID MSACM_pLastACMDriverID;
340 extern PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR pszFileName,
341                                               HINSTANCE hinstModule);
342 extern void MSACM_RegisterAllDrivers(void);
343 extern PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p);
344 extern void MSACM_UnregisterAllDrivers(void);
345 extern PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID);
346 extern PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver);
347 extern PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj, DWORD type);
348
349 extern MMRESULT MSACM_Message(HACMDRIVER, UINT, LPARAM, LPARAM);
350 extern BOOL MSACM_FindFormatTagInCache(WINE_ACMDRIVERID*, DWORD, LPDWORD);
351
352 /* From msacm32.c */
353 extern HINSTANCE MSACM_hInstance32;
354
355 /* From pcmcnvtr.c */
356 LRESULT CALLBACK        PCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg,
357                                        LPARAM dwParam1, LPARAM dwParam2);
358
359 /* Dialog box templates */
360 #include "msacmdlg.h"
361
362 #endif /* __WINE_WINEACM_H */