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