move crt, ddk and GL includes
[reactos.git] / reactos / w32api / include / dsdriver.h
1 /*
2 * DirectSound driver
3 * (DirectX 5 version)
4 *
5 * Copyright (C) 2000 Ove Kaaven
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22 #ifndef __WINE_DSDRIVER_H
23 #define __WINE_DSDRIVER_H
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /*****************************************************************************
30 * Predeclare the interfaces
31 */
32 DEFINE_GUID(IID_IDsDriver, 0x8C4233C0l, 0xB4CC, 0x11CE, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
33 typedef struct IDsDriver *PIDSDRIVER;
34
35 DEFINE_GUID(IID_IDsDriverBuffer, 0x8C4233C1l, 0xB4CC, 0x11CE, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
36 typedef struct IDsDriverBuffer *PIDSDRIVERBUFFER;
37
38 DEFINE_GUID(IID_IDsDriverPropertySet, 0x0F6F2E8E0, 0xD842, 0x11D0, 0x8F, 0x75, 0x00, 0xC0, 0x4F, 0xC2, 0x8A, 0xCA);
39 typedef struct IDsDriverPropertySet *PIDSDRIVERPROPERTYSET;
40
41 DEFINE_GUID(IID_IDsDriverNotify, 0x00363EF44, 0x3B57, 0x11D3, 0xAC, 0x79, 0x00, 0x10, 0x5A, 0x01, 0x7f, 0xe1);
42 typedef struct IDsDriverNotify *PIDSDRIVERNOTIFY;
43
44 DEFINE_GUID(IID_IDsCaptureDriver, 0x03DD10C47, 0x74FB, 0x11D3, 0x90, 0x49, 0xCB, 0xB4, 0xB3, 0x2E, 0xAA, 0x08);
45 typedef struct IDsCaptureDriver *PIDSCDRIVER;
46
47 DEFINE_GUID(IID_IDsCaptureDriverBuffer, 0x03DD10C48, 0x74FB, 0x11D3, 0x90, 0x49, 0xCB, 0xB4, 0xB3, 0x2E, 0xAA, 0x08);
48 typedef struct IDsCaptureDriverBuffer *PIDSCDRIVERBUFFER;
49
50 #define DSDDESC_DOMMSYSTEMOPEN 0x00000001
51 #define DSDDESC_DOMMSYSTEMSETFORMAT 0x00000002
52 #define DSDDESC_USESYSTEMMEMORY 0x00000004
53 #define DSDDESC_DONTNEEDPRIMARYLOCK 0x00000008
54 #define DSDDESC_DONTNEEDSECONDARYLOCK 0x00000010
55
56 #define DSDHEAP_NOHEAP 0
57 #define DSDHEAP_CREATEHEAP 1
58 #define DSDHEAP_USEDIRECTDRAWHEAP 2
59 #define DSDHEAP_PRIVATEHEAP 3
60
61 typedef struct _DSDRIVERDESC
62 {
63 DWORD dwFlags;
64 TCHAR szDesc[256];
65 TCHAR szDrvname[256];
66 DWORD dnDevNode;
67 WORD wVxdId;
68 WORD wReserved;
69 ULONG ulDeviceNum;
70 DWORD dwHeapType;
71 LPVOID pvDirectDrawHeap;
72 DWORD dwMemStartAddress;
73 DWORD dwMemEndAddress;
74 DWORD dwMemAllocExtra;
75 LPVOID pvReserved1;
76 LPVOID pvReserved2;
77 } DSDRIVERDESC,*PDSDRIVERDESC;
78
79
80
81
82 typedef struct _DSDRIVERCAPS
83 {
84 DWORD dwFlags;
85 DWORD dwMinSecondarySampleRate;
86 DWORD dwMaxSecondarySampleRate;
87 DWORD dwPrimaryBuffers;
88 DWORD dwMaxHwMixingAllBuffers;
89 DWORD dwMaxHwMixingStaticBuffers;
90 DWORD dwMaxHwMixingStreamingBuffers;
91 DWORD dwFreeHwMixingAllBuffers;
92 DWORD dwFreeHwMixingStaticBuffers;
93 DWORD dwFreeHwMixingStreamingBuffers;
94 DWORD dwMaxHw3DAllBuffers;
95 DWORD dwMaxHw3DStaticBuffers;
96 DWORD dwMaxHw3DStreamingBuffers;
97 DWORD dwFreeHw3DAllBuffers;
98 DWORD dwFreeHw3DStaticBuffers;
99 DWORD dwFreeHw3DStreamingBuffers;
100 DWORD dwTotalHwMemBytes;
101 DWORD dwFreeHwMemBytes;
102 DWORD dwMaxContigFreeHwMemBytes;
103 } DSDRIVERCAPS,*PDSDRIVERCAPS;
104
105 typedef struct _DSVOLUMEPAN
106 {
107 DWORD dwTotalLeftAmpFactor;
108 DWORD dwTotalRightAmpFactor;
109 LONG lVolume;
110 DWORD dwVolAmpFactor;
111 LONG lPan;
112 DWORD dwPanLeftAmpFactor;
113 DWORD dwPanRightAmpFactor;
114 } DSVOLUMEPAN,*PDSVOLUMEPAN;
115
116 typedef union _DSPROPERTY
117 {
118 struct {
119 GUID Set;
120 ULONG Id;
121 ULONG Flags;
122 ULONG InstanceId;
123 } DUMMYSTRUCTNAME;
124 ULONGLONG Alignment;
125 } DSPROPERTY,*PDSPROPERTY;
126
127 typedef struct _DSCDRIVERCAPS
128 {
129 DWORD dwSize;
130 DWORD dwFlags;
131 DWORD dwFormats;
132 DWORD dwChannels;
133 } DSCDRIVERCAPS,*PDSCDRIVERCAPS;
134
135 /*****************************************************************************
136 * IDsDriver interface
137 */
138 #define INTERFACE IDsDriver
139 DECLARE_INTERFACE_(IDsDriver,IUnknown)
140 {
141 /*** IUnknown methods ***/
142 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
143 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
144 STDMETHOD_(ULONG,Release)(THIS) PURE;
145 /*** IDsDriver methods ***/
146 STDMETHOD(GetDriverDesc)(THIS_ PDSDRIVERDESC pDsDriverDesc) PURE;
147 STDMETHOD(Open)(THIS) PURE;
148 STDMETHOD(Close)(THIS) PURE;
149 STDMETHOD(GetCaps)(THIS_ PDSDRIVERCAPS pDsDrvCaps) PURE;
150 STDMETHOD(CreateSoundBuffer)(THIS_ LPWAVEFORMATEX pwfx,DWORD dwFlags,DWORD dwCardAddress,LPDWORD pdwcbBufferSize,LPBYTE *ppbBuffer,LPVOID *ppvObj) PURE;
151 STDMETHOD(DuplicateSoundBuffer)(THIS_ PIDSDRIVERBUFFER pIDsDriverBuffer,LPVOID *ppvObj) PURE;
152 };
153 #undef INTERFACE
154
155 #if !defined (__cplusplus) || defined(CINTERFACE)
156 /*** IUnknown methods ***/
157 #define IDsDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
158 #define IDsDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
159 #define IDsDriver_Release(p) (p)->lpVtbl->Release(p)
160 /*** IDsDriver methods ***/
161 #define IDsDriver_GetDriverDesc(p,a) (p)->lpVtbl->GetDriverDesc(p,a)
162 #define IDsDriver_Open(p) (p)->lpVtbl->Open(p)
163 #define IDsDriver_Close(p) (p)->lpVtbl->Close(p)
164 #define IDsDriver_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
165 #define IDsDriver_CreateSoundBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c,d,e,f)
166 #define IDsDriver_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
167 #endif
168
169 /*****************************************************************************
170 * IDsDriverBuffer interface
171 */
172 #define INTERFACE IDsDriverBuffer
173 DECLARE_INTERFACE_(IDsDriverBuffer,IUnknown)
174 {
175 /*** IUnknown methods ***/
176 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
177 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
178 STDMETHOD_(ULONG,Release)(THIS) PURE;
179 /*** IDsDriverBuffer methods ***/
180 STDMETHOD(Lock)(THIS_ LPVOID *ppvAudio1,LPDWORD pdwLen1,LPVOID *pdwAudio2,LPDWORD pdwLen2,DWORD dwWritePosition,DWORD dwWriteLen,DWORD dwFlags) PURE;
181 STDMETHOD(Unlock)(THIS_ LPVOID pvAudio1,DWORD dwLen1,LPVOID pvAudio2,DWORD dwLen2) PURE;
182 STDMETHOD(SetFormat)(THIS_ LPWAVEFORMATEX pwfxToSet) PURE;
183 STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE;
184 STDMETHOD(SetVolumePan)(THIS_ PDSVOLUMEPAN pDsVolumePan) PURE;
185 STDMETHOD(SetPosition)(THIS_ DWORD dwNewPosition) PURE;
186 STDMETHOD(GetPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor,LPDWORD lpdwCurrentWriteCursor) PURE;
187 STDMETHOD(Play)(THIS_ DWORD dwReserved1,DWORD dwReserved2,DWORD dwFlags) PURE;
188 STDMETHOD(Stop)(THIS) PURE;
189 };
190 #undef INTERFACE
191
192 #if !defined (__cplusplus) || defined(CINTERFACE)
193 /*** IUnknown methods ***/
194 #define IDsDriverBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
195 #define IDsDriverBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
196 #define IDsDriverBuffer_Release(p) (p)->lpVtbl->Release(p)
197 /*** IDsDriverBuffer methods ***/
198 #define IDsDriverBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
199 #define IDsDriverBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
200 #define IDsDriverBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
201 #define IDsDriverBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
202 #define IDsDriverBuffer_SetVolumePan(p,a) (p)->lpVtbl->SetVolumePan(p,a)
203 #define IDsDriverBuffer_SetPosition(p,a) (p)->lpVtbl->SetPosition(p,a)
204 #define IDsDriverBuffer_GetPosition(p,a,b) (p)->lpVtbl->GetPosition(p,a,b)
205 #define IDsDriverBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
206 #define IDsDriverBuffer_Stop(p) (p)->lpVtbl->Stop(p)
207 #endif
208
209 /*****************************************************************************
210 * IDsDriverPropertySet interface
211 */
212 #define INTERFACE IDsDriverPropertySet
213 DECLARE_INTERFACE_(IDsDriverPropertySet,IUnknown)
214 {
215 /*** IUnknown methods ***/
216 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
217 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
218 STDMETHOD_(ULONG,Release)(THIS) PURE;
219 /*** IDsDriverPropertySet methods ***/
220 STDMETHOD(Get)(THIS_ PDSPROPERTY pDsProperty,LPVOID pPropertyParams,ULONG cbPropertyParams,LPVOID pPropertyData,ULONG cbPropertyData,PULONG pcbReturnedData) PURE;
221 STDMETHOD(Set)(THIS_ PDSPROPERTY pDsProperty,LPVOID pPropertyParams,ULONG cbPropertyParams,LPVOID pPropertyData,ULONG cbPropertyData) PURE;
222 STDMETHOD(QuerySupport)(THIS_ REFGUID PropertySetId,ULONG PropertyId,PULONG pSupport) PURE;
223 };
224 #undef INTERFACE
225
226 #if !defined (__cplusplus) || defined(CINTERFACE)
227 /*** IUnknown methods ***/
228 #define IDsDriverPropertySet_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
229 #define IDsDriverPropertySet_AddRef(p) (p)->lpVtbl->AddRef(p)
230 #define IDsDriverPropertySet_Release(p) (p)->lpVtbl->Release(p)
231 /*** IDsDriverPropertySet methods ***/
232 #define IDsDriverPropertySet_Get(p,a,b,c,d,e,f) (p)->lpVtbl->Get(p,a,b,c,d,e,f)
233 #define IDsDriverPropertySet_Set(p,a,b,c,d,e) (p)->lpVtbl->Set(p,a,b,c,d,e)
234 #define IDsDriverPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c)
235 #endif
236
237 /* Defined property sets */
238 DEFINE_GUID(DSPROPSETID_DirectSound3DListener, 0x6D047B40, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
239 typedef enum
240 {
241 DSPROPERTY_DIRECTSOUND3DLISTENER_ALL,
242 DSPROPERTY_DIRECTSOUND3DLISTENER_POSITION,
243 DSPROPERTY_DIRECTSOUND3DLISTENER_VELOCITY,
244 DSPROPERTY_DIRECTSOUND3DLISTENER_ORIENTATION,
245 DSPROPERTY_DIRECTSOUND3DLISTENER_DISTANCEFACTOR,
246 DSPROPERTY_DIRECTSOUND3DLISTENER_ROLLOFFFACTOR,
247 DSPROPERTY_DIRECTSOUND3DLISTENER_DOPPLERFACTOR,
248 DSPROPERTY_DIRECTSOUND3DLISTENER_BATCH,
249 DSPROPERTY_DIRECTSOUND3DLISTENER_ALLOCATION
250 } DSPROPERTY_DIRECTSOUND3DLISTENER;
251
252 DEFINE_GUID(DSPROPSETID_DirectSound3DBuffer, 0x6D047B41, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
253 typedef enum
254 {
255 DSPROPERTY_DIRECTSOUND3DBUFFER_ALL,
256 DSPROPERTY_DIRECTSOUND3DBUFFER_POSITION,
257 DSPROPERTY_DIRECTSOUND3DBUFFER_VELOCITY,
258 DSPROPERTY_DIRECTSOUND3DBUFFER_CONEANGLES,
259 DSPROPERTY_DIRECTSOUND3DBUFFER_CONEORIENTATION,
260 DSPROPERTY_DIRECTSOUND3DBUFFER_CONEOUTSIDEVOLUME,
261 DSPROPERTY_DIRECTSOUND3DBUFFER_MINDISTANCE,
262 DSPROPERTY_DIRECTSOUND3DBUFFER_MAXDISTANCE,
263 DSPROPERTY_DIRECTSOUND3DBUFFER_MODE
264 } DSPROPERTY_DIRECTSOUND3DBUFFER;
265
266 DEFINE_GUID(DSPROPSETID_DirectSoundSpeakerConfig, 0x6D047B42, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
267 typedef enum
268 {
269 DSPROPERTY_DIRECTSOUNDSPEAKERCONFIG_SPEAKERCONFIG
270 } DSPROPERTY_DIRECTSOUNDSPEAKERCONFIG;
271
272 /*****************************************************************************
273 * IDsDriverNotify interface
274 */
275 #define INTERFACE IDsDriverNotify
276 DECLARE_INTERFACE_(IDsDriverNotify,IUnknown)
277 {
278 /*** IUnknown methods ***/
279 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
280 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
281 STDMETHOD_(ULONG,Release)(THIS) PURE;
282 /*** IDsDriverNotify methods ***/
283 STDMETHOD(SetNotificationPositions)(THIS_ DWORD dwPositionNotifies,LPCDSBPOSITIONNOTIFY pcPositionNotifies) PURE;
284 };
285 #undef INTERFACE
286
287 #if !defined (__cplusplus) || defined(CINTERFACE)
288 /*** IUnknown methods ***/
289 #define IDsDriverNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
290 #define IDsDriverNotify_AddRef(p) (p)->lpVtbl->AddRef(p)
291 #define IDsDriverNotify_Release(p) (p)->lpVtbl->Release(p)
292 /*** IDsDriverNotify methods ***/
293 #define IDsDriverNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
294 #endif
295
296 /*****************************************************************************
297 * IDsCaptureDriver interface
298 */
299 #define INTERFACE IDsCaptureDriver
300 DECLARE_INTERFACE_(IDsCaptureDriver,IUnknown)
301 {
302 /*** IUnknown methods ***/
303 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
304 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
305 STDMETHOD_(ULONG,Release)(THIS) PURE;
306 /*** IDsCaptureDriver methods ***/
307 STDMETHOD(GetDriverDesc)(THIS_ PDSDRIVERDESC pDsDriverDesc) PURE;
308 STDMETHOD(Open)(THIS) PURE;
309 STDMETHOD(Close)(THIS) PURE;
310 STDMETHOD(GetCaps)(THIS_ PDSCDRIVERCAPS pDsDrvCaps) PURE;
311 STDMETHOD(CreateCaptureBuffer)(THIS_ LPWAVEFORMATEX pwfx,DWORD dwFlags,DWORD dwCardAddress,LPDWORD pdwcbBufferSize,LPBYTE *ppbBuffer,LPVOID *ppvObj) PURE;
312 };
313 #undef INTERFACE
314
315 #if !defined (__cplusplus) || defined(CINTERFACE)
316 /*** IUnknown methods ***/
317 #define IDsCaptureDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
318 #define IDsCaptureDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
319 #define IDsCaptureDriver_Release(p) (p)->lpVtbl->Release(p)
320 /*** IDsCaptureDriver methods ***/
321 #define IDsCaptureDriver_GetDriverDesc(p,a) (p)->lpVtbl->GetDriverDesc(p,a)
322 #define IDsCaptureDriver_Open(p) (p)->lpVtbl->Open(p)
323 #define IDsCaptureDriver_Close(p) (p)->lpVtbl->Close(p)
324 #define IDsCaptureDriver_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
325 #define IDsCaptureDriver_CreateCaptureBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c,d,e,f)
326 #endif
327
328 /*****************************************************************************
329 * IDsCaptureDriverBuffer interface
330 */
331 #define INTERFACE IDsCaptureDriverBuffer
332 DECLARE_INTERFACE_(IDsCaptureDriverBuffer,IUnknown)
333 {
334 /*** IUnknown methods ***/
335 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
336 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
337 STDMETHOD_(ULONG,Release)(THIS) PURE;
338 /*** IDsCaptureDriverBuffer methods ***/
339 STDMETHOD(Lock)(THIS_ LPVOID *ppvAudio1,LPDWORD pdwLen1,LPVOID *ppvAudio2,LPDWORD pdwLen2,DWORD dwWritePosition,DWORD dwWriteLen,DWORD dwFlags) PURE;
340 STDMETHOD(Unlock)(THIS_ LPVOID pvAudio1,DWORD dwLen1,LPVOID pvAudio2,DWORD dwLen2) PURE;
341 STDMETHOD(SetFormat)(THIS_ LPWAVEFORMATEX pwfxToSet) PURE;
342 STDMETHOD(GetPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor,LPDWORD lpdwCurrentWriteCursor) PURE;
343 STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
344 STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE;
345 STDMETHOD(Stop)(THIS) PURE;
346 };
347 #undef INTERFACE
348
349 #if !defined (__cplusplus) || defined(CINTERFACE)
350 /*** IUnknown methods ***/
351 #define IDsCaptureDriverBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
352 #define IDsCaptureDriverBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
353 #define IDsCaptureDriverBuffer_Release(p) (p)->lpVtbl->Release(p)
354 /*** IDsCaptureDriverBuffer methods ***/
355 #define IDsCaptureDriverBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
356 #define IDsCaptureDriverBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
357 #define IDsCaptureDriverBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
358 #define IDsCaptureDriverBuffer_GetPosition(p,a,b) (p)->lpVtbl->GetPosition(p,a,b)
359 #define IDsCaptureDriverBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
360 #define IDsCaptureDriverBuffer_Start(p,a) (p)->lpVtbl->Start(p,a)
361 #define IDsCaptureDriverBuffer_Stop(p) (p)->lpVtbl->Stop(p)
362 #endif
363
364 #ifdef __cplusplus
365 } /* extern "C" */
366 #endif
367
368 #endif /* __WINE_DSDRIVER_H */