2 * Copyright (C) the Wine project
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.
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.
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
19 #ifndef __WINE_DSOUND_H
20 #define __WINE_DSOUND_H
22 #include "winbase.h" /* for CRITICAL_SECTION */
25 #include "wine/obj_ksproperty.h"
29 #endif /* defined(__cplusplus) */
31 /*****************************************************************************
32 * Predeclare the interfaces
34 DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
36 DEFINE_GUID(IID_IDirectSound, 0x279AFA83,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
37 typedef struct IDirectSound IDirectSound,*LPDIRECTSOUND;
39 DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
40 typedef struct IDirectSoundBuffer IDirectSoundBuffer,*LPDIRECTSOUNDBUFFER,**LPLPDIRECTSOUNDBUFFER;
42 DEFINE_GUID(IID_IDirectSoundNotify, 0xB0210783,0x89cd,0x11d0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
43 typedef struct IDirectSoundNotify IDirectSoundNotify,*LPDIRECTSOUNDNOTIFY;
45 DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
46 typedef struct IDirectSound3DListener IDirectSound3DListener,*LPDIRECTSOUND3DLISTENER;
48 DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
49 typedef struct IDirectSound3DBuffer IDirectSound3DBuffer,*LPDIRECTSOUND3DBUFFER;
51 DEFINE_GUID(IID_IDirectSoundCapture, 0xB0210781,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
52 typedef struct IDirectSoundCapture IDirectSoundCapture,*LPDIRECTSOUNDCAPTURE;
54 DEFINE_GUID(IID_IDirectSoundCaptureBuffer,0xB0210782,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
55 typedef struct IDirectSoundCaptureBuffer IDirectSoundCaptureBuffer,*LPDIRECTSOUNDCAPTUREBUFFER;
59 #define MAKE_DSHRESULT(code) MAKE_HRESULT(1,_FACDS,code)
62 #define DSERR_ALLOCATED MAKE_DSHRESULT(10)
63 #define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30)
64 #define DSERR_INVALIDPARAM E_INVALIDARG
65 #define DSERR_INVALIDCALL MAKE_DSHRESULT(50)
66 #define DSERR_GENERIC E_FAIL
67 #define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70)
68 #define DSERR_OUTOFMEMORY E_OUTOFMEMORY
69 #define DSERR_BADFORMAT MAKE_DSHRESULT(100)
70 #define DSERR_UNSUPPORTED E_NOTIMPL
71 #define DSERR_NODRIVER MAKE_DSHRESULT(120)
72 #define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130)
73 #define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION
74 #define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
75 #define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160)
76 #define DSERR_UNINITIALIZED MAKE_DSHRESULT(170)
78 #define DSCAPS_PRIMARYMONO 0x00000001
79 #define DSCAPS_PRIMARYSTEREO 0x00000002
80 #define DSCAPS_PRIMARY8BIT 0x00000004
81 #define DSCAPS_PRIMARY16BIT 0x00000008
82 #define DSCAPS_CONTINUOUSRATE 0x00000010
83 #define DSCAPS_EMULDRIVER 0x00000020
84 #define DSCAPS_CERTIFIED 0x00000040
85 #define DSCAPS_SECONDARYMONO 0x00000100
86 #define DSCAPS_SECONDARYSTEREO 0x00000200
87 #define DSCAPS_SECONDARY8BIT 0x00000400
88 #define DSCAPS_SECONDARY16BIT 0x00000800
90 #define DSSCL_NORMAL 1
91 #define DSSCL_PRIORITY 2
92 #define DSSCL_EXCLUSIVE 3
93 #define DSSCL_WRITEPRIMARY 4
95 typedef struct _DSCAPS
99 DWORD dwMinSecondarySampleRate;
100 DWORD dwMaxSecondarySampleRate;
101 DWORD dwPrimaryBuffers;
102 DWORD dwMaxHwMixingAllBuffers;
103 DWORD dwMaxHwMixingStaticBuffers;
104 DWORD dwMaxHwMixingStreamingBuffers;
105 DWORD dwFreeHwMixingAllBuffers;
106 DWORD dwFreeHwMixingStaticBuffers;
107 DWORD dwFreeHwMixingStreamingBuffers;
108 DWORD dwMaxHw3DAllBuffers;
109 DWORD dwMaxHw3DStaticBuffers;
110 DWORD dwMaxHw3DStreamingBuffers;
111 DWORD dwFreeHw3DAllBuffers;
112 DWORD dwFreeHw3DStaticBuffers;
113 DWORD dwFreeHw3DStreamingBuffers;
114 DWORD dwTotalHwMemBytes;
115 DWORD dwFreeHwMemBytes;
116 DWORD dwMaxContigFreeHwMemBytes;
117 DWORD dwUnlockTransferRateHwBuffers;
118 DWORD dwPlayCpuOverheadSwBuffers;
123 #define DSBPLAY_LOOPING 0x00000001
125 #define DSBSTATUS_PLAYING 0x00000001
126 #define DSBSTATUS_BUFFERLOST 0x00000002
127 #define DSBSTATUS_LOOPING 0x00000004
130 #define DSBLOCK_FROMWRITECURSOR 0x00000001
131 #define DSBLOCK_ENTIREBUFFER 0x00000002
133 #define DSBCAPS_PRIMARYBUFFER 0x00000001
134 #define DSBCAPS_STATIC 0x00000002
135 #define DSBCAPS_LOCHARDWARE 0x00000004
136 #define DSBCAPS_LOCSOFTWARE 0x00000008
137 #define DSBCAPS_CTRL3D 0x00000010
138 #define DSBCAPS_CTRLFREQUENCY 0x00000020
139 #define DSBCAPS_CTRLPAN 0x00000040
140 #define DSBCAPS_CTRLVOLUME 0x00000080
141 #define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100
142 #define DSBCAPS_CTRLDEFAULT 0x000000E0 /* Pan + volume + frequency. */
143 #define DSBCAPS_CTRLALL 0x000001F0 /* All control capabilities */
144 #define DSBCAPS_STICKYFOCUS 0x00004000
145 #define DSBCAPS_GLOBALFOCUS 0x00008000
146 #define DSBCAPS_GETCURRENTPOSITION2 0x00010000 /* More accurate play cursor under emulation*/
147 #define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
149 #define DSBSIZE_MIN 4
150 #define DSBSIZE_MAX 0xFFFFFFF
151 #define DSBPAN_LEFT -10000
152 #define DSBPAN_RIGHT 10000
153 #define DSBVOLUME_MAX 0
154 #define DSBVOLUME_MIN -10000
155 #define DSBFREQUENCY_MIN 100
156 #define DSBFREQUENCY_MAX 100000
157 #define DSBFREQUENCY_ORIGINAL 0
159 typedef struct _DSBCAPS
164 DWORD dwUnlockTransferRate;
165 DWORD dwPlayCpuOverhead;
166 } DSBCAPS,*LPDSBCAPS;
168 #define DSSCL_NORMAL 1
169 #define DSSCL_PRIORITY 2
170 #define DSSCL_EXCLUSIVE 3
171 #define DSSCL_WRITEPRIMARY 4
173 typedef struct _DSBUFFERDESC
179 LPWAVEFORMATEX lpwfxFormat;
180 } DSBUFFERDESC,*LPDSBUFFERDESC;
182 typedef struct _DSBPOSITIONNOTIFY
186 } DSBPOSITIONNOTIFY,*LPDSBPOSITIONNOTIFY;
188 typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
190 #define DSSPEAKER_HEADPHONE 1
191 #define DSSPEAKER_MONO 2
192 #define DSSPEAKER_QUAD 3
193 #define DSSPEAKER_STEREO 4
194 #define DSSPEAKER_SURROUND 5
196 #define DSSPEAKER_GEOMETRY_MIN 0x00000005 /* 5 degrees */
197 #define DSSPEAKER_GEOMETRY_NARROW 0x0000000A /* 10 degrees */
198 #define DSSPEAKER_GEOMETRY_WIDE 0x00000014 /* 20 degrees */
199 #define DSSPEAKER_GEOMETRY_MAX 0x000000B4 /* 180 degrees */
201 typedef struct _DSCBUFFERDESC
207 LPWAVEFORMATEX lpwfxFormat;
208 } DSCBUFFERDESC, *LPDSCBUFFERDESC;
209 typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
211 typedef struct _DSCCAPS
217 } DSCCAPS, *LPDSCCAPS;
218 typedef const DSCCAPS *LPCDSCCAPS;
220 typedef struct _DSCBCAPS
226 } DSCBCAPS, *LPDSCBCAPS;
227 typedef const DSCBCAPS *LPCDSCBCAPS;
229 #ifndef __LPCGUID_DEFINED__
230 #define __LPCGUID_DEFINED__
231 typedef const GUID *LPCGUID;
234 typedef LPVOID* LPLPVOID;
236 typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID,LPWSTR,LPWSTR,LPVOID);
237 typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID,LPSTR,LPSTR,LPVOID);
239 extern HRESULT WINAPI DirectSoundCreate(LPCGUID lpGUID,LPDIRECTSOUND * ppDS,IUnknown *pUnkOuter );
240 extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
241 extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
243 extern HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
244 extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
245 extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
248 /*****************************************************************************
249 * IDirectSound interface
251 #define ICOM_INTERFACE IDirectSound
252 #define IDirectSound_METHODS \
253 ICOM_METHOD3(HRESULT,CreateSoundBuffer, LPDSBUFFERDESC,lpcDSBufferDesc, LPLPDIRECTSOUNDBUFFER,lplpDirectSoundBuffer, IUnknown*,pUnkOuter) \
254 ICOM_METHOD1(HRESULT,GetCaps, LPDSCAPS,lpDSCaps) \
255 ICOM_METHOD2(HRESULT,DuplicateSoundBuffer, LPDIRECTSOUNDBUFFER,lpDsbOriginal, LPLPDIRECTSOUNDBUFFER,lplpDsbDuplicate) \
256 ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hwnd, DWORD,dwLevel) \
257 ICOM_METHOD (HRESULT,Compact) \
258 ICOM_METHOD1(HRESULT,GetSpeakerConfig, LPDWORD,lpdwSpeakerConfig) \
259 ICOM_METHOD1(HRESULT,SetSpeakerConfig, DWORD,dwSpeakerConfig) \
260 ICOM_METHOD1(HRESULT,Initialize, LPCGUID,lpcGuid)
261 #define IDirectSound_IMETHODS \
264 ICOM_DEFINE(IDirectSound,IUnknown)
265 #undef ICOM_INTERFACE
267 /*** IUnknown methods ***/
268 #define IDirectSound_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
269 #define IDirectSound_AddRef(p) ICOM_CALL (AddRef,p)
270 #define IDirectSound_Release(p) ICOM_CALL (Release,p)
271 /*** IDirectSound methods ***/
272 #define IDirectSound_CreateSoundBuffer(p,a,b,c) ICOM_CALL3(CreateSoundBuffer,p,a,b,c)
273 #define IDirectSound_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
274 #define IDirectSound_DuplicateSoundBuffer(p,a,b) ICOM_CALL2(DuplicateSoundBuffer,p,a,b)
275 #define IDirectSound_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
276 #define IDirectSound_Compact(p) ICOM_CALL (Compact,p)
277 #define IDirectSound_GetSpeakerConfig(p,a) ICOM_CALL1(GetSpeakerConfig,p,a)
278 #define IDirectSound_SetSpeakerConfig(p,a) ICOM_CALL1(SetSpeakerConfig,p,a)
279 #define IDirectSound_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
282 /*****************************************************************************
283 * IDirectSoundBuffer interface
285 #define ICOM_INTERFACE IDirectSoundBuffer
286 #define IDirectSoundBuffer_METHODS \
287 ICOM_METHOD1(HRESULT,GetCaps, LPDSBCAPS,lpDSBufferCaps) \
288 ICOM_METHOD2(HRESULT,GetCurrentPosition, LPDWORD,lpdwCurrentPlayCursor, LPDWORD,lpdwCurrentWriteCursor) \
289 ICOM_METHOD3(HRESULT,GetFormat, LPWAVEFORMATEX,lpwfxFormat, DWORD,dwSizeAllocated, LPDWORD,lpdwSizeWritten) \
290 ICOM_METHOD1(HRESULT,GetVolume, LPLONG,lplVolume) \
291 ICOM_METHOD1(HRESULT,GetPan, LPLONG,lplpan) \
292 ICOM_METHOD1(HRESULT,GetFrequency, LPDWORD,lpdwFrequency) \
293 ICOM_METHOD1(HRESULT,GetStatus, LPDWORD,lpdwStatus) \
294 ICOM_METHOD2(HRESULT,Initialize, LPDIRECTSOUND,lpDirectSound, LPDSBUFFERDESC,lpcDSBufferDesc) \
295 ICOM_METHOD7(HRESULT,Lock, DWORD,dwWriteCursor, DWORD,dwWriteBytes, LPVOID,lplpvAudioPtr1, LPDWORD,lpdwAudioBytes1, LPVOID,lplpvAudioPtr2, LPDWORD,lpdwAudioBytes2, DWORD,dwFlags) \
296 ICOM_METHOD3(HRESULT,Play, DWORD,dwReserved1, DWORD,dwReserved2, DWORD,dwFlags) \
297 ICOM_METHOD1(HRESULT,SetCurrentPosition, DWORD,dwNewPosition) \
298 ICOM_METHOD1(HRESULT,SetFormat, LPWAVEFORMATEX,lpcfxFormat) \
299 ICOM_METHOD1(HRESULT,SetVolume, LONG,lVolume) \
300 ICOM_METHOD1(HRESULT,SetPan, LONG,lPan) \
301 ICOM_METHOD1(HRESULT,SetFrequency, DWORD,dwFrequency) \
302 ICOM_METHOD (HRESULT,Stop) \
303 ICOM_METHOD4(HRESULT,Unlock, LPVOID,lpvAudioPtr1, DWORD,dwAudioBytes1, LPVOID,lpvAudioPtr2, DWORD,dwAudioPtr2) \
304 ICOM_METHOD (HRESULT,Restore)
305 #define IDirectSoundBuffer_IMETHODS \
307 IDirectSoundBuffer_METHODS
308 ICOM_DEFINE(IDirectSoundBuffer,IUnknown)
309 #undef ICOM_INTERFACE
311 /*** IUnknown methods ***/
312 #define IDirectSoundBuffer_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
313 #define IDirectSoundBuffer_AddRef(p) ICOM_CALL (AddRef,p)
314 #define IDirectSoundBuffer_Release(p) ICOM_CALL (Release,p)
315 /*** IDirectSoundBuffer methods ***/
316 #define IDirectSoundBuffer_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
317 #define IDirectSoundBuffer_GetCurrentPosition(p,a,b) ICOM_CALL2(GetCurrentPosition,p,a,b)
318 #define IDirectSoundBuffer_GetFormat(p,a,b,c) ICOM_CALL3(GetFormat,p,a,b,c)
319 #define IDirectSoundBuffer_GetVolume(p,a) ICOM_CALL1(GetVolume,p,a)
320 #define IDirectSoundBuffer_GetPan(p,a) ICOM_CALL1(GetPan,p,a)
321 #define IDirectSoundBuffer_GetFrequency(p,a) ICOM_CALL1(GetFrequency,p,a)
322 #define IDirectSoundBuffer_GetStatus(p,a) ICOM_CALL1(GetStatus,p,a)
323 #define IDirectSoundBuffer_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
324 #define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) ICOM_CALL7(Lock,p,a,b,c,d,e,f,g)
325 #define IDirectSoundBuffer_Play(p,a,b,c) ICOM_CALL3(Play,p,a,b,c)
326 #define IDirectSoundBuffer_SetCurrentPosition(p,a) ICOM_CALL1(SetCurrentPosition,p,a)
327 #define IDirectSoundBuffer_SetFormat(p,a) ICOM_CALL1(SetFormat,p,a)
328 #define IDirectSoundBuffer_SetVolume(p,a) ICOM_CALL1(SetVolume,p,a)
329 #define IDirectSoundBuffer_SetPan(p,a) ICOM_CALL1(SetPan,p,a)
330 #define IDirectSoundBuffer_SetFrequency(p,a) ICOM_CALL1(SetFrequency,p,a)
331 #define IDirectSoundBuffer_Stop(p) ICOM_CALL (Stop,p)
332 #define IDirectSoundBuffer_Unlock(p,a,b,c,d) ICOM_CALL4(Unlock,p,a,b,c,d)
333 #define IDirectSoundBuffer_Restore(p) ICOM_CALL (Restore,p)
336 /*****************************************************************************
337 * IDirectSoundCapture interface
339 #define ICOM_INTERFACE IDirectSoundCapture
340 #define IDirectSoundCapture_METHODS \
341 ICOM_METHOD3(HRESULT,CreateCaptureBuffer, LPCDSCBUFFERDESC,lpcDSCBufferDesc,LPDIRECTSOUNDCAPTUREBUFFER*,lplpDSCaptureBuffer, LPUNKNOWN,pUnk) \
342 ICOM_METHOD1(HRESULT,GetCaps, LPDSCCAPS,lpDSCCaps) \
343 ICOM_METHOD1(HRESULT,Initialize, LPCGUID,lpcGUID)
345 #define IDirectSoundCapture_IMETHODS \
347 IDirectSoundCapture_METHODS
348 ICOM_DEFINE(IDirectSoundCapture,IUnknown)
349 #undef ICOM_INTERFACE
351 #define IDirectSoundCapture_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
352 #define IDirectSoundCapture_AddRef(p) ICOM_CALL (AddRef,p)
353 #define IDirectSoundCapture_Release(p) ICOM_CALL (Release,p)
354 #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) ICOM_CALL3(CreateCaptureBuffer,p,a,b,c)
355 #define IDirectSoundCapture_GetCaps(p,a) ICOM_CALL (GetCaps,p,a)
356 #define IDirectSoundCapture_Initialize(p,a) ICOM_CALL (Initialize,p,a)
358 /*****************************************************************************
359 * IDirectSoundCaptureBuffer interface
361 #define ICOM_INTERFACE IDirectSoundCaptureBuffer
362 #define IDirectSoundCaptureBuffer_METHODS \
363 ICOM_METHOD1(HRESULT,GetCaps, LPDSCBCAPS,lpDSCBCaps) \
364 ICOM_METHOD2(HRESULT,GetCurrentPosition, LPDWORD,lpdwCapturePosition,LPDWORD,lpdwReadPosition) \
365 ICOM_METHOD3(HRESULT,GetFormat, LPWAVEFORMATEX,lpwfxFormat, DWORD,dwSizeAllocated, LPDWORD,lpdwSizeWritten) \
366 ICOM_METHOD1(HRESULT,GetStatus, LPDWORD,lpdwStatus) \
367 ICOM_METHOD2(HRESULT,Initialize, LPDIRECTSOUNDCAPTURE,lpDSC, LPCDSCBUFFERDESC,lpcDSCBDesc) \
368 ICOM_METHOD7(HRESULT,Lock, DWORD,dwReadCusor, DWORD,dwReadBytes, LPVOID*,lplpvAudioPtr1, LPDWORD,lpdwAudioBytes1, LPVOID*,lplpvAudioPtr2, LPDWORD,lpdwAudioBytes2, DWORD,dwFlags) \
369 ICOM_METHOD1(HRESULT,Start, DWORD,dwFlags) \
370 ICOM_METHOD (HRESULT,Stop) \
371 ICOM_METHOD4(HRESULT,Unlock, LPVOID,lpvAudioPtr1, DWORD,dwAudioBytes1, LPVOID,lpvAudioPtr2, DWORD,dwAudioBytes2)
373 #define IDirectSoundCaptureBuffer_IMETHODS \
375 IDirectSoundCaptureBuffer_METHODS
376 ICOM_DEFINE(IDirectSoundCaptureBuffer,IUnknown)
377 #undef ICOM_INTERFACE
379 #define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
380 #define IDirectSoundCaptureBuffer_AddRef(p) ICOM_CALL (AddRef,p)
381 #define IDirectSoundCaptureBuffer_Release(p) ICOM_CALL (Release,p)
382 #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) ICOM_CALL2(GetCurrentPosition,p,a,b)
383 #define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) ICOM_CALL3(GetFormat,p,a,b,c)
384 #define IDirectSoundCaptureBuffer_GetStatus(p,a) ICOM_CALL1(GetStatus,p,a)
385 #define IDirectSoundCaptureBuffer_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
386 #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) ICOM_CALL7(Lock,p,a,b,c,d,e,f,g)
387 #define IDirectSoundCaptureBuffer_Start(p,a) ICOM_CALL1(Start,p,a)
388 #define IDirectSoundCaptureBuffer_Stop(p) ICOM_CALL (Stop,p)
389 #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) ICOM_CALL4(Unlock,p,a,b,c,d)
391 /*****************************************************************************
392 * IDirectSoundNotify interface
394 #define WINE_NOBUFFER 0x80000000
396 #define DSBPN_OFFSETSTOP -1
398 #define ICOM_INTERFACE IDirectSoundNotify
399 #define IDirectSoundNotify_METHODS \
400 ICOM_METHOD2(HRESULT,SetNotificationPositions, DWORD,cPositionNotifies, LPCDSBPOSITIONNOTIFY,lpcPositionNotifies)
401 #define IDirectSoundNotify_IMETHODS \
403 IDirectSoundNotify_METHODS
404 ICOM_DEFINE(IDirectSoundNotify,IUnknown)
405 #undef ICOM_INTERFACE
407 /*** IUnknown methods ***/
408 #define IDirectSoundNotify_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
409 #define IDirectSoundNotify_AddRef(p) ICOM_CALL (AddRef,p)
410 #define IDirectSoundNotify_Release(p) ICOM_CALL (Release,p)
411 /*** IDirectSoundNotify methods ***/
412 #define IDirectSoundNotify_SetNotificationPositions(p,a,b) ICOM_CALL2(SetNotificationPositions,p,a,b)
415 /*****************************************************************************
416 * IDirectSound3DListener interface
418 #define DS3DMODE_NORMAL 0x00000000
419 #define DS3DMODE_HEADRELATIVE 0x00000001
420 #define DS3DMODE_DISABLE 0x00000002
422 #define DS3D_IMMEDIATE 0x00000000
423 #define DS3D_DEFERRED 0x00000001
425 #define DS3D_MINDISTANCEFACTOR 0.0f
426 #define DS3D_MAXDISTANCEFACTOR 10.0f
427 #define DS3D_DEFAULTDISTANCEFACTOR 1.0f
429 #define DS3D_MINROLLOFFFACTOR 0.0f
430 #define DS3D_MAXROLLOFFFACTOR 10.0f
431 #define DS3D_DEFAULTROLLOFFFACTOR 1.0f
433 #define DS3D_MINDOPPLERFACTOR 0.0f
434 #define DS3D_MAXDOPPLERFACTOR 10.0f
435 #define DS3D_DEFAULTDOPPLERFACTOR 1.0f
437 #define DS3D_DEFAULTMINDISTANCE 1.0f
438 #define DS3D_DEFAULTMAXDISTANCE 1000000000.0f
440 #define DS3D_MINCONEANGLE 0
441 #define DS3D_MAXCONEANGLE 360
442 #define DS3D_DEFAULTCONEANGLE 360
444 #define DS3D_DEFAULTCONEOUTSIDEVOLUME 0
446 typedef struct _DS3DLISTENER {
450 D3DVECTOR vOrientFront;
451 D3DVECTOR vOrientTop;
452 D3DVALUE flDistanceFactor;
453 D3DVALUE flRolloffFactor;
454 D3DVALUE flDopplerFactor;
455 } DS3DLISTENER, *LPDS3DLISTENER;
457 typedef const DS3DLISTENER *LPCDS3DLISTENER;
459 #define ICOM_INTERFACE IDirectSound3DListener
460 #define IDirectSound3DListener_METHODS \
461 ICOM_METHOD1(HRESULT,GetAllParameters, LPDS3DLISTENER,lpListener) \
462 ICOM_METHOD1(HRESULT,GetDistanceFactor, LPD3DVALUE,lpflDistanceFactor) \
463 ICOM_METHOD1(HRESULT,GetDopplerFactor, LPD3DVALUE,lpflDopplerFactor) \
464 ICOM_METHOD2(HRESULT,GetOrientation, LPD3DVECTOR,lpvOrientFront, LPD3DVECTOR,lpvOrientTop) \
465 ICOM_METHOD1(HRESULT,GetPosition, LPD3DVECTOR,lpvPosition) \
466 ICOM_METHOD1(HRESULT,GetRolloffFactor, LPD3DVALUE,lpflRolloffFactor) \
467 ICOM_METHOD1(HRESULT,GetVelocity, LPD3DVECTOR,lpvVelocity) \
468 ICOM_METHOD2(HRESULT,SetAllParameters, LPCDS3DLISTENER,lpcListener, DWORD,dwApply) \
469 ICOM_METHOD2(HRESULT,SetDistanceFactor, D3DVALUE,flDistanceFactor, DWORD,dwApply) \
470 ICOM_METHOD2(HRESULT,SetDopplerFactor, D3DVALUE,flDopplerFactor, DWORD,dwApply) \
471 ICOM_METHOD7(HRESULT,SetOrientation, D3DVALUE,xFront, D3DVALUE,yFront, D3DVALUE,zFront, D3DVALUE,xTop, D3DVALUE,yTop, D3DVALUE,zTop, DWORD,dwApply) \
472 ICOM_METHOD4(HRESULT,SetPosition, D3DVALUE,x, D3DVALUE,y, D3DVALUE,z, DWORD,dwApply) \
473 ICOM_METHOD2(HRESULT,SetRolloffFactor, D3DVALUE,flRolloffFactor, DWORD,dwApply) \
474 ICOM_METHOD4(HRESULT,SetVelocity, D3DVALUE,x, D3DVALUE,y, D3DVALUE,z, DWORD,dwApply) \
475 ICOM_METHOD (HRESULT,CommitDeferredSettings)
476 #define IDirectSound3DListener_IMETHODS \
478 IDirectSound3DListener_METHODS
479 ICOM_DEFINE(IDirectSound3DListener,IUnknown)
480 #undef ICOM_INTERFACE
482 /*** IUnknown methods ***/
483 #define IDirectSound3DListener_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
484 #define IDirectSound3DListener_AddRef(p) ICOM_CALL (AddRef,p)
485 #define IDirectSound3DListener_Release(p) ICOM_CALL (Release,p)
486 /*** IDirectSound3DListener methods ***/
487 #define IDirectSound3DListener_GetAllParameters(p,a) ICOM_CALL1(GetAllParameters,p,a)
488 #define IDirectSound3DListener_GetDistanceFactor(p,a) ICOM_CALL1(GetDistanceFactor,p,a)
489 #define IDirectSound3DListener_GetDopplerFactor(p,a) ICOM_CALL1(GetDopplerFactor,p,a)
490 #define IDirectSound3DListener_GetOrientation(p,a,b) ICOM_CALL2(GetOrientation,p,a,b)
491 #define IDirectSound3DListener_GetPosition(p,a) ICOM_CALL1(GetPosition,p,a)
492 #define IDirectSound3DListener_GetRolloffFactor(p,a) ICOM_CALL1(GetRolloffFactor,p,a)
493 #define IDirectSound3DListener_GetVelocity(p,a) ICOM_CALL1(GetVelocity,p,a)
494 #define IDirectSound3DListener_SetAllParameters(p,a,b) ICOM_CALL2(SetAllParameters,p,a,b)
495 #define IDirectSound3DListener_SetDistanceFactor(p,a,b) ICOM_CALL2(SetDistanceFactor,p,a,b)
496 #define IDirectSound3DListener_SetDopplerFactor(p,a,b) ICOM_CALL2(SetDopplerFactor,p,a,b)
497 #define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) ICOM_CALL7(SetOrientation,p,a,b,c,d,e,f,g)
498 #define IDirectSound3DListener_SetPosition(p,a,b,c,d) ICOM_CALL4(SetPosition,p,a,b,c,d)
499 #define IDirectSound3DListener_SetRolloffFactor(p,a,b) ICOM_CALL2(SetRolloffFactor,p,a,b)
500 #define IDirectSound3DListener_SetVelocity(p,a,b,c,d) ICOM_CALL4(SetVelocity,p,a,b,c,d)
501 #define IDirectSound3DListener_CommitDeferredSettings(p) ICOM_CALL (CommitDeferredSettings,p)
504 /*****************************************************************************
505 * IDirectSound3DBuffer interface
507 typedef struct _DS3DBUFFER {
511 DWORD dwInsideConeAngle;
512 DWORD dwOutsideConeAngle;
513 D3DVECTOR vConeOrientation;
514 LONG lConeOutsideVolume;
515 D3DVALUE flMinDistance;
516 D3DVALUE flMaxDistance;
518 } DS3DBUFFER, *LPDS3DBUFFER;
520 typedef const DS3DBUFFER *LPCDS3DBUFFER;
522 #define ICOM_INTERFACE IDirectSound3DBuffer
523 #define IDirectSound3DBuffer_METHODS \
524 ICOM_METHOD1(HRESULT,GetAllParameters, LPDS3DBUFFER,lpDs3dBuffer) \
525 ICOM_METHOD2(HRESULT,GetConeAngles, LPDWORD,lpdwInsideConeAngle, LPDWORD,lpdwOutsideConeAngle) \
526 ICOM_METHOD1(HRESULT,GetConeOrientation, LPD3DVECTOR,lpvOrientation) \
527 ICOM_METHOD1(HRESULT,GetConeOutsideVolume, LPLONG,lplConeOutsideVolume) \
528 ICOM_METHOD1(HRESULT,GetMaxDistance, LPD3DVALUE,lpflMaxDistance) \
529 ICOM_METHOD1(HRESULT,GetMinDistance, LPD3DVALUE,lpflMinDistance) \
530 ICOM_METHOD1(HRESULT,GetMode, LPDWORD,lpwdMode) \
531 ICOM_METHOD1(HRESULT,GetPosition, LPD3DVECTOR,lpvPosition) \
532 ICOM_METHOD1(HRESULT,GetVelocity, LPD3DVECTOR,lpvVelocity) \
533 ICOM_METHOD2(HRESULT,SetAllParameters, LPCDS3DBUFFER,lpcDs3dBuffer, DWORD,dwApply) \
534 ICOM_METHOD3(HRESULT,SetConeAngles, DWORD,dwInsideConeAngle, DWORD,dwOutsideConeAngle, DWORD,dwApply) \
535 ICOM_METHOD4(HRESULT,SetConeOrientation, D3DVALUE,x, D3DVALUE,y, D3DVALUE,z, DWORD,dwApply) \
536 ICOM_METHOD2(HRESULT,SetConeOutsideVolume, LONG,lConeOutsideVolume, DWORD,dwApply) \
537 ICOM_METHOD2(HRESULT,SetMaxDistance, D3DVALUE,flMaxDistance, DWORD,dwApply) \
538 ICOM_METHOD2(HRESULT,SetMinDistance, D3DVALUE,flMinDistance, DWORD,dwApply) \
539 ICOM_METHOD2(HRESULT,SetMode, DWORD,dwMode, DWORD,dwApply) \
540 ICOM_METHOD4(HRESULT,SetPosition, D3DVALUE,x, D3DVALUE,y, D3DVALUE,z, DWORD,dwApply) \
541 ICOM_METHOD4(HRESULT,SetVelocity, D3DVALUE,x, D3DVALUE,y, D3DVALUE,z, DWORD,dwApply)
542 #define IDirectSound3DBuffer_IMETHODS \
544 IDirectSound3DBuffer_METHODS
545 ICOM_DEFINE(IDirectSound3DBuffer,IUnknown)
546 #undef ICOM_INTERFACE
548 /*** IUnknown methods ***/
549 #define IDirectSound3DBuffer_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
550 #define IDirectSound3DBuffer_AddRef(p) ICOM_CALL (AddRef,p)
551 #define IDirectSound3DBuffer_Release(p) ICOM_CALL (Release,p)
552 /*** IDirectSound3DBuffer methods ***/
553 #define IDirectSound3DBuffer_GetAllParameters(p,a) ICOM_CALL1(GetAllParameters,p,a)
554 #define IDirectSound3DBuffer_GetConeAngles(p,a,b) ICOM_CALL2(GetConeAngles,p,a,b)
555 #define IDirectSound3DBuffer_GetConeOrientation(p,a) ICOM_CALL1(GetConeOrientation,p,a)
556 #define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) ICOM_CALL1(GetConeOutsideVolume,p,a)
557 #define IDirectSound3DBuffer_GetMaxDistance(p,a) ICOM_CALL1(GetMaxDistance,p,a)
558 #define IDirectSound3DBuffer_GetMinDistance(p,a) ICOM_CALL1(GetMinDistance,p,a)
559 #define IDirectSound3DBuffer_GetMode(p,a) ICOM_CALL1(GetMode,p,a)
560 #define IDirectSound3DBuffer_GetPosition(p,a) ICOM_CALL1(GetPosition,p,a)
561 #define IDirectSound3DBuffer_GetVelocity(p,a) ICOM_CALL1(GetVelocity,p,a)
562 #define IDirectSound3DBuffer_SetAllParameters(p,a,b) ICOM_CALL2(SetAllParameters,p,a,b)
563 #define IDirectSound3DBuffer_SetConeAngles(p,a,b) ICOM_CALL3(SetConeAngles,p,a,b)
564 #define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) ICOM_CALL4(SetConeOrientation,p,a,b,c,d)
565 #define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) ICOM_CALL2(SetConeOutsideVolume,p,a,b)
566 #define IDirectSound3DBuffer_SetMaxDistance(p,a,b) ICOM_CALL2(SetMaxDistance,p,a,b)
567 #define IDirectSound3DBuffer_SetMinDistance(p,a,b) ICOM_CALL2(SetMinDistance,p,a,b)
568 #define IDirectSound3DBuffer_SetMode(p,a,b) ICOM_CALL2(SetMode,p,a,b)
569 #define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) ICOM_CALL4(SetPosition,p,a,b,c,d)
570 #define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) ICOM_CALL4(SetVelocity,p,a,b,c,d)
576 #endif /* defined(__cplusplus) */
578 #endif /* __WINE_DSOUND_H */