winecoreaudio: Create port for sending messages to the callback thread only once.
[wine] / dlls / msacm32 / 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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(void);
188 MMRESULT16 WINAPI acmMetrics16(
189   HACMOBJ16 hao, UINT16 uMetric, LPVOID pMetric
190 );
191 MMRESULT16 WINAPI acmDriverEnum16(
192   ACMDRIVERENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
193 );
194 MMRESULT16 WINAPI acmDriverDetails16(
195   HACMDRIVERID16 hadid, LPACMDRIVERDETAILS16 padd, DWORD fdwDetails
196 );
197 MMRESULT16 WINAPI acmDriverAdd16(
198   LPHACMDRIVERID16 phadid, HINSTANCE16 hinstModule,
199   LPARAM lParam, DWORD dwPriority, DWORD fdwAdd
200 );
201 MMRESULT16 WINAPI acmDriverRemove16(
202   HACMDRIVERID16 hadid, DWORD fdwRemove
203 );
204 MMRESULT16 WINAPI acmDriverOpen16(
205   LPHACMDRIVER16 phad, HACMDRIVERID16 hadid, DWORD fdwOpen
206 );
207 MMRESULT16 WINAPI acmDriverClose16(
208   HACMDRIVER16 had, DWORD fdwClose
209 );
210 LRESULT WINAPI acmDriverMessage16(
211   HACMDRIVER16 had, UINT16 uMsg, LPARAM lParam1, LPARAM lParam2
212 );
213 MMRESULT16 WINAPI acmDriverID16(
214   HACMOBJ16 hao, LPHACMDRIVERID16 phadid, DWORD fdwDriverID
215 );
216 MMRESULT16 WINAPI acmDriverPriority16(
217  HACMDRIVERID16 hadid, DWORD dwPriority, DWORD fdwPriority
218 );
219 MMRESULT16 WINAPI acmFormatTagDetails16(
220   HACMDRIVER16 had, LPACMFORMATTAGDETAILS16 paftd, DWORD fdwDetails
221 );
222 MMRESULT16 WINAPI acmFormatTagEnum16(
223   HACMDRIVER16 had, LPACMFORMATTAGDETAILS16 paftd,
224   ACMFORMATTAGENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
225 );
226 MMRESULT16 WINAPI acmFormatChoose16(
227   LPACMFORMATCHOOSE16 pafmtc
228 );
229 MMRESULT16 WINAPI acmFormatDetails16(
230   HACMDRIVER16 had, LPACMFORMATDETAILS16 pafd, DWORD fdwDetails
231 );
232 MMRESULT16 WINAPI acmFormatEnum16(
233   HACMDRIVER16 had, LPACMFORMATDETAILS16 pafd,
234   ACMFORMATENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
235 );
236 MMRESULT16 WINAPI acmFormatSuggest16(
237   HACMDRIVER16 had, LPWAVEFORMATEX pwfxSrc,
238   LPWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest
239 );
240 MMRESULT16 WINAPI acmFilterTagDetails16(
241   HACMDRIVER16 had, LPACMFILTERTAGDETAILS16 paftd, DWORD fdwDetails
242 );
243 MMRESULT16 WINAPI acmFilterTagEnum16(
244   HACMDRIVER16 had, LPACMFILTERTAGDETAILS16 paftd,
245   ACMFILTERTAGENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
246 );
247 MMRESULT16 WINAPI acmFilterChoose16(
248   LPACMFILTERCHOOSE16 pafltrc
249 );
250 MMRESULT16 WINAPI acmFilterDetails16(
251   HACMDRIVER16 had, LPACMFILTERDETAILS16 pafd, DWORD fdwDetails
252 );
253 MMRESULT16 WINAPI acmFilterEnum16(
254   HACMDRIVER16 had, LPACMFILTERDETAILS16 pafd,
255   ACMFILTERENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
256 );
257 MMRESULT16 WINAPI acmStreamOpen16(
258   LPHACMSTREAM16 phas, HACMDRIVER16 had,
259   LPWAVEFORMATEX pwfxSrc, LPWAVEFORMATEX pwfxDst,
260   LPWAVEFILTER pwfltr, DWORD dwCallback,
261   DWORD dwInstance, DWORD fdwOpen
262 );
263 MMRESULT16 WINAPI acmStreamClose16(
264   HACMSTREAM16 has, DWORD fdwClose
265 );
266 MMRESULT16 WINAPI acmStreamSize16(
267   HACMSTREAM16 has, DWORD cbInput,
268   LPDWORD pdwOutputBytes, DWORD fdwSize
269 );
270 MMRESULT16 WINAPI acmStreamConvert16(
271   HACMSTREAM16 has, LPACMSTREAMHEADER16 pash, DWORD fdwConvert
272 );
273 MMRESULT16 WINAPI acmStreamReset16(
274   HACMSTREAM16 has, DWORD fdwReset
275 );
276 MMRESULT16 WINAPI acmStreamPrepareHeader16(
277   HACMSTREAM16 has, LPACMSTREAMHEADER16 pash, DWORD fdwPrepare
278 );
279 MMRESULT16 WINAPI acmStreamUnprepareHeader16(
280   HACMSTREAM16 has, LPACMSTREAMHEADER16 pash, DWORD fdwUnprepare
281 );
282
283
284 /***********************************************************************
285  * Wine specific - Win32
286  */
287 typedef struct _WINE_ACMDRIVERID *PWINE_ACMDRIVERID;
288 typedef struct _WINE_ACMDRIVER   *PWINE_ACMDRIVER;
289
290 #define WINE_ACMOBJ_DONTCARE    0x5EED0000
291 #define WINE_ACMOBJ_DRIVERID    0x5EED0001
292 #define WINE_ACMOBJ_DRIVER      0x5EED0002
293 #define WINE_ACMOBJ_STREAM      0x5EED0003
294 #define WINE_ACMOBJ_NOTIFYWND   0x5EED0004
295 #define WINE_ACMOBJ_LOCALDRIVER 0x5EED0005
296
297 typedef struct _WINE_ACMOBJ
298 {
299     DWORD               dwType;
300     PWINE_ACMDRIVERID   pACMDriverID;
301 } WINE_ACMOBJ, *PWINE_ACMOBJ;
302
303 typedef struct _WINE_ACMLOCALDRIVER * PWINE_ACMLOCALDRIVER;
304 typedef struct _WINE_ACMLOCALDRIVERINST * PWINE_ACMLOCALDRIVERINST;
305 typedef struct _WINE_ACMLOCALDRIVER
306 {
307     WINE_ACMOBJ         obj;
308     HMODULE             hModule;
309     DRIVERPROC          lpDrvProc;
310     PWINE_ACMLOCALDRIVERINST pACMInstList;
311     PWINE_ACMLOCALDRIVER pNextACMLocalDrv;
312     PWINE_ACMLOCALDRIVER pPrevACMLocalDrv;
313 } WINE_ACMLOCALDRIVER;
314
315 typedef struct _WINE_ACMLOCALDRIVERINST
316 {
317     PWINE_ACMLOCALDRIVER pLocalDriver;
318     DWORD dwDriverID;
319     BOOL bSession;
320     PWINE_ACMLOCALDRIVERINST pNextACMInst;
321 } WINE_ACMLOCALDRIVERINST;
322
323 typedef struct _WINE_ACMDRIVER
324 {
325     WINE_ACMOBJ         obj;
326     HDRVR               hDrvr;
327     PWINE_ACMLOCALDRIVERINST pLocalDrvrInst;
328
329     PWINE_ACMDRIVER     pNextACMDriver;
330 } WINE_ACMDRIVER;
331
332 typedef struct _WINE_ACMSTREAM
333 {
334     WINE_ACMOBJ         obj;
335     PWINE_ACMDRIVER     pDrv;
336     ACMDRVSTREAMINSTANCE drvInst;
337     HACMDRIVER          hAcmDriver;
338 } WINE_ACMSTREAM, *PWINE_ACMSTREAM;
339
340 typedef struct _WINE_ACMDRIVERID
341 {
342     WINE_ACMOBJ         obj;
343     LPWSTR              pszDriverAlias;
344     LPWSTR              pszFileName;
345     PWINE_ACMLOCALDRIVER pLocalDriver;          /* NULL if global */
346     PWINE_ACMDRIVER     pACMDriverList;
347     PWINE_ACMDRIVERID   pNextACMDriverID;
348     PWINE_ACMDRIVERID   pPrevACMDriverID;
349     /* information about the driver itself, either gotten from registry or driver itself */
350     DWORD               cFilterTags;
351     DWORD               cFormatTags;
352     DWORD               fdwSupport;
353     struct {
354         DWORD                   dwFormatTag;
355         DWORD                   cbwfx;
356     }*                  aFormatTag;
357 } WINE_ACMDRIVERID;
358
359 typedef struct _WINE_ACMNOTIFYWND * PWINE_ACMNOTIFYWND;
360 typedef struct _WINE_ACMNOTIFYWND
361 {
362     WINE_ACMOBJ         obj;
363     HWND                hNotifyWnd;          /* Window to notify on ACM events: driver add, driver removal, priority change */
364     DWORD               dwNotifyMsg;         /* Notification message to send to window */
365     DWORD               fdwSupport;
366     PWINE_ACMNOTIFYWND  pNextACMNotifyWnd;
367     PWINE_ACMNOTIFYWND  pPrevACMNotifyWnd;
368 } WINE_ACMNOTIFYWND;
369
370 /* From internal.c */
371 extern HANDLE MSACM_hHeap;
372 extern PWINE_ACMDRIVERID MSACM_pFirstACMDriverID;
373 extern PWINE_ACMDRIVERID MSACM_pLastACMDriverID;
374 extern PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR pszFileName,
375                                               PWINE_ACMLOCALDRIVER pLocalDriver);
376 extern void MSACM_RegisterAllDrivers(void);
377 extern PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p);
378 extern void MSACM_UnregisterAllDrivers(void);
379 extern PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID);
380 extern PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver);
381 extern PWINE_ACMNOTIFYWND MSACM_GetNotifyWnd(HACMDRIVERID hDriver);
382 extern PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj, DWORD type);
383
384 extern MMRESULT MSACM_Message(HACMDRIVER, UINT, LPARAM, LPARAM);
385 extern BOOL MSACM_FindFormatTagInCache(WINE_ACMDRIVERID*, DWORD, LPDWORD);
386
387 extern void MSACM_RePositionDriver(PWINE_ACMDRIVERID, DWORD);
388 extern void MSACM_WriteCurrentPriorities(void);
389 extern void MSACM_BroadcastNotification(void);
390 extern void MSACM_DisableNotifications(void);
391 extern void MSACM_EnableNotifications(void);
392 extern PWINE_ACMNOTIFYWND MSACM_RegisterNotificationWindow(HWND hNotifyWnd, DWORD dwNotifyMsg);
393 extern PWINE_ACMNOTIFYWND MSACM_UnRegisterNotificationWindow(PWINE_ACMNOTIFYWND);
394
395 extern PWINE_ACMDRIVERID MSACM_RegisterDriverFromRegistry(LPCWSTR pszRegEntry);
396
397 extern PWINE_ACMLOCALDRIVER MSACM_RegisterLocalDriver(HMODULE hModule, DRIVERPROC lpDriverProc);
398 extern PWINE_ACMLOCALDRIVERINST MSACM_OpenLocalDriver(PWINE_ACMLOCALDRIVER, LPARAM);
399 extern LRESULT MSACM_CloseLocalDriver(PWINE_ACMLOCALDRIVERINST);
400 extern PWINE_ACMLOCALDRIVER MSACM_UnregisterLocalDriver(PWINE_ACMLOCALDRIVER);
401 /*
402 extern PWINE_ACMLOCALDRIVER MSACM_GetLocalDriver(HACMDRIVER hDriver);
403 */
404 /* From msacm32.c */
405 extern HINSTANCE MSACM_hInstance32;
406
407 /* From pcmcnvtr.c */
408 LRESULT CALLBACK        PCM_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
409                                        LPARAM dwParam1, LPARAM dwParam2);
410
411 /* Dialog box templates */
412 #include "msacmdlg.h"
413
414 #endif /* __WINE_WINEACM_H */