dsound.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:108k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1995-2000 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:       dsound.h
  6.  *  Content:    DirectSound include file
  7.  *
  8.  **************************************************************************/
  9. #define COM_NO_WINDOWS_H
  10. #include <objbase.h>
  11. #include <float.h>
  12. #ifndef DIRECTSOUND_VERSION
  13. #define DIRECTSOUND_VERSION 0x0800  /* Version 8.0 */
  14. #endif
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif // __cplusplus
  18. #ifndef __DSOUND_INCLUDED__
  19. #define __DSOUND_INCLUDED__
  20. /* Type definitions shared with Direct3D */
  21. #ifndef DX_SHARED_DEFINES
  22. typedef float D3DVALUE, *LPD3DVALUE;
  23. #ifndef D3DCOLOR_DEFINED
  24. typedef DWORD D3DCOLOR;
  25. #define D3DCOLOR_DEFINED
  26. #endif
  27. #ifndef LPD3DCOLOR_DEFINED
  28. typedef DWORD *LPD3DCOLOR;
  29. #define LPD3DCOLOR_DEFINED
  30. #endif
  31. #ifndef D3DVECTOR_DEFINED
  32. typedef struct _D3DVECTOR {
  33.     float x;
  34.     float y;
  35.     float z;
  36. } D3DVECTOR;
  37. #define D3DVECTOR_DEFINED
  38. #endif
  39. #ifndef LPD3DVECTOR_DEFINED
  40. typedef D3DVECTOR *LPD3DVECTOR;
  41. #define LPD3DVECTOR_DEFINED
  42. #endif
  43. #define DX_SHARED_DEFINES
  44. #endif // DX_SHARED_DEFINES
  45. #define _FACDS  0x878   /* DirectSound's facility code */
  46. #define MAKE_DSHRESULT(code)  MAKE_HRESULT(1, _FACDS, code)
  47. // DirectSound Component GUID {47D4D946-62E8-11CF-93BC-444553540000}
  48. DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  49. // DirectSound 8.0 Component GUID {3901CC3F-84B5-4FA4-BA35-AA8172B8A09B}
  50. DEFINE_GUID(CLSID_DirectSound8, 0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b);
  51. // DirectSound Capture Component GUID {B0210780-89CD-11D0-AF08-00A0C925CD16}
  52. DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  53. // DirectSound 8.0 Capture Component GUID {E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1}
  54. DEFINE_GUID(CLSID_DirectSoundCapture8, 0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1);
  55. // DirectSound Full Duplex Component GUID {FEA4300C-7959-4147-B26A-2377B9E7A91D}
  56. DEFINE_GUID(CLSID_DirectSoundFullDuplex, 0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d);
  57. // DirectSound default playback device GUID {DEF00000-9C6D-47ED-AAF1-4DDA8F2B5C03}
  58. DEFINE_GUID(DSDEVID_DefaultPlayback, 0xdef00000, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
  59. // DirectSound default capture device GUID {DEF00001-9C6D-47ED-AAF1-4DDA8F2B5C03}
  60. DEFINE_GUID(DSDEVID_DefaultCapture, 0xdef00001, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
  61. // DirectSound default device for voice playback {DEF00002-9C6D-47ED-AAF1-4DDA8F2B5C03}
  62. DEFINE_GUID(DSDEVID_DefaultVoicePlayback, 0xdef00002, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
  63. // DirectSound default device for voice capture {DEF00003-9C6D-47ED-AAF1-4DDA8F2B5C03}
  64. DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xdef00003, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
  65. //
  66. // Forward declarations for interfaces.
  67. // 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
  68. //
  69. #ifdef __cplusplus
  70. struct IDirectSound;
  71. struct IDirectSoundBuffer;
  72. struct IDirectSound3DListener;
  73. struct IDirectSound3DBuffer;
  74. struct IDirectSoundCapture;
  75. struct IDirectSoundCaptureBuffer;
  76. struct IDirectSoundNotify;
  77. #endif // __cplusplus
  78. //
  79. // DirectSound 8.0 interfaces.
  80. //
  81. #if DIRECTSOUND_VERSION >= 0x0800
  82. #ifdef __cplusplus
  83. struct IDirectSound8;
  84. struct IDirectSoundBuffer8;
  85. struct IDirectSoundCaptureBuffer8;
  86. struct IDirectSoundFXGargle;
  87. struct IDirectSoundFXChorus;
  88. struct IDirectSoundFXFlanger;
  89. struct IDirectSoundFXEcho;
  90. struct IDirectSoundFXDistortion;
  91. struct IDirectSoundFXCompressor;
  92. struct IDirectSoundFXParamEq;
  93. struct IDirectSoundFXWavesReverb;
  94. struct IDirectSoundFXI3DL2Reverb;
  95. struct IDirectSoundCaptureFXAec;
  96. struct IDirectSoundCaptureFXNoiseSuppress;
  97. struct IDirectSoundFullDuplex;
  98. #endif // __cplusplus
  99. // IDirectSound8, IDirectSoundBuffer8 and IDirectSoundCaptureBuffer8 are the
  100. // only DirectSound 7.0 interfaces with changed functionality in version 8.0.
  101. // The other level 8 interfaces as equivalent to their level 7 counterparts:
  102. #define IDirectSoundCapture8            IDirectSoundCapture
  103. #define IDirectSound3DListener8         IDirectSound3DListener
  104. #define IDirectSound3DBuffer8           IDirectSound3DBuffer
  105. #define IDirectSoundNotify8             IDirectSoundNotify
  106. #define IDirectSoundFXGargle8           IDirectSoundFXGargle
  107. #define IDirectSoundFXChorus8           IDirectSoundFXChorus
  108. #define IDirectSoundFXFlanger8          IDirectSoundFXFlanger
  109. #define IDirectSoundFXEcho8             IDirectSoundFXEcho
  110. #define IDirectSoundFXDistortion8       IDirectSoundFXDistortion
  111. #define IDirectSoundFXCompressor8       IDirectSoundFXCompressor
  112. #define IDirectSoundFXParamEq8          IDirectSoundFXParamEq
  113. #define IDirectSoundFXWavesReverb8      IDirectSoundFXWavesReverb
  114. #define IDirectSoundFXI3DL2Reverb8      IDirectSoundFXI3DL2Reverb
  115. #define IDirectSoundCaptureFXAec8       IDirectSoundCaptureFXAec
  116. #define IDirectSoundCaptureFXNoiseSuppress8 IDirectSoundCaptureFXNoiseSuppress
  117. #define IDirectSoundFullDuplex8         IDirectSoundFullDuplex
  118. #endif // DIRECTSOUND_VERSION >= 0x0800
  119. typedef struct IDirectSound                 *LPDIRECTSOUND;
  120. typedef struct IDirectSoundBuffer           *LPDIRECTSOUNDBUFFER;
  121. typedef struct IDirectSound3DListener       *LPDIRECTSOUND3DLISTENER;
  122. typedef struct IDirectSound3DBuffer         *LPDIRECTSOUND3DBUFFER;
  123. typedef struct IDirectSoundCapture          *LPDIRECTSOUNDCAPTURE;
  124. typedef struct IDirectSoundCaptureBuffer    *LPDIRECTSOUNDCAPTUREBUFFER;
  125. typedef struct IDirectSoundNotify           *LPDIRECTSOUNDNOTIFY;
  126. #if DIRECTSOUND_VERSION >= 0x0800
  127. typedef struct IDirectSoundFXGargle         *LPDIRECTSOUNDFXGARGLE;
  128. typedef struct IDirectSoundFXChorus         *LPDIRECTSOUNDFXCHORUS;
  129. typedef struct IDirectSoundFXFlanger        *LPDIRECTSOUNDFXFLANGER;
  130. typedef struct IDirectSoundFXEcho           *LPDIRECTSOUNDFXECHO;
  131. typedef struct IDirectSoundFXDistortion     *LPDIRECTSOUNDFXDISTORTION;
  132. typedef struct IDirectSoundFXCompressor     *LPDIRECTSOUNDFXCOMPRESSOR;
  133. typedef struct IDirectSoundFXParamEq        *LPDIRECTSOUNDFXPARAMEQ;
  134. typedef struct IDirectSoundFXWavesReverb    *LPDIRECTSOUNDFXWAVESREVERB;
  135. typedef struct IDirectSoundFXI3DL2Reverb    *LPDIRECTSOUNDFXI3DL2REVERB;
  136. typedef struct IDirectSoundCaptureFXAec     *LPDIRECTSOUNDCAPTUREFXAEC;
  137. typedef struct IDirectSoundCaptureFXNoiseSuppress *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS;
  138. typedef struct IDirectSoundFullDuplex       *LPDIRECTSOUNDFULLDUPLEX;
  139. typedef struct IDirectSound8                *LPDIRECTSOUND8;
  140. typedef struct IDirectSoundBuffer8          *LPDIRECTSOUNDBUFFER8;
  141. typedef struct IDirectSound3DListener8      *LPDIRECTSOUND3DLISTENER8;
  142. typedef struct IDirectSound3DBuffer8        *LPDIRECTSOUND3DBUFFER8;
  143. typedef struct IDirectSoundCapture8         *LPDIRECTSOUNDCAPTURE8;
  144. typedef struct IDirectSoundCaptureBuffer8   *LPDIRECTSOUNDCAPTUREBUFFER8;
  145. typedef struct IDirectSoundNotify8          *LPDIRECTSOUNDNOTIFY8;
  146. typedef struct IDirectSoundFXGargle8        *LPDIRECTSOUNDFXGARGLE8;
  147. typedef struct IDirectSoundFXChorus8        *LPDIRECTSOUNDFXCHORUS8;
  148. typedef struct IDirectSoundFXFlanger8       *LPDIRECTSOUNDFXFLANGER8;
  149. typedef struct IDirectSoundFXEcho8          *LPDIRECTSOUNDFXECHO8;
  150. typedef struct IDirectSoundFXDistortion8    *LPDIRECTSOUNDFXDISTORTION8;
  151. typedef struct IDirectSoundFXCompressor8    *LPDIRECTSOUNDFXCOMPRESSOR8;
  152. typedef struct IDirectSoundFXParamEq8       *LPDIRECTSOUNDFXPARAMEQ8;
  153. typedef struct IDirectSoundFXWavesReverb8   *LPDIRECTSOUNDFXWAVESREVERB8;
  154. typedef struct IDirectSoundFXI3DL2Reverb8   *LPDIRECTSOUNDFXI3DL2REVERB8;
  155. typedef struct IDirectSoundCaptureFXAec8    *LPDIRECTSOUNDCAPTUREFXAEC8;
  156. typedef struct IDirectSoundCaptureFXNoiseSuppress8 *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS8;
  157. typedef struct IDirectSoundFullDuplex8      *LPDIRECTSOUNDFULLDUPLEX8;
  158. #endif // DIRECTSOUND_VERSION >= 0x0800
  159. //
  160. // IID definitions for the unchanged DirectSound 8.0 interfaces
  161. //
  162. #if DIRECTSOUND_VERSION >= 0x0800
  163. #define IID_IDirectSoundCapture8            IID_IDirectSoundCapture
  164. #define IID_IDirectSound3DListener8         IID_IDirectSound3DListener
  165. #define IID_IDirectSound3DBuffer8           IID_IDirectSound3DBuffer
  166. #define IID_IDirectSoundNotify8             IID_IDirectSoundNotify
  167. #define IID_IDirectSoundFXGargle8           IID_IDirectSoundFXGargle
  168. #define IID_IDirectSoundFXChorus8           IID_IDirectSoundFXChorus
  169. #define IID_IDirectSoundFXFlanger8          IID_IDirectSoundFXFlanger
  170. #define IID_IDirectSoundFXEcho8             IID_IDirectSoundFXEcho
  171. #define IID_IDirectSoundFXDistortion8       IID_IDirectSoundFXDistortion
  172. #define IID_IDirectSoundFXCompressor8       IID_IDirectSoundFXCompressor
  173. #define IID_IDirectSoundFXParamEq8          IID_IDirectSoundFXParamEq
  174. #define IID_IDirectSoundFXWavesReverb8      IID_IDirectSoundFXWavesReverb
  175. #define IID_IDirectSoundFXI3DL2Reverb8      IID_IDirectSoundFXI3DL2Reverb
  176. #define IID_IDirectSoundCaptureFXAec8       IID_IDirectSoundCaptureFXAec
  177. #define IID_IDirectSoundCaptureFXNoiseSuppress8 IID_IDirectSoundCaptureFXNoiseSuppress
  178. #define IID_IDirectSoundFullDuplex8         IID_IDirectSoundFullDuplex
  179. #endif // DIRECTSOUND_VERSION >= 0x0800
  180. //
  181. // Compatibility typedefs
  182. //
  183. #ifndef _LPCWAVEFORMATEX_DEFINED
  184. #define _LPCWAVEFORMATEX_DEFINED
  185. typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
  186. #endif // _LPCWAVEFORMATEX_DEFINED
  187. #ifndef __LPCGUID_DEFINED__
  188. #define __LPCGUID_DEFINED__
  189. typedef const GUID *LPCGUID;
  190. #endif // __LPCGUID_DEFINED__
  191. typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
  192. typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
  193. typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
  194. typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
  195. typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
  196. typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
  197. typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
  198. #if DIRECTSOUND_VERSION >= 0x0800
  199. typedef LPDIRECTSOUND8 *LPLPDIRECTSOUND8;
  200. typedef LPDIRECTSOUNDBUFFER8 *LPLPDIRECTSOUNDBUFFER8;
  201. typedef LPDIRECTSOUNDCAPTURE8 *LPLPDIRECTSOUNDCAPTURE8;
  202. typedef LPDIRECTSOUNDCAPTUREBUFFER8 *LPLPDIRECTSOUNDCAPTUREBUFFER8;
  203. #endif // DIRECTSOUND_VERSION >= 0x0800
  204. //
  205. // Structures
  206. //
  207. typedef struct _DSCAPS
  208. {
  209.     DWORD           dwSize;
  210.     DWORD           dwFlags;
  211.     DWORD           dwMinSecondarySampleRate;
  212.     DWORD           dwMaxSecondarySampleRate;
  213.     DWORD           dwPrimaryBuffers;
  214.     DWORD           dwMaxHwMixingAllBuffers;
  215.     DWORD           dwMaxHwMixingStaticBuffers;
  216.     DWORD           dwMaxHwMixingStreamingBuffers;
  217.     DWORD           dwFreeHwMixingAllBuffers;
  218.     DWORD           dwFreeHwMixingStaticBuffers;
  219.     DWORD           dwFreeHwMixingStreamingBuffers;
  220.     DWORD           dwMaxHw3DAllBuffers;
  221.     DWORD           dwMaxHw3DStaticBuffers;
  222.     DWORD           dwMaxHw3DStreamingBuffers;
  223.     DWORD           dwFreeHw3DAllBuffers;
  224.     DWORD           dwFreeHw3DStaticBuffers;
  225.     DWORD           dwFreeHw3DStreamingBuffers;
  226.     DWORD           dwTotalHwMemBytes;
  227.     DWORD           dwFreeHwMemBytes;
  228.     DWORD           dwMaxContigFreeHwMemBytes;
  229.     DWORD           dwUnlockTransferRateHwBuffers;
  230.     DWORD           dwPlayCpuOverheadSwBuffers;
  231.     DWORD           dwReserved1;
  232.     DWORD           dwReserved2;
  233. } DSCAPS, *LPDSCAPS;
  234. typedef const DSCAPS *LPCDSCAPS;
  235. typedef struct _DSBCAPS
  236. {
  237.     DWORD           dwSize;
  238.     DWORD           dwFlags;
  239.     DWORD           dwBufferBytes;
  240.     DWORD           dwUnlockTransferRate;
  241.     DWORD           dwPlayCpuOverhead;
  242. } DSBCAPS, *LPDSBCAPS;
  243. typedef const DSBCAPS *LPCDSBCAPS;
  244. #if DIRECTSOUND_VERSION >= 0x0800
  245.     typedef struct _DSEFFECTDESC
  246.     {
  247.         DWORD       dwSize;
  248.         DWORD       dwFlags;
  249.         GUID        guidDSFXClass;
  250.         DWORD_PTR   dwReserved1;
  251.         DWORD_PTR   dwReserved2;
  252.     } DSEFFECTDESC, *LPDSEFFECTDESC;
  253.     typedef const DSEFFECTDESC *LPCDSEFFECTDESC;
  254.     #define DSFX_LOCHARDWARE    0x00000001
  255.     #define DSFX_LOCSOFTWARE    0x00000002
  256.     enum
  257.     {
  258.         DSFXR_PRESENT,          // 0
  259.         DSFXR_LOCHARDWARE,      // 1
  260.         DSFXR_LOCSOFTWARE,      // 2
  261.         DSFXR_UNALLOCATED,      // 3
  262.         DSFXR_FAILED,           // 4
  263.         DSFXR_UNKNOWN,          // 5
  264.         DSFXR_SENDLOOP          // 6
  265.     };
  266.     typedef struct _DSCEFFECTDESC
  267.     {
  268.         DWORD       dwSize;
  269.         DWORD       dwFlags;
  270.         GUID        guidDSCFXClass;
  271.         GUID        guidDSCFXInstance;
  272.         DWORD       dwReserved1;
  273.         DWORD       dwReserved2;
  274.     } DSCEFFECTDESC, *LPDSCEFFECTDESC;
  275.     typedef const DSCEFFECTDESC *LPCDSCEFFECTDESC;
  276.     #define DSCFX_LOCHARDWARE   0x00000001
  277.     #define DSCFX_LOCSOFTWARE   0x00000002
  278.     #define DSCFXR_LOCHARDWARE  0x00000010
  279.     #define DSCFXR_LOCSOFTWARE  0x00000020
  280. #endif // DIRECTSOUND_VERSION >= 0x0800
  281. typedef struct _DSBUFFERDESC
  282. {
  283.     DWORD           dwSize;
  284.     DWORD           dwFlags;
  285.     DWORD           dwBufferBytes;
  286.     DWORD           dwReserved;
  287.     LPWAVEFORMATEX  lpwfxFormat;
  288. #if DIRECTSOUND_VERSION >= 0x0700
  289.     GUID            guid3DAlgorithm;
  290. #endif
  291. } DSBUFFERDESC, *LPDSBUFFERDESC;
  292. typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
  293. // Older version of this structure:
  294. typedef struct _DSBUFFERDESC1
  295. {
  296.     DWORD           dwSize;
  297.     DWORD           dwFlags;
  298.     DWORD           dwBufferBytes;
  299.     DWORD           dwReserved;
  300.     LPWAVEFORMATEX  lpwfxFormat;
  301. } DSBUFFERDESC1, *LPDSBUFFERDESC1;
  302. typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1;
  303. typedef struct _DS3DBUFFER
  304. {
  305.     DWORD           dwSize;
  306.     D3DVECTOR       vPosition;
  307.     D3DVECTOR       vVelocity;
  308.     DWORD           dwInsideConeAngle;
  309.     DWORD           dwOutsideConeAngle;
  310.     D3DVECTOR       vConeOrientation;
  311.     LONG            lConeOutsideVolume;
  312.     D3DVALUE        flMinDistance;
  313.     D3DVALUE        flMaxDistance;
  314.     DWORD           dwMode;
  315. } DS3DBUFFER, *LPDS3DBUFFER;
  316. typedef const DS3DBUFFER *LPCDS3DBUFFER;
  317. typedef struct _DS3DLISTENER
  318. {
  319.     DWORD           dwSize;
  320.     D3DVECTOR       vPosition;
  321.     D3DVECTOR       vVelocity;
  322.     D3DVECTOR       vOrientFront;
  323.     D3DVECTOR       vOrientTop;
  324.     D3DVALUE        flDistanceFactor;
  325.     D3DVALUE        flRolloffFactor;
  326.     D3DVALUE        flDopplerFactor;
  327. } DS3DLISTENER, *LPDS3DLISTENER;
  328. typedef const DS3DLISTENER *LPCDS3DLISTENER;
  329. typedef struct _DSCCAPS
  330. {
  331.     DWORD           dwSize;
  332.     DWORD           dwFlags;
  333.     DWORD           dwFormats;
  334.     DWORD           dwChannels;
  335. } DSCCAPS, *LPDSCCAPS;
  336. typedef const DSCCAPS *LPCDSCCAPS;
  337. typedef struct _DSCBUFFERDESC1
  338. {
  339.     DWORD           dwSize;
  340.     DWORD           dwFlags;
  341.     DWORD           dwBufferBytes;
  342.     DWORD           dwReserved;
  343.     LPWAVEFORMATEX  lpwfxFormat;
  344. } DSCBUFFERDESC1, *LPDSCBUFFERDESC1;
  345. typedef struct _DSCBUFFERDESC
  346. {
  347.     DWORD           dwSize;
  348.     DWORD           dwFlags;
  349.     DWORD           dwBufferBytes;
  350.     DWORD           dwReserved;
  351.     LPWAVEFORMATEX  lpwfxFormat;
  352. #if DIRECTSOUND_VERSION >= 0x0800
  353.     DWORD           dwFXCount;
  354.     LPDSCEFFECTDESC lpDSCFXDesc;
  355. #endif
  356. } DSCBUFFERDESC, *LPDSCBUFFERDESC;
  357. typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
  358. typedef struct _DSCBCAPS
  359. {
  360.     DWORD           dwSize;
  361.     DWORD           dwFlags;
  362.     DWORD           dwBufferBytes;
  363.     DWORD           dwReserved;
  364. } DSCBCAPS, *LPDSCBCAPS;
  365. typedef const DSCBCAPS *LPCDSCBCAPS;
  366. typedef struct _DSBPOSITIONNOTIFY
  367. {
  368.     DWORD           dwOffset;
  369.     HANDLE          hEventNotify;
  370. } DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
  371. typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
  372. //
  373. // DirectSound API
  374. //
  375. typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
  376. typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
  377. extern HRESULT WINAPI DirectSoundCreate(LPCGUID pcGuidDevice, LPDIRECTSOUND *ppDS, LPUNKNOWN pUnkOuter);
  378. extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA pDSEnumCallback, LPVOID pContext);
  379. extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW pDSEnumCallback, LPVOID pContext);
  380. extern HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID pcGuidDevice, LPDIRECTSOUNDCAPTURE *ppDSC, LPUNKNOWN pUnkOuter);
  381. extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA pDSEnumCallback, LPVOID pContext);
  382. extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW pDSEnumCallback, LPVOID pContext);
  383. #if DIRECTSOUND_VERSION >= 0x0800
  384. extern HRESULT WINAPI DirectSoundCreate8(LPCGUID pcGuidDevice, LPDIRECTSOUND8 *ppDS8, LPUNKNOWN pUnkOuter);
  385. extern HRESULT WINAPI DirectSoundCaptureCreate8(LPCGUID pcGuidDevice, LPDIRECTSOUNDCAPTURE8 *ppDSC8, LPUNKNOWN pUnkOuter);
  386. extern HRESULT WINAPI DirectSoundFullDuplexCreate(LPCGUID pcGuidCaptureDevice, LPCGUID pcGuidRenderDevice,
  387.         LPCDSCBUFFERDESC pcDSCBufferDesc, LPCDSBUFFERDESC pcDSBufferDesc, HWND hWnd,
  388.         DWORD dwLevel, LPDIRECTSOUNDFULLDUPLEX* ppDSFD, LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8,
  389.         LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, LPUNKNOWN pUnkOuter);
  390. #define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate
  391. extern HRESULT WINAPI GetDeviceID(LPCGUID pGuidSrc, LPGUID pGuidDest);
  392. #endif // DIRECTSOUND_VERSION >= 0x0800
  393. #ifdef UNICODE
  394. #define LPDSENUMCALLBACK            LPDSENUMCALLBACKW
  395. #define DirectSoundEnumerate        DirectSoundEnumerateW
  396. #define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
  397. #else // UNICODE
  398. #define LPDSENUMCALLBACK            LPDSENUMCALLBACKA
  399. #define DirectSoundEnumerate        DirectSoundEnumerateA
  400. #define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
  401. #endif // UNICODE
  402. //
  403. // IUnknown
  404. //
  405. #if !defined(__cplusplus) || defined(CINTERFACE)
  406. #ifndef IUnknown_QueryInterface
  407. #define IUnknown_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
  408. #endif // IUnknown_QueryInterface
  409. #ifndef IUnknown_AddRef
  410. #define IUnknown_AddRef(p)              (p)->lpVtbl->AddRef(p)
  411. #endif // IUnknown_AddRef
  412. #ifndef IUnknown_Release
  413. #define IUnknown_Release(p)             (p)->lpVtbl->Release(p)
  414. #endif // IUnknown_Release
  415. #else // !defined(__cplusplus) || defined(CINTERFACE)
  416. #ifndef IUnknown_QueryInterface
  417. #define IUnknown_QueryInterface(p,a,b)  (p)->QueryInterface(a,b)
  418. #endif // IUnknown_QueryInterface
  419. #ifndef IUnknown_AddRef
  420. #define IUnknown_AddRef(p)              (p)->AddRef()
  421. #endif // IUnknown_AddRef
  422. #ifndef IUnknown_Release
  423. #define IUnknown_Release(p)             (p)->Release()
  424. #endif // IUnknown_Release
  425. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  426. #ifndef __IReferenceClock_INTERFACE_DEFINED__
  427. #define __IReferenceClock_INTERFACE_DEFINED__
  428. typedef LONGLONG REFERENCE_TIME;
  429. typedef REFERENCE_TIME *LPREFERENCE_TIME;
  430. DEFINE_GUID(IID_IReferenceClock, 0x56a86897, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
  431. #undef INTERFACE
  432. #define INTERFACE IReferenceClock
  433. DECLARE_INTERFACE_(IReferenceClock, IUnknown)
  434. {
  435.     // IUnknown methods
  436.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  437.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  438.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  439.     // IReferenceClock methods
  440.     STDMETHOD(GetTime)              (THIS_ REFERENCE_TIME *pTime) PURE;
  441.     STDMETHOD(AdviseTime)           (THIS_ REFERENCE_TIME rtBaseTime, REFERENCE_TIME rtStreamTime,
  442.                                            HANDLE hEvent, LPDWORD pdwAdviseCookie) PURE;
  443.     STDMETHOD(AdvisePeriodic)       (THIS_ REFERENCE_TIME rtStartTime, REFERENCE_TIME rtPeriodTime,
  444.                                            HANDLE hSemaphore, LPDWORD pdwAdviseCookie) PURE;
  445.     STDMETHOD(Unadvise)             (THIS_ DWORD dwAdviseCookie) PURE;
  446. };
  447. #endif // __IReferenceClock_INTERFACE_DEFINED__
  448. #ifndef IReferenceClock_QueryInterface
  449. #define IReferenceClock_QueryInterface(p,a,b)      IUnknown_QueryInterface(p,a,b)
  450. #define IReferenceClock_AddRef(p)                  IUnknown_AddRef(p)
  451. #define IReferenceClock_Release(p)                 IUnknown_Release(p)
  452. #if !defined(__cplusplus) || defined(CINTERFACE)
  453. #define IReferenceClock_GetTime(p,a)               (p)->lpVtbl->GetTime(p,a)
  454. #define IReferenceClock_AdviseTime(p,a,b,c,d)      (p)->lpVtbl->AdviseTime(p,a,b,c,d)
  455. #define IReferenceClock_AdvisePeriodic(p,a,b,c,d)  (p)->lpVtbl->AdvisePeriodic(p,a,b,c,d)
  456. #define IReferenceClock_Unadvise(p,a)              (p)->lpVtbl->Unadvise(p,a)
  457. #else // !defined(__cplusplus) || defined(CINTERFACE)
  458. #define IReferenceClock_GetTime(p,a)               (p)->GetTime(a)
  459. #define IReferenceClock_AdviseTime(p,a,b,c,d)      (p)->AdviseTime(a,b,c,d)
  460. #define IReferenceClock_AdvisePeriodic(p,a,b,c,d)  (p)->AdvisePeriodic(a,b,c,d)
  461. #define IReferenceClock_Unadvise(p,a)              (p)->Unadvise(a)
  462. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  463. #endif // IReferenceClock_QueryInterface
  464. //
  465. // IDirectSound
  466. //
  467. DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  468. #undef INTERFACE
  469. #define INTERFACE IDirectSound
  470. DECLARE_INTERFACE_(IDirectSound, IUnknown)
  471. {
  472.     // IUnknown methods
  473.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  474.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  475.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  476.     // IDirectSound methods
  477.     STDMETHOD(CreateSoundBuffer)    (THIS_ LPCDSBUFFERDESC pcDSBufferDesc, LPDIRECTSOUNDBUFFER *ppDSBuffer, LPUNKNOWN pUnkOuter) PURE;
  478.     STDMETHOD(GetCaps)              (THIS_ LPDSCAPS pDSCaps) PURE;
  479.     STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER pDSBufferOriginal, LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE;
  480.     STDMETHOD(SetCooperativeLevel)  (THIS_ HWND hwnd, DWORD dwLevel) PURE;
  481.     STDMETHOD(Compact)              (THIS) PURE;
  482.     STDMETHOD(GetSpeakerConfig)     (THIS_ LPDWORD pdwSpeakerConfig) PURE;
  483.     STDMETHOD(SetSpeakerConfig)     (THIS_ DWORD dwSpeakerConfig) PURE;
  484.     STDMETHOD(Initialize)           (THIS_ LPCGUID pcGuidDevice) PURE;
  485. };
  486. #define IDirectSound_QueryInterface(p,a,b)       IUnknown_QueryInterface(p,a,b)
  487. #define IDirectSound_AddRef(p)                   IUnknown_AddRef(p)
  488. #define IDirectSound_Release(p)                  IUnknown_Release(p)
  489. #if !defined(__cplusplus) || defined(CINTERFACE)
  490. #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
  491. #define IDirectSound_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
  492. #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
  493. #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
  494. #define IDirectSound_Compact(p)                  (p)->lpVtbl->Compact(p)
  495. #define IDirectSound_GetSpeakerConfig(p,a)       (p)->lpVtbl->GetSpeakerConfig(p,a)
  496. #define IDirectSound_SetSpeakerConfig(p,b)       (p)->lpVtbl->SetSpeakerConfig(p,b)
  497. #define IDirectSound_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
  498. #else // !defined(__cplusplus) || defined(CINTERFACE)
  499. #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->CreateSoundBuffer(a,b,c)
  500. #define IDirectSound_GetCaps(p,a)                (p)->GetCaps(a)
  501. #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
  502. #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
  503. #define IDirectSound_Compact(p)                  (p)->Compact()
  504. #define IDirectSound_GetSpeakerConfig(p,a)       (p)->GetSpeakerConfig(a)
  505. #define IDirectSound_SetSpeakerConfig(p,b)       (p)->SetSpeakerConfig(b)
  506. #define IDirectSound_Initialize(p,a)             (p)->Initialize(a)
  507. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  508. #if DIRECTSOUND_VERSION >= 0x0800
  509. //
  510. // IDirectSound8
  511. //
  512. DEFINE_GUID(IID_IDirectSound8, 0xC50A7E93, 0xF395, 0x4834, 0x9E, 0xF6, 0x7F, 0xA9, 0x9D, 0xE5, 0x09, 0x66);
  513. #undef INTERFACE
  514. #define INTERFACE IDirectSound8
  515. DECLARE_INTERFACE_(IDirectSound8, IDirectSound)
  516. {
  517.     // IUnknown methods
  518.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  519.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  520.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  521.     // IDirectSound methods
  522.     STDMETHOD(CreateSoundBuffer)    (THIS_ LPCDSBUFFERDESC pcDSBufferDesc, LPDIRECTSOUNDBUFFER *ppDSBuffer, LPUNKNOWN pUnkOuter) PURE;
  523.     STDMETHOD(GetCaps)              (THIS_ LPDSCAPS pDSCaps) PURE;
  524.     STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER pDSBufferOriginal, LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE;
  525.     STDMETHOD(SetCooperativeLevel)  (THIS_ HWND hwnd, DWORD dwLevel) PURE;
  526.     STDMETHOD(Compact)              (THIS) PURE;
  527.     STDMETHOD(GetSpeakerConfig)     (THIS_ LPDWORD pdwSpeakerConfig) PURE;
  528.     STDMETHOD(SetSpeakerConfig)     (THIS_ DWORD dwSpeakerConfig) PURE;
  529.     STDMETHOD(Initialize)           (THIS_ LPCGUID pcGuidDevice) PURE;
  530.     // IDirectSound8 methods
  531.     STDMETHOD(VerifyCertification)  (THIS_ LPDWORD pdwCertified) PURE;
  532. };
  533. #define IDirectSound8_QueryInterface(p,a,b)       IDirectSound_QueryInterface(p,a,b)
  534. #define IDirectSound8_AddRef(p)                   IDirectSound_AddRef(p)
  535. #define IDirectSound8_Release(p)                  IDirectSound_Release(p)
  536. #define IDirectSound8_CreateSoundBuffer(p,a,b,c)  IDirectSound_CreateSoundBuffer(p,a,b,c)
  537. #define IDirectSound8_GetCaps(p,a)                IDirectSound_GetCaps(p,a)
  538. #define IDirectSound8_DuplicateSoundBuffer(p,a,b) IDirectSound_DuplicateSoundBuffer(p,a,b)
  539. #define IDirectSound8_SetCooperativeLevel(p,a,b)  IDirectSound_SetCooperativeLevel(p,a,b)
  540. #define IDirectSound8_Compact(p)                  IDirectSound_Compact(p)
  541. #define IDirectSound8_GetSpeakerConfig(p,a)       IDirectSound_GetSpeakerConfig(p,a)
  542. #define IDirectSound8_SetSpeakerConfig(p,a)       IDirectSound_SetSpeakerConfig(p,a)
  543. #define IDirectSound8_Initialize(p,a)             IDirectSound_Initialize(p,a)
  544. #if !defined(__cplusplus) || defined(CINTERFACE)
  545. #define IDirectSound8_VerifyCertification(p,a)           (p)->lpVtbl->VerifyCertification(p,a)
  546. #else // !defined(__cplusplus) || defined(CINTERFACE)
  547. #define IDirectSound8_VerifyCertification(p,a)           (p)->VerifyCertification(a)
  548. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  549. #endif // DIRECTSOUND_VERSION >= 0x0800
  550. //
  551. // IDirectSoundBuffer
  552. //
  553. DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  554. #undef INTERFACE
  555. #define INTERFACE IDirectSoundBuffer
  556. DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
  557. {
  558.     // IUnknown methods
  559.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  560.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  561.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  562.     // IDirectSoundBuffer methods
  563.     STDMETHOD(GetCaps)              (THIS_ LPDSBCAPS pDSBufferCaps) PURE;
  564.     STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor) PURE;
  565.     STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE;
  566.     STDMETHOD(GetVolume)            (THIS_ LPLONG plVolume) PURE;
  567.     STDMETHOD(GetPan)               (THIS_ LPLONG plPan) PURE;
  568.     STDMETHOD(GetFrequency)         (THIS_ LPDWORD pdwFrequency) PURE;
  569.     STDMETHOD(GetStatus)            (THIS_ LPDWORD pdwStatus) PURE;
  570.     STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUND pDirectSound, LPCDSBUFFERDESC pcDSBufferDesc) PURE;
  571.     STDMETHOD(Lock)                 (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
  572.                                            LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
  573.     STDMETHOD(Play)                 (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE;
  574.     STDMETHOD(SetCurrentPosition)   (THIS_ DWORD dwNewPosition) PURE;
  575.     STDMETHOD(SetFormat)            (THIS_ LPCWAVEFORMATEX pcfxFormat) PURE;
  576.     STDMETHOD(SetVolume)            (THIS_ LONG lVolume) PURE;
  577.     STDMETHOD(SetPan)               (THIS_ LONG lPan) PURE;
  578.     STDMETHOD(SetFrequency)         (THIS_ DWORD dwFrequency) PURE;
  579.     STDMETHOD(Stop)                 (THIS) PURE;
  580.     STDMETHOD(Unlock)               (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
  581.     STDMETHOD(Restore)              (THIS) PURE;
  582. };
  583. #define IDirectSoundBuffer_QueryInterface(p,a,b)        IUnknown_QueryInterface(p,a,b)
  584. #define IDirectSoundBuffer_AddRef(p)                    IUnknown_AddRef(p)
  585. #define IDirectSoundBuffer_Release(p)                   IUnknown_Release(p)
  586. #if !defined(__cplusplus) || defined(CINTERFACE)
  587. #define IDirectSoundBuffer_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
  588. #define IDirectSoundBuffer_GetCurrentPosition(p,a,b)    (p)->lpVtbl->GetCurrentPosition(p,a,b)
  589. #define IDirectSoundBuffer_GetFormat(p,a,b,c)           (p)->lpVtbl->GetFormat(p,a,b,c)
  590. #define IDirectSoundBuffer_GetVolume(p,a)               (p)->lpVtbl->GetVolume(p,a)
  591. #define IDirectSoundBuffer_GetPan(p,a)                  (p)->lpVtbl->GetPan(p,a)
  592. #define IDirectSoundBuffer_GetFrequency(p,a)            (p)->lpVtbl->GetFrequency(p,a)
  593. #define IDirectSoundBuffer_GetStatus(p,a)               (p)->lpVtbl->GetStatus(p,a)
  594. #define IDirectSoundBuffer_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
  595. #define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
  596. #define IDirectSoundBuffer_Play(p,a,b,c)                (p)->lpVtbl->Play(p,a,b,c)
  597. #define IDirectSoundBuffer_SetCurrentPosition(p,a)      (p)->lpVtbl->SetCurrentPosition(p,a)
  598. #define IDirectSoundBuffer_SetFormat(p,a)               (p)->lpVtbl->SetFormat(p,a)
  599. #define IDirectSoundBuffer_SetVolume(p,a)               (p)->lpVtbl->SetVolume(p,a)
  600. #define IDirectSoundBuffer_SetPan(p,a)                  (p)->lpVtbl->SetPan(p,a)
  601. #define IDirectSoundBuffer_SetFrequency(p,a)            (p)->lpVtbl->SetFrequency(p,a)
  602. #define IDirectSoundBuffer_Stop(p)                      (p)->lpVtbl->Stop(p)
  603. #define IDirectSoundBuffer_Unlock(p,a,b,c,d)            (p)->lpVtbl->Unlock(p,a,b,c,d)
  604. #define IDirectSoundBuffer_Restore(p)                   (p)->lpVtbl->Restore(p)
  605. #else // !defined(__cplusplus) || defined(CINTERFACE)
  606. #define IDirectSoundBuffer_GetCaps(p,a)                 (p)->GetCaps(a)
  607. #define IDirectSoundBuffer_GetCurrentPosition(p,a,b)    (p)->GetCurrentPosition(a,b)
  608. #define IDirectSoundBuffer_GetFormat(p,a,b,c)           (p)->GetFormat(a,b,c)
  609. #define IDirectSoundBuffer_GetVolume(p,a)               (p)->GetVolume(a)
  610. #define IDirectSoundBuffer_GetPan(p,a)                  (p)->GetPan(a)
  611. #define IDirectSoundBuffer_GetFrequency(p,a)            (p)->GetFrequency(a)
  612. #define IDirectSoundBuffer_GetStatus(p,a)               (p)->GetStatus(a)
  613. #define IDirectSoundBuffer_Initialize(p,a,b)            (p)->Initialize(a,b)
  614. #define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->Lock(a,b,c,d,e,f,g)
  615. #define IDirectSoundBuffer_Play(p,a,b,c)                (p)->Play(a,b,c)
  616. #define IDirectSoundBuffer_SetCurrentPosition(p,a)      (p)->SetCurrentPosition(a)
  617. #define IDirectSoundBuffer_SetFormat(p,a)               (p)->SetFormat(a)
  618. #define IDirectSoundBuffer_SetVolume(p,a)               (p)->SetVolume(a)
  619. #define IDirectSoundBuffer_SetPan(p,a)                  (p)->SetPan(a)
  620. #define IDirectSoundBuffer_SetFrequency(p,a)            (p)->SetFrequency(a)
  621. #define IDirectSoundBuffer_Stop(p)                      (p)->Stop()
  622. #define IDirectSoundBuffer_Unlock(p,a,b,c,d)            (p)->Unlock(a,b,c,d)
  623. #define IDirectSoundBuffer_Restore(p)                   (p)->Restore()
  624. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  625. #if DIRECTSOUND_VERSION >= 0x0800
  626. //
  627. // IDirectSoundBuffer8
  628. //
  629. DEFINE_GUID(IID_IDirectSoundBuffer8, 0x6825a449, 0x7524, 0x4d82, 0x92, 0x0f, 0x50, 0xe3, 0x6a, 0xb3, 0xab, 0x1e);
  630. #undef INTERFACE
  631. #define INTERFACE IDirectSoundBuffer8
  632. DECLARE_INTERFACE_(IDirectSoundBuffer8, IDirectSoundBuffer)
  633. {
  634.     // IUnknown methods
  635.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  636.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  637.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  638.     // IDirectSoundBuffer methods
  639.     STDMETHOD(GetCaps)              (THIS_ LPDSBCAPS pDSBufferCaps) PURE;
  640.     STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor) PURE;
  641.     STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE;
  642.     STDMETHOD(GetVolume)            (THIS_ LPLONG plVolume) PURE;
  643.     STDMETHOD(GetPan)               (THIS_ LPLONG plPan) PURE;
  644.     STDMETHOD(GetFrequency)         (THIS_ LPDWORD pdwFrequency) PURE;
  645.     STDMETHOD(GetStatus)            (THIS_ LPDWORD pdwStatus) PURE;
  646.     STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUND pDirectSound, LPCDSBUFFERDESC pcDSBufferDesc) PURE;
  647.     STDMETHOD(Lock)                 (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
  648.                                            LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
  649.     STDMETHOD(Play)                 (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE;
  650.     STDMETHOD(SetCurrentPosition)   (THIS_ DWORD dwNewPosition) PURE;
  651.     STDMETHOD(SetFormat)            (THIS_ LPCWAVEFORMATEX pcfxFormat) PURE;
  652.     STDMETHOD(SetVolume)            (THIS_ LONG lVolume) PURE;
  653.     STDMETHOD(SetPan)               (THIS_ LONG lPan) PURE;
  654.     STDMETHOD(SetFrequency)         (THIS_ DWORD dwFrequency) PURE;
  655.     STDMETHOD(Stop)                 (THIS) PURE;
  656.     STDMETHOD(Unlock)               (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
  657.     STDMETHOD(Restore)              (THIS) PURE;
  658.     // IDirectSoundBuffer8 methods
  659.     STDMETHOD(SetFX)                (THIS_ DWORD dwEffectsCount, LPDSEFFECTDESC pDSFXDesc, LPDWORD pdwResultCodes) PURE;
  660.     STDMETHOD(AcquireResources)     (THIS_ DWORD dwFlags, DWORD dwEffectsCount, LPDWORD pdwResultCodes) PURE;
  661.     STDMETHOD(GetObjectInPath)      (THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
  662. };
  663. // Special GUID meaning "select all objects" for use in GetObjectInPath()
  664. DEFINE_GUID(GUID_All_Objects, 0xaa114de5, 0xc262, 0x4169, 0xa1, 0xc8, 0x23, 0xd6, 0x98, 0xcc, 0x73, 0xb5);
  665. #define IDirectSoundBuffer8_QueryInterface(p,a,b)           IUnknown_QueryInterface(p,a,b)
  666. #define IDirectSoundBuffer8_AddRef(p)                       IUnknown_AddRef(p)
  667. #define IDirectSoundBuffer8_Release(p)                      IUnknown_Release(p)
  668. #define IDirectSoundBuffer8_GetCaps(p,a)                    IDirectSoundBuffer_GetCaps(p,a)
  669. #define IDirectSoundBuffer8_GetCurrentPosition(p,a,b)       IDirectSoundBuffer_GetCurrentPosition(p,a,b)
  670. #define IDirectSoundBuffer8_GetFormat(p,a,b,c)              IDirectSoundBuffer_GetFormat(p,a,b,c)
  671. #define IDirectSoundBuffer8_GetVolume(p,a)                  IDirectSoundBuffer_GetVolume(p,a)
  672. #define IDirectSoundBuffer8_GetPan(p,a)                     IDirectSoundBuffer_GetPan(p,a)
  673. #define IDirectSoundBuffer8_GetFrequency(p,a)               IDirectSoundBuffer_GetFrequency(p,a)
  674. #define IDirectSoundBuffer8_GetStatus(p,a)                  IDirectSoundBuffer_GetStatus(p,a)
  675. #define IDirectSoundBuffer8_Initialize(p,a,b)               IDirectSoundBuffer_Initialize(p,a,b)
  676. #define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g)           IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)
  677. #define IDirectSoundBuffer8_Play(p,a,b,c)                   IDirectSoundBuffer_Play(p,a,b,c)
  678. #define IDirectSoundBuffer8_SetCurrentPosition(p,a)         IDirectSoundBuffer_SetCurrentPosition(p,a)
  679. #define IDirectSoundBuffer8_SetFormat(p,a)                  IDirectSoundBuffer_SetFormat(p,a)
  680. #define IDirectSoundBuffer8_SetVolume(p,a)                  IDirectSoundBuffer_SetVolume(p,a)
  681. #define IDirectSoundBuffer8_SetPan(p,a)                     IDirectSoundBuffer_SetPan(p,a)
  682. #define IDirectSoundBuffer8_SetFrequency(p,a)               IDirectSoundBuffer_SetFrequency(p,a)
  683. #define IDirectSoundBuffer8_Stop(p)                         IDirectSoundBuffer_Stop(p)
  684. #define IDirectSoundBuffer8_Unlock(p,a,b,c,d)               IDirectSoundBuffer_Unlock(p,a,b,c,d)
  685. #define IDirectSoundBuffer8_Restore(p)                      IDirectSoundBuffer_Restore(p)
  686. #if !defined(__cplusplus) || defined(CINTERFACE)
  687. #define IDirectSoundBuffer8_SetFX(p,a,b,c)                  (p)->lpVtbl->SetFX(p,a,b,c)
  688. #define IDirectSoundBuffer8_AcquireResources(p,a,b,c)       (p)->lpVtbl->AcquireResources(p,a,b,c)
  689. #define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d)      (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
  690. #else // !defined(__cplusplus) || defined(CINTERFACE)
  691. #define IDirectSoundBuffer8_SetFX(p,a,b,c)                  (p)->SetFX(a,b,c)
  692. #define IDirectSoundBuffer8_AcquireResources(p,a,b,c)       (p)->AcquireResources(a,b,c)
  693. #define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d)      (p)->GetObjectInPath(a,b,c,d)
  694. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  695. #endif // DIRECTSOUND_VERSION >= 0x0800
  696. //
  697. // IDirectSound3DListener
  698. //
  699. DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  700. #undef INTERFACE
  701. #define INTERFACE IDirectSound3DListener
  702. DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
  703. {
  704.     // IUnknown methods
  705.     STDMETHOD(QueryInterface)           (THIS_ REFIID, LPVOID *) PURE;
  706.     STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
  707.     STDMETHOD_(ULONG,Release)           (THIS) PURE;
  708.     // IDirectSound3DListener methods
  709.     STDMETHOD(GetAllParameters)         (THIS_ LPDS3DLISTENER pListener) PURE;
  710.     STDMETHOD(GetDistanceFactor)        (THIS_ D3DVALUE* pflDistanceFactor) PURE;
  711.     STDMETHOD(GetDopplerFactor)         (THIS_ D3DVALUE* pflDopplerFactor) PURE;
  712.     STDMETHOD(GetOrientation)           (THIS_ D3DVECTOR* pvOrientFront, D3DVECTOR* pvOrientTop) PURE;
  713.     STDMETHOD(GetPosition)              (THIS_ D3DVECTOR* pvPosition) PURE;
  714.     STDMETHOD(GetRolloffFactor)         (THIS_ D3DVALUE* pflRolloffFactor) PURE;
  715.     STDMETHOD(GetVelocity)              (THIS_ D3DVECTOR* pvVelocity) PURE;
  716.     STDMETHOD(SetAllParameters)         (THIS_ LPCDS3DLISTENER pcListener, DWORD dwApply) PURE;
  717.     STDMETHOD(SetDistanceFactor)        (THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE;
  718.     STDMETHOD(SetDopplerFactor)         (THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE;
  719.     STDMETHOD(SetOrientation)           (THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront,
  720.                                                D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE;
  721.     STDMETHOD(SetPosition)              (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
  722.     STDMETHOD(SetRolloffFactor)         (THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE;
  723.     STDMETHOD(SetVelocity)              (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
  724.     STDMETHOD(CommitDeferredSettings)   (THIS) PURE;
  725. };
  726. #define IDirectSound3DListener_QueryInterface(p,a,b)            IUnknown_QueryInterface(p,a,b)
  727. #define IDirectSound3DListener_AddRef(p)                        IUnknown_AddRef(p)
  728. #define IDirectSound3DListener_Release(p)                       IUnknown_Release(p)
  729. #if !defined(__cplusplus) || defined(CINTERFACE)
  730. #define IDirectSound3DListener_GetAllParameters(p,a)            (p)->lpVtbl->GetAllParameters(p,a)
  731. #define IDirectSound3DListener_GetDistanceFactor(p,a)           (p)->lpVtbl->GetDistanceFactor(p,a)
  732. #define IDirectSound3DListener_GetDopplerFactor(p,a)            (p)->lpVtbl->GetDopplerFactor(p,a)
  733. #define IDirectSound3DListener_GetOrientation(p,a,b)            (p)->lpVtbl->GetOrientation(p,a,b)
  734. #define IDirectSound3DListener_GetPosition(p,a)                 (p)->lpVtbl->GetPosition(p,a)
  735. #define IDirectSound3DListener_GetRolloffFactor(p,a)            (p)->lpVtbl->GetRolloffFactor(p,a)
  736. #define IDirectSound3DListener_GetVelocity(p,a)                 (p)->lpVtbl->GetVelocity(p,a)
  737. #define IDirectSound3DListener_SetAllParameters(p,a,b)          (p)->lpVtbl->SetAllParameters(p,a,b)
  738. #define IDirectSound3DListener_SetDistanceFactor(p,a,b)         (p)->lpVtbl->SetDistanceFactor(p,a,b)
  739. #define IDirectSound3DListener_SetDopplerFactor(p,a,b)          (p)->lpVtbl->SetDopplerFactor(p,a,b)
  740. #define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g)  (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
  741. #define IDirectSound3DListener_SetPosition(p,a,b,c,d)           (p)->lpVtbl->SetPosition(p,a,b,c,d)
  742. #define IDirectSound3DListener_SetRolloffFactor(p,a,b)          (p)->lpVtbl->SetRolloffFactor(p,a,b)
  743. #define IDirectSound3DListener_SetVelocity(p,a,b,c,d)           (p)->lpVtbl->SetVelocity(p,a,b,c,d)
  744. #define IDirectSound3DListener_CommitDeferredSettings(p)        (p)->lpVtbl->CommitDeferredSettings(p)
  745. #else // !defined(__cplusplus) || defined(CINTERFACE)
  746. #define IDirectSound3DListener_GetAllParameters(p,a)            (p)->GetAllParameters(a)
  747. #define IDirectSound3DListener_GetDistanceFactor(p,a)           (p)->GetDistanceFactor(a)
  748. #define IDirectSound3DListener_GetDopplerFactor(p,a)            (p)->GetDopplerFactor(a)
  749. #define IDirectSound3DListener_GetOrientation(p,a,b)            (p)->GetOrientation(a,b)
  750. #define IDirectSound3DListener_GetPosition(p,a)                 (p)->GetPosition(a)
  751. #define IDirectSound3DListener_GetRolloffFactor(p,a)            (p)->GetRolloffFactor(a)
  752. #define IDirectSound3DListener_GetVelocity(p,a)                 (p)->GetVelocity(a)
  753. #define IDirectSound3DListener_SetAllParameters(p,a,b)          (p)->SetAllParameters(a,b)
  754. #define IDirectSound3DListener_SetDistanceFactor(p,a,b)         (p)->SetDistanceFactor(a,b)
  755. #define IDirectSound3DListener_SetDopplerFactor(p,a,b)          (p)->SetDopplerFactor(a,b)
  756. #define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g)  (p)->SetOrientation(a,b,c,d,e,f,g)
  757. #define IDirectSound3DListener_SetPosition(p,a,b,c,d)           (p)->SetPosition(a,b,c,d)
  758. #define IDirectSound3DListener_SetRolloffFactor(p,a,b)          (p)->SetRolloffFactor(a,b)
  759. #define IDirectSound3DListener_SetVelocity(p,a,b,c,d)           (p)->SetVelocity(a,b,c,d)
  760. #define IDirectSound3DListener_CommitDeferredSettings(p)        (p)->CommitDeferredSettings()
  761. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  762. //
  763. // IDirectSound3DBuffer
  764. //
  765. DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  766. #undef INTERFACE
  767. #define INTERFACE IDirectSound3DBuffer
  768. DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
  769. {
  770.     // IUnknown methods
  771.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  772.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  773.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  774.     // IDirectSound3DBuffer methods
  775.     STDMETHOD(GetAllParameters)     (THIS_ LPDS3DBUFFER pDs3dBuffer) PURE;
  776.     STDMETHOD(GetConeAngles)        (THIS_ LPDWORD pdwInsideConeAngle, LPDWORD pdwOutsideConeAngle) PURE;
  777.     STDMETHOD(GetConeOrientation)   (THIS_ D3DVECTOR* pvOrientation) PURE;
  778.     STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG plConeOutsideVolume) PURE;
  779.     STDMETHOD(GetMaxDistance)       (THIS_ D3DVALUE* pflMaxDistance) PURE;
  780.     STDMETHOD(GetMinDistance)       (THIS_ D3DVALUE* pflMinDistance) PURE;
  781.     STDMETHOD(GetMode)              (THIS_ LPDWORD pdwMode) PURE;
  782.     STDMETHOD(GetPosition)          (THIS_ D3DVECTOR* pvPosition) PURE;
  783.     STDMETHOD(GetVelocity)          (THIS_ D3DVECTOR* pvVelocity) PURE;
  784.     STDMETHOD(SetAllParameters)     (THIS_ LPCDS3DBUFFER pcDs3dBuffer, DWORD dwApply) PURE;
  785.     STDMETHOD(SetConeAngles)        (THIS_ DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) PURE;
  786.     STDMETHOD(SetConeOrientation)   (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
  787.     STDMETHOD(SetConeOutsideVolume) (THIS_ LONG lConeOutsideVolume, DWORD dwApply) PURE;
  788.     STDMETHOD(SetMaxDistance)       (THIS_ D3DVALUE flMaxDistance, DWORD dwApply) PURE;
  789.     STDMETHOD(SetMinDistance)       (THIS_ D3DVALUE flMinDistance, DWORD dwApply) PURE;
  790.     STDMETHOD(SetMode)              (THIS_ DWORD dwMode, DWORD dwApply) PURE;
  791.     STDMETHOD(SetPosition)          (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
  792.     STDMETHOD(SetVelocity)          (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
  793. };
  794. #define IDirectSound3DBuffer_QueryInterface(p,a,b)          IUnknown_QueryInterface(p,a,b)
  795. #define IDirectSound3DBuffer_AddRef(p)                      IUnknown_AddRef(p)
  796. #define IDirectSound3DBuffer_Release(p)                     IUnknown_Release(p)
  797. #if !defined(__cplusplus) || defined(CINTERFACE)
  798. #define IDirectSound3DBuffer_GetAllParameters(p,a)          (p)->lpVtbl->GetAllParameters(p,a)
  799. #define IDirectSound3DBuffer_GetConeAngles(p,a,b)           (p)->lpVtbl->GetConeAngles(p,a,b)
  800. #define IDirectSound3DBuffer_GetConeOrientation(p,a)        (p)->lpVtbl->GetConeOrientation(p,a)
  801. #define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)      (p)->lpVtbl->GetConeOutsideVolume(p,a)
  802. #define IDirectSound3DBuffer_GetPosition(p,a)               (p)->lpVtbl->GetPosition(p,a)
  803. #define IDirectSound3DBuffer_GetMinDistance(p,a)            (p)->lpVtbl->GetMinDistance(p,a)
  804. #define IDirectSound3DBuffer_GetMaxDistance(p,a)            (p)->lpVtbl->GetMaxDistance(p,a)
  805. #define IDirectSound3DBuffer_GetMode(p,a)                   (p)->lpVtbl->GetMode(p,a)
  806. #define IDirectSound3DBuffer_GetVelocity(p,a)               (p)->lpVtbl->GetVelocity(p,a)
  807. #define IDirectSound3DBuffer_SetAllParameters(p,a,b)        (p)->lpVtbl->SetAllParameters(p,a,b)
  808. #define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)         (p)->lpVtbl->SetConeAngles(p,a,b,c)
  809. #define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d)  (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
  810. #define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)    (p)->lpVtbl->SetConeOutsideVolume(p,a,b)
  811. #define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)         (p)->lpVtbl->SetPosition(p,a,b,c,d)
  812. #define IDirectSound3DBuffer_SetMinDistance(p,a,b)          (p)->lpVtbl->SetMinDistance(p,a,b)
  813. #define IDirectSound3DBuffer_SetMaxDistance(p,a,b)          (p)->lpVtbl->SetMaxDistance(p,a,b)
  814. #define IDirectSound3DBuffer_SetMode(p,a,b)                 (p)->lpVtbl->SetMode(p,a,b)
  815. #define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)         (p)->lpVtbl->SetVelocity(p,a,b,c,d)
  816. #else // !defined(__cplusplus) || defined(CINTERFACE)
  817. #define IDirectSound3DBuffer_GetAllParameters(p,a)          (p)->GetAllParameters(a)
  818. #define IDirectSound3DBuffer_GetConeAngles(p,a,b)           (p)->GetConeAngles(a,b)
  819. #define IDirectSound3DBuffer_GetConeOrientation(p,a)        (p)->GetConeOrientation(a)
  820. #define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)      (p)->GetConeOutsideVolume(a)
  821. #define IDirectSound3DBuffer_GetPosition(p,a)               (p)->GetPosition(a)
  822. #define IDirectSound3DBuffer_GetMinDistance(p,a)            (p)->GetMinDistance(a)
  823. #define IDirectSound3DBuffer_GetMaxDistance(p,a)            (p)->GetMaxDistance(a)
  824. #define IDirectSound3DBuffer_GetMode(p,a)                   (p)->GetMode(a)
  825. #define IDirectSound3DBuffer_GetVelocity(p,a)               (p)->GetVelocity(a)
  826. #define IDirectSound3DBuffer_SetAllParameters(p,a,b)        (p)->SetAllParameters(a,b)
  827. #define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)         (p)->SetConeAngles(a,b,c)
  828. #define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d)  (p)->SetConeOrientation(a,b,c,d)
  829. #define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)    (p)->SetConeOutsideVolume(a,b)
  830. #define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)         (p)->SetPosition(a,b,c,d)
  831. #define IDirectSound3DBuffer_SetMinDistance(p,a,b)          (p)->SetMinDistance(a,b)
  832. #define IDirectSound3DBuffer_SetMaxDistance(p,a,b)          (p)->SetMaxDistance(a,b)
  833. #define IDirectSound3DBuffer_SetMode(p,a,b)                 (p)->SetMode(a,b)
  834. #define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)         (p)->SetVelocity(a,b,c,d)
  835. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  836. //
  837. // IDirectSoundCapture
  838. //
  839. DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  840. #undef INTERFACE
  841. #define INTERFACE IDirectSoundCapture
  842. DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
  843. {
  844.     // IUnknown methods
  845.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  846.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  847.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  848.     // IDirectSoundCapture methods
  849.     STDMETHOD(CreateCaptureBuffer)  (THIS_ LPCDSCBUFFERDESC pcDSCBufferDesc, LPDIRECTSOUNDCAPTUREBUFFER *ppDSCBuffer, LPUNKNOWN pUnkOuter) PURE;
  850.     STDMETHOD(GetCaps)              (THIS_ LPDSCCAPS pDSCCaps) PURE;
  851.     STDMETHOD(Initialize)           (THIS_ LPCGUID pcGuidDevice) PURE;
  852. };
  853. #define IDirectSoundCapture_QueryInterface(p,a,b)           IUnknown_QueryInterface(p,a,b)
  854. #define IDirectSoundCapture_AddRef(p)                       IUnknown_AddRef(p)
  855. #define IDirectSoundCapture_Release(p)                      IUnknown_Release(p)
  856. #if !defined(__cplusplus) || defined(CINTERFACE)
  857. #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c)    (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
  858. #define IDirectSoundCapture_GetCaps(p,a)                    (p)->lpVtbl->GetCaps(p,a)
  859. #define IDirectSoundCapture_Initialize(p,a)                 (p)->lpVtbl->Initialize(p,a)
  860. #else // !defined(__cplusplus) || defined(CINTERFACE)
  861. #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c)    (p)->CreateCaptureBuffer(a,b,c)
  862. #define IDirectSoundCapture_GetCaps(p,a)                    (p)->GetCaps(a)
  863. #define IDirectSoundCapture_Initialize(p,a)                 (p)->Initialize(a)
  864. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  865. //
  866. // IDirectSoundCaptureBuffer
  867. //
  868. DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  869. #undef INTERFACE
  870. #define INTERFACE IDirectSoundCaptureBuffer
  871. DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
  872. {
  873.     // IUnknown methods
  874.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  875.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  876.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  877.     // IDirectSoundCaptureBuffer methods
  878.     STDMETHOD(GetCaps)              (THIS_ LPDSCBCAPS pDSCBCaps) PURE;
  879.     STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD pdwCapturePosition, LPDWORD pdwReadPosition) PURE;
  880.     STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE;
  881.     STDMETHOD(GetStatus)            (THIS_ LPDWORD pdwStatus) PURE;
  882.     STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUNDCAPTURE pDirectSoundCapture, LPCDSCBUFFERDESC pcDSCBufferDesc) PURE;
  883.     STDMETHOD(Lock)                 (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
  884.                                            LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
  885.     STDMETHOD(Start)                (THIS_ DWORD dwFlags) PURE;
  886.     STDMETHOD(Stop)                 (THIS) PURE;
  887.     STDMETHOD(Unlock)               (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
  888. };
  889. #define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)         IUnknown_QueryInterface(p,a,b)
  890. #define IDirectSoundCaptureBuffer_AddRef(p)                     IUnknown_AddRef(p)
  891. #define IDirectSoundCaptureBuffer_Release(p)                    IUnknown_Release(p)
  892. #if !defined(__cplusplus) || defined(CINTERFACE)
  893. #define IDirectSoundCaptureBuffer_GetCaps(p,a)                  (p)->lpVtbl->GetCaps(p,a)
  894. #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)     (p)->lpVtbl->GetCurrentPosition(p,a,b)
  895. #define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)            (p)->lpVtbl->GetFormat(p,a,b,c)
  896. #define IDirectSoundCaptureBuffer_GetStatus(p,a)                (p)->lpVtbl->GetStatus(p,a)
  897. #define IDirectSoundCaptureBuffer_Initialize(p,a,b)             (p)->lpVtbl->Initialize(p,a,b)
  898. #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)         (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
  899. #define IDirectSoundCaptureBuffer_Start(p,a)                    (p)->lpVtbl->Start(p,a)
  900. #define IDirectSoundCaptureBuffer_Stop(p)                       (p)->lpVtbl->Stop(p)
  901. #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)             (p)->lpVtbl->Unlock(p,a,b,c,d)
  902. #else // !defined(__cplusplus) || defined(CINTERFACE)
  903. #define IDirectSoundCaptureBuffer_GetCaps(p,a)                  (p)->GetCaps(a)
  904. #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)     (p)->GetCurrentPosition(a,b)
  905. #define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)            (p)->GetFormat(a,b,c)
  906. #define IDirectSoundCaptureBuffer_GetStatus(p,a)                (p)->GetStatus(a)
  907. #define IDirectSoundCaptureBuffer_Initialize(p,a,b)             (p)->Initialize(a,b)
  908. #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)         (p)->Lock(a,b,c,d,e,f,g)
  909. #define IDirectSoundCaptureBuffer_Start(p,a)                    (p)->Start(a)
  910. #define IDirectSoundCaptureBuffer_Stop(p)                       (p)->Stop()
  911. #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)             (p)->Unlock(a,b,c,d)
  912. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  913. #if DIRECTSOUND_VERSION >= 0x0800
  914. //
  915. // IDirectSoundCaptureBuffer8
  916. //
  917. DEFINE_GUID(IID_IDirectSoundCaptureBuffer8, 0x990df4, 0xdbb, 0x4872, 0x83, 0x3e, 0x6d, 0x30, 0x3e, 0x80, 0xae, 0xb6);
  918. #undef INTERFACE
  919. #define INTERFACE IDirectSoundCaptureBuffer8
  920. DECLARE_INTERFACE_(IDirectSoundCaptureBuffer8, IDirectSoundCaptureBuffer)
  921. {
  922.     // IUnknown methods
  923.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  924.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  925.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  926.     // IDirectSoundCaptureBuffer methods
  927.     STDMETHOD(GetCaps)              (THIS_ LPDSCBCAPS pDSCBCaps) PURE;
  928.     STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD pdwCapturePosition, LPDWORD pdwReadPosition) PURE;
  929.     STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE;
  930.     STDMETHOD(GetStatus)            (THIS_ LPDWORD pdwStatus) PURE;
  931.     STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUNDCAPTURE pDirectSoundCapture, LPCDSCBUFFERDESC pcDSCBufferDesc) PURE;
  932.     STDMETHOD(Lock)                 (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
  933.                                            LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
  934.     STDMETHOD(Start)                (THIS_ DWORD dwFlags) PURE;
  935.     STDMETHOD(Stop)                 (THIS) PURE;
  936.     STDMETHOD(Unlock)               (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
  937.     // IDirectSoundCaptureBuffer8 methods
  938.     STDMETHOD(GetObjectInPath)      (THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
  939.     STDMETHOD(GetFXStatus)          (DWORD dwFXCount, LPDWORD pdwFXStatus) PURE;
  940. };
  941. #define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b)            IUnknown_QueryInterface(p,a,b)
  942. #define IDirectSoundCaptureBuffer8_AddRef(p)                        IUnknown_AddRef(p)
  943. #define IDirectSoundCaptureBuffer8_Release(p)                       IUnknown_Release(p)
  944. #define IDirectSoundCaptureBuffer8_GetCaps(p,a)                     IDirectSoundCaptureBuffer_GetCaps(p,a)
  945. #define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b)        IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)
  946. #define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c)               IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)
  947. #define IDirectSoundCaptureBuffer8_GetStatus(p,a)                   IDirectSoundCaptureBuffer_GetStatus(p,a)
  948. #define IDirectSoundCaptureBuffer8_Initialize(p,a,b)                IDirectSoundCaptureBuffer_Initialize(p,a,b)
  949. #define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g)            IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)
  950. #define IDirectSoundCaptureBuffer8_Start(p,a)                       IDirectSoundCaptureBuffer_Start(p,a)
  951. #define IDirectSoundCaptureBuffer8_Stop(p)                          IDirectSoundCaptureBuffer_Stop(p))
  952. #define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d)                IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)
  953. #if !defined(__cplusplus) || defined(CINTERFACE)
  954. #define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d)       (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
  955. #define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b)               (p)->lpVtbl->GetFXStatus(p,a,b)
  956. #else // !defined(__cplusplus) || defined(CINTERFACE)
  957. #define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d)       (p)->GetObjectInPath(a,b,c,d)
  958. #define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b)               (p)->GetFXStatus(a,b)
  959. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  960. #endif // DIRECTSOUND_VERSION >= 0x0800
  961. //
  962. // IDirectSoundNotify
  963. //
  964. DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  965. #undef INTERFACE
  966. #define INTERFACE IDirectSoundNotify
  967. DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
  968. {
  969.     // IUnknown methods
  970.     STDMETHOD(QueryInterface)           (THIS_ REFIID, LPVOID *) PURE;
  971.     STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
  972.     STDMETHOD_(ULONG,Release)           (THIS) PURE;
  973.     // IDirectSoundNotify methods
  974.     STDMETHOD(SetNotificationPositions) (THIS_ DWORD dwPositionNotifies, LPCDSBPOSITIONNOTIFY pcPositionNotifies) PURE;
  975. };
  976. #define IDirectSoundNotify_QueryInterface(p,a,b)            IUnknown_QueryInterface(p,a,b)
  977. #define IDirectSoundNotify_AddRef(p)                        IUnknown_AddRef(p)
  978. #define IDirectSoundNotify_Release(p)                       IUnknown_Release(p)
  979. #if !defined(__cplusplus) || defined(CINTERFACE)
  980. #define IDirectSoundNotify_SetNotificationPositions(p,a,b)  (p)->lpVtbl->SetNotificationPositions(p,a,b)
  981. #else // !defined(__cplusplus) || defined(CINTERFACE)
  982. #define IDirectSoundNotify_SetNotificationPositions(p,a,b)  (p)->SetNotificationPositions(a,b)
  983. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  984. //
  985. // IKsPropertySet
  986. //
  987. #ifndef _IKsPropertySet_
  988. #define _IKsPropertySet_
  989. #ifdef __cplusplus
  990. // 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
  991. struct IKsPropertySet;
  992. #endif // __cplusplus
  993. typedef struct IKsPropertySet *LPKSPROPERTYSET;
  994. #define KSPROPERTY_SUPPORT_GET  0x00000001
  995. #define KSPROPERTY_SUPPORT_SET  0x00000002
  996. DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
  997. #undef INTERFACE
  998. #define INTERFACE IKsPropertySet
  999. DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
  1000. {
  1001.     // IUnknown methods
  1002.     STDMETHOD(QueryInterface)   (THIS_ REFIID, LPVOID *) PURE;
  1003.     STDMETHOD_(ULONG,AddRef)    (THIS) PURE;
  1004.     STDMETHOD_(ULONG,Release)   (THIS) PURE;
  1005.     // IKsPropertySet methods
  1006.     STDMETHOD(Get)              (THIS_ REFGUID rguidPropSet, ULONG ulId, LPVOID pInstanceData, ULONG ulInstanceLength,
  1007.                                        LPVOID pPropertyData, ULONG ulDataLength, PULONG pulBytesReturned) PURE;
  1008.     STDMETHOD(Set)              (THIS_ REFGUID rguidPropSet, ULONG ulId, LPVOID pInstanceData, ULONG ulInstanceLength,
  1009.                                        LPVOID pPropertyData, ULONG ulDataLength) PURE;
  1010.     STDMETHOD(QuerySupport)     (THIS_ REFGUID rguidPropSet, ULONG ulId, PULONG pulTypeSupport) PURE;
  1011. };
  1012. #define IKsPropertySet_QueryInterface(p,a,b)       IUnknown_QueryInterface(p,a,b)
  1013. #define IKsPropertySet_AddRef(p)                   IUnknown_AddRef(p)
  1014. #define IKsPropertySet_Release(p)                  IUnknown_Release(p)
  1015. #if !defined(__cplusplus) || defined(CINTERFACE)
  1016. #define IKsPropertySet_Get(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
  1017. #define IKsPropertySet_Set(p,a,b,c,d,e,f)          (p)->lpVtbl->Set(p,a,b,c,d,e,f)
  1018. #define IKsPropertySet_QuerySupport(p,a,b,c)       (p)->lpVtbl->QuerySupport(p,a,b,c)
  1019. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1020. #define IKsPropertySet_Get(p,a,b,c,d,e,f,g)        (p)->Get(a,b,c,d,e,f,g)
  1021. #define IKsPropertySet_Set(p,a,b,c,d,e,f)          (p)->Set(a,b,c,d,e,f)
  1022. #define IKsPropertySet_QuerySupport(p,a,b,c)       (p)->QuerySupport(a,b,c)
  1023. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1024. #endif // _IKsPropertySet_
  1025. #if DIRECTSOUND_VERSION >= 0x0800
  1026. //
  1027. // IDirectSoundFXGargle
  1028. //
  1029. DEFINE_GUID(IID_IDirectSoundFXGargle, 0xd616f352, 0xd622, 0x11ce, 0xaa, 0xc5, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3);
  1030. typedef struct _DSFXGargle
  1031. {
  1032.     DWORD       dwRateHz;               // Rate of modulation in hz
  1033.     DWORD       dwWaveShape;            // DSFXGARGLE_WAVE_xxx
  1034. } DSFXGargle, *LPDSFXGargle;
  1035. #define DSFXGARGLE_WAVE_TRIANGLE        0
  1036. #define DSFXGARGLE_WAVE_SQUARE          1
  1037. typedef const DSFXGargle *LPCDSFXGargle;
  1038. #define DSFXGARGLE_RATEHZ_MIN           1
  1039. #define DSFXGARGLE_RATEHZ_MAX           1000
  1040. #undef INTERFACE
  1041. #define INTERFACE IDirectSoundFXGargle
  1042. DECLARE_INTERFACE_(IDirectSoundFXGargle, IUnknown)
  1043. {
  1044.     // IUnknown methods
  1045.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  1046.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1047.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1048.     // IDirectSoundFXGargle methods
  1049.     STDMETHOD(SetAllParameters)     (THIS_ LPCDSFXGargle pcDsFxGargle) PURE;
  1050.     STDMETHOD(GetAllParameters)     (THIS_ LPDSFXGargle pDsFxGargle) PURE;
  1051. };
  1052. #define IDirectSoundFXGargle_QueryInterface(p,a,b)          IUnknown_QueryInterface(p,a,b)
  1053. #define IDirectSoundFXGargle_AddRef(p)                      IUnknown_AddRef(p)
  1054. #define IDirectSoundFXGargle_Release(p)                     IUnknown_Release(p)
  1055. #if !defined(__cplusplus) || defined(CINTERFACE)
  1056. #define IDirectSoundFXGargle_SetAllParameters(p,a)          (p)->lpVtbl->SetAllParameters(p,a)
  1057. #define IDirectSoundFXGargle_GetAllParameters(p,a)          (p)->lpVtbl->GetAllParameters(p,a)
  1058. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1059. #define IDirectSoundFXGargle_SetAllParameters(p,a)          (p)->SetAllParameters(a)
  1060. #define IDirectSoundFXGargle_GetAllParameters(p,a)          (p)->GetAllParameters(a)
  1061. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1062. //
  1063. // IDirectSoundFXChorus
  1064. //
  1065. DEFINE_GUID(IID_IDirectSoundFXChorus, 0x880842e3, 0x145f, 0x43e6, 0xa9, 0x34, 0xa7, 0x18, 0x06, 0xe5, 0x05, 0x47);
  1066. typedef struct _DSFXChorus
  1067. {
  1068.     FLOAT       fWetDryMix;
  1069.     FLOAT       fDepth;
  1070.     FLOAT       fFeedback;
  1071.     FLOAT       fFrequency;
  1072.     LONG        lWaveform;          // LFO shape; DSFXCHORUS_WAVE_xxx
  1073.     FLOAT       fDelay;
  1074.     LONG        lPhase;
  1075. } DSFXChorus, *LPDSFXChorus;
  1076. typedef const DSFXChorus *LPCDSFXChorus;
  1077. #define DSFXCHORUS_WAVE_TRIANGLE        0
  1078. #define DSFXCHORUS_WAVE_SIN             1
  1079. #define DSFXCHORUS_WETDRYMIX_MIN        0.0f
  1080. #define DSFXCHORUS_WETDRYMIX_MAX        100.0f
  1081. #define DSFXCHORUS_DEPTH_MIN            0.0f
  1082. #define DSFXCHORUS_DEPTH_MAX            100.0f
  1083. #define DSFXCHORUS_FEEDBACK_MIN         -99.0f
  1084. #define DSFXCHORUS_FEEDBACK_MAX         99.0f
  1085. #define DSFXCHORUS_FREQUENCY_MIN        0.0f
  1086. #define DSFXCHORUS_FREQUENCY_MAX        10.0f
  1087. #define DSFXCHORUS_DELAY_MIN            0.0f
  1088. #define DSFXCHORUS_DELAY_MAX            20.0f
  1089. #define DSFXCHORUS_PHASE_MIN            0
  1090. #define DSFXCHORUS_PHASE_MAX            4
  1091. #define DSFXCHORUS_PHASE_NEG_180        0
  1092. #define DSFXCHORUS_PHASE_NEG_90         1
  1093. #define DSFXCHORUS_PHASE_ZERO           2
  1094. #define DSFXCHORUS_PHASE_90             3
  1095. #define DSFXCHORUS_PHASE_180            4
  1096. #undef INTERFACE
  1097. #define INTERFACE IDirectSoundFXChorus
  1098. DECLARE_INTERFACE_(IDirectSoundFXChorus, IUnknown)
  1099. {
  1100.     // IUnknown methods
  1101.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  1102.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1103.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1104.     // IDirectSoundFXChorus methods
  1105.     STDMETHOD(SetAllParameters)     (THIS_ LPCDSFXChorus pcDsFxChorus) PURE;
  1106.     STDMETHOD(GetAllParameters)     (THIS_ LPDSFXChorus pDsFxChorus) PURE;
  1107. };
  1108. #define IDirectSoundFXChorus_QueryInterface(p,a,b)          IUnknown_QueryInterface(p,a,b)
  1109. #define IDirectSoundFXChorus_AddRef(p)                      IUnknown_AddRef(p)
  1110. #define IDirectSoundFXChorus_Release(p)                     IUnknown_Release(p)
  1111. #if !defined(__cplusplus) || defined(CINTERFACE)
  1112. #define IDirectSoundFXChorus_SetAllParameters(p,a)          (p)->lpVtbl->SetAllParameters(p,a)
  1113. #define IDirectSoundFXChorus_GetAllParameters(p,a)          (p)->lpVtbl->GetAllParameters(p,a)
  1114. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1115. #define IDirectSoundFXChorus_SetAllParameters(p,a)          (p)->SetAllParameters(a)
  1116. #define IDirectSoundFXChorus_GetAllParameters(p,a)          (p)->GetAllParameters(a)
  1117. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1118. //
  1119. // IDirectSoundFXFlanger
  1120. //
  1121. DEFINE_GUID(IID_IDirectSoundFXFlanger, 0x903e9878, 0x2c92, 0x4072, 0x9b, 0x2c, 0xea, 0x68, 0xf5, 0x39, 0x67, 0x83);
  1122. typedef struct _DSFXFlanger
  1123. {
  1124.     FLOAT       fWetDryMix;
  1125.     FLOAT       fDepth;
  1126.     FLOAT       fFeedback;
  1127.     FLOAT       fFrequency;
  1128.     LONG        lWaveform;
  1129.     FLOAT       fDelay;
  1130.     LONG        lPhase;
  1131. } DSFXFlanger, *LPDSFXFlanger;
  1132. typedef const DSFXFlanger *LPCDSFXFlanger;
  1133. #define DSFXFLANGER_WAVE_TRIANGLE       0
  1134. #define DSFXFLANGER_WAVE_SIN            1
  1135. #define DSFXFLANGER_WETDRYMIX_MIN       0.0f
  1136. #define DSFXFLANGER_WETDRYMIX_MAX       100.0f
  1137. #define DSFXFLANGER_FREQUENCY_MIN       0.0f
  1138. #define DSFXFLANGER_FREQUENCY_MAX       10.0f
  1139. #define DSFXFLANGER_DEPTH_MIN           0.0f
  1140. #define DSFXFLANGER_DEPTH_MAX           100.0f
  1141. #define DSFXFLANGER_PHASE_MIN           0
  1142. #define DSFXFLANGER_PHASE_MAX           4
  1143. #define DSFXFLANGER_FEEDBACK_MIN        -99.0f
  1144. #define DSFXFLANGER_FEEDBACK_MAX        99.0f
  1145. #define DSFXFLANGER_DELAY_MIN           0.0f
  1146. #define DSFXFLANGER_DELAY_MAX           4.0f
  1147. #define DSFXFLANGER_PHASE_NEG_180       0
  1148. #define DSFXFLANGER_PHASE_NEG_90        1
  1149. #define DSFXFLANGER_PHASE_ZERO          2
  1150. #define DSFXFLANGER_PHASE_90            3
  1151. #define DSFXFLANGER_PHASE_180           4
  1152. #undef INTERFACE
  1153. #define INTERFACE IDirectSoundFXFlanger
  1154. DECLARE_INTERFACE_(IDirectSoundFXFlanger, IUnknown)
  1155. {
  1156.     // IUnknown methods
  1157.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  1158.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1159.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1160.     // IDirectSoundFXFlanger methods
  1161.     STDMETHOD(SetAllParameters)     (THIS_ LPCDSFXFlanger pcDsFxFlanger) PURE;
  1162.     STDMETHOD(GetAllParameters)     (THIS_ LPDSFXFlanger pDsFxFlanger) PURE;
  1163. };
  1164. #define IDirectSoundFXFlanger_QueryInterface(p,a,b)         IUnknown_QueryInterface(p,a,b)
  1165. #define IDirectSoundFXFlanger_AddRef(p)                     IUnknown_AddRef(p)
  1166. #define IDirectSoundFXFlanger_Release(p)                    IUnknown_Release(p)
  1167. #if !defined(__cplusplus) || defined(CINTERFACE)
  1168. #define IDirectSoundFXFlanger_SetAllParameters(p,a)         (p)->lpVtbl->SetAllParameters(p,a)
  1169. #define IDirectSoundFXFlanger_GetAllParameters(p,a)         (p)->lpVtbl->GetAllParameters(p,a)
  1170. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1171. #define IDirectSoundFXFlanger_SetAllParameters(p,a)         (p)->SetAllParameters(a)
  1172. #define IDirectSoundFXFlanger_GetAllParameters(p,a)         (p)->GetAllParameters(a)
  1173. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1174. //
  1175. // IDirectSoundFXEcho
  1176. //
  1177. DEFINE_GUID(IID_IDirectSoundFXEcho, 0x8bd28edf, 0x50db, 0x4e92, 0xa2, 0xbd, 0x44, 0x54, 0x88, 0xd1, 0xed, 0x42);
  1178. typedef struct _DSFXEcho
  1179. {
  1180.     FLOAT   fWetDryMix;
  1181.     FLOAT   fFeedback;
  1182.     FLOAT   fLeftDelay;
  1183.     FLOAT   fRightDelay;
  1184.     LONG    lPanDelay;
  1185. } DSFXEcho, *LPDSFXEcho;
  1186. typedef const DSFXEcho *LPCDSFXEcho;
  1187. #define DSFXECHO_WETDRYMIX_MIN      0.0f
  1188. #define DSFXECHO_WETDRYMIX_MAX      100.0f
  1189. #define DSFXECHO_FEEDBACK_MIN       0.0f
  1190. #define DSFXECHO_FEEDBACK_MAX       100.0f
  1191. #define DSFXECHO_LEFTDELAY_MIN      1.0f
  1192. #define DSFXECHO_LEFTDELAY_MAX      2000.0f
  1193. #define DSFXECHO_RIGHTDELAY_MIN     1.0f
  1194. #define DSFXECHO_RIGHTDELAY_MAX     2000.0f
  1195. #define DSFXECHO_PANDELAY_MIN       0
  1196. #define DSFXECHO_PANDELAY_MAX       1
  1197. #undef INTERFACE
  1198. #define INTERFACE IDirectSoundFXEcho
  1199. DECLARE_INTERFACE_(IDirectSoundFXEcho, IUnknown)
  1200. {
  1201.     // IUnknown methods
  1202.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  1203.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1204.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1205.     // IDirectSoundFXEcho methods
  1206.     STDMETHOD(SetAllParameters)     (THIS_ LPCDSFXEcho pcDsFxEcho) PURE;
  1207.     STDMETHOD(GetAllParameters)     (THIS_ LPDSFXEcho pDsFxEcho) PURE;
  1208. };
  1209. #define IDirectSoundFXEcho_QueryInterface(p,a,b)            IUnknown_QueryInterface(p,a,b)
  1210. #define IDirectSoundFXEcho_AddRef(p)                        IUnknown_AddRef(p)
  1211. #define IDirectSoundFXEcho_Release(p)                       IUnknown_Release(p)
  1212. #if !defined(__cplusplus) || defined(CINTERFACE)
  1213. #define IDirectSoundFXEcho_SetAllParameters(p,a)            (p)->lpVtbl->SetAllParameters(p,a)
  1214. #define IDirectSoundFXEcho_GetAllParameters(p,a)            (p)->lpVtbl->GetAllParameters(p,a)
  1215. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1216. #define IDirectSoundFXEcho_SetAllParameters(p,a)            (p)->SetAllParameters(a)
  1217. #define IDirectSoundFXEcho_GetAllParameters(p,a)            (p)->GetAllParameters(a)
  1218. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1219. //
  1220. // IDirectSoundFXDistortion
  1221. //
  1222. DEFINE_GUID(IID_IDirectSoundFXDistortion, 0x8ecf4326, 0x455f, 0x4d8b, 0xbd, 0xa9, 0x8d, 0x5d, 0x3e, 0x9e, 0x3e, 0x0b);
  1223. typedef struct _DSFXDistortion
  1224. {
  1225.     FLOAT   fGain;
  1226.     FLOAT   fEdge;
  1227.     FLOAT   fPostEQCenterFrequency;
  1228.     FLOAT   fPostEQBandwidth;
  1229.     FLOAT   fPreLowpassCutoff;
  1230. } DSFXDistortion, *LPDSFXDistortion;
  1231. typedef const DSFXDistortion *LPCDSFXDistortion;
  1232. #define DSFXDISTORTION_GAIN_MIN                     -60.0f
  1233. #define DSFXDISTORTION_GAIN_MAX                     0.0f
  1234. #define DSFXDISTORTION_EDGE_MIN                     0.0f
  1235. #define DSFXDISTORTION_EDGE_MAX                     100.0f
  1236. #define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MIN    100.0f
  1237. #define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MAX    8000.0f
  1238. #define DSFXDISTORTION_POSTEQBANDWIDTH_MIN          100.0f
  1239. #define DSFXDISTORTION_POSTEQBANDWIDTH_MAX          8000.0f
  1240. #define DSFXDISTORTION_PRELOWPASSCUTOFF_MIN         100.0f
  1241. #define DSFXDISTORTION_PRELOWPASSCUTOFF_MAX         8000.0f
  1242. #undef INTERFACE
  1243. #define INTERFACE IDirectSoundFXDistortion
  1244. DECLARE_INTERFACE_(IDirectSoundFXDistortion, IUnknown)
  1245. {
  1246.     // IUnknown methods
  1247.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  1248.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1249.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1250.     // IDirectSoundFXDistortion methods
  1251.     STDMETHOD(SetAllParameters)     (THIS_ LPCDSFXDistortion pcDsFxDistortion) PURE;
  1252.     STDMETHOD(GetAllParameters)     (THIS_ LPDSFXDistortion pDsFxDistortion) PURE;
  1253. };
  1254. #define IDirectSoundFXDistortion_QueryInterface(p,a,b)      IUnknown_QueryInterface(p,a,b)
  1255. #define IDirectSoundFXDistortion_AddRef(p)                  IUnknown_AddRef(p)
  1256. #define IDirectSoundFXDistortion_Release(p)                 IUnknown_Release(p)
  1257. #if !defined(__cplusplus) || defined(CINTERFACE)
  1258. #define IDirectSoundFXDistortion_SetAllParameters(p,a)      (p)->lpVtbl->SetAllParameters(p,a)
  1259. #define IDirectSoundFXDistortion_GetAllParameters(p,a)      (p)->lpVtbl->GetAllParameters(p,a)
  1260. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1261. #define IDirectSoundFXDistortion_SetAllParameters(p,a)      (p)->SetAllParameters(a)
  1262. #define IDirectSoundFXDistortion_GetAllParameters(p,a)      (p)->GetAllParameters(a)
  1263. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1264. //
  1265. // IDirectSoundFXCompressor
  1266. //
  1267. DEFINE_GUID(IID_IDirectSoundFXCompressor, 0x4bbd1154, 0x62f6, 0x4e2c, 0xa1, 0x5c, 0xd3, 0xb6, 0xc4, 0x17, 0xf7, 0xa0);
  1268. typedef struct _DSFXCompressor
  1269. {
  1270.     FLOAT   fGain;
  1271.     FLOAT   fAttack;
  1272.     FLOAT   fRelease;
  1273.     FLOAT   fThreshold;
  1274.     FLOAT   fRatio;
  1275.     FLOAT   fPredelay;
  1276. } DSFXCompressor, *LPDSFXCompressor;
  1277. typedef const DSFXCompressor *LPCDSFXCompressor;
  1278. #define DSFXCOMPRESSOR_GAIN_MIN             -60.0f
  1279. #define DSFXCOMPRESSOR_GAIN_MAX             60.0f
  1280. #define DSFXCOMPRESSOR_ATTACK_MIN           0.01f
  1281. #define DSFXCOMPRESSOR_ATTACK_MAX           500.0f
  1282. #define DSFXCOMPRESSOR_RELEASE_MIN          50.0f
  1283. #define DSFXCOMPRESSOR_RELEASE_MAX          3000.0f
  1284. #define DSFXCOMPRESSOR_THRESHOLD_MIN        -60.0f
  1285. #define DSFXCOMPRESSOR_THRESHOLD_MAX        0.0f
  1286. #define DSFXCOMPRESSOR_RATIO_MIN            1.0f
  1287. #define DSFXCOMPRESSOR_RATIO_MAX            100.0f
  1288. #define DSFXCOMPRESSOR_PREDELAY_MIN         0.0f
  1289. #define DSFXCOMPRESSOR_PREDELAY_MAX         4.0f
  1290. #undef INTERFACE
  1291. #define INTERFACE IDirectSoundFXCompressor
  1292. DECLARE_INTERFACE_(IDirectSoundFXCompressor, IUnknown)
  1293. {
  1294.     // IUnknown methods
  1295.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  1296.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1297.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1298.     // IDirectSoundFXCompressor methods
  1299.     STDMETHOD(SetAllParameters)     (THIS_ LPCDSFXCompressor pcDsFxCompressor) PURE;
  1300.     STDMETHOD(GetAllParameters)     (THIS_ LPDSFXCompressor pDsFxCompressor) PURE;
  1301. };
  1302. #define IDirectSoundFXCompressor_QueryInterface(p,a,b)      IUnknown_QueryInterface(p,a,b)
  1303. #define IDirectSoundFXCompressor_AddRef(p)                  IUnknown_AddRef(p)
  1304. #define IDirectSoundFXCompressor_Release(p)                 IUnknown_Release(p)
  1305. #if !defined(__cplusplus) || defined(CINTERFACE)
  1306. #define IDirectSoundFXCompressor_SetAllParameters(p,a)      (p)->lpVtbl->SetAllParameters(p,a)
  1307. #define IDirectSoundFXCompressor_GetAllParameters(p,a)      (p)->lpVtbl->GetAllParameters(p,a)
  1308. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1309. #define IDirectSoundFXCompressor_SetAllParameters(p,a)      (p)->SetAllParameters(a)
  1310. #define IDirectSoundFXCompressor_GetAllParameters(p,a)      (p)->GetAllParameters(a)
  1311. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1312. //
  1313. // IDirectSoundFXParamEq
  1314. //
  1315. DEFINE_GUID(IID_IDirectSoundFXParamEq, 0xc03ca9fe, 0xfe90, 0x4204, 0x80, 0x78, 0x82, 0x33, 0x4c, 0xd1, 0x77, 0xda);
  1316. typedef struct _DSFXParamEq
  1317. {
  1318.     FLOAT   fCenter;
  1319.     FLOAT   fBandwidth;
  1320.     FLOAT   fGain;
  1321. } DSFXParamEq, *LPDSFXParamEq;
  1322. typedef const DSFXParamEq *LPCDSFXParamEq;
  1323. #define DSFXPARAMEQ_CENTER_MIN      80.0f
  1324. #define DSFXPARAMEQ_CENTER_MAX      16000.0f
  1325. #define DSFXPARAMEQ_BANDWIDTH_MIN   1.0f
  1326. #define DSFXPARAMEQ_BANDWIDTH_MAX   36.0f
  1327. #define DSFXPARAMEQ_GAIN_MIN        -15.0f
  1328. #define DSFXPARAMEQ_GAIN_MAX        15.0f
  1329. #undef INTERFACE
  1330. #define INTERFACE IDirectSoundFXParamEq
  1331. DECLARE_INTERFACE_(IDirectSoundFXParamEq, IUnknown)
  1332. {
  1333.     // IUnknown methods
  1334.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  1335.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1336.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1337.     // IDirectSoundFXParamEq methods
  1338.     STDMETHOD(SetAllParameters)     (THIS_ LPCDSFXParamEq pcDsFxParamEq) PURE;
  1339.     STDMETHOD(GetAllParameters)     (THIS_ LPDSFXParamEq pDsFxParamEq) PURE;
  1340. };
  1341. #define IDirectSoundFXParamEq_QueryInterface(p,a,b)      IUnknown_QueryInterface(p,a,b)
  1342. #define IDirectSoundFXParamEq_AddRef(p)                  IUnknown_AddRef(p)
  1343. #define IDirectSoundFXParamEq_Release(p)                 IUnknown_Release(p)
  1344. #if !defined(__cplusplus) || defined(CINTERFACE)
  1345. #define IDirectSoundFXParamEq_SetAllParameters(p,a)      (p)->lpVtbl->SetAllParameters(p,a)
  1346. #define IDirectSoundFXParamEq_GetAllParameters(p,a)      (p)->lpVtbl->GetAllParameters(p,a)
  1347. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1348. #define IDirectSoundFXParamEq_SetAllParameters(p,a)      (p)->SetAllParameters(a)
  1349. #define IDirectSoundFXParamEq_GetAllParameters(p,a)      (p)->GetAllParameters(a)
  1350. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1351. //
  1352. // IDirectSoundFXI3DL2Reverb
  1353. //
  1354. DEFINE_GUID(IID_IDirectSoundFXI3DL2Reverb, 0x4b166a6a, 0x0d66, 0x43f3, 0x80, 0xe3, 0xee, 0x62, 0x80, 0xde, 0xe1, 0xa4);
  1355. typedef struct _DSFXI3DL2Reverb
  1356. {
  1357.     LONG    lRoom;                  // [-10000, 0]      default: -1000 mB
  1358.     LONG    lRoomHF;                // [-10000, 0]      default: 0 mB
  1359.     FLOAT   flRoomRolloffFactor;    // [0.0, 10.0]      default: 0.0
  1360.     FLOAT   flDecayTime;            // [0.1, 20.0]      default: 1.49s
  1361.     FLOAT   flDecayHFRatio;         // [0.1, 2.0]       default: 0.83
  1362.     LONG    lReflections;           // [-10000, 1000]   default: -2602 mB
  1363.     FLOAT   flReflectionsDelay;     // [0.0, 0.3]       default: 0.007 s
  1364.     LONG    lReverb;                // [-10000, 2000]   default: 200 mB
  1365.     FLOAT   flReverbDelay;          // [0.0, 0.1]       default: 0.011 s
  1366.     FLOAT   flDiffusion;            // [0.0, 100.0]     default: 100.0 %
  1367.     FLOAT   flDensity;              // [0.0, 100.0]     default: 100.0 %
  1368.     FLOAT   flHFReference;          // [20.0, 20000.0]  default: 5000.0 Hz
  1369. } DSFXI3DL2Reverb, *LPDSFXI3DL2Reverb;
  1370. typedef const DSFXI3DL2Reverb *LPCDSFXI3DL2Reverb;
  1371. #define DSFX_I3DL2REVERB_ROOM_MIN                   (-10000)
  1372. #define DSFX_I3DL2REVERB_ROOM_MAX                   0
  1373. #define DSFX_I3DL2REVERB_ROOM_DEFAULT               (-1000)
  1374.                                                     
  1375. #define DSFX_I3DL2REVERB_ROOMHF_MIN                 (-10000)
  1376. #define DSFX_I3DL2REVERB_ROOMHF_MAX                 0
  1377. #define DSFX_I3DL2REVERB_ROOMHF_DEFAULT             (-100)
  1378.                                                     
  1379. #define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MIN      0.0f
  1380. #define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MAX      10.0f
  1381. #define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_DEFAULT  0.0f
  1382. #define DSFX_I3DL2REVERB_DECAYTIME_MIN              0.1f
  1383. #define DSFX_I3DL2REVERB_DECAYTIME_MAX              20.0f
  1384. #define DSFX_I3DL2REVERB_DECAYTIME_DEFAULT          1.49f
  1385.                                                     
  1386. #define DSFX_I3DL2REVERB_DECAYHFRATIO_MIN           0.1f
  1387. #define DSFX_I3DL2REVERB_DECAYHFRATIO_MAX           2.0f
  1388. #define DSFX_I3DL2REVERB_DECAYHFRATIO_DEFAULT       0.83f
  1389.                                                     
  1390. #define DSFX_I3DL2REVERB_REFLECTIONS_MIN            (-10000)
  1391. #define DSFX_I3DL2REVERB_REFLECTIONS_MAX            1000
  1392. #define DSFX_I3DL2REVERB_REFLECTIONS_DEFAULT        (-2602)
  1393.                                                     
  1394. #define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MIN       0.0f
  1395. #define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MAX       0.3f
  1396. #define DSFX_I3DL2REVERB_REFLECTIONSDELAY_DEFAULT   0.007f
  1397. #define DSFX_I3DL2REVERB_REVERB_MIN                 (-10000)
  1398. #define DSFX_I3DL2REVERB_REVERB_MAX                 2000
  1399. #define DSFX_I3DL2REVERB_REVERB_DEFAULT             (200)
  1400.                                                     
  1401. #define DSFX_I3DL2REVERB_REVERBDELAY_MIN            0.0f
  1402. #define DSFX_I3DL2REVERB_REVERBDELAY_MAX            0.1f
  1403. #define DSFX_I3DL2REVERB_REVERBDELAY_DEFAULT        0.011f
  1404.                                                     
  1405. #define DSFX_I3DL2REVERB_DIFFUSION_MIN              0.0f
  1406. #define DSFX_I3DL2REVERB_DIFFUSION_MAX              100.0f
  1407. #define DSFX_I3DL2REVERB_DIFFUSION_DEFAULT          100.0f
  1408.                                                     
  1409. #define DSFX_I3DL2REVERB_DENSITY_MIN                0.0f
  1410. #define DSFX_I3DL2REVERB_DENSITY_MAX                100.0f
  1411. #define DSFX_I3DL2REVERB_DENSITY_DEFAULT            100.0f
  1412.                                                     
  1413. #define DSFX_I3DL2REVERB_HFREFERENCE_MIN            20.0f
  1414. #define DSFX_I3DL2REVERB_HFREFERENCE_MAX            20000.0f
  1415. #define DSFX_I3DL2REVERB_HFREFERENCE_DEFAULT        5000.0f
  1416.                                                     
  1417. #define DSFX_I3DL2REVERB_QUALITY_MIN                0
  1418. #define DSFX_I3DL2REVERB_QUALITY_MAX                3
  1419. #define DSFX_I3DL2REVERB_QUALITY_DEFAULT            2
  1420. #undef INTERFACE
  1421. #define INTERFACE IDirectSoundFXI3DL2Reverb
  1422. DECLARE_INTERFACE_(IDirectSoundFXI3DL2Reverb, IUnknown)
  1423. {
  1424.     // IUnknown methods
  1425.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  1426.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1427.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1428.     // IDirectSoundFXI3DL2Reverb methods
  1429.     STDMETHOD(SetAllParameters)     (THIS_ LPCDSFXI3DL2Reverb pcDsFxI3DL2Reverb) PURE;
  1430.     STDMETHOD(GetAllParameters)     (THIS_ LPDSFXI3DL2Reverb pDsFxI3DL2Reverb) PURE;
  1431.     STDMETHOD(SetPreset)            (THIS_ DWORD dwPreset) PURE;
  1432.     STDMETHOD(GetPreset)            (THIS_ LPDWORD pdwPreset) PURE;
  1433.     STDMETHOD(SetQuality)           (THIS_ LONG lQuality) PURE;
  1434.     STDMETHOD(GetQuality)           (THIS_ LONG *plQuality) PURE;
  1435. };
  1436. #define IDirectSoundFXI3DL2Reverb_QueryInterface(p,a,b)     IUnknown_QueryInterface(p,a,b)
  1437. #define IDirectSoundFXI3DL2Reverb_AddRef(p)                 IUnknown_AddRef(p)
  1438. #define IDirectSoundFXI3DL2Reverb_Release(p)                IUnknown_Release(p)
  1439. #if !defined(__cplusplus) || defined(CINTERFACE)
  1440. #define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a)     (p)->lpVtbl->SetAllParameters(p,a)
  1441. #define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a)     (p)->lpVtbl->GetAllParameters(p,a)
  1442. #define IDirectSoundFXI3DL2Reverb_SetPreset(p,a)            (p)->lpVtbl->SetPreset(p,a)
  1443. #define IDirectSoundFXI3DL2Reverb_GetPreset(p,a)            (p)->lpVtbl->GetPreset(p,a)
  1444. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1445. #define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a)     (p)->SetAllParameters(a)
  1446. #define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a)     (p)->GetAllParameters(a)
  1447. #define IDirectSoundFXI3DL2Reverb_SetPreset(p,a)            (p)->SetPreset(a)
  1448. #define IDirectSoundFXI3DL2Reverb_GetPreset(p,a)            (p)->GetPreset(a)
  1449. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1450. //
  1451. // IDirectSoundFXWavesReverb
  1452. //
  1453. DEFINE_GUID(IID_IDirectSoundFXWavesReverb,0x46858c3a,0x0dc6,0x45e3,0xb7,0x60,0xd4,0xee,0xf1,0x6c,0xb3,0x25);
  1454. typedef struct _DSFXWavesReverb
  1455. {
  1456.     FLOAT   fInGain;                // [-96.0,0.0]            default: 0.0 dB
  1457.     FLOAT   fReverbMix;             // [-96.0,0.0]            default: 0.0 db
  1458.     FLOAT   fReverbTime;            // [0.001,3000.0]         default: 1000.0 ms
  1459.     FLOAT   fHighFreqRTRatio;       // [0.001,0.999]          default: 0.001
  1460. } DSFXWavesReverb, *LPDSFXWavesReverb;
  1461. typedef const DSFXWavesReverb *LPCDSFXWavesReverb;
  1462. #define DSFX_WAVESREVERB_INGAIN_MIN                 -96.0f
  1463. #define DSFX_WAVESREVERB_INGAIN_MAX                 0.0f
  1464. #define DSFX_WAVESREVERB_INGAIN_DEFAULT             0.0f
  1465. #define DSFX_WAVESREVERB_REVERBMIX_MIN              -96.0f
  1466. #define DSFX_WAVESREVERB_REVERBMIX_MAX              0.0f
  1467. #define DSFX_WAVESREVERB_REVERBMIX_DEFAULT          0.0f
  1468. #define DSFX_WAVESREVERB_REVERBTIME_MIN             0.001f
  1469. #define DSFX_WAVESREVERB_REVERBTIME_MAX             3000.0f
  1470. #define DSFX_WAVESREVERB_REVERBTIME_DEFAULT         1000.0f
  1471. #define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN        0.001f
  1472. #define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX        0.999f
  1473. #define DSFX_WAVESREVERB_HIGHFREQRTRATIO_DEFAULT    0.001f
  1474. #undef INTERFACE
  1475. #define INTERFACE IDirectSoundFXWavesReverb
  1476. DECLARE_INTERFACE_(IDirectSoundFXWavesReverb, IUnknown)
  1477. {
  1478.     // IUnknown methods
  1479.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  1480.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1481.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1482.     // IDirectSoundFXWavesReverb methods
  1483.     STDMETHOD(SetAllParameters)     (THIS_ LPCDSFXWavesReverb pcDsFxWavesReverb) PURE;
  1484.     STDMETHOD(GetAllParameters)     (THIS_ LPDSFXWavesReverb pDsFxWavesReverb) PURE;
  1485. };
  1486. #define IDirectSoundFXWavesReverb_QueryInterface(p,a,b)     IUnknown_QueryInterface(p,a,b)
  1487. #define IDirectSoundFXWavesReverb_AddRef(p)                 IUnknown_AddRef(p)
  1488. #define IDirectSoundFXWavesReverb_Release(p)                IUnknown_Release(p)
  1489. #if !defined(__cplusplus) || defined(CINTERFACE)
  1490. #define IDirectSoundFXWavesReverb_SetAllParameters(p,a)     (p)->lpVtbl->SetAllParameters(p,a)
  1491. #define IDirectSoundFXWavesReverb_GetAllParameters(p,a)     (p)->lpVtbl->GetAllParameters(p,a)
  1492. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1493. #define IDirectSoundFXWavesReverb_SetAllParameters(p,a)     (p)->SetAllParameters(a)
  1494. #define IDirectSoundFXWavesReverb_GetAllParameters(p,a)     (p)->GetAllParameters(a)
  1495. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1496. //
  1497. // IDirectSoundCaptureFXAec
  1498. //
  1499. DEFINE_GUID(IID_IDirectSoundCaptureFXAec, 0x174d3eb9, 0x6696, 0x4fac, 0xa4, 0x6c, 0xa0, 0xac, 0x7b, 0xc9, 0xe2, 0xf);
  1500. typedef struct _DSCFXAec
  1501. {
  1502.     BOOL    fEnable;
  1503.     BOOL    fReset;
  1504.     BOOL    fNoiseFill;
  1505. } DSCFXAec, *LPDSCFXAec;
  1506. typedef const DSCFXAec *LPCDSCFXAec;
  1507. #undef INTERFACE
  1508. #define INTERFACE IDirectSoundCaptureFXAec
  1509. DECLARE_INTERFACE_(IDirectSoundCaptureFXAec, IUnknown)
  1510. {
  1511.     // IUnknown methods
  1512.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  1513.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1514.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1515.     // IDirectSoundCaptureFXAec methods
  1516.     STDMETHOD(SetAllParameters)     (THIS_ LPCDSCFXAec pDscFxAec) PURE;
  1517.     STDMETHOD(GetAllParameters)     (THIS_ LPDSCFXAec pDscFxAec) PURE;
  1518. };
  1519. #define IDirectSoundCaptureFXAec_QueryInterface(p,a,b)     IUnknown_QueryInterface(p,a,b)
  1520. #define IDirectSoundCaptureFXAec_AddRef(p)                 IUnknown_AddRef(p)
  1521. #define IDirectSoundCaptureFXAec_Release(p)                IUnknown_Release(p)
  1522. #if !defined(__cplusplus) || defined(CINTERFACE)
  1523. #define IDirectSoundCaptureFXAec_SetAllParameters(p,a)     (p)->lpVtbl->SetAllParameters(p,a)
  1524. #define IDirectSoundCaptureFXAec_GetAllParameters(p,a)     (p)->lpVtbl->GetAllParameters(p,a)
  1525. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1526. #define IDirectSoundCaptureFXAec_SetAllParameters(p,a)     (p)->SetAllParameters(a)
  1527. #define IDirectSoundCaptureFXAec_GetAllParameters(p,a)     (p)->GetAllParameters(a)
  1528. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1529. //
  1530. // IDirectSoundCaptureFXNoiseSuppress
  1531. //
  1532. DEFINE_GUID(IID_IDirectSoundCaptureFXNoiseSuppress, 0xed311e41, 0xfbae, 0x4175, 0x96, 0x25, 0xcd, 0x8, 0x54, 0xf6, 0x93, 0xca);
  1533. typedef struct _DSCFXNoiseSuppress
  1534. {
  1535.     BOOL    fEnable;
  1536.     BOOL    fReset;
  1537. } DSCFXNoiseSuppress, *LPDSCFXNoiseSuppress;
  1538. typedef const DSCFXNoiseSuppress *LPCDSCFXNoiseSuppress;
  1539. #undef INTERFACE
  1540. #define INTERFACE IDirectSoundCaptureFXNoiseSuppress
  1541. DECLARE_INTERFACE_(IDirectSoundCaptureFXNoiseSuppress, IUnknown)
  1542. {
  1543.     // IUnknown methods
  1544.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  1545.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1546.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1547.     // IDirectSoundCaptureFXNoiseSuppress methods
  1548.     STDMETHOD(SetAllParameters)     (THIS_ LPCDSCFXNoiseSuppress pcDscFxNoiseSuppress) PURE;
  1549.     STDMETHOD(GetAllParameters)     (THIS_ LPDSCFXNoiseSuppress pDscFxNoiseSuppress) PURE;
  1550. };
  1551. #define IDirectSoundCaptureFXNoiseSuppress_QueryInterface(p,a,b)     IUnknown_QueryInterface(p,a,b)
  1552. #define IDirectSoundCaptureFXNoiseSuppress_AddRef(p)                 IUnknown_AddRef(p)
  1553. #define IDirectSoundCaptureFXNoiseSuppress_Release(p)                IUnknown_Release(p)
  1554. #if !defined(__cplusplus) || defined(CINTERFACE)
  1555. #define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a)     (p)->lpVtbl->SetAllParameters(p,a)
  1556. #define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a)     (p)->lpVtbl->GetAllParameters(p,a)
  1557. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1558. #define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a)     (p)->SetAllParameters(a)
  1559. #define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a)     (p)->GetAllParameters(a)
  1560. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1561. //
  1562. // IDirectSoundFullDuplex
  1563. //
  1564. #ifndef _IDirectSoundFullDuplex_
  1565. #define _IDirectSoundFullDuplex_
  1566. #ifdef __cplusplus
  1567. // 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
  1568. struct IDirectSoundFullDuplex;
  1569. #endif // __cplusplus
  1570. typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX;
  1571. DEFINE_GUID(IID_IDirectSoundFullDuplex, 0xedcb4c7a, 0xdaab, 0x4216, 0xa4, 0x2e, 0x6c, 0x50, 0x59, 0x6d, 0xdc, 0x1d);
  1572. #undef INTERFACE
  1573. #define INTERFACE IDirectSoundFullDuplex
  1574. DECLARE_INTERFACE_(IDirectSoundFullDuplex, IUnknown)
  1575. {
  1576.     // IUnknown methods
  1577.     STDMETHOD(QueryInterface)   (THIS_ REFIID, LPVOID *) PURE;
  1578.     STDMETHOD_(ULONG,AddRef)    (THIS) PURE;
  1579.     STDMETHOD_(ULONG,Release)   (THIS) PURE;
  1580.     // IDirectSoundFullDuplex methods 
  1581.     STDMETHOD(Initialize)     (THIS_ LPCGUID pCaptureGuid, LPCGUID pRenderGuid, LPCDSCBUFFERDESC lpDscBufferDesc, LPCDSBUFFERDESC lpDsBufferDesc, HWND hWnd, DWORD dwLevel, LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8, LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8) PURE;
  1582. };
  1583. #define IDirectSoundFullDuplex_QueryInterface(p,a,b)    IUnknown_QueryInterface(p,a,b)
  1584. #define IDirectSoundFullDuplex_AddRef(p)                IUnknown_AddRef(p)
  1585. #define IDirectSoundFullDuplex_Release(p)               IUnknown_Release(p)
  1586. #if !defined(__cplusplus) || defined(CINTERFACE)
  1587. #define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h)     (p)->lpVtbl->Initialize(p,a,b,c,d,e,f,g,h)
  1588. #else // !defined(__cplusplus) || defined(CINTERFACE)
  1589. #define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h)     (p)->Initialize(a,b,c,d,e,f,g,h)
  1590. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  1591. #endif // _IDirectSoundFullDuplex_
  1592. #endif // DIRECTSOUND_VERSION >= 0x0800
  1593. //
  1594. // Return Codes
  1595. //
  1596. // The function completed successfully
  1597. #define DS_OK                           S_OK
  1598. // The call succeeded, but we had to substitute the 3D algorithm
  1599. #define DS_NO_VIRTUALIZATION            MAKE_HRESULT(0, _FACDS, 10)
  1600. // The call succeeded, but not all of the optional effects were obtained.
  1601. #define DS_INCOMPLETE                   MAKE_HRESULT(0, _FACDS, 20)
  1602. // The call failed because resources (such as a priority level)
  1603. // were already being used by another caller
  1604. #define DSERR_ALLOCATED                 MAKE_DSHRESULT(10)
  1605. // The control (vol, pan, etc.) requested by the caller is not available
  1606. #define DSERR_CONTROLUNAVAIL            MAKE_DSHRESULT(30)
  1607. // An invalid parameter was passed to the returning function
  1608. #define DSERR_INVALIDPARAM              E_INVALIDARG
  1609. // This call is not valid for the current state of this object
  1610. #define DSERR_INVALIDCALL               MAKE_DSHRESULT(50)
  1611. // An undetermined error occurred inside the DirectSound subsystem
  1612. #define DSERR_GENERIC                   E_FAIL
  1613. // The caller does not have the priority level required for the function to
  1614. // succeed
  1615. #define DSERR_PRIOLEVELNEEDED           MAKE_DSHRESULT(70)
  1616. // Not enough free memory is available to complete the operation
  1617. #define DSERR_OUTOFMEMORY               E_OUTOFMEMORY
  1618. // The specified WAVE format is not supported
  1619. #define DSERR_BADFORMAT                 MAKE_DSHRESULT(100)
  1620. // The function called is not supported at this time
  1621. #define DSERR_UNSUPPORTED               E_NOTIMPL
  1622. // No sound driver is available for use
  1623. #define DSERR_NODRIVER                  MAKE_DSHRESULT(120)
  1624. // This object is already initialized
  1625. #define DSERR_ALREADYINITIALIZED        MAKE_DSHRESULT(130)
  1626. // This object does not support aggregation
  1627. #define DSERR_NOAGGREGATION             CLASS_E_NOAGGREGATION
  1628. // The buffer memory has been lost, and must be restored
  1629. #define DSERR_BUFFERLOST                MAKE_DSHRESULT(150)
  1630. // Another app has a higher priority level, preventing this call from
  1631. // succeeding
  1632. #define DSERR_OTHERAPPHASPRIO           MAKE_DSHRESULT(160)
  1633. // This object has not been initialized
  1634. #define DSERR_UNINITIALIZED             MAKE_DSHRESULT(170)
  1635. // The requested COM interface is not available
  1636. #define DSERR_NOINTERFACE               E_NOINTERFACE
  1637. // Access is denied
  1638. #define DSERR_ACCESSDENIED              E_ACCESSDENIED
  1639. // Tried to create a DSBCAPS_CTRLFX buffer shorter than DSBSIZE_FX_MIN milliseconds
  1640. #define DSERR_BUFFERTOOSMALL            MAKE_DSHRESULT(180)
  1641. // Attempt to use DirectSound 8 functionality on an older DirectSound object
  1642. #define DSERR_DS8_REQUIRED              MAKE_DSHRESULT(190)
  1643. // A circular loop of send effects was detected
  1644. #define DSERR_SENDLOOP                  MAKE_DSHRESULT(200)
  1645. // The GUID specified in an audiopath file does not match a valid MIXIN buffer
  1646. #define DSERR_BADSENDBUFFERGUID         MAKE_DSHRESULT(210)
  1647. // The object requested was not found (numerically equal to DMUS_E_NOT_FOUND)
  1648. #define DSERR_OBJECTNOTFOUND            MAKE_DSHRESULT(4449)
  1649. // The effects requested could not be found on the system, or they were found
  1650. // but in the wrong order, or in the wrong hardware/software locations.
  1651. #define DSERR_FXUNAVAILABLE             MAKE_DSHRESULT(220)
  1652. //
  1653. // Flags
  1654. //
  1655. #define DSCAPS_PRIMARYMONO          0x00000001
  1656. #define DSCAPS_PRIMARYSTEREO        0x00000002
  1657. #define DSCAPS_PRIMARY8BIT          0x00000004
  1658. #define DSCAPS_PRIMARY16BIT         0x00000008
  1659. #define DSCAPS_CONTINUOUSRATE       0x00000010
  1660. #define DSCAPS_EMULDRIVER           0x00000020
  1661. #define DSCAPS_CERTIFIED            0x00000040
  1662. #define DSCAPS_SECONDARYMONO        0x00000100
  1663. #define DSCAPS_SECONDARYSTEREO      0x00000200
  1664. #define DSCAPS_SECONDARY8BIT        0x00000400
  1665. #define DSCAPS_SECONDARY16BIT       0x00000800
  1666. #define DSSCL_NORMAL                0x00000001
  1667. #define DSSCL_PRIORITY              0x00000002
  1668. #define DSSCL_EXCLUSIVE             0x00000003
  1669. #define DSSCL_WRITEPRIMARY          0x00000004
  1670. #define DSSPEAKER_DIRECTOUT         0x00000000
  1671. #define DSSPEAKER_HEADPHONE         0x00000001
  1672. #define DSSPEAKER_MONO              0x00000002
  1673. #define DSSPEAKER_QUAD              0x00000003
  1674. #define DSSPEAKER_STEREO            0x00000004
  1675. #define DSSPEAKER_SURROUND          0x00000005
  1676. #define DSSPEAKER_5POINT1           0x00000006
  1677. #define DSSPEAKER_7POINT1           0x00000007
  1678. #define DSSPEAKER_GEOMETRY_MIN      0x00000005  //   5 degrees
  1679. #define DSSPEAKER_GEOMETRY_NARROW   0x0000000A  //  10 degrees
  1680. #define DSSPEAKER_GEOMETRY_WIDE     0x00000014  //  20 degrees
  1681. #define DSSPEAKER_GEOMETRY_MAX      0x000000B4  // 180 degrees
  1682. #define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
  1683. #define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
  1684. #define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
  1685. #define DSBCAPS_PRIMARYBUFFER       0x00000001
  1686. #define DSBCAPS_STATIC              0x00000002
  1687. #define DSBCAPS_LOCHARDWARE         0x00000004
  1688. #define DSBCAPS_LOCSOFTWARE         0x00000008
  1689. #define DSBCAPS_CTRL3D              0x00000010
  1690. #define DSBCAPS_CTRLFREQUENCY       0x00000020
  1691. #define DSBCAPS_CTRLPAN             0x00000040
  1692. #define DSBCAPS_CTRLVOLUME          0x00000080
  1693. #define DSBCAPS_CTRLPOSITIONNOTIFY  0x00000100
  1694. #define DSBCAPS_CTRLFX              0x00000200
  1695. #define DSBCAPS_STICKYFOCUS         0x00004000
  1696. #define DSBCAPS_GLOBALFOCUS         0x00008000
  1697. #define DSBCAPS_GETCURRENTPOSITION2 0x00010000
  1698. #define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
  1699. #define DSBCAPS_LOCDEFER            0x00040000
  1700. #define DSBPLAY_LOOPING             0x00000001
  1701. #define DSBPLAY_LOCHARDWARE         0x00000002
  1702. #define DSBPLAY_LOCSOFTWARE         0x00000004
  1703. #define DSBPLAY_TERMINATEBY_TIME    0x00000008
  1704. #define DSBPLAY_TERMINATEBY_DISTANCE    0x000000010
  1705. #define DSBPLAY_TERMINATEBY_PRIORITY    0x000000020
  1706. #define DSBSTATUS_PLAYING           0x00000001
  1707. #define DSBSTATUS_BUFFERLOST        0x00000002
  1708. #define DSBSTATUS_LOOPING           0x00000004
  1709. #define DSBSTATUS_LOCHARDWARE       0x00000008
  1710. #define DSBSTATUS_LOCSOFTWARE       0x00000010
  1711. #define DSBSTATUS_TERMINATED        0x00000020
  1712. #define DSBLOCK_FROMWRITECURSOR     0x00000001
  1713. #define DSBLOCK_ENTIREBUFFER        0x00000002
  1714. #define DSBFREQUENCY_MIN            100
  1715. #define DSBFREQUENCY_MAX            100000
  1716. #define DSBFREQUENCY_ORIGINAL       0
  1717. #define DSBPAN_LEFT                 -10000
  1718. #define DSBPAN_CENTER               0
  1719. #define DSBPAN_RIGHT                10000
  1720. #define DSBVOLUME_MIN               -10000
  1721. #define DSBVOLUME_MAX               0
  1722. #define DSBSIZE_MIN                 4
  1723. #define DSBSIZE_MAX                 0x0FFFFFFF
  1724. #define DSBSIZE_FX_MIN              150  // NOTE: Milliseconds, not bytes
  1725. #define DS3DMODE_NORMAL             0x00000000
  1726. #define DS3DMODE_HEADRELATIVE       0x00000001
  1727. #define DS3DMODE_DISABLE            0x00000002
  1728. #define DS3D_IMMEDIATE              0x00000000
  1729. #define DS3D_DEFERRED               0x00000001
  1730. #define DS3D_MINDISTANCEFACTOR      FLT_MIN
  1731. #define DS3D_MAXDISTANCEFACTOR      FLT_MAX
  1732. #define DS3D_DEFAULTDISTANCEFACTOR  1.0f
  1733. #define DS3D_MINROLLOFFFACTOR       0.0f
  1734. #define DS3D_MAXROLLOFFFACTOR       10.0f
  1735. #define DS3D_DEFAULTROLLOFFFACTOR   1.0f
  1736. #define DS3D_MINDOPPLERFACTOR       0.0f
  1737. #define DS3D_MAXDOPPLERFACTOR       10.0f
  1738. #define DS3D_DEFAULTDOPPLERFACTOR   1.0f
  1739. #define DS3D_DEFAULTMINDISTANCE     1.0f
  1740. #define DS3D_DEFAULTMAXDISTANCE     1000000000.0f
  1741. #define DS3D_MINCONEANGLE           0
  1742. #define DS3D_MAXCONEANGLE           360
  1743. #define DS3D_DEFAULTCONEANGLE       360
  1744. #define DS3D_DEFAULTCONEOUTSIDEVOLUME DSBVOLUME_MAX
  1745. // IDirectSoundCapture attributes
  1746. #define DSCCAPS_EMULDRIVER          DSCAPS_EMULDRIVER
  1747. #define DSCCAPS_CERTIFIED           DSCAPS_CERTIFIED
  1748. // IDirectSoundCaptureBuffer attributes
  1749. #define DSCBCAPS_WAVEMAPPED         0x80000000
  1750. #if DIRECTSOUND_VERSION >= 0x0800
  1751. #define DSCBCAPS_CTRLFX             0x00000200
  1752. #endif
  1753. #define DSCBLOCK_ENTIREBUFFER       0x00000001
  1754. #define DSCBSTATUS_CAPTURING        0x00000001
  1755. #define DSCBSTATUS_LOOPING          0x00000002
  1756. #define DSCBSTART_LOOPING           0x00000001
  1757. #define DSBPN_OFFSETSTOP            0xFFFFFFFF
  1758. #define DS_CERTIFIED                0x00000000
  1759. #define DS_UNCERTIFIED              0x00000001
  1760. // Dsound SYSTEM resource constants
  1761. // Matches the KSAUDIO_CPU_RESOURCES_xxx_HOST_CPU values defined 
  1762. // in ksmedia.h.
  1763. #define DS_SYSTEM_RESOURCES_NO_HOST_RESOURCES  0x00000000
  1764. #define DS_SYSTEM_RESOURCES_ALL_HOST_RESOURCES 0x7FFFFFFF
  1765. #define DS_SYSTEM_RESOURCES_UNDEFINED          0x80000000
  1766. //
  1767. // I3DL2 Material Presets
  1768. //
  1769. enum
  1770. {
  1771.     DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW,
  1772.     DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW,
  1773.     DSFX_I3DL2_MATERIAL_PRESET_THINDOOR,
  1774.     DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR,
  1775.     DSFX_I3DL2_MATERIAL_PRESET_WOODWALL,
  1776.     DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL,
  1777.     DSFX_I3DL2_MATERIAL_PRESET_STONEWALL,
  1778.     DSFX_I3DL2_MATERIAL_PRESET_CURTAIN
  1779. };
  1780. #define I3DL2_MATERIAL_PRESET_SINGLEWINDOW    -2800,0.71f
  1781. #define I3DL2_MATERIAL_PRESET_DOUBLEWINDOW    -5000,0.40f
  1782. #define I3DL2_MATERIAL_PRESET_THINDOOR        -1800,0.66f
  1783. #define I3DL2_MATERIAL_PRESET_THICKDOOR       -4400,0.64f
  1784. #define I3DL2_MATERIAL_PRESET_WOODWALL        -4000,0.50f
  1785. #define I3DL2_MATERIAL_PRESET_BRICKWALL       -5000,0.60f
  1786. #define I3DL2_MATERIAL_PRESET_STONEWALL       -6000,0.68f
  1787. #define I3DL2_MATERIAL_PRESET_CURTAIN         -1200,0.15f
  1788. enum
  1789. {
  1790.     DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT,
  1791.     DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC,
  1792.     DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL,
  1793.     DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM,
  1794.     DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM,
  1795.     DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM,
  1796.     DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM,
  1797.     DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM,
  1798.     DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL,
  1799.     DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE,
  1800.     DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA,
  1801.     DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR,
  1802.     DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY,
  1803.     DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY,
  1804.     DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR,
  1805.     DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY,
  1806.     DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST,
  1807.     DSFX_I3DL2_ENVIRONMENT_PRESET_CITY,
  1808.     DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS,
  1809.     DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY,
  1810.     DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN,
  1811.     DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT,
  1812.     DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE,
  1813.     DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER,
  1814.     DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM,
  1815.     DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM,
  1816.     DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM,
  1817.     DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL,
  1818.     DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL,
  1819.     DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE
  1820. };
  1821. //
  1822. // I3DL2 Reverberation Presets Values
  1823. //
  1824. #define I3DL2_ENVIRONMENT_PRESET_DEFAULT         -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f,   200, 0.011f, 100.0f, 100.0f, 5000.0f
  1825. #define I3DL2_ENVIRONMENT_PRESET_GENERIC         -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f,   200, 0.011f, 100.0f, 100.0f, 5000.0f
  1826. #define I3DL2_ENVIRONMENT_PRESET_PADDEDCELL      -1000,-6000, 0.0f, 0.17f, 0.10f, -1204, 0.001f,   207, 0.002f, 100.0f, 100.0f, 5000.0f
  1827. #define I3DL2_ENVIRONMENT_PRESET_ROOM            -1000, -454, 0.0f, 0.40f, 0.83f, -1646, 0.002f,    53, 0.003f, 100.0f, 100.0f, 5000.0f
  1828. #define I3DL2_ENVIRONMENT_PRESET_BATHROOM        -1000,-1200, 0.0f, 1.49f, 0.54f,  -370, 0.007f,  1030, 0.011f, 100.0f,  60.0f, 5000.0f
  1829. #define I3DL2_ENVIRONMENT_PRESET_LIVINGROOM      -1000,-6000, 0.0f, 0.50f, 0.10f, -1376, 0.003f, -1104, 0.004f, 100.0f, 100.0f, 5000.0f
  1830. #define I3DL2_ENVIRONMENT_PRESET_STONEROOM       -1000, -300, 0.0f, 2.31f, 0.64f,  -711, 0.012f,    83, 0.017f, 100.0f, 100.0f, 5000.0f
  1831. #define I3DL2_ENVIRONMENT_PRESET_AUDITORIUM      -1000, -476, 0.0f, 4.32f, 0.59f,  -789, 0.020f,  -289, 0.030f, 100.0f, 100.0f, 5000.0f
  1832. #define I3DL2_ENVIRONMENT_PRESET_CONCERTHALL     -1000, -500, 0.0f, 3.92f, 0.70f, -1230, 0.020f,    -2, 0.029f, 100.0f, 100.0f, 5000.0f
  1833. #define I3DL2_ENVIRONMENT_PRESET_CAVE            -1000,    0, 0.0f, 2.91f, 1.30f,  -602, 0.015f,  -302, 0.022f, 100.0f, 100.0f, 5000.0f
  1834. #define I3DL2_ENVIRONMENT_PRESET_ARENA           -1000, -698, 0.0f, 7.24f, 0.33f, -1166, 0.020f,    16, 0.030f, 100.0f, 100.0f, 5000.0f
  1835. #define I3DL2_ENVIRONMENT_PRESET_HANGAR          -1000,-1000, 0.0f,10.05f, 0.23f,  -602, 0.020f,   198, 0.030f, 100.0f, 100.0f, 5000.0f
  1836. #define I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY -1000,-4000, 0.0f, 0.30f, 0.10f, -1831, 0.002f, -1630, 0.030f, 100.0f, 100.0f, 5000.0f
  1837. #define I3DL2_ENVIRONMENT_PRESET_HALLWAY         -1000, -300, 0.0f, 1.49f, 0.59f, -1219, 0.007f,   441, 0.011f, 100.0f, 100.0f, 5000.0f
  1838. #define I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR   -1000, -237, 0.0f, 2.70f, 0.79f, -1214, 0.013f,   395, 0.020f, 100.0f, 100.0f, 5000.0f
  1839. #define I3DL2_ENVIRONMENT_PRESET_ALLEY           -1000, -270, 0.0f, 1.49f, 0.86f, -1204, 0.007f,    -4, 0.011f, 100.0f, 100.0f, 5000.0f
  1840. #define I3DL2_ENVIRONMENT_PRESET_FOREST          -1000,-3300, 0.0f, 1.49f, 0.54f, -2560, 0.162f,  -613, 0.088f,  79.0f, 100.0f, 5000.0f
  1841. #define I3DL2_ENVIRONMENT_PRESET_CITY            -1000, -800, 0.0f, 1.49f, 0.67f, -2273, 0.007f, -2217, 0.011f,  50.0f, 100.0f, 5000.0f
  1842. #define I3DL2_ENVIRONMENT_PRESET_MOUNTAINS       -1000,-2500, 0.0f, 1.49f, 0.21f, -2780, 0.300f, -2014, 0.100f,  27.0f, 100.0f, 5000.0f
  1843. #define I3DL2_ENVIRONMENT_PRESET_QUARRY          -1000,-1000, 0.0f, 1.49f, 0.83f,-10000, 0.061f,   500, 0.025f, 100.0f, 100.0f, 5000.0f
  1844. #define I3DL2_ENVIRONMENT_PRESET_PLAIN           -1000,-2000, 0.0f, 1.49f, 0.50f, -2466, 0.179f, -2514, 0.100f,  21.0f, 100.0f, 5000.0f
  1845. #define I3DL2_ENVIRONMENT_PRESET_PARKINGLOT      -1000,    0, 0.0f, 1.65f, 1.50f, -1363, 0.008f, -1153, 0.012f, 100.0f, 100.0f, 5000.0f
  1846. #define I3DL2_ENVIRONMENT_PRESET_SEWERPIPE       -1000,-1000, 0.0f, 2.81f, 0.14f,   429, 0.014f,   648, 0.021f,  80.0f,  60.0f, 5000.0f
  1847. #define I3DL2_ENVIRONMENT_PRESET_UNDERWATER      -1000,-4000, 0.0f, 1.49f, 0.10f,  -449, 0.007f,  1700, 0.011f, 100.0f, 100.0f, 5000.0f
  1848. //
  1849. // Examples simulating 'musical' reverb presets
  1850. //
  1851. // Name       Decay time   Description
  1852. // Small Room    1.1s      A small size room with a length of 5m or so.
  1853. // Medium Room   1.3s      A medium size room with a length of 10m or so.
  1854. // Large Room    1.5s      A large size room suitable for live performances.
  1855. // Medium Hall   1.8s      A medium size concert hall.
  1856. // Large Hall    1.8s      A large size concert hall suitable for a full orchestra.
  1857. // Plate         1.3s      A plate reverb simulation.
  1858. //
  1859. #define I3DL2_ENVIRONMENT_PRESET_SMALLROOM       -1000, -600, 0.0f, 1.10f, 0.83f,  -400, 0.005f,   500, 0.010f, 100.0f, 100.0f, 5000.0f
  1860. #define I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM      -1000, -600, 0.0f, 1.30f, 0.83f, -1000, 0.010f,  -200, 0.020f, 100.0f, 100.0f, 5000.0f
  1861. #define I3DL2_ENVIRONMENT_PRESET_LARGEROOM       -1000, -600, 0.0f, 1.50f, 0.83f, -1600, 0.020f, -1000, 0.040f, 100.0f, 100.0f, 5000.0f
  1862. #define I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL      -1000, -600, 0.0f, 1.80f, 0.70f, -1300, 0.015f,  -800, 0.030f, 100.0f, 100.0f, 5000.0f
  1863. #define I3DL2_ENVIRONMENT_PRESET_LARGEHALL       -1000, -600, 0.0f, 1.80f, 0.70f, -2000, 0.030f, -1400, 0.060f, 100.0f, 100.0f, 5000.0f
  1864. #define I3DL2_ENVIRONMENT_PRESET_PLATE           -1000, -200, 0.0f, 1.30f, 0.90f,     0, 0.002f,     0, 0.010f, 100.0f,  75.0f, 5000.0f
  1865. //
  1866. // DirectSound3D Algorithms
  1867. //
  1868. // Default DirectSound3D algorithm {00000000-0000-0000-0000-000000000000}
  1869. #define DS3DALG_DEFAULT GUID_NULL
  1870. // No virtualization (Pan3D) {C241333F-1C1B-11d2-94F5-00C04FC28ACA}
  1871. DEFINE_GUID(DS3DALG_NO_VIRTUALIZATION, 0xc241333f, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
  1872. // High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA}
  1873. DEFINE_GUID(DS3DALG_HRTF_FULL, 0xc2413340, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
  1874. // Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA}
  1875. DEFINE_GUID(DS3DALG_HRTF_LIGHT, 0xc2413342, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
  1876. #if DIRECTSOUND_VERSION >= 0x0800
  1877. //
  1878. // DirectSound Internal Effect Algorithms
  1879. //
  1880. // Gargle {DAFD8210-5711-4B91-9FE3-F75B7AE279BF}
  1881. DEFINE_GUID(GUID_DSFX_STANDARD_GARGLE, 0xdafd8210, 0x5711, 0x4b91, 0x9f, 0xe3, 0xf7, 0x5b, 0x7a, 0xe2, 0x79, 0xbf);
  1882. // Chorus {EFE6629C-81F7-4281-BD91-C9D604A95AF6}
  1883. DEFINE_GUID(GUID_DSFX_STANDARD_CHORUS, 0xefe6629c, 0x81f7, 0x4281, 0xbd, 0x91, 0xc9, 0xd6, 0x04, 0xa9, 0x5a, 0xf6);
  1884. // Flanger {EFCA3D92-DFD8-4672-A603-7420894BAD98}
  1885. DEFINE_GUID(GUID_DSFX_STANDARD_FLANGER, 0xefca3d92, 0xdfd8, 0x4672, 0xa6, 0x03, 0x74, 0x20, 0x89, 0x4b, 0xad, 0x98);
  1886. // Echo/Delay {EF3E932C-D40B-4F51-8CCF-3F98F1B29D5D}
  1887. DEFINE_GUID(GUID_DSFX_STANDARD_ECHO, 0xef3e932c, 0xd40b, 0x4f51, 0x8c, 0xcf, 0x3f, 0x98, 0xf1, 0xb2, 0x9d, 0x5d);
  1888. // Distortion {EF114C90-CD1D-484E-96E5-09CFAF912A21}
  1889. DEFINE_GUID(GUID_DSFX_STANDARD_DISTORTION, 0xef114c90, 0xcd1d, 0x484e, 0x96, 0xe5, 0x09, 0xcf, 0xaf, 0x91, 0x2a, 0x21);
  1890. // Compressor/Limiter {EF011F79-4000-406D-87AF-BFFB3FC39D57}
  1891. DEFINE_GUID(GUID_DSFX_STANDARD_COMPRESSOR, 0xef011f79, 0x4000, 0x406d, 0x87, 0xaf, 0xbf, 0xfb, 0x3f, 0xc3, 0x9d, 0x57);
  1892. // Parametric Equalization {120CED89-3BF4-4173-A132-3CB406CF3231}
  1893. DEFINE_GUID(GUID_DSFX_STANDARD_PARAMEQ, 0x120ced89, 0x3bf4, 0x4173, 0xa1, 0x32, 0x3c, 0xb4, 0x06, 0xcf, 0x32, 0x31);
  1894. // I3DL2 Environmental Reverberation: Reverb (Listener) Effect {EF985E71-D5C7-42D4-BA4D-2D073E2E96F4}
  1895. DEFINE_GUID(GUID_DSFX_STANDARD_I3DL2REVERB, 0xef985e71, 0xd5c7, 0x42d4, 0xba, 0x4d, 0x2d, 0x07, 0x3e, 0x2e, 0x96, 0xf4);
  1896. // Waves Reverberation {87FC0268-9A55-4360-95AA-004A1D9DE26C}
  1897. DEFINE_GUID(GUID_DSFX_WAVES_REVERB, 0x87fc0268, 0x9a55, 0x4360, 0x95, 0xaa, 0x00, 0x4a, 0x1d, 0x9d, 0xe2, 0x6c);
  1898. //
  1899. // DirectSound Capture Effect Algorithms
  1900. //
  1901. // Acoustic Echo Canceller {BF963D80-C559-11D0-8A2B-00A0C9255AC1}
  1902. // Matches KSNODETYPE_ACOUSTIC_ECHO_CANCEL in ksmedia.h
  1903. DEFINE_GUID(GUID_DSCFX_CLASS_AEC, 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1);
  1904. // Microsoft AEC {CDEBB919-379A-488a-8765-F53CFD36DE40}
  1905. DEFINE_GUID(GUID_DSCFX_MS_AEC, 0xcdebb919, 0x379a, 0x488a, 0x87, 0x65, 0xf5, 0x3c, 0xfd, 0x36, 0xde, 0x40);
  1906. // System AEC {1C22C56D-9879-4f5b-A389-27996DDC2810}
  1907. DEFINE_GUID(GUID_DSCFX_SYSTEM_AEC, 0x1c22c56d, 0x9879, 0x4f5b, 0xa3, 0x89, 0x27, 0x99, 0x6d, 0xdc, 0x28, 0x10);
  1908. // Noise Supression {E07F903F-62FD-4e60-8CDD-DEA7236665B5}
  1909. // Matches KSNODETYPE_NOISE_SUPPRESS in post Windows ME DDK's ksmedia.h
  1910. DEFINE_GUID(GUID_DSCFX_CLASS_NS, 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5);
  1911. // Microsoft Noise Suppresion {11C5C73B-66E9-4ba1-A0BA-E814C6EED92D}
  1912. DEFINE_GUID(GUID_DSCFX_MS_NS, 0x11c5c73b, 0x66e9, 0x4ba1, 0xa0, 0xba, 0xe8, 0x14, 0xc6, 0xee, 0xd9, 0x2d);
  1913. // System Noise Suppresion {5AB0882E-7274-4516-877D-4EEE99BA4FD0}
  1914. DEFINE_GUID(GUID_DSCFX_SYSTEM_NS, 0x5ab0882e, 0x7274, 0x4516, 0x87, 0x7d, 0x4e, 0xee, 0x99, 0xba, 0x4f, 0xd0);
  1915. #endif // DIRECTSOUND_VERSION >= 0x0800
  1916. #endif // __DSOUND_INCLUDED__
  1917. #ifdef __cplusplus
  1918. };
  1919. #endif // __cplusplus