- Some fixes on DirectSound init (need SetCooperativeLevel as seen in
[wine] / include / dsound.h
1 /*
2  * Copyright (C) the Wine project
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef __WINE_DSOUND_H
20 #define __WINE_DSOUND_H
21
22 #ifndef DIRECTSOUND_VERSION
23 #define DIRECTSOUND_VERSION 0x0800
24 #endif
25
26 #define COM_NO_WINDOWS_H
27 #include <objbase.h>
28 #include <float.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* defined(__cplusplus) */
33
34 #ifndef DX_SHARED_DEFINES
35
36 typedef float D3DVALUE, *LPD3DVALUE;
37
38 #ifndef D3DCOLOR_DEFINED
39 typedef DWORD D3DCOLOR, *LPD3DCOLOR;
40 #define D3DCOLOR_DEFINED
41 #endif
42
43 #ifndef D3DVECTOR_DEFINED
44 typedef struct _D3DVECTOR {
45     float x;
46     float y;
47     float z;
48 } D3DVECTOR, *LPD3DVECTOR;
49 #define D3DVECTOR_DEFINED
50 #endif
51
52 #define DX_SHARED_DEFINES
53 #endif /* DX_SHARED_DEFINES */
54
55 /*****************************************************************************
56  * Predeclare the interfaces
57  */
58 DEFINE_GUID(CLSID_DirectSound,          0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
59 DEFINE_GUID(CLSID_DirectSound8,         0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b);
60 DEFINE_GUID(CLSID_DirectSoundCapture,   0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x08, 0x00, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
61 DEFINE_GUID(CLSID_DirectSoundCapture8,  0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1);
62 DEFINE_GUID(CLSID_DirectSoundFullDuplex,0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d);
63
64 DEFINE_GUID(IID_IDirectSound,           0x279AFA83,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
65 typedef struct IDirectSound IDirectSound,*LPDIRECTSOUND;
66
67 DEFINE_GUID(IID_IDirectSound8,          0xC50A7E93,0xF395,0x4834,0x9E,0xF6,0x7F,0xA9,0x9D,0xE5,0x09,0x66);
68 typedef struct IDirectSound8 IDirectSound8,*LPDIRECTSOUND8;
69
70 DEFINE_GUID(IID_IDirectSoundBuffer,     0x279AFA85,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
71 typedef struct IDirectSoundBuffer IDirectSoundBuffer,*LPDIRECTSOUNDBUFFER,**LPLPDIRECTSOUNDBUFFER;
72
73 DEFINE_GUID(IID_IDirectSoundBuffer8,    0x6825A449,0x7524,0x4D82,0x92,0x0F,0x50,0xE3,0x6A,0xB3,0xAB,0x1E);
74 typedef struct IDirectSoundBuffer8 IDirectSoundBuffer8,*LPDIRECTSOUNDBUFFER8,**LPLPDIRECTSOUNDBUFFER8;
75
76 DEFINE_GUID(IID_IDirectSoundNotify,     0xB0210783,0x89cd,0x11d0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
77 typedef struct IDirectSoundNotify IDirectSoundNotify,*LPDIRECTSOUNDNOTIFY;
78 #define IID_IDirectSoundNotify8         IID_IDirectSoundNotify
79
80 DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
81 typedef struct IDirectSound3DListener IDirectSound3DListener,*LPDIRECTSOUND3DLISTENER;
82
83 DEFINE_GUID(IID_IDirectSound3DBuffer,   0x279AFA86,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
84 typedef struct IDirectSound3DBuffer IDirectSound3DBuffer,*LPDIRECTSOUND3DBUFFER;
85
86 DEFINE_GUID(IID_IDirectSoundCapture,    0xB0210781,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
87 typedef struct IDirectSoundCapture IDirectSoundCapture,*LPDIRECTSOUNDCAPTURE;
88 #define IID_IDirectSoundCapture8        IID_IDirectSoundCapture
89 typedef struct IDirectSoundCapture IDirectSoundCapture8,*LPDIRECTSOUNDCAPTURE8;
90
91 DEFINE_GUID(IID_IDirectSoundCaptureBuffer,0xB0210782,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
92 typedef struct IDirectSoundCaptureBuffer IDirectSoundCaptureBuffer,*LPDIRECTSOUNDCAPTUREBUFFER;
93
94 DEFINE_GUID(IID_IDirectSoundCaptureBuffer8,0x00990DF4,0x0DBB,0x4872,0x83,0x3E,0x6D,0x30,0x3E,0x80,0xAE,0xB6);
95 typedef struct IDirectSoundCaptureBuffer8 IDirectSoundCaptureBuffer8,*LPDIRECTSOUNDCAPTUREBUFFER8,**LPLPDIRECTSOUNDCAPTUREBUFFER8;
96
97 DEFINE_GUID(IID_IDirectSoundFullDuplex, 0xEDCB4C7A,0xDAAB,0x4216,0xA4,0x2E,0x6C,0x50,0x59,0x6D,0xDC,0x1D);
98 typedef struct IDirectSoundFullDuplex IDirectSoundFullDuplex,*LPDIRECTSOUNDFULLDUPLEX;
99 #define IID_IDirectSoundFullDuplex8     IID_IDirectSoundFullDuplex
100
101 DEFINE_GUID(DSDEVID_DefaultPlayback,     0xDEF00000,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
102 DEFINE_GUID(DSDEVID_DefaultCapture,      0xDEF00001,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
103 DEFINE_GUID(DSDEVID_DefaultVoicePlayback,0xDEF00002,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
104 DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xDEF00003,0x9C6D,0x47ED,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
105
106 DEFINE_GUID(DSDEVID_WinePlayback,        0x40316A1D,0x605B,0xD611,0x87,0xC6,0x00,0x80,0xAD,0x00,0x02,0xFE);
107
108 #define _FACDS          0x878
109 #define MAKE_DSHRESULT(code)            MAKE_HRESULT(1,_FACDS,code)
110
111 #define DS_OK                           0
112 #define DSERR_ALLOCATED                 MAKE_DSHRESULT(10)
113 #define DSERR_CONTROLUNAVAIL            MAKE_DSHRESULT(30)
114 #define DSERR_INVALIDPARAM              E_INVALIDARG
115 #define DSERR_INVALIDCALL               MAKE_DSHRESULT(50)
116 #define DSERR_GENERIC                   E_FAIL
117 #define DSERR_PRIOLEVELNEEDED           MAKE_DSHRESULT(70)
118 #define DSERR_OUTOFMEMORY               E_OUTOFMEMORY
119 #define DSERR_BADFORMAT                 MAKE_DSHRESULT(100)
120 #define DSERR_UNSUPPORTED               E_NOTIMPL
121 #define DSERR_NODRIVER                  MAKE_DSHRESULT(120)
122 #define DSERR_ALREADYINITIALIZED        MAKE_DSHRESULT(130)
123 #define DSERR_NOAGGREGATION             CLASS_E_NOAGGREGATION
124 #define DSERR_BUFFERLOST                MAKE_DSHRESULT(150)
125 #define DSERR_OTHERAPPHASPRIO           MAKE_DSHRESULT(160)
126 #define DSERR_UNINITIALIZED             MAKE_DSHRESULT(170)
127
128 #define DSCAPS_PRIMARYMONO          0x00000001
129 #define DSCAPS_PRIMARYSTEREO        0x00000002
130 #define DSCAPS_PRIMARY8BIT          0x00000004
131 #define DSCAPS_PRIMARY16BIT         0x00000008
132 #define DSCAPS_CONTINUOUSRATE       0x00000010
133 #define DSCAPS_EMULDRIVER           0x00000020
134 #define DSCAPS_CERTIFIED            0x00000040
135 #define DSCAPS_SECONDARYMONO        0x00000100
136 #define DSCAPS_SECONDARYSTEREO      0x00000200
137 #define DSCAPS_SECONDARY8BIT        0x00000400
138 #define DSCAPS_SECONDARY16BIT       0x00000800
139
140 #define DSSCL_NORMAL            1
141 #define DSSCL_PRIORITY          2
142 #define DSSCL_EXCLUSIVE         3
143 #define DSSCL_WRITEPRIMARY      4
144
145 typedef struct _DSCAPS
146 {
147     DWORD       dwSize;
148     DWORD       dwFlags;
149     DWORD       dwMinSecondarySampleRate;
150     DWORD       dwMaxSecondarySampleRate;
151     DWORD       dwPrimaryBuffers;
152     DWORD       dwMaxHwMixingAllBuffers;
153     DWORD       dwMaxHwMixingStaticBuffers;
154     DWORD       dwMaxHwMixingStreamingBuffers;
155     DWORD       dwFreeHwMixingAllBuffers;
156     DWORD       dwFreeHwMixingStaticBuffers;
157     DWORD       dwFreeHwMixingStreamingBuffers;
158     DWORD       dwMaxHw3DAllBuffers;
159     DWORD       dwMaxHw3DStaticBuffers;
160     DWORD       dwMaxHw3DStreamingBuffers;
161     DWORD       dwFreeHw3DAllBuffers;
162     DWORD       dwFreeHw3DStaticBuffers;
163     DWORD       dwFreeHw3DStreamingBuffers;
164     DWORD       dwTotalHwMemBytes;
165     DWORD       dwFreeHwMemBytes;
166     DWORD       dwMaxContigFreeHwMemBytes;
167     DWORD       dwUnlockTransferRateHwBuffers;
168     DWORD       dwPlayCpuOverheadSwBuffers;
169     DWORD       dwReserved1;
170     DWORD       dwReserved2;
171 } DSCAPS,*LPDSCAPS;
172
173 #define DSBPLAY_LOOPING         0x00000001
174
175 #define DSBSTATUS_PLAYING           0x00000001
176 #define DSBSTATUS_BUFFERLOST        0x00000002
177 #define DSBSTATUS_LOOPING           0x00000004
178
179
180 #define DSBLOCK_FROMWRITECURSOR     0x00000001
181 #define DSBLOCK_ENTIREBUFFER        0x00000002
182
183 #define DSBCAPS_PRIMARYBUFFER       0x00000001
184 #define DSBCAPS_STATIC              0x00000002
185 #define DSBCAPS_LOCHARDWARE         0x00000004
186 #define DSBCAPS_LOCSOFTWARE         0x00000008
187 #define DSBCAPS_CTRL3D              0x00000010
188 #define DSBCAPS_CTRLFREQUENCY       0x00000020
189 #define DSBCAPS_CTRLPAN             0x00000040
190 #define DSBCAPS_CTRLVOLUME          0x00000080
191 #define DSBCAPS_CTRLPOSITIONNOTIFY  0x00000100
192 #define DSBCAPS_CTRLFX              0x00000200
193 #define DSBCAPS_CTRLDEFAULT         0x000000E0  /* Pan + volume + frequency. */
194 #define DSBCAPS_CTRLALL             0x000001F0  /* All control capabilities */
195 #define DSBCAPS_STICKYFOCUS         0x00004000
196 #define DSBCAPS_GLOBALFOCUS         0x00008000
197 #define DSBCAPS_GETCURRENTPOSITION2 0x00010000  /* More accurate play cursor under emulation*/
198 #define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
199
200 #define DSBSIZE_MIN                 4
201 #define DSBSIZE_MAX                 0xFFFFFFF
202 #define DSBPAN_LEFT                 -10000
203 #define DSBPAN_RIGHT                 10000
204 #define DSBVOLUME_MAX                    0
205 #define DSBVOLUME_MIN               -10000
206 #define DSBFREQUENCY_MIN            100
207 #define DSBFREQUENCY_MAX            100000
208 #define DSBFREQUENCY_ORIGINAL       0
209
210 typedef struct _DSBCAPS
211 {
212     DWORD       dwSize;
213     DWORD       dwFlags;
214     DWORD       dwBufferBytes;
215     DWORD       dwUnlockTransferRate;
216     DWORD       dwPlayCpuOverhead;
217 } DSBCAPS,*LPDSBCAPS;
218
219 #define DSSCL_NORMAL                1
220 #define DSSCL_PRIORITY              2
221 #define DSSCL_EXCLUSIVE             3
222 #define DSSCL_WRITEPRIMARY          4
223
224 typedef struct _DSEFFECTDESC
225 {
226     DWORD       dwSize;
227     DWORD       dwFlags;
228     GUID        guidDSFXClass;
229     DWORD_PTR   dwReserved1;
230     DWORD_PTR   dwReserved2;
231 } DSEFFECTDESC,*LPDSEFFECTDESC;
232 typedef const DSEFFECTDESC *LPCDSEFFECTDESC;
233
234 #define DSFX_LOCHARDWARE    0x00000001
235 #define DSFX_LOCSOFTWARE    0x00000002
236
237 enum
238 {
239     DSFXR_PRESENT,
240     DSFXR_LOCHARDWARE,
241     DSFXR_LOCSOFTWARE,
242     DSFXR_UNALLOCATED,
243     DSFXR_FAILED,
244     DSFXR_UNKNOWN,
245     DSFXR_SENDLOOP
246 };
247
248 typedef struct _DSBUFFERDESC
249 {
250     DWORD               dwSize;
251     DWORD               dwFlags;
252     DWORD               dwBufferBytes;
253     DWORD               dwReserved;
254     LPWAVEFORMATEX      lpwfxFormat;
255 #if DIRECTSOUND_VERSION >= 0x0700
256     GUID                guid3DAlgorithm;
257 #endif
258 } DSBUFFERDESC,*LPDSBUFFERDESC;
259 typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
260
261 typedef struct _DSBPOSITIONNOTIFY
262 {
263     DWORD       dwOffset;
264     HANDLE      hEventNotify;
265 } DSBPOSITIONNOTIFY,*LPDSBPOSITIONNOTIFY;
266 typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
267
268 #define DSSPEAKER_HEADPHONE     1
269 #define DSSPEAKER_MONO          2
270 #define DSSPEAKER_QUAD          3
271 #define DSSPEAKER_STEREO        4
272 #define DSSPEAKER_SURROUND      5
273
274 #define DSSPEAKER_GEOMETRY_MIN      0x00000005  /* 5 degrees */
275 #define DSSPEAKER_GEOMETRY_NARROW   0x0000000A  /* 10 degrees */
276 #define DSSPEAKER_GEOMETRY_WIDE     0x00000014  /* 20 degrees */
277 #define DSSPEAKER_GEOMETRY_MAX      0x000000B4  /* 180 degrees */
278
279 #define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
280 #define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
281 #define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
282
283 #define DS_CERTIFIED                0x00000000
284 #define DS_UNCERTIFIED              0x00000001
285
286 typedef struct _DSCBUFFERDESC
287 {
288   DWORD          dwSize;
289   DWORD          dwFlags;
290   DWORD          dwBufferBytes;
291   DWORD          dwReserved;
292   LPWAVEFORMATEX lpwfxFormat;
293 } DSCBUFFERDESC, *LPDSCBUFFERDESC;
294 typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
295
296 typedef struct _DSCCAPS
297 {
298   DWORD dwSize;
299   DWORD dwFlags;
300   DWORD dwFormats;
301   DWORD dwChannels;
302 } DSCCAPS, *LPDSCCAPS;
303 typedef const DSCCAPS *LPCDSCCAPS;
304
305 typedef struct _DSCBCAPS
306 {
307   DWORD dwSize;
308   DWORD dwFlags;
309   DWORD dwBufferBytes;
310   DWORD dwReserved;
311 } DSCBCAPS, *LPDSCBCAPS;
312 typedef const DSCBCAPS *LPCDSCBCAPS;
313
314 #define DSCCAPS_EMULDRIVER          DSCAPS_EMULDRIVER
315 #define DSCCAPS_CERTIFIED           DSCAPS_CERTIFIED
316
317 #define DSCBCAPS_WAVEMAPPED         0x80000000
318 #define DSCBCAPS_CTRLFX             0x00000200
319
320 #define DSCBLOCL_ENTIREBUFFER       0x00000001
321 #define DSCBSTART_LOOPING           0x00000001
322 #define DSCBPN_OFFSET_STOP          0xffffffff
323
324 #define DSCBSTATUS_CAPTURING        0x00000001
325 #define DSCBSTATUS_LOOPING          0x00000002
326
327 #ifndef __LPCGUID_DEFINED__
328 #define __LPCGUID_DEFINED__
329 typedef const GUID *LPCGUID;
330 #endif
331
332 typedef LPVOID* LPLPVOID;
333
334 typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID,LPCWSTR,LPCWSTR,LPVOID);
335 typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID,LPCSTR,LPCSTR,LPVOID);
336
337 extern HRESULT WINAPI DirectSoundCreate(LPCGUID lpGUID,LPDIRECTSOUND *ppDS,LPUNKNOWN pUnkOuter);
338 extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
339 extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
340
341 extern HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID lpGUID, LPDIRECTSOUNDCAPTURE *ppDSC, LPUNKNOWN pUnkOuter);
342 extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
343 extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
344
345 extern HRESULT WINAPI DirectSoundCreate8(LPCGUID lpGUID,LPDIRECTSOUND8 *ppDS8,LPUNKNOWN pUnkOuter);
346 extern HRESULT WINAPI DirectSoundCaptureCreate8(LPCGUID lpGUID, LPDIRECTSOUNDCAPTURE *ppDSC8, LPUNKNOWN pUnkOuter);
347 extern HRESULT WINAPI DirectSoundFullDuplexCreate(LPCGUID pcGuidCaptureDevice, LPCGUID pcGuidRenderDevice, 
348     LPCDSCBUFFERDESC pcDSCBufferDesc, LPCDSBUFFERDESC pcDSBufferDesc, HWND hWnd, DWORD dwLevel, 
349     LPDIRECTSOUNDFULLDUPLEX *ppDSFD, LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8, LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, LPUNKNOWN pUnkOuter); 
350 #define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate
351 extern HRESULT WINAPI GetDeviceID(LPCGUID lpGuidSrc, LPGUID lpGuidDest);
352
353
354 /*****************************************************************************
355  * IDirectSound interface
356  */
357 #define INTERFACE IDirectSound
358 #define IDirectSound_METHODS \
359     IUnknown_METHODS \
360     STDMETHOD(CreateSoundBuffer)(THIS_ LPDSBUFFERDESC lpcDSBufferDesc, LPLPDIRECTSOUNDBUFFER lplpDirectSoundBuffer, IUnknown *pUnkOuter) PURE; \
361     STDMETHOD(GetCaps)(THIS_ LPDSCAPS lpDSCaps) PURE; \
362     STDMETHOD(DuplicateSoundBuffer)(THIS_ LPDIRECTSOUNDBUFFER lpDsbOriginal, LPLPDIRECTSOUNDBUFFER lplpDsbDuplicate) PURE; \
363     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwLevel) PURE; \
364     STDMETHOD(Compact)(THIS) PURE; \
365     STDMETHOD(GetSpeakerConfig)(THIS_ LPDWORD lpdwSpeakerConfig) PURE; \
366     STDMETHOD(SetSpeakerConfig)(THIS_ DWORD dwSpeakerConfig) PURE; \
367     STDMETHOD(Initialize)(THIS_ LPCGUID lpcGuid) PURE;
368 ICOM_DEFINE(IDirectSound,IUnknown)
369 #undef INTERFACE
370
371 #ifdef COBJMACROS
372     /*** IUnknown methods ***/
373 #define IDirectSound_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
374 #define IDirectSound_AddRef(p)             (p)->lpVtbl->AddRef(p)
375 #define IDirectSound_Release(p)            (p)->lpVtbl->Release(p)
376     /*** IDirectSound methods ***/
377 #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
378 #define IDirectSound_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
379 #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
380 #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
381 #define IDirectSound_Compact(p)                  (p)->lpVtbl->Compact(p)
382 #define IDirectSound_GetSpeakerConfig(p,a)       (p)->lpVtbl->GetSpeakerConfig(p,a)
383 #define IDirectSound_SetSpeakerConfig(p,a)       (p)->lpVtbl->SetSpeakerConfig(p,a)
384 #define IDirectSound_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
385 #endif
386
387
388 /*****************************************************************************
389  * IDirectSound8 interface
390  */
391 #define INTERFACE IDirectSound8
392 #define IDirectSound8_METHODS \
393     IUnknown_METHODS \
394     STDMETHOD(CreateSoundBuffer)(THIS_ LPDSBUFFERDESC lpcDSBufferDesc, LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer, IUnknown *pUnkOuter) PURE; \
395     STDMETHOD(GetCaps)(THIS_ LPDSCAPS lpDSCaps) PURE; \
396     STDMETHOD(DuplicateSoundBuffer)(THIS_ LPDIRECTSOUNDBUFFER8 lpDsbOriginal, LPLPDIRECTSOUNDBUFFER8 lplpDsbDuplicate) PURE; \
397     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwLevel) PURE; \
398     STDMETHOD(Compact)(THIS) PURE; \
399     STDMETHOD(GetSpeakerConfig)(THIS_ LPDWORD lpdwSpeakerConfig) PURE; \
400     STDMETHOD(SetSpeakerConfig)(THIS_ DWORD dwSpeakerConfig) PURE; \
401     STDMETHOD(Initialize)(THIS_ LPCGUID lpcGuid) PURE; \
402     STDMETHOD(VerifyCertification)(THIS_ LPDWORD pdwCertified) PURE;
403 ICOM_DEFINE(IDirectSound8,IUnknown)
404 #undef INTERFACE
405
406 #ifdef COBJMACROS
407     /*** IUnknown methods ***/
408 #define IDirectSound8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
409 #define IDirectSound8_AddRef(p)             (p)->lpVtbl->AddRef(p)
410 #define IDirectSound8_Release(p)            (p)->lpVtbl->Release(p)
411     /*** IDirectSound methods ***/
412 #define IDirectSound8_CreateSoundBuffer(p,a,b,c)  (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
413 #define IDirectSound8_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
414 #define IDirectSound8_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
415 #define IDirectSound8_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
416 #define IDirectSound8_Compact(p)                  (p)->lpVtbl->Compact(p)
417 #define IDirectSound8_GetSpeakerConfig(p,a)       (p)->lpVtbl->GetSpeakerConfig(p,a)
418 #define IDirectSound8_SetSpeakerConfig(p,a)       (p)->lpVtbl->SetSpeakerConfig(p,a)
419 #define IDirectSound8_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
420     /*** IDirectSound8 methods ***/
421 #define IDirectSound8_VerifyCertification(p,a)    (p)->lpVtbl->VerifyCertification(p,a)
422 #endif
423
424
425 /*****************************************************************************
426  * IDirectSoundBuffer interface
427  */
428 #define INTERFACE IDirectSoundBuffer
429 #define IDirectSoundBuffer_METHODS \
430     IUnknown_METHODS \
431     STDMETHOD(GetCaps)(THIS_ LPDSBCAPS lpDSBufferCaps) PURE; \
432     STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor) PURE; \
433     STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE; \
434     STDMETHOD(GetVolume)(THIS_ LPLONG lplVolume) PURE; \
435     STDMETHOD(GetPan)(THIS_ LPLONG lplpan) PURE; \
436     STDMETHOD(GetFrequency)(THIS_ LPDWORD lpdwFrequency) PURE; \
437     STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE; \
438     STDMETHOD(Initialize)(THIS_ LPDIRECTSOUND lpDirectSound, LPDSBUFFERDESC lpcDSBufferDesc) PURE; \
439     STDMETHOD(Lock)(THIS_ DWORD dwWriteCursor, DWORD dwWriteBytes, LPVOID lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE; \
440     STDMETHOD(Play)(THIS_ DWORD dwReserved1, DWORD dwReserved2, DWORD dwFlags) PURE; \
441     STDMETHOD(SetCurrentPosition)(THIS_ DWORD dwNewPosition) PURE; \
442     STDMETHOD(SetFormat)(THIS_ LPWAVEFORMATEX lpcfxFormat) PURE; \
443     STDMETHOD(SetVolume)(THIS_ LONG lVolume) PURE; \
444     STDMETHOD(SetPan)(THIS_ LONG lPan) PURE; \
445     STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE; \
446     STDMETHOD(Stop)(THIS) PURE; \
447     STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioPtr2) PURE; \
448     STDMETHOD(Restore)(THIS) PURE;
449 ICOM_DEFINE(IDirectSoundBuffer,IUnknown)
450 #undef INTERFACE
451
452 #ifdef COBJMACROS
453     /*** IUnknown methods ***/
454 #define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
455 #define IDirectSoundBuffer_AddRef(p)             (p)->lpVtbl->AddRef(p)
456 #define IDirectSoundBuffer_Release(p)            (p)->lpVtbl->Release(p)
457     /*** IDirectSoundBuffer methods ***/
458 #define IDirectSoundBuffer_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
459 #define IDirectSoundBuffer_GetCurrentPosition(p,a,b)   (p)->lpVtbl->GetCurrentPosition(p,a,b)
460 #define IDirectSoundBuffer_GetFormat(p,a,b,c)          (p)->lpVtbl->GetFormat(p,a,b,c)
461 #define IDirectSoundBuffer_GetVolume(p,a)              (p)->lpVtbl->GetVolume(p,a)
462 #define IDirectSoundBuffer_GetPan(p,a)                 (p)->lpVtbl->GetPan(p,a)
463 #define IDirectSoundBuffer_GetFrequency(p,a)           (p)->lpVtbl->GetFrequency(p,a)
464 #define IDirectSoundBuffer_GetStatus(p,a)              (p)->lpVtbl->GetStatus(p,a)
465 #define IDirectSoundBuffer_Initialize(p,a,b)           (p)->lpVtbl->Initialize(p,a,b)
466 #define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)       (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
467 #define IDirectSoundBuffer_Play(p,a,b,c)               (p)->lpVtbl->Play(p,a,b,c)
468 #define IDirectSoundBuffer_SetCurrentPosition(p,a)     (p)->lpVtbl->SetCurrentPosition(p,a)
469 #define IDirectSoundBuffer_SetFormat(p,a)              (p)->lpVtbl->SetFormat(p,a)
470 #define IDirectSoundBuffer_SetVolume(p,a)              (p)->lpVtbl->SetVolume(p,a)
471 #define IDirectSoundBuffer_SetPan(p,a)                 (p)->lpVtbl->SetPan(p,a)
472 #define IDirectSoundBuffer_SetFrequency(p,a)           (p)->lpVtbl->SetFrequency(p,a)
473 #define IDirectSoundBuffer_Stop(p)                     (p)->lpVtbl->Stop(p)
474 #define IDirectSoundBuffer_Unlock(p,a,b,c,d)           (p)->lpVtbl->Unlock(p,a,b,c,d)
475 #define IDirectSoundBuffer_Restore(p)                  (p)->lpVtbl->Restore(p)
476 #endif
477
478
479 /*****************************************************************************
480  * IDirectSoundBuffer8 interface
481  */
482 #define INTERFACE IDirectSoundBuffer8
483 #define IDirectSoundBuffer8_METHODS \
484     IUnknown_METHODS \
485     STDMETHOD(GetCaps)(THIS_ LPDSBCAPS lpDSBufferCaps) PURE; \
486     STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor) PURE; \
487     STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE; \
488     STDMETHOD(GetVolume)(THIS_ LPLONG lplVolume) PURE; \
489     STDMETHOD(GetPan)(THIS_ LPLONG lplpan) PURE; \
490     STDMETHOD(GetFrequency)(THIS_ LPDWORD lpdwFrequency) PURE; \
491     STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE; \
492     STDMETHOD(Initialize)(THIS_ LPDIRECTSOUND8 lpDirectSound, LPDSBUFFERDESC lpcDSBufferDesc) PURE; \
493     STDMETHOD(Lock)(THIS_ DWORD dwWriteCursor, DWORD dwWriteBytes, LPVOID lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE; \
494     STDMETHOD(Play)(THIS_ DWORD dwReserved1, DWORD dwReserved2, DWORD dwFlags) PURE; \
495     STDMETHOD(SetCurrentPosition)(THIS_ DWORD dwNewPosition) PURE; \
496     STDMETHOD(SetFormat)(THIS_ LPWAVEFORMATEX lpcfxFormat) PURE; \
497     STDMETHOD(SetVolume)(THIS_ LONG lVolume) PURE; \
498     STDMETHOD(SetPan)(THIS_ LONG lPan) PURE; \
499     STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE; \
500     STDMETHOD(Stop)(THIS) PURE; \
501     STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioPtr2) PURE; \
502     STDMETHOD(Restore)(THIS) PURE; \
503     STDMETHOD(SetFX)(THIS_ DWORD dwEffectsCount, LPDSEFFECTDESC pDSFXDesc, LPDWORD pdwResultCodes) PURE; \
504     STDMETHOD(AcquireResources)(THIS_ DWORD dwFlags, DWORD dwEffectsCount, LPDWORD pdwResultCodes) PURE; \
505     STDMETHOD(GetObjectInPath)(THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
506 ICOM_DEFINE(IDirectSoundBuffer8,IUnknown)
507 #undef INTERFACE
508
509 #ifdef COBJMACROS
510     /*** IUnknown methods ***/
511 #define IDirectSoundBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
512 #define IDirectSoundBuffer8_AddRef(p)             (p)->lpVtbl->AddRef(p)
513 #define IDirectSoundBuffer8_Release(p)            (p)->lpVtbl->Release(p)
514     /*** IDirectSoundBuffer methods ***/
515 #define IDirectSoundBuffer8_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
516 #define IDirectSoundBuffer8_GetCurrentPosition(p,a,b)   (p)->lpVtbl->GetCurrentPosition(p,a,b)
517 #define IDirectSoundBuffer8_GetFormat(p,a,b,c)          (p)->lpVtbl->GetFormat(p,a,b,c)
518 #define IDirectSoundBuffer8_GetVolume(p,a)              (p)->lpVtbl->GetVolume(p,a)
519 #define IDirectSoundBuffer8_GetPan(p,a)                 (p)->lpVtbl->GetPan(p,a)
520 #define IDirectSoundBuffer8_GetFrequency(p,a)           (p)->lpVtbl->GetFrequency(p,a)
521 #define IDirectSoundBuffer8_GetStatus(p,a)              (p)->lpVtbl->GetStatus(p,a)
522 #define IDirectSoundBuffer8_Initialize(p,a,b)           (p)->lpVtbl->Initialize(p,a,b)
523 #define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g)       (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
524 #define IDirectSoundBuffer8_Play(p,a,b,c)               (p)->lpVtbl->Play(p,a,b,c)
525 #define IDirectSoundBuffer8_SetCurrentPosition(p,a)     (p)->lpVtbl->SetCurrentPosition(p,a)
526 #define IDirectSoundBuffer8_SetFormat(p,a)              (p)->lpVtbl->SetFormat(p,a)
527 #define IDirectSoundBuffer8_SetVolume(p,a)              (p)->lpVtbl->SetVolume(p,a)
528 #define IDirectSoundBuffer8_SetPan(p,a)                 (p)->lpVtbl->SetPan(p,a)
529 #define IDirectSoundBuffer8_SetFrequency(p,a)           (p)->lpVtbl->SetFrequency(p,a)
530 #define IDirectSoundBuffer8_Stop(p)                     (p)->lpVtbl->Stop(p)
531 #define IDirectSoundBuffer8_Unlock(p,a,b,c,d)           (p)->lpVtbl->Unlock(p,a,b,c,d)
532 #define IDirectSoundBuffer8_Restore(p)                  (p)->lpVtbl->Restore(p)
533     /*** IDirectSoundBuffer8 methods ***/
534 #define IDirectSoundBuffer8_SetFX(p,a,b,c)              (p)->lpVtbl->SetFX(p,a,b,c)
535 #define IDirectSoundBuffer8_AcquireResources(p,a,b,c)   (p)->lpVtbl->AcquireResources(p,a,b,c)
536 #define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c)    (p)->lpVtbl->GetObjectInPath(p,a,b,c)
537 #endif
538
539
540 /*****************************************************************************
541  * IDirectSoundCapture interface
542  */
543 #define INTERFACE IDirectSoundCapture
544 #define IDirectSoundCapture_METHODS \
545     IUnknown_METHODS \
546     STDMETHOD(CreateCaptureBuffer)(THIS_ LPCDSCBUFFERDESC lpcDSCBufferDesc,LPDIRECTSOUNDCAPTUREBUFFER *lplpDSCaptureBuffer, LPUNKNOWN pUnk) PURE; \
547     STDMETHOD(GetCaps)(THIS_ LPDSCCAPS lpDSCCaps) PURE; \
548     STDMETHOD(Initialize)(THIS_ LPCGUID lpcGUID) PURE;
549 ICOM_DEFINE(IDirectSoundCapture,IUnknown)
550 #undef INTERFACE
551
552 #ifdef COBJMACROS
553 #define IDirectSoundCapture_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
554 #define IDirectSoundCapture_AddRef(p)                    (p)->lpVtbl->AddRef(p)
555 #define IDirectSoundCapture_Release(p)                   (p)->lpVtbl->Release(p)
556 #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
557 #define IDirectSoundCapture_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
558 #define IDirectSoundCapture_Initialize(p,a)              (p)->lpVtbl->Initialize(p,a)
559 #endif
560
561 /*****************************************************************************
562  * IDirectSoundCaptureBuffer interface
563  */
564 #define INTERFACE IDirectSoundCaptureBuffer
565 #define IDirectSoundCaptureBuffer_METHODS \
566     IUnknown_METHODS \
567     STDMETHOD(GetCaps)(THIS_ LPDSCBCAPS lpDSCBCaps) PURE; \
568     STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCapturePosition,LPDWORD lpdwReadPosition) PURE; \
569     STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE; \
570     STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE; \
571     STDMETHOD(Initialize)(THIS_ LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc) PURE; \
572     STDMETHOD(Lock)(THIS_ DWORD dwReadCusor, DWORD dwReadBytes, LPVOID *lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID *lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE; \
573     STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE; \
574     STDMETHOD(Stop)(THIS) PURE; \
575     STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2) PURE;
576 ICOM_DEFINE(IDirectSoundCaptureBuffer,IUnknown)
577 #undef INTERFACE
578
579 #ifdef COBJMACROS
580 #define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)     (p)->lpVtbl->QueryInterface(p,a,b)
581 #define IDirectSoundCaptureBuffer_AddRef(p)                 (p)->lpVtbl->AddRef(p)
582 #define IDirectSoundCaptureBuffer_Release(p)                (p)->lpVtbl->Release(p)
583 #define IDirectSoundCaptureBuffer_GetCaps(p,a)              (p)->lpVtbl->GetCaps(p,a)
584 #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
585 #define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)        (p)->lpVtbl->GetFormat(p,a,b,c)
586 #define IDirectSoundCaptureBuffer_GetStatus(p,a)            (p)->lpVtbl->GetStatus(p,a)
587 #define IDirectSoundCaptureBuffer_Initialize(p,a,b)         (p)->lpVtbl->Initialize(p,a,b)
588 #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)     (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
589 #define IDirectSoundCaptureBuffer_Start(p,a)                (p)->lpVtbl->Start(p,a)
590 #define IDirectSoundCaptureBuffer_Stop(p)                   (p)->lpVtbl->Stop(p)
591 #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)         (p)->lpVtbl->Unlock(p,a,b,c,d)
592 #endif
593
594 /*****************************************************************************
595  * IDirectSoundCaptureBuffer8 interface
596  */
597 #define INTERFACE IDirectSoundCaptureBuffer8
598 #define IDirectSoundCaptureBuffer8_METHODS \
599     IDirectSoundCaptureBuffer_METHODS \
600     STDMETHOD(GetObjectInPath)(THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE; \
601     STDMETHOD(GetFXStatus)(THIS_ DWORD dwFXCount, LPDWORD pdwFXStatus) PURE;
602 ICOM_DEFINE(IDirectSoundCaptureBuffer8,IDirectSoundCaptureBuffer)
603 #undef INTERFACE
604
605 #ifdef COBJMACROS
606 #define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
607 #define IDirectSoundCaptureBuffer8_AddRef(p)                  (p)->lpVtbl->AddRef(p)
608 #define IDirectSoundCaptureBuffer8_Release(p)                 (p)->lpVtbl->Release(p)
609 #define IDirectSoundCaptureBuffer8_GetCaps(p,a)               (p)->lpVtbl->GetCaps(p,a)
610 #define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b)  (p)->lpVtbl->GetCurrentPosition(p,a,b)
611 #define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c)         (p)->lpVtbl->GetFormat(p,a,b,c)
612 #define IDirectSoundCaptureBuffer8_GetStatus(p,a)             (p)->lpVtbl->GetStatus(p,a)
613 #define IDirectSoundCaptureBuffer8_Initialize(p,a,b)          (p)->lpVtbl->Initialize(p,a,b)
614 #define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g)      (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
615 #define IDirectSoundCaptureBuffer8_Start(p,a)                 (p)->lpVtbl->Start(p,a)
616 #define IDirectSoundCaptureBuffer8_Stop(p)                    (p)->lpVtbl->Stop(p)
617 #define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d)          (p)->lpVtbl->Unlock(p,a,b,c,d)
618 #define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
619 #define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b)         (p)->lpVtbl->GetFXStatus(p,a,b)
620 #endif
621
622 /*****************************************************************************
623  * IDirectSoundNotify interface
624  */
625 #define WINE_NOBUFFER                   0x80000000
626
627 #define DSBPN_OFFSETSTOP                -1
628
629 #define INTERFACE IDirectSoundNotify
630 #define IDirectSoundNotify_METHODS \
631     IUnknown_METHODS \
632     STDMETHOD(SetNotificationPositions)(THIS_ DWORD cPositionNotifies, LPCDSBPOSITIONNOTIFY lpcPositionNotifies) PURE;
633 ICOM_DEFINE(IDirectSoundNotify,IUnknown)
634 #undef INTERFACE
635
636 #ifdef COBJMACROS
637 /*** IUnknown methods ***/
638 #define IDirectSoundNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
639 #define IDirectSoundNotify_AddRef(p)             (p)->lpVtbl->AddRef(p)
640 #define IDirectSoundNotify_Release(p)            (p)->lpVtbl->Release(p)
641 /*** IDirectSoundNotify methods ***/
642 #define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
643 #endif
644
645
646 /*****************************************************************************
647  * IDirectSound3DListener interface
648  */
649 #define DS3DMODE_NORMAL             0x00000000
650 #define DS3DMODE_HEADRELATIVE       0x00000001
651 #define DS3DMODE_DISABLE            0x00000002
652
653 #define DS3D_IMMEDIATE              0x00000000
654 #define DS3D_DEFERRED               0x00000001
655
656 #define DS3D_MINDISTANCEFACTOR      0.0f
657 #define DS3D_MAXDISTANCEFACTOR      10.0f
658 #define DS3D_DEFAULTDISTANCEFACTOR  1.0f
659
660 #define DS3D_MINROLLOFFFACTOR       0.0f
661 #define DS3D_MAXROLLOFFFACTOR       10.0f
662 #define DS3D_DEFAULTROLLOFFFACTOR   1.0f
663
664 #define DS3D_MINDOPPLERFACTOR       0.0f
665 #define DS3D_MAXDOPPLERFACTOR       10.0f
666 #define DS3D_DEFAULTDOPPLERFACTOR   1.0f
667
668 #define DS3D_DEFAULTMINDISTANCE     1.0f
669 #define DS3D_DEFAULTMAXDISTANCE     1000000000.0f
670
671 #define DS3D_MINCONEANGLE           0
672 #define DS3D_MAXCONEANGLE           360
673 #define DS3D_DEFAULTCONEANGLE       360
674
675 #define DS3D_DEFAULTCONEOUTSIDEVOLUME   0
676
677 typedef struct _DS3DLISTENER {
678         DWORD                           dwSize;
679         D3DVECTOR                       vPosition;
680         D3DVECTOR                       vVelocity;
681         D3DVECTOR                       vOrientFront;
682         D3DVECTOR                       vOrientTop;
683         D3DVALUE                        flDistanceFactor;
684         D3DVALUE                        flRolloffFactor;
685         D3DVALUE                        flDopplerFactor;
686 } DS3DLISTENER, *LPDS3DLISTENER;
687
688 typedef const DS3DLISTENER *LPCDS3DLISTENER;
689
690 #define INTERFACE IDirectSound3DListener
691 #define IDirectSound3DListener_METHODS \
692     IUnknown_METHODS \
693     STDMETHOD(GetAllParameters)(THIS_ LPDS3DLISTENER lpListener) PURE; \
694     STDMETHOD(GetDistanceFactor)(THIS_ LPD3DVALUE lpflDistanceFactor) PURE; \
695     STDMETHOD(GetDopplerFactor)(THIS_ LPD3DVALUE lpflDopplerFactor) PURE; \
696     STDMETHOD(GetOrientation)(THIS_ LPD3DVECTOR lpvOrientFront, LPD3DVECTOR lpvOrientTop) PURE; \
697     STDMETHOD(GetPosition)(THIS_ LPD3DVECTOR lpvPosition) PURE; \
698     STDMETHOD(GetRolloffFactor)(THIS_ LPD3DVALUE lpflRolloffFactor) PURE; \
699     STDMETHOD(GetVelocity)(THIS_ LPD3DVECTOR lpvVelocity) PURE; \
700     STDMETHOD(SetAllParameters)(THIS_ LPCDS3DLISTENER lpcListener, DWORD dwApply) PURE; \
701     STDMETHOD(SetDistanceFactor)(THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE; \
702     STDMETHOD(SetDopplerFactor)(THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE; \
703     STDMETHOD(SetOrientation)(THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront, D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE; \
704     STDMETHOD(SetPosition)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; \
705     STDMETHOD(SetRolloffFactor)(THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE; \
706     STDMETHOD(SetVelocity)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; \
707     STDMETHOD(CommitDeferredSettings)(THIS) PURE;
708 ICOM_DEFINE(IDirectSound3DListener,IUnknown)
709 #undef INTERFACE
710
711 #ifdef COBJMACROS
712 /*** IUnknown methods ***/
713 #define IDirectSound3DListener_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
714 #define IDirectSound3DListener_AddRef(p)             (p)->lpVtbl->AddRef(p)
715 #define IDirectSound3DListener_Release(p)            (p)->lpVtbl->Release(p)
716 /*** IDirectSound3DListener methods ***/
717 #define IDirectSound3DListener_GetAllParameters(p,a)           (p)->lpVtbl->GetAllParameters(p,a)
718 #define IDirectSound3DListener_GetDistanceFactor(p,a)          (p)->lpVtbl->GetDistanceFactor(p,a)
719 #define IDirectSound3DListener_GetDopplerFactor(p,a)           (p)->lpVtbl->GetDopplerFactor(p,a)
720 #define IDirectSound3DListener_GetOrientation(p,a,b)           (p)->lpVtbl->GetOrientation(p,a,b)
721 #define IDirectSound3DListener_GetPosition(p,a)                (p)->lpVtbl->GetPosition(p,a)
722 #define IDirectSound3DListener_GetRolloffFactor(p,a)           (p)->lpVtbl->GetRolloffFactor(p,a)
723 #define IDirectSound3DListener_GetVelocity(p,a)                (p)->lpVtbl->GetVelocity(p,a)
724 #define IDirectSound3DListener_SetAllParameters(p,a,b)         (p)->lpVtbl->SetAllParameters(p,a,b)
725 #define IDirectSound3DListener_SetDistanceFactor(p,a,b)        (p)->lpVtbl->SetDistanceFactor(p,a,b)
726 #define IDirectSound3DListener_SetDopplerFactor(p,a,b)         (p)->lpVtbl->SetDopplerFactor(p,a,b)
727 #define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
728 #define IDirectSound3DListener_SetPosition(p,a,b,c,d)          (p)->lpVtbl->SetPosition(p,a,b,c,d)
729 #define IDirectSound3DListener_SetRolloffFactor(p,a,b)         (p)->lpVtbl->SetRolloffFactor(p,a,b)
730 #define IDirectSound3DListener_SetVelocity(p,a,b,c,d)          (p)->lpVtbl->SetVelocity(p,a,b,c,d)
731 #define IDirectSound3DListener_CommitDeferredSettings(p)       (p)->lpVtbl->CommitDeferredSettings(p)
732 #endif
733
734
735 /*****************************************************************************
736  * IDirectSound3DBuffer interface
737  */
738 typedef struct  _DS3DBUFFER {
739         DWORD                           dwSize;
740         D3DVECTOR                       vPosition;
741         D3DVECTOR                       vVelocity;
742         DWORD                           dwInsideConeAngle;
743         DWORD                           dwOutsideConeAngle;
744         D3DVECTOR                       vConeOrientation;
745         LONG                            lConeOutsideVolume;
746         D3DVALUE                        flMinDistance;
747         D3DVALUE                        flMaxDistance;
748         DWORD                           dwMode;
749 } DS3DBUFFER, *LPDS3DBUFFER;
750
751 typedef const DS3DBUFFER *LPCDS3DBUFFER;
752
753 #define INTERFACE IDirectSound3DBuffer
754 #define IDirectSound3DBuffer_METHODS \
755     IUnknown_METHODS \
756     STDMETHOD(GetAllParameters)(THIS_ LPDS3DBUFFER lpDs3dBuffer) PURE; \
757     STDMETHOD(GetConeAngles)(THIS_ LPDWORD lpdwInsideConeAngle, LPDWORD lpdwOutsideConeAngle) PURE; \
758     STDMETHOD(GetConeOrientation)(THIS_ LPD3DVECTOR lpvOrientation) PURE; \
759     STDMETHOD(GetConeOutsideVolume)(THIS_ LPLONG lplConeOutsideVolume) PURE; \
760     STDMETHOD(GetMaxDistance)(THIS_ LPD3DVALUE lpflMaxDistance) PURE; \
761     STDMETHOD(GetMinDistance)(THIS_ LPD3DVALUE lpflMinDistance) PURE; \
762     STDMETHOD(GetMode)(THIS_ LPDWORD lpwdMode) PURE; \
763     STDMETHOD(GetPosition)(THIS_ LPD3DVECTOR lpvPosition) PURE; \
764     STDMETHOD(GetVelocity)(THIS_ LPD3DVECTOR lpvVelocity) PURE; \
765     STDMETHOD(SetAllParameters)(THIS_ LPCDS3DBUFFER lpcDs3dBuffer, DWORD dwApply) PURE; \
766     STDMETHOD(SetConeAngles)(THIS_ DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) PURE; \
767     STDMETHOD(SetConeOrientation)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; \
768     STDMETHOD(SetConeOutsideVolume)(THIS_ LONG lConeOutsideVolume, DWORD dwApply) PURE; \
769     STDMETHOD(SetMaxDistance)(THIS_ D3DVALUE flMaxDistance, DWORD dwApply) PURE; \
770     STDMETHOD(SetMinDistance)(THIS_ D3DVALUE flMinDistance, DWORD dwApply) PURE; \
771     STDMETHOD(SetMode)(THIS_ DWORD dwMode, DWORD dwApply) PURE; \
772     STDMETHOD(SetPosition)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; \
773     STDMETHOD(SetVelocity)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
774 ICOM_DEFINE(IDirectSound3DBuffer,IUnknown)
775 #undef INTERFACE
776
777 #ifdef COBJMACROS
778 /*** IUnknown methods ***/
779 #define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
780 #define IDirectSound3DBuffer_AddRef(p)             (p)->lpVtbl->AddRef(p)
781 #define IDirectSound3DBuffer_Release(p)            (p)->lpVtbl->Release(p)
782 /*** IDirectSound3DBuffer methods ***/
783 #define IDirectSound3DBuffer_GetAllParameters(p,a)         (p)->lpVtbl->GetAllParameters(p,a)
784 #define IDirectSound3DBuffer_GetConeAngles(p,a,b)          (p)->lpVtbl->GetConeAngles(p,a,b)
785 #define IDirectSound3DBuffer_GetConeOrientation(p,a)       (p)->lpVtbl->GetConeOrientation(p,a)
786 #define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)     (p)->lpVtbl->GetConeOutsideVolume(p,a)
787 #define IDirectSound3DBuffer_GetMaxDistance(p,a)           (p)->lpVtbl->GetMaxDistance(p,a)
788 #define IDirectSound3DBuffer_GetMinDistance(p,a)           (p)->lpVtbl->GetMinDistance(p,a)
789 #define IDirectSound3DBuffer_GetMode(p,a)                  (p)->lpVtbl->GetMode(p,a)
790 #define IDirectSound3DBuffer_GetPosition(p,a)              (p)->lpVtbl->GetPosition(p,a)
791 #define IDirectSound3DBuffer_GetVelocity(p,a)              (p)->lpVtbl->GetVelocity(p,a)
792 #define IDirectSound3DBuffer_SetAllParameters(p,a,b)       (p)->lpVtbl->SetAllParameters(p,a,b)
793 #define IDirectSound3DBuffer_SetConeAngles(p,a,b)          (p)->lpVtbl->SetConeAngles(p,a,b)
794 #define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
795 #define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)   (p)->lpVtbl->SetConeOutsideVolume(p,a,b)
796 #define IDirectSound3DBuffer_SetMaxDistance(p,a,b)         (p)->lpVtbl->SetMaxDistance(p,a,b)
797 #define IDirectSound3DBuffer_SetMinDistance(p,a,b)         (p)->lpVtbl->SetMinDistance(p,a,b)
798 #define IDirectSound3DBuffer_SetMode(p,a,b)                (p)->lpVtbl->SetMode(p,a,b)
799 #define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)        (p)->lpVtbl->SetPosition(p,a,b,c,d)
800 #define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)        (p)->lpVtbl->SetVelocity(p,a,b,c,d)
801 #endif
802
803 /*****************************************************************************
804  * IKsPropertySet interface
805  */
806 #ifndef _IKsPropertySet_
807 #define _IKsPropertySet_
808
809 typedef struct IKsPropertySet IKsPropertySet,*LPKSPROPERTYSET;
810
811 DEFINE_GUID(IID_IKsPropertySet,0x31EFAC30,0x515C,0x11D0,0xA9,0xAA,0x00,0xAA,0x00,0x61,0xBE,0x93);
812
813 #define KSPROPERTY_SUPPORT_GET  1
814 #define KSPROPERTY_SUPPORT_SET  2
815
816 #define INTERFACE IKsPropertySet
817 #define IKsPropertySet_METHODS \
818     IUnknown_METHODS \
819     STDMETHOD(Get)(THIS_ REFGUID rgid,ULONG x1,LPVOID p1,ULONG x2,LPVOID p2,ULONG x3,ULONG *px4) PURE;\
820     STDMETHOD(Set)(THIS_ REFGUID rgid,ULONG x1,LPVOID p1,ULONG x2,LPVOID p2,ULONG x3) PURE;\
821     STDMETHOD(QuerySupport)(THIS_ REFGUID rgid,ULONG x1,ULONG *px2) PURE;
822 ICOM_DEFINE(IKsPropertySet,IUnknown)
823 #undef INTERFACE
824
825 #ifdef COBJMACROS
826 #define IKsPropertySet_QueryInterface(p,a,b)    (p)->lpVtbl->QueryInterface(p,a,b)
827 #define IKsPropertySet_AddRef(p)                (p)->lpVtbl->AddRef(p)
828 #define IKsPropertySet_Release(p)               (p)->lpVtbl->Release(p)
829 #define IKsPropertySet_Get(p,a,b,c,d,e,f,g)     (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
830 #define IKsPropertySet_Set(p,a,b,c,d,e,f)       (p)->lpVtbl->Set(p,a,b,c,d,e,f)
831 #define IKsPropertySet_QuerySupport(p,a,b,c)    (p)->lpVtbl->QuerySupport(p,a,b,c)
832 #endif
833
834 #endif /* _IKsPropertySet_ */
835
836 /*****************************************************************************
837  * IDirectSoundFullDuplex interface
838  */
839 #define INTERFACE IDirectSoundFullDuplex
840 #define IDirectSoundFullDuplex_METHODS \
841     IUnknown_METHODS \
842     STDMETHOD(Initialize)(THIS_ LPCGUID pCaptureGuid,LPCGUID pRendererGuid,LPCDSCBUFFERDESC lpDscBufferDesc,LPCDSBUFFERDESC lpDsBufferDesc,HWND hWnd,DWORD dwLevel,LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8,LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8) PURE;
843 ICOM_DEFINE(IDirectSoundFullDuplex,IUnknown)
844 #undef INTERFACE
845
846 #ifdef COBJMACROS
847 #define IDirectSoundFullDuplex_QueryInterface(p,a,b)    (p)->lpVtbl->QueryInterface(p,a,b)
848 #define IDirectSoundFullDuplex_AddRef(p)                (p)->lpVtbl->AddRef(p)
849 #define IDirectSoundFullDuplex_Release(p)               (p)->lpVtbl->Release(p)
850 #define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h)    (p)->lpVtbl->Initialize(p,a,b,c,d,e,f,g,h)
851 #endif
852
853 #ifdef __cplusplus
854 } /* extern "C" */
855 #endif /* defined(__cplusplus) */
856
857 #endif /* __WINE_DSOUND_H */