[XDK]
[reactos.git] / include / psdk / 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 #define DSDDESC_DONTNEEDWRITELEAD 0x00000020
56
57 #define DSDHEAP_NOHEAP 0
58 #define DSDHEAP_CREATEHEAP 1
59 #define DSDHEAP_USEDIRECTDRAWHEAP 2
60 #define DSDHEAP_PRIVATEHEAP 3
61
62 typedef struct _DSDRIVERDESC
63 {
64 DWORD dwFlags;
65 TCHAR szDesc[256];
66 TCHAR szDrvname[256];
67 DWORD_PTR dnDevNode;
68 WORD wVxdId;
69 WORD wReserved;
70 ULONG ulDeviceNum;
71 DWORD dwHeapType;
72 LPVOID pvDirectDrawHeap;
73 DWORD dwMemStartAddress;
74 DWORD dwMemEndAddress;
75 DWORD dwMemAllocExtra;
76 LPVOID pvReserved1;
77 LPVOID pvReserved2;
78 } DSDRIVERDESC,*PDSDRIVERDESC;
79
80
81
82
83 typedef struct _DSDRIVERCAPS
84 {
85 DWORD dwFlags;
86 DWORD dwMinSecondarySampleRate;
87 DWORD dwMaxSecondarySampleRate;
88 DWORD dwPrimaryBuffers;
89 DWORD dwMaxHwMixingAllBuffers;
90 DWORD dwMaxHwMixingStaticBuffers;
91 DWORD dwMaxHwMixingStreamingBuffers;
92 DWORD dwFreeHwMixingAllBuffers;
93 DWORD dwFreeHwMixingStaticBuffers;
94 DWORD dwFreeHwMixingStreamingBuffers;
95 DWORD dwMaxHw3DAllBuffers;
96 DWORD dwMaxHw3DStaticBuffers;
97 DWORD dwMaxHw3DStreamingBuffers;
98 DWORD dwFreeHw3DAllBuffers;
99 DWORD dwFreeHw3DStaticBuffers;
100 DWORD dwFreeHw3DStreamingBuffers;
101 DWORD dwTotalHwMemBytes;
102 DWORD dwFreeHwMemBytes;
103 DWORD dwMaxContigFreeHwMemBytes;
104 } DSDRIVERCAPS,*PDSDRIVERCAPS;
105
106 typedef struct _DSVOLUMEPAN
107 {
108 DWORD dwTotalLeftAmpFactor;
109 DWORD dwTotalRightAmpFactor;
110 LONG lVolume;
111 DWORD dwVolAmpFactor;
112 LONG lPan;
113 DWORD dwPanLeftAmpFactor;
114 DWORD dwPanRightAmpFactor;
115 } DSVOLUMEPAN,*PDSVOLUMEPAN;
116
117 typedef union _DSPROPERTY
118 {
119 struct {
120 GUID Set;
121 ULONG Id;
122 ULONG Flags;
123 ULONG_PTR InstanceId;
124 } DUMMYSTRUCTNAME;
125 ULONGLONG Alignment;
126 } DSPROPERTY,*PDSPROPERTY;
127
128 typedef struct _DSCDRIVERCAPS
129 {
130 DWORD dwSize;
131 DWORD dwFlags;
132 DWORD dwFormats;
133 DWORD dwChannels;
134 } DSCDRIVERCAPS,*PDSCDRIVERCAPS;
135
136 /*****************************************************************************
137 * IDsDriver interface
138 */
139 #define INTERFACE IDsDriver
140 DECLARE_INTERFACE_(IDsDriver,IUnknown)
141 {
142 /*** IUnknown methods ***/
143 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
144 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
145 STDMETHOD_(ULONG,Release)(THIS) PURE;
146 /*** IDsDriver methods ***/
147 STDMETHOD(GetDriverDesc)(THIS_ PDSDRIVERDESC pDsDriverDesc) PURE;
148 STDMETHOD(Open)(THIS) PURE;
149 STDMETHOD(Close)(THIS) PURE;
150 STDMETHOD(GetCaps)(THIS_ PDSDRIVERCAPS pDsDrvCaps) PURE;
151 STDMETHOD(CreateSoundBuffer)(THIS_ LPWAVEFORMATEX pwfx,DWORD dwFlags,DWORD dwCardAddress,LPDWORD pdwcbBufferSize,LPBYTE *ppbBuffer,LPVOID *ppvObj) PURE;
152 STDMETHOD(DuplicateSoundBuffer)(THIS_ PIDSDRIVERBUFFER pIDsDriverBuffer,LPVOID *ppvObj) PURE;
153 };
154 #undef INTERFACE
155
156 #if !defined (__cplusplus) || defined(CINTERFACE)
157 /*** IUnknown methods ***/
158 #define IDsDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
159 #define IDsDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
160 #define IDsDriver_Release(p) (p)->lpVtbl->Release(p)
161 /*** IDsDriver methods ***/
162 #define IDsDriver_GetDriverDesc(p,a) (p)->lpVtbl->GetDriverDesc(p,a)
163 #define IDsDriver_Open(p) (p)->lpVtbl->Open(p)
164 #define IDsDriver_Close(p) (p)->lpVtbl->Close(p)
165 #define IDsDriver_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
166 #define IDsDriver_CreateSoundBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c,d,e,f)
167 #define IDsDriver_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
168 #endif
169
170 /*****************************************************************************
171 * IDsDriverBuffer interface
172 */
173 #define INTERFACE IDsDriverBuffer
174 DECLARE_INTERFACE_(IDsDriverBuffer,IUnknown)
175 {
176 /*** IUnknown methods ***/
177 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
178 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
179 STDMETHOD_(ULONG,Release)(THIS) PURE;
180 /*** IDsDriverBuffer methods ***/
181 STDMETHOD(Lock)(THIS_ LPVOID *ppvAudio1,LPDWORD pdwLen1,LPVOID *pdwAudio2,LPDWORD pdwLen2,DWORD dwWritePosition,DWORD dwWriteLen,DWORD dwFlags) PURE;
182 STDMETHOD(Unlock)(THIS_ LPVOID pvAudio1,DWORD dwLen1,LPVOID pvAudio2,DWORD dwLen2) PURE;
183 STDMETHOD(SetFormat)(THIS_ LPWAVEFORMATEX pwfxToSet) PURE;
184 STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE;
185 STDMETHOD(SetVolumePan)(THIS_ PDSVOLUMEPAN pDsVolumePan) PURE;
186 STDMETHOD(SetPosition)(THIS_ DWORD dwNewPosition) PURE;
187 STDMETHOD(GetPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor,LPDWORD lpdwCurrentWriteCursor) PURE;
188 STDMETHOD(Play)(THIS_ DWORD dwReserved1,DWORD dwReserved2,DWORD dwFlags) PURE;
189 STDMETHOD(Stop)(THIS) PURE;
190 };
191 #undef INTERFACE
192
193 #if !defined (__cplusplus) || defined(CINTERFACE)
194 /*** IUnknown methods ***/
195 #define IDsDriverBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
196 #define IDsDriverBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
197 #define IDsDriverBuffer_Release(p) (p)->lpVtbl->Release(p)
198 /*** IDsDriverBuffer methods ***/
199 #define IDsDriverBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
200 #define IDsDriverBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
201 #define IDsDriverBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
202 #define IDsDriverBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
203 #define IDsDriverBuffer_SetVolumePan(p,a) (p)->lpVtbl->SetVolumePan(p,a)
204 #define IDsDriverBuffer_SetPosition(p,a) (p)->lpVtbl->SetPosition(p,a)
205 #define IDsDriverBuffer_GetPosition(p,a,b) (p)->lpVtbl->GetPosition(p,a,b)
206 #define IDsDriverBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
207 #define IDsDriverBuffer_Stop(p) (p)->lpVtbl->Stop(p)
208 #endif
209
210 /*****************************************************************************
211 * IDsDriverPropertySet interface
212 */
213 #define INTERFACE IDsDriverPropertySet
214 DECLARE_INTERFACE_(IDsDriverPropertySet,IUnknown)
215 {
216 /*** IUnknown methods ***/
217 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
218 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
219 STDMETHOD_(ULONG,Release)(THIS) PURE;
220 /*** IDsDriverPropertySet methods ***/
221 STDMETHOD(Get)(THIS_ PDSPROPERTY pDsProperty,LPVOID pPropertyParams,ULONG cbPropertyParams,LPVOID pPropertyData,ULONG cbPropertyData,PULONG pcbReturnedData) PURE;
222 STDMETHOD(Set)(THIS_ PDSPROPERTY pDsProperty,LPVOID pPropertyParams,ULONG cbPropertyParams,LPVOID pPropertyData,ULONG cbPropertyData) PURE;
223 STDMETHOD(QuerySupport)(THIS_ REFGUID PropertySetId,ULONG PropertyId,PULONG pSupport) PURE;
224 };
225 #undef INTERFACE
226
227 #if !defined (__cplusplus) || defined(CINTERFACE)
228 /*** IUnknown methods ***/
229 #define IDsDriverPropertySet_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
230 #define IDsDriverPropertySet_AddRef(p) (p)->lpVtbl->AddRef(p)
231 #define IDsDriverPropertySet_Release(p) (p)->lpVtbl->Release(p)
232 /*** IDsDriverPropertySet methods ***/
233 #define IDsDriverPropertySet_Get(p,a,b,c,d,e,f) (p)->lpVtbl->Get(p,a,b,c,d,e,f)
234 #define IDsDriverPropertySet_Set(p,a,b,c,d,e) (p)->lpVtbl->Set(p,a,b,c,d,e)
235 #define IDsDriverPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c)
236 #endif
237
238 /* Defined property sets */
239 DEFINE_GUID(DSPROPSETID_DirectSound3DListener, 0x6D047B40, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
240 typedef enum
241 {
242 DSPROPERTY_DIRECTSOUND3DLISTENER_ALL,
243 DSPROPERTY_DIRECTSOUND3DLISTENER_POSITION,
244 DSPROPERTY_DIRECTSOUND3DLISTENER_VELOCITY,
245 DSPROPERTY_DIRECTSOUND3DLISTENER_ORIENTATION,
246 DSPROPERTY_DIRECTSOUND3DLISTENER_DISTANCEFACTOR,
247 DSPROPERTY_DIRECTSOUND3DLISTENER_ROLLOFFFACTOR,
248 DSPROPERTY_DIRECTSOUND3DLISTENER_DOPPLERFACTOR,
249 DSPROPERTY_DIRECTSOUND3DLISTENER_BATCH,
250 DSPROPERTY_DIRECTSOUND3DLISTENER_ALLOCATION
251 } DSPROPERTY_DIRECTSOUND3DLISTENER;
252
253 DEFINE_GUID(DSPROPSETID_DirectSound3DBuffer, 0x6D047B41, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
254 typedef enum
255 {
256 DSPROPERTY_DIRECTSOUND3DBUFFER_ALL,
257 DSPROPERTY_DIRECTSOUND3DBUFFER_POSITION,
258 DSPROPERTY_DIRECTSOUND3DBUFFER_VELOCITY,
259 DSPROPERTY_DIRECTSOUND3DBUFFER_CONEANGLES,
260 DSPROPERTY_DIRECTSOUND3DBUFFER_CONEORIENTATION,
261 DSPROPERTY_DIRECTSOUND3DBUFFER_CONEOUTSIDEVOLUME,
262 DSPROPERTY_DIRECTSOUND3DBUFFER_MINDISTANCE,
263 DSPROPERTY_DIRECTSOUND3DBUFFER_MAXDISTANCE,
264 DSPROPERTY_DIRECTSOUND3DBUFFER_MODE
265 } DSPROPERTY_DIRECTSOUND3DBUFFER;
266
267 DEFINE_GUID(DSPROPSETID_DirectSoundSpeakerConfig, 0x6D047B42, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
268 typedef enum
269 {
270 DSPROPERTY_DIRECTSOUNDSPEAKERCONFIG_SPEAKERCONFIG
271 } DSPROPERTY_DIRECTSOUNDSPEAKERCONFIG;
272
273 /*****************************************************************************
274 * IDsDriverNotify interface
275 */
276 #define INTERFACE IDsDriverNotify
277 DECLARE_INTERFACE_(IDsDriverNotify,IUnknown)
278 {
279 /*** IUnknown methods ***/
280 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
281 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
282 STDMETHOD_(ULONG,Release)(THIS) PURE;
283 /*** IDsDriverNotify methods ***/
284 STDMETHOD(SetNotificationPositions)(THIS_ DWORD dwPositionNotifies,LPCDSBPOSITIONNOTIFY pcPositionNotifies) PURE;
285 };
286 #undef INTERFACE
287
288 #if !defined (__cplusplus) || defined(CINTERFACE)
289 /*** IUnknown methods ***/
290 #define IDsDriverNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
291 #define IDsDriverNotify_AddRef(p) (p)->lpVtbl->AddRef(p)
292 #define IDsDriverNotify_Release(p) (p)->lpVtbl->Release(p)
293 /*** IDsDriverNotify methods ***/
294 #define IDsDriverNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
295 #endif
296
297 /*****************************************************************************
298 * IDsCaptureDriver interface
299 */
300 #define INTERFACE IDsCaptureDriver
301 DECLARE_INTERFACE_(IDsCaptureDriver,IUnknown)
302 {
303 /*** IUnknown methods ***/
304 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
305 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
306 STDMETHOD_(ULONG,Release)(THIS) PURE;
307 /*** IDsCaptureDriver methods ***/
308 STDMETHOD(GetDriverDesc)(THIS_ PDSDRIVERDESC pDsDriverDesc) PURE;
309 STDMETHOD(Open)(THIS) PURE;
310 STDMETHOD(Close)(THIS) PURE;
311 STDMETHOD(GetCaps)(THIS_ PDSCDRIVERCAPS pDsDrvCaps) PURE;
312 STDMETHOD(CreateCaptureBuffer)(THIS_ LPWAVEFORMATEX pwfx,DWORD dwFlags,DWORD dwCardAddress,LPDWORD pdwcbBufferSize,LPBYTE *ppbBuffer,LPVOID *ppvObj) PURE;
313 };
314 #undef INTERFACE
315
316 #if !defined (__cplusplus) || defined(CINTERFACE)
317 /*** IUnknown methods ***/
318 #define IDsCaptureDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
319 #define IDsCaptureDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
320 #define IDsCaptureDriver_Release(p) (p)->lpVtbl->Release(p)
321 /*** IDsCaptureDriver methods ***/
322 #define IDsCaptureDriver_GetDriverDesc(p,a) (p)->lpVtbl->GetDriverDesc(p,a)
323 #define IDsCaptureDriver_Open(p) (p)->lpVtbl->Open(p)
324 #define IDsCaptureDriver_Close(p) (p)->lpVtbl->Close(p)
325 #define IDsCaptureDriver_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
326 #define IDsCaptureDriver_CreateCaptureBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c,d,e,f)
327 #endif
328
329 /*****************************************************************************
330 * IDsCaptureDriverBuffer interface
331 */
332 #define INTERFACE IDsCaptureDriverBuffer
333 DECLARE_INTERFACE_(IDsCaptureDriverBuffer,IUnknown)
334 {
335 /*** IUnknown methods ***/
336 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
337 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
338 STDMETHOD_(ULONG,Release)(THIS) PURE;
339 /*** IDsCaptureDriverBuffer methods ***/
340 STDMETHOD(Lock)(THIS_ LPVOID *ppvAudio1,LPDWORD pdwLen1,LPVOID *ppvAudio2,LPDWORD pdwLen2,DWORD dwWritePosition,DWORD dwWriteLen,DWORD dwFlags) PURE;
341 STDMETHOD(Unlock)(THIS_ LPVOID pvAudio1,DWORD dwLen1,LPVOID pvAudio2,DWORD dwLen2) PURE;
342 STDMETHOD(SetFormat)(THIS_ LPWAVEFORMATEX pwfxToSet) PURE;
343 STDMETHOD(GetPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor,LPDWORD lpdwCurrentWriteCursor) PURE;
344 STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
345 STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE;
346 STDMETHOD(Stop)(THIS) PURE;
347 };
348 #undef INTERFACE
349
350 #if !defined (__cplusplus) || defined(CINTERFACE)
351 /*** IUnknown methods ***/
352 #define IDsCaptureDriverBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
353 #define IDsCaptureDriverBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
354 #define IDsCaptureDriverBuffer_Release(p) (p)->lpVtbl->Release(p)
355 /*** IDsCaptureDriverBuffer methods ***/
356 #define IDsCaptureDriverBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
357 #define IDsCaptureDriverBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
358 #define IDsCaptureDriverBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
359 #define IDsCaptureDriverBuffer_GetPosition(p,a,b) (p)->lpVtbl->GetPosition(p,a,b)
360 #define IDsCaptureDriverBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
361 #define IDsCaptureDriverBuffer_Start(p,a) (p)->lpVtbl->Start(p,a)
362 #define IDsCaptureDriverBuffer_Stop(p) (p)->lpVtbl->Stop(p)
363 #endif
364
365 #ifdef __cplusplus
366 } /* extern "C" */
367 #endif
368
369 #endif /* __WINE_DSDRIVER_H */