home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / dsound.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  41.3 KB  |  938 lines

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1995-1998 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:       dsound.h
  6.  *  Content:    DirectSound include file
  7.  *
  8.  **************************************************************************/
  9.  
  10. #ifndef __DSOUND_INCLUDED__
  11. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  12. #define __DSOUND_INCLUDED__
  13.  
  14. #include "d3dtypes.h"
  15.  
  16. #define COM_NO_WINDOWS_H
  17. #include <objbase.h>
  18.  
  19. #define _FACDS  0x878
  20. #define MAKE_DSHRESULT(code)  MAKE_HRESULT(1, _FACDS, code)
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif // __cplusplus
  25.  
  26. #ifndef DIRECTSOUND_VERSION
  27. #define DIRECTSOUND_VERSION  0x0700       /* version 7.0 */
  28. #endif /* !DIRECTSOUND_VERSION */
  29.  
  30.  
  31. // DirectSound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
  32. DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  33.  
  34. // DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
  35. DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  36.  
  37. #ifdef __cplusplus
  38. // 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
  39. struct IDirectSound;
  40. struct IDirectSoundBuffer;
  41. struct IDirectSound3DListener;
  42. struct IDirectSound3DBuffer;
  43. struct IDirectSoundCapture;
  44. struct IDirectSoundCaptureBuffer;
  45. struct IDirectSoundNotify;
  46. #endif // __cplusplus
  47.  
  48. typedef struct IDirectSound *LPDIRECTSOUND;
  49. typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER;
  50. typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER;
  51. typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER;
  52. typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE;
  53. typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER;
  54. typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY;
  55.  
  56. //
  57. // Compatibility typedefs
  58. //
  59.  
  60. #ifndef _LPCWAVEFORMATEX_DEFINED
  61. #define _LPCWAVEFORMATEX_DEFINED
  62. typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
  63. #endif // _LPCWAVEFORMATEX_DEFINED
  64.  
  65. #ifndef __LPCGUID_DEFINED__
  66. #define __LPCGUID_DEFINED__
  67. typedef const GUID *LPCGUID;
  68. #endif // __LPCGUID_DEFINED__
  69.  
  70. typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
  71. typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
  72. typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
  73. typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
  74. typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
  75. typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
  76. typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
  77.  
  78. //
  79. // Structures
  80. //
  81.  
  82. typedef struct _DSCAPS
  83. {
  84.     DWORD           dwSize;
  85.     DWORD           dwFlags;
  86.     DWORD           dwMinSecondarySampleRate;
  87.     DWORD           dwMaxSecondarySampleRate;
  88.     DWORD           dwPrimaryBuffers;
  89.     DWORD           dwMaxHwMixingAllBuffers;
  90.     DWORD           dwMaxHwMixingStaticBuffers;
  91.     DWORD           dwMaxHwMixingStreamingBuffers;
  92.     DWORD           dwFreeHwMixingAllBuffers;
  93.     DWORD           dwFreeHwMixingStaticBuffers;
  94.     DWORD           dwFreeHwMixingStreamingBuffers;
  95.     DWORD           dwMaxHw3DAllBuffers;
  96.     DWORD           dwMaxHw3DStaticBuffers;
  97.     DWORD           dwMaxHw3DStreamingBuffers;
  98.     DWORD           dwFreeHw3DAllBuffers;
  99.     DWORD           dwFreeHw3DStaticBuffers;
  100.     DWORD           dwFreeHw3DStreamingBuffers;
  101.     DWORD           dwTotalHwMemBytes;
  102.     DWORD           dwFreeHwMemBytes;
  103.     DWORD           dwMaxContigFreeHwMemBytes;
  104.     DWORD           dwUnlockTransferRateHwBuffers;
  105.     DWORD           dwPlayCpuOverheadSwBuffers;
  106.     DWORD           dwReserved1;
  107.     DWORD           dwReserved2;
  108. } DSCAPS, *LPDSCAPS;
  109.  
  110. typedef const DSCAPS *LPCDSCAPS;
  111.  
  112. typedef struct _DSBCAPS
  113. {
  114.     DWORD           dwSize;
  115.     DWORD           dwFlags;
  116.     DWORD           dwBufferBytes;
  117.     DWORD           dwUnlockTransferRate;
  118.     DWORD           dwPlayCpuOverhead;
  119. } DSBCAPS, *LPDSBCAPS;
  120.  
  121. typedef const DSBCAPS *LPCDSBCAPS;
  122.  
  123. typedef struct _DSBUFFERDESC
  124. {
  125.     DWORD           dwSize;
  126.     DWORD           dwFlags;
  127.     DWORD           dwBufferBytes;
  128.     DWORD           dwReserved;
  129.     LPWAVEFORMATEX  lpwfxFormat;
  130. #if DIRECTSOUND_VERSION >= 0x0700
  131.     GUID            guid3DAlgorithm;
  132. #endif
  133. } DSBUFFERDESC, *LPDSBUFFERDESC;
  134.  
  135. typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
  136.  
  137. typedef struct _DSBUFFERDESC1
  138. {
  139.     DWORD           dwSize;
  140.     DWORD           dwFlags;
  141.     DWORD           dwBufferBytes;
  142.     DWORD           dwReserved;
  143.     LPWAVEFORMATEX  lpwfxFormat;
  144. } DSBUFFERDESC1, *LPDSBUFFERDESC1;
  145.  
  146. typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1;
  147.  
  148. typedef struct _DS3DBUFFER
  149. {
  150.     DWORD           dwSize;
  151.     D3DVECTOR       vPosition;
  152.     D3DVECTOR       vVelocity;
  153.     DWORD           dwInsideConeAngle;
  154.     DWORD           dwOutsideConeAngle;
  155.     D3DVECTOR       vConeOrientation;
  156.     LONG            lConeOutsideVolume;
  157.     D3DVALUE        flMinDistance;
  158.     D3DVALUE        flMaxDistance;
  159.     DWORD           dwMode;
  160. } DS3DBUFFER, *LPDS3DBUFFER;
  161.  
  162. typedef const DS3DBUFFER *LPCDS3DBUFFER;
  163.  
  164. typedef struct _DS3DLISTENER
  165. {
  166.     DWORD           dwSize;
  167.     D3DVECTOR       vPosition;
  168.     D3DVECTOR       vVelocity;
  169.     D3DVECTOR       vOrientFront;
  170.     D3DVECTOR       vOrientTop;
  171.     D3DVALUE        flDistanceFactor;
  172.     D3DVALUE        flRolloffFactor;
  173.     D3DVALUE        flDopplerFactor;
  174. } DS3DLISTENER, *LPDS3DLISTENER;
  175.  
  176. typedef const DS3DLISTENER *LPCDS3DLISTENER;
  177.  
  178. typedef struct _DSCCAPS
  179. {
  180.     DWORD           dwSize;
  181.     DWORD           dwFlags;
  182.     DWORD           dwFormats;
  183.     DWORD           dwChannels;
  184. } DSCCAPS, *LPDSCCAPS;
  185.  
  186. typedef const DSCCAPS *LPCDSCCAPS;
  187.  
  188. typedef struct _DSCBUFFERDESC
  189. {
  190.     DWORD           dwSize;
  191.     DWORD           dwFlags;
  192.     DWORD           dwBufferBytes;
  193.     DWORD           dwReserved;
  194.     LPWAVEFORMATEX  lpwfxFormat;
  195. } DSCBUFFERDESC, *LPDSCBUFFERDESC;
  196.  
  197. typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
  198.  
  199. typedef struct _DSCBCAPS
  200. {
  201.     DWORD           dwSize;
  202.     DWORD           dwFlags;
  203.     DWORD           dwBufferBytes;
  204.     DWORD           dwReserved;
  205. } DSCBCAPS, *LPDSCBCAPS;
  206.  
  207. typedef const DSCBCAPS *LPCDSCBCAPS;
  208.  
  209. typedef struct _DSBPOSITIONNOTIFY
  210. {
  211.     DWORD           dwOffset;
  212.     HANDLE          hEventNotify;
  213. } DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
  214.  
  215. typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
  216.  
  217. //
  218. // DirectSound API
  219. //
  220.  
  221. typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
  222. typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
  223.  
  224. extern HRESULT WINAPI DirectSoundCreate(LPCGUID, LPDIRECTSOUND *, LPUNKNOWN);
  225. extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
  226. extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
  227.  
  228. extern HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
  229. extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
  230. extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
  231.  
  232. #ifdef UNICODE
  233. #define LPDSENUMCALLBACK            LPDSENUMCALLBACKW
  234. #define DirectSoundEnumerate        DirectSoundEnumerateW
  235. #define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
  236. #else // UNICODE
  237. #define LPDSENUMCALLBACK            LPDSENUMCALLBACKA
  238. #define DirectSoundEnumerate        DirectSoundEnumerateA
  239. #define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
  240. #endif // UNICODE
  241.  
  242. //
  243. // IUnknown
  244. //
  245.  
  246. #if !defined(__cplusplus) || defined(CINTERFACE)
  247. #ifndef IUnknown_QueryInterface
  248. #define IUnknown_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
  249. #endif // IUnknown_QueryInterface
  250. #ifndef IUnknown_AddRef
  251. #define IUnknown_AddRef(p)              (p)->lpVtbl->AddRef(p)
  252. #endif // IUnknown_AddRef
  253. #ifndef IUnknown_Release
  254. #define IUnknown_Release(p)             (p)->lpVtbl->Release(p)
  255. #endif // IUnknown_Release
  256. #else // !defined(__cplusplus) || defined(CINTERFACE)
  257. #ifndef IUnknown_QueryInterface
  258. #define IUnknown_QueryInterface(p,a,b)  (p)->QueryInterface(a,b)
  259. #endif // IUnknown_QueryInterface
  260. #ifndef IUnknown_AddRef
  261. #define IUnknown_AddRef(p)              (p)->AddRef()
  262. #endif // IUnknown_AddRef
  263. #ifndef IUnknown_Release
  264. #define IUnknown_Release(p)             (p)->Release()
  265. #endif // IUnknown_Release
  266. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  267.  
  268. //
  269. // IDirectSound
  270. //
  271.  
  272. DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  273.  
  274. #undef INTERFACE
  275. #define INTERFACE IDirectSound
  276.  
  277. DECLARE_INTERFACE_(IDirectSound, IUnknown)
  278. {
  279.     // IUnknown methods
  280.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  281.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  282.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  283.  
  284.     // IDirectSound methods
  285.     STDMETHOD(CreateSoundBuffer)    (THIS_ LPCDSBUFFERDESC, LPDIRECTSOUNDBUFFER *, LPUNKNOWN) PURE;
  286.     STDMETHOD(GetCaps)              (THIS_ LPDSCAPS) PURE;
  287.     STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER, LPDIRECTSOUNDBUFFER *) PURE;
  288.     STDMETHOD(SetCooperativeLevel)  (THIS_ HWND, DWORD) PURE;
  289.     STDMETHOD(Compact)              (THIS) PURE;
  290.     STDMETHOD(GetSpeakerConfig)     (THIS_ LPDWORD) PURE;
  291.     STDMETHOD(SetSpeakerConfig)     (THIS_ DWORD) PURE;
  292.     STDMETHOD(Initialize)           (THIS_ LPCGUID) PURE;
  293. };
  294.  
  295. #define IDirectSound_QueryInterface(p,a,b)       IUnknown_QueryInterface(p,a,b)
  296. #define IDirectSound_AddRef(p)                   IUnknown_AddRef(p)
  297. #define IDirectSound_Release(p)                  IUnknown_Release(p)
  298.  
  299. #if !defined(__cplusplus) || defined(CINTERFACE)
  300. #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
  301. #define IDirectSound_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
  302. #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
  303. #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
  304. #define IDirectSound_Compact(p)                  (p)->lpVtbl->Compact(p)
  305. #define IDirectSound_GetSpeakerConfig(p,a)       (p)->lpVtbl->GetSpeakerConfig(p,a)
  306. #define IDirectSound_SetSpeakerConfig(p,b)       (p)->lpVtbl->SetSpeakerConfig(p,b)
  307. #define IDirectSound_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
  308. #else // !defined(__cplusplus) || defined(CINTERFACE)
  309. #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->CreateSoundBuffer(a,b,c)
  310. #define IDirectSound_GetCaps(p,a)                (p)->GetCaps(a)
  311. #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
  312. #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
  313. #define IDirectSound_Compact(p)                  (p)->Compact()
  314. #define IDirectSound_GetSpeakerConfig(p,a)       (p)->GetSpeakerConfig(a)
  315. #define IDirectSound_SetSpeakerConfig(p,b)       (p)->SetSpeakerConfig(b)
  316. #define IDirectSound_Initialize(p,a)             (p)->Initialize(a)
  317. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  318.  
  319. //
  320. // IDirectSoundBuffer
  321. //
  322.  
  323. DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  324.  
  325. #undef INTERFACE
  326. #define INTERFACE IDirectSoundBuffer
  327.  
  328. DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
  329. {
  330.     // IUnknown methods
  331.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  332.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  333.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  334.  
  335.     // IDirectSoundBuffer methods
  336.     STDMETHOD(GetCaps)              (THIS_ LPDSBCAPS) PURE;
  337.     STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD, LPDWORD) PURE;
  338.     STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE;
  339.     STDMETHOD(GetVolume)            (THIS_ LPLONG) PURE;
  340.     STDMETHOD(GetPan)               (THIS_ LPLONG) PURE;
  341.     STDMETHOD(GetFrequency)         (THIS_ LPDWORD) PURE;
  342.     STDMETHOD(GetStatus)            (THIS_ LPDWORD) PURE;
  343.     STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUND, LPCDSBUFFERDESC) PURE;
  344.     STDMETHOD(Lock)                 (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
  345.     STDMETHOD(Play)                 (THIS_ DWORD, DWORD, DWORD) PURE;
  346.     STDMETHOD(SetCurrentPosition)   (THIS_ DWORD) PURE;
  347.     STDMETHOD(SetFormat)            (THIS_ LPCWAVEFORMATEX) PURE;
  348.     STDMETHOD(SetVolume)            (THIS_ LONG) PURE;
  349.     STDMETHOD(SetPan)               (THIS_ LONG) PURE;
  350.     STDMETHOD(SetFrequency)         (THIS_ DWORD) PURE;
  351.     STDMETHOD(Stop)                 (THIS) PURE;
  352.     STDMETHOD(Unlock)               (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
  353.     STDMETHOD(Restore)              (THIS) PURE;
  354. };
  355.  
  356. #define IDirectSoundBuffer_QueryInterface(p,a,b)        IUnknown_QueryInterface(p,a,b)
  357. #define IDirectSoundBuffer_AddRef(p)                    IUnknown_AddRef(p)
  358. #define IDirectSoundBuffer_Release(p)                   IUnknown_Release(p)
  359.  
  360. #if !defined(__cplusplus) || defined(CINTERFACE)
  361. #define IDirectSoundBuffer_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
  362. #define IDirectSoundBuffer_GetCurrentPosition(p,a,b)    (p)->lpVtbl->GetCurrentPosition(p,a,b)
  363. #define IDirectSoundBuffer_GetFormat(p,a,b,c)           (p)->lpVtbl->GetFormat(p,a,b,c)
  364. #define IDirectSoundBuffer_GetVolume(p,a)               (p)->lpVtbl->GetVolume(p,a)
  365. #define IDirectSoundBuffer_GetPan(p,a)                  (p)->lpVtbl->GetPan(p,a)
  366. #define IDirectSoundBuffer_GetFrequency(p,a)            (p)->lpVtbl->GetFrequency(p,a)
  367. #define IDirectSoundBuffer_GetStatus(p,a)               (p)->lpVtbl->GetStatus(p,a)
  368. #define IDirectSoundBuffer_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
  369. #define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
  370. #define IDirectSoundBuffer_Play(p,a,b,c)                (p)->lpVtbl->Play(p,a,b,c)
  371. #define IDirectSoundBuffer_SetCurrentPosition(p,a)      (p)->lpVtbl->SetCurrentPosition(p,a)
  372. #define IDirectSoundBuffer_SetFormat(p,a)               (p)->lpVtbl->SetFormat(p,a)
  373. #define IDirectSoundBuffer_SetVolume(p,a)               (p)->lpVtbl->SetVolume(p,a)
  374. #define IDirectSoundBuffer_SetPan(p,a)                  (p)->lpVtbl->SetPan(p,a)
  375. #define IDirectSoundBuffer_SetFrequency(p,a)            (p)->lpVtbl->SetFrequency(p,a)
  376. #define IDirectSoundBuffer_Stop(p)                      (p)->lpVtbl->Stop(p)
  377. #define IDirectSoundBuffer_Unlock(p,a,b,c,d)            (p)->lpVtbl->Unlock(p,a,b,c,d)
  378. #define IDirectSoundBuffer_Restore(p)                   (p)->lpVtbl->Restore(p)
  379. #else // !defined(__cplusplus) || defined(CINTERFACE)
  380. #define IDirectSoundBuffer_GetCaps(p,a)                 (p)->GetCaps(a)
  381. #define IDirectSoundBuffer_GetCurrentPosition(p,a,b)    (p)->GetCurrentPosition(a,b)
  382. #define IDirectSoundBuffer_GetFormat(p,a,b,c)           (p)->GetFormat(a,b,c)
  383. #define IDirectSoundBuffer_GetVolume(p,a)               (p)->GetVolume(a)
  384. #define IDirectSoundBuffer_GetPan(p,a)                  (p)->GetPan(a)
  385. #define IDirectSoundBuffer_GetFrequency(p,a)            (p)->GetFrequency(a)
  386. #define IDirectSoundBuffer_GetStatus(p,a)               (p)->GetStatus(a)
  387. #define IDirectSoundBuffer_Initialize(p,a,b)            (p)->Initialize(a,b)
  388. #define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->Lock(a,b,c,d,e,f,g)
  389. #define IDirectSoundBuffer_Play(p,a,b,c)                (p)->Play(a,b,c)
  390. #define IDirectSoundBuffer_SetCurrentPosition(p,a)      (p)->SetCurrentPosition(a)
  391. #define IDirectSoundBuffer_SetFormat(p,a)               (p)->SetFormat(a)
  392. #define IDirectSoundBuffer_SetVolume(p,a)               (p)->SetVolume(a)
  393. #define IDirectSoundBuffer_SetPan(p,a)                  (p)->SetPan(a)
  394. #define IDirectSoundBuffer_SetFrequency(p,a)            (p)->SetFrequency(a)
  395. #define IDirectSoundBuffer_Stop(p)                      (p)->Stop()
  396. #define IDirectSoundBuffer_Unlock(p,a,b,c,d)            (p)->Unlock(a,b,c,d)
  397. #define IDirectSoundBuffer_Restore(p)                   (p)->Restore()
  398. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  399.  
  400. //
  401. // IDirectSound3DListener
  402. //
  403.  
  404. DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  405.  
  406. #undef INTERFACE
  407. #define INTERFACE IDirectSound3DListener
  408.  
  409. DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
  410. {
  411.     // IUnknown methods
  412.     STDMETHOD(QueryInterface)           (THIS_ REFIID, LPVOID *) PURE;
  413.     STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
  414.     STDMETHOD_(ULONG,Release)           (THIS) PURE;
  415.  
  416.     // IDirectSound3DListener methods
  417.     STDMETHOD(GetAllParameters)         (THIS_ LPDS3DLISTENER) PURE;
  418.     STDMETHOD(GetDistanceFactor)        (THIS_ LPD3DVALUE) PURE;
  419.     STDMETHOD(GetDopplerFactor)         (THIS_ LPD3DVALUE) PURE;
  420.     STDMETHOD(GetOrientation)           (THIS_ LPD3DVECTOR, LPD3DVECTOR) PURE;
  421.     STDMETHOD(GetPosition)              (THIS_ LPD3DVECTOR) PURE;
  422.     STDMETHOD(GetRolloffFactor)         (THIS_ LPD3DVALUE) PURE;
  423.     STDMETHOD(GetVelocity)              (THIS_ LPD3DVECTOR) PURE;
  424.     STDMETHOD(SetAllParameters)         (THIS_ LPCDS3DLISTENER, DWORD) PURE;
  425.     STDMETHOD(SetDistanceFactor)        (THIS_ D3DVALUE, DWORD) PURE;
  426.     STDMETHOD(SetDopplerFactor)         (THIS_ D3DVALUE, DWORD) PURE;
  427.     STDMETHOD(SetOrientation)           (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  428.     STDMETHOD(SetPosition)              (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  429.     STDMETHOD(SetRolloffFactor)         (THIS_ D3DVALUE, DWORD) PURE;
  430.     STDMETHOD(SetVelocity)              (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  431.     STDMETHOD(CommitDeferredSettings)   (THIS) PURE;
  432. };
  433.  
  434. #define IDirectSound3DListener_QueryInterface(p,a,b)            IUnknown_QueryInterface(p,a,b)
  435. #define IDirectSound3DListener_AddRef(p)                        IUnknown_AddRef(p)
  436. #define IDirectSound3DListener_Release(p)                       IUnknown_Release(p)
  437.  
  438. #if !defined(__cplusplus) || defined(CINTERFACE)
  439. #define IDirectSound3DListener_GetAllParameters(p,a)            (p)->lpVtbl->GetAllParameters(p,a)
  440. #define IDirectSound3DListener_GetDistanceFactor(p,a)           (p)->lpVtbl->GetDistanceFactor(p,a)
  441. #define IDirectSound3DListener_GetDopplerFactor(p,a)            (p)->lpVtbl->GetDopplerFactor(p,a)
  442. #define IDirectSound3DListener_GetOrientation(p,a,b)            (p)->lpVtbl->GetOrientation(p,a,b)
  443. #define IDirectSound3DListener_GetPosition(p,a)                 (p)->lpVtbl->GetPosition(p,a)
  444. #define IDirectSound3DListener_GetRolloffFactor(p,a)            (p)->lpVtbl->GetRolloffFactor(p,a)
  445. #define IDirectSound3DListener_GetVelocity(p,a)                 (p)->lpVtbl->GetVelocity(p,a)
  446. #define IDirectSound3DListener_SetAllParameters(p,a,b)          (p)->lpVtbl->SetAllParameters(p,a,b)
  447. #define IDirectSound3DListener_SetDistanceFactor(p,a,b)         (p)->lpVtbl->SetDistanceFactor(p,a,b)
  448. #define IDirectSound3DListener_SetDopplerFactor(p,a,b)          (p)->lpVtbl->SetDopplerFactor(p,a,b)
  449. #define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g)  (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
  450. #define IDirectSound3DListener_SetPosition(p,a,b,c,d)           (p)->lpVtbl->SetPosition(p,a,b,c,d)
  451. #define IDirectSound3DListener_SetRolloffFactor(p,a,b)          (p)->lpVtbl->SetRolloffFactor(p,a,b)
  452. #define IDirectSound3DListener_SetVelocity(p,a,b,c,d)           (p)->lpVtbl->SetVelocity(p,a,b,c,d)
  453. #define IDirectSound3DListener_CommitDeferredSettings(p)        (p)->lpVtbl->CommitDeferredSettings(p)
  454. #else // !defined(__cplusplus) || defined(CINTERFACE)
  455. #define IDirectSound3DListener_GetAllParameters(p,a)            (p)->GetAllParameters(a)
  456. #define IDirectSound3DListener_GetDistanceFactor(p,a)           (p)->GetDistanceFactor(a)
  457. #define IDirectSound3DListener_GetDopplerFactor(p,a)            (p)->GetDopplerFactor(a)
  458. #define IDirectSound3DListener_GetOrientation(p,a,b)            (p)->GetOrientation(a,b)
  459. #define IDirectSound3DListener_GetPosition(p,a)                 (p)->GetPosition(a)
  460. #define IDirectSound3DListener_GetRolloffFactor(p,a)            (p)->GetRolloffFactor(a)
  461. #define IDirectSound3DListener_GetVelocity(p,a)                 (p)->GetVelocity(a)
  462. #define IDirectSound3DListener_SetAllParameters(p,a,b)          (p)->SetAllParameters(a,b)
  463. #define IDirectSound3DListener_SetDistanceFactor(p,a,b)         (p)->SetDistanceFactor(a,b)
  464. #define IDirectSound3DListener_SetDopplerFactor(p,a,b)          (p)->SetDopplerFactor(a,b)
  465. #define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g)  (p)->SetOrientation(a,b,c,d,e,f,g)
  466. #define IDirectSound3DListener_SetPosition(p,a,b,c,d)           (p)->SetPosition(a,b,c,d)
  467. #define IDirectSound3DListener_SetRolloffFactor(p,a,b)          (p)->SetRolloffFactor(a,b)
  468. #define IDirectSound3DListener_SetVelocity(p,a,b,c,d)           (p)->SetVelocity(a,b,c,d)
  469. #define IDirectSound3DListener_CommitDeferredSettings(p)        (p)->CommitDeferredSettings()
  470. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  471.  
  472. //
  473. // IDirectSound3DBuffer
  474. //
  475.  
  476. DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  477.  
  478. #undef INTERFACE
  479. #define INTERFACE IDirectSound3DBuffer
  480.  
  481. DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
  482. {
  483.     // IUnknown methods
  484.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  485.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  486.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  487.  
  488.     // IDirectSound3DBuffer methods
  489.     STDMETHOD(GetAllParameters)     (THIS_ LPDS3DBUFFER) PURE;
  490.     STDMETHOD(GetConeAngles)        (THIS_ LPDWORD, LPDWORD) PURE;
  491.     STDMETHOD(GetConeOrientation)   (THIS_ LPD3DVECTOR) PURE;
  492.     STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG) PURE;
  493.     STDMETHOD(GetMaxDistance)       (THIS_ LPD3DVALUE) PURE;
  494.     STDMETHOD(GetMinDistance)       (THIS_ LPD3DVALUE) PURE;
  495.     STDMETHOD(GetMode)              (THIS_ LPDWORD) PURE;
  496.     STDMETHOD(GetPosition)          (THIS_ LPD3DVECTOR) PURE;
  497.     STDMETHOD(GetVelocity)          (THIS_ LPD3DVECTOR) PURE;
  498.     STDMETHOD(SetAllParameters)     (THIS_ LPCDS3DBUFFER, DWORD) PURE;
  499.     STDMETHOD(SetConeAngles)        (THIS_ DWORD, DWORD, DWORD) PURE;
  500.     STDMETHOD(SetConeOrientation)   (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  501.     STDMETHOD(SetConeOutsideVolume) (THIS_ LONG, DWORD) PURE;
  502.     STDMETHOD(SetMaxDistance)       (THIS_ D3DVALUE, DWORD) PURE;
  503.     STDMETHOD(SetMinDistance)       (THIS_ D3DVALUE, DWORD) PURE;
  504.     STDMETHOD(SetMode)              (THIS_ DWORD, DWORD) PURE;
  505.     STDMETHOD(SetPosition)          (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  506.     STDMETHOD(SetVelocity)          (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  507. };
  508.  
  509. #define IDirectSound3DBuffer_QueryInterface(p,a,b)          IUnknown_QueryInterface(p,a,b)
  510. #define IDirectSound3DBuffer_AddRef(p)                      IUnknown_AddRef(p)
  511. #define IDirectSound3DBuffer_Release(p)                     IUnknown_Release(p)
  512.  
  513. #if !defined(__cplusplus) || defined(CINTERFACE)
  514. #define IDirectSound3DBuffer_GetAllParameters(p,a)          (p)->lpVtbl->GetAllParameters(p,a)
  515. #define IDirectSound3DBuffer_GetConeAngles(p,a,b)           (p)->lpVtbl->GetConeAngles(p,a,b)
  516. #define IDirectSound3DBuffer_GetConeOrientation(p,a)        (p)->lpVtbl->GetConeOrientation(p,a)
  517. #define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)      (p)->lpVtbl->GetConeOutsideVolume(p,a)
  518. #define IDirectSound3DBuffer_GetPosition(p,a)               (p)->lpVtbl->GetPosition(p,a)
  519. #define IDirectSound3DBuffer_GetMinDistance(p,a)            (p)->lpVtbl->GetMinDistance(p,a)
  520. #define IDirectSound3DBuffer_GetMaxDistance(p,a)            (p)->lpVtbl->GetMaxDistance(p,a)
  521. #define IDirectSound3DBuffer_GetMode(p,a)                   (p)->lpVtbl->GetMode(p,a)
  522. #define IDirectSound3DBuffer_GetVelocity(p,a)               (p)->lpVtbl->GetVelocity(p,a)
  523. #define IDirectSound3DBuffer_SetAllParameters(p,a,b)        (p)->lpVtbl->SetAllParameters(p,a,b)
  524. #define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)         (p)->lpVtbl->SetConeAngles(p,a,b,c)
  525. #define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d)  (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
  526. #define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)    (p)->lpVtbl->SetConeOutsideVolume(p,a,b)
  527. #define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)         (p)->lpVtbl->SetPosition(p,a,b,c,d)
  528. #define IDirectSound3DBuffer_SetMinDistance(p,a,b)          (p)->lpVtbl->SetMinDistance(p,a,b)
  529. #define IDirectSound3DBuffer_SetMaxDistance(p,a,b)          (p)->lpVtbl->SetMaxDistance(p,a,b)
  530. #define IDirectSound3DBuffer_SetMode(p,a,b)                 (p)->lpVtbl->SetMode(p,a,b)
  531. #define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)         (p)->lpVtbl->SetVelocity(p,a,b,c,d)
  532. #else // !defined(__cplusplus) || defined(CINTERFACE)
  533. #define IDirectSound3DBuffer_GetAllParameters(p,a)          (p)->GetAllParameters(a)
  534. #define IDirectSound3DBuffer_GetConeAngles(p,a,b)           (p)->GetConeAngles(a,b)
  535. #define IDirectSound3DBuffer_GetConeOrientation(p,a)        (p)->GetConeOrientation(a)
  536. #define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)      (p)->GetConeOutsideVolume(a)
  537. #define IDirectSound3DBuffer_GetPosition(p,a)               (p)->GetPosition(a)
  538. #define IDirectSound3DBuffer_GetMinDistance(p,a)            (p)->GetMinDistance(a)
  539. #define IDirectSound3DBuffer_GetMaxDistance(p,a)            (p)->GetMaxDistance(a)
  540. #define IDirectSound3DBuffer_GetMode(p,a)                   (p)->GetMode(a)
  541. #define IDirectSound3DBuffer_GetVelocity(p,a)               (p)->GetVelocity(a)
  542. #define IDirectSound3DBuffer_SetAllParameters(p,a,b)        (p)->SetAllParameters(a,b)
  543. #define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)         (p)->SetConeAngles(a,b,c)
  544. #define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d)  (p)->SetConeOrientation(a,b,c,d)
  545. #define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)    (p)->SetConeOutsideVolume(a,b)
  546. #define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)         (p)->SetPosition(a,b,c,d)
  547. #define IDirectSound3DBuffer_SetMinDistance(p,a,b)          (p)->SetMinDistance(a,b)
  548. #define IDirectSound3DBuffer_SetMaxDistance(p,a,b)          (p)->SetMaxDistance(a,b)
  549. #define IDirectSound3DBuffer_SetMode(p,a,b)                 (p)->SetMode(a,b)
  550. #define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)         (p)->SetVelocity(a,b,c,d)
  551. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  552.  
  553. //
  554. // IDirectSoundCapture
  555. //
  556.  
  557. DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  558.  
  559. #undef INTERFACE
  560. #define INTERFACE IDirectSoundCapture
  561.  
  562. DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
  563. {
  564.     // IUnknown methods
  565.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  566.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  567.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  568.  
  569.     // IDirectSoundCapture methods
  570.     STDMETHOD(CreateCaptureBuffer)  (THIS_ LPCDSCBUFFERDESC, LPDIRECTSOUNDCAPTUREBUFFER *, LPUNKNOWN) PURE;
  571.     STDMETHOD(GetCaps)              (THIS_ LPDSCCAPS ) PURE;
  572.     STDMETHOD(Initialize)           (THIS_ LPCGUID) PURE;
  573. };
  574.  
  575. #define IDirectSoundCapture_QueryInterface(p,a,b)           IUnknown_QueryInterface(p,a,b)
  576. #define IDirectSoundCapture_AddRef(p)                       IUnknown_AddRef(p)
  577. #define IDirectSoundCapture_Release(p)                      IUnknown_Release(p)
  578.  
  579. #if !defined(__cplusplus) || defined(CINTERFACE)
  580. #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c)    (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
  581. #define IDirectSoundCapture_GetCaps(p,a)                    (p)->lpVtbl->GetCaps(p,a)
  582. #define IDirectSoundCapture_Initialize(p,a)                 (p)->lpVtbl->Initialize(p,a)
  583. #else // !defined(__cplusplus) || defined(CINTERFACE)
  584. #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c)    (p)->CreateCaptureBuffer(a,b,c)
  585. #define IDirectSoundCapture_GetCaps(p,a)                    (p)->GetCaps(a)
  586. #define IDirectSoundCapture_Initialize(p,a)                 (p)->Initialize(a)
  587. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  588.  
  589. //
  590. // IDirectSoundCaptureBuffer
  591. //
  592.  
  593. DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  594.  
  595. #undef INTERFACE
  596. #define INTERFACE IDirectSoundCaptureBuffer
  597.  
  598. DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
  599. {
  600.     // IUnknown methods
  601.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  602.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  603.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  604.  
  605.     // IDirectSoundCaptureBuffer methods
  606.     STDMETHOD(GetCaps)              (THIS_ LPDSCBCAPS ) PURE;
  607.     STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD, LPDWORD ) PURE;
  608.     STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) PURE;
  609.     STDMETHOD(GetStatus)            (THIS_ LPDWORD ) PURE;
  610.     STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUNDCAPTURE, LPCDSCBUFFERDESC) PURE;
  611.     STDMETHOD(Lock)                 (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
  612.     STDMETHOD(Start)                (THIS_ DWORD) PURE;
  613.     STDMETHOD(Stop)                 (THIS) PURE;
  614.     STDMETHOD(Unlock)               (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
  615. };
  616.  
  617. #define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)         IUnknown_QueryInterface(p,a,b)
  618. #define IDirectSoundCaptureBuffer_AddRef(p)                     IUnknown_AddRef(p)
  619. #define IDirectSoundCaptureBuffer_Release(p)                    IUnknown_Release(p)
  620.  
  621. #if !defined(__cplusplus) || defined(CINTERFACE)
  622. #define IDirectSoundCaptureBuffer_GetCaps(p,a)                  (p)->lpVtbl->GetCaps(p,a)
  623. #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)     (p)->lpVtbl->GetCurrentPosition(p,a,b)
  624. #define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)            (p)->lpVtbl->GetFormat(p,a,b,c)
  625. #define IDirectSoundCaptureBuffer_GetStatus(p,a)                (p)->lpVtbl->GetStatus(p,a)
  626. #define IDirectSoundCaptureBuffer_Initialize(p,a,b)             (p)->lpVtbl->Initialize(p,a,b)
  627. #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)         (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
  628. #define IDirectSoundCaptureBuffer_Start(p,a)                    (p)->lpVtbl->Start(p,a)
  629. #define IDirectSoundCaptureBuffer_Stop(p)                       (p)->lpVtbl->Stop(p)
  630. #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)             (p)->lpVtbl->Unlock(p,a,b,c,d)
  631. #else // !defined(__cplusplus) || defined(CINTERFACE)
  632. #define IDirectSoundCaptureBuffer_GetCaps(p,a)                  (p)->GetCaps(a)
  633. #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)     (p)->GetCurrentPosition(a,b)
  634. #define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)            (p)->GetFormat(a,b,c)
  635. #define IDirectSoundCaptureBuffer_GetStatus(p,a)                (p)->GetStatus(a)
  636. #define IDirectSoundCaptureBuffer_Initialize(p,a,b)             (p)->Initialize(a,b)
  637. #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)         (p)->Lock(a,b,c,d,e,f,g)
  638. #define IDirectSoundCaptureBuffer_Start(p,a)                    (p)->Start(a)
  639. #define IDirectSoundCaptureBuffer_Stop(p)                       (p)->Stop()
  640. #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)             (p)->Unlock(a,b,c,d)
  641. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  642.  
  643. //
  644. // IDirectSoundNotify
  645. //
  646.  
  647. DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  648.  
  649. #undef INTERFACE
  650. #define INTERFACE IDirectSoundNotify
  651.  
  652. DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
  653. {
  654.     // IUnknown methods
  655.     STDMETHOD(QueryInterface)           (THIS_ REFIID, LPVOID *) PURE;
  656.     STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
  657.     STDMETHOD_(ULONG,Release)           (THIS) PURE;
  658.  
  659.     // IDirectSoundNotify methods
  660.     STDMETHOD(SetNotificationPositions) (THIS_ DWORD, LPCDSBPOSITIONNOTIFY) PURE;
  661. };
  662.  
  663. #define IDirectSoundNotify_QueryInterface(p,a,b)            IUnknown_QueryInterface(p,a,b)
  664. #define IDirectSoundNotify_AddRef(p)                        IUnknown_AddRef(p)
  665. #define IDirectSoundNotify_Release(p)                       IUnknown_Release(p)
  666.  
  667. #if !defined(__cplusplus) || defined(CINTERFACE)
  668. #define IDirectSoundNotify_SetNotificationPositions(p,a,b)  (p)->lpVtbl->SetNotificationPositions(p,a,b)
  669. #else // !defined(__cplusplus) || defined(CINTERFACE)
  670. #define IDirectSoundNotify_SetNotificationPositions(p,a,b)  (p)->SetNotificationPositions(a,b)
  671. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  672.  
  673. //
  674. // IKsPropertySet
  675. //
  676.  
  677. #ifndef _IKsPropertySet_
  678. #define _IKsPropertySet_
  679.  
  680. #ifdef __cplusplus
  681. // 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
  682. struct IKsPropertySet;
  683. #endif // __cplusplus
  684.  
  685. typedef struct IKsPropertySet *LPKSPROPERTYSET;
  686.  
  687. #define KSPROPERTY_SUPPORT_GET  0x00000001
  688. #define KSPROPERTY_SUPPORT_SET  0x00000002
  689.  
  690. DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
  691.  
  692. #undef INTERFACE
  693. #define INTERFACE IKsPropertySet
  694.  
  695. DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
  696. {
  697.     // IUnknown methods
  698.     STDMETHOD(QueryInterface)   (THIS_ REFIID, LPVOID *) PURE;
  699.     STDMETHOD_(ULONG,AddRef)    (THIS) PURE;
  700.     STDMETHOD_(ULONG,Release)   (THIS) PURE;
  701.  
  702.     // IKsPropertySet methods
  703.     STDMETHOD(Get)              (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG, PULONG) PURE;
  704.     STDMETHOD(Set)              (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG) PURE;
  705.     STDMETHOD(QuerySupport)     (THIS_ REFGUID, ULONG, PULONG) PURE;
  706. };
  707.  
  708. #define IKsPropertySet_QueryInterface(p,a,b)       IUnknown_QueryInterface(p,a,b)
  709. #define IKsPropertySet_AddRef(p)                   IUnknown_AddRef(p)
  710. #define IKsPropertySet_Release(p)                  IUnknown_Release(p)
  711.  
  712. #if !defined(__cplusplus) || defined(CINTERFACE)
  713. #define IKsPropertySet_Get(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
  714. #define IKsPropertySet_Set(p,a,b,c,d,e,f)          (p)->lpVtbl->Set(p,a,b,c,d,e,f)
  715. #define IKsPropertySet_QuerySupport(p,a,b,c)       (p)->lpVtbl->QuerySupport(p,a,b,c)
  716. #else // !defined(__cplusplus) || defined(CINTERFACE)
  717. #define IKsPropertySet_Get(p,a,b,c,d,e,f,g)        (p)->Get(a,b,c,d,e,f,g)
  718. #define IKsPropertySet_Set(p,a,b,c,d,e,f)          (p)->Set(a,b,c,d,e,f)
  719. #define IKsPropertySet_QuerySupport(p,a,b,c)       (p)->QuerySupport(a,b,c)
  720. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  721.  
  722. #endif // _IKsPropertySet_
  723.  
  724.  
  725. //
  726. // Return Codes
  727. //
  728.  
  729. // The function completed successfully
  730. #define DS_OK                           S_OK
  731.  
  732. // The function completed successfully, but we had to substitute the 3D algorithm
  733. #define DS_NO_VIRTUALIZATION            MAKE_HRESULT(0, _FACDS, 10)
  734.  
  735. // The call failed because resources (such as a priority level)
  736. // were already being used by another caller
  737. #define DSERR_ALLOCATED                 MAKE_DSHRESULT(10)
  738.  
  739. // The control (vol,pan,etc.) requested by the caller is not available
  740. #define DSERR_CONTROLUNAVAIL            MAKE_DSHRESULT(30)
  741.  
  742. // An invalid parameter was passed to the returning function
  743. #define DSERR_INVALIDPARAM              E_INVALIDARG
  744.  
  745. // This call is not valid for the current state of this object
  746. #define DSERR_INVALIDCALL               MAKE_DSHRESULT(50)
  747.  
  748. // An undetermined error occured inside the DirectSound subsystem
  749. #define DSERR_GENERIC                   E_FAIL
  750.  
  751. // The caller does not have the priority level required for the function to
  752. // succeed
  753. #define DSERR_PRIOLEVELNEEDED           MAKE_DSHRESULT(70)
  754.  
  755. // Not enough free memory is available to complete the operation
  756. #define DSERR_OUTOFMEMORY               E_OUTOFMEMORY
  757.  
  758. // The specified WAVE format is not supported
  759. #define DSERR_BADFORMAT                 MAKE_DSHRESULT(100)
  760.  
  761. // The function called is not supported at this time
  762. #define DSERR_UNSUPPORTED               E_NOTIMPL
  763.  
  764. // No sound driver is available for use
  765. #define DSERR_NODRIVER                  MAKE_DSHRESULT(120)
  766.  
  767. // This object is already initialized
  768. #define DSERR_ALREADYINITIALIZED        MAKE_DSHRESULT(130)
  769.  
  770. // This object does not support aggregation
  771. #define DSERR_NOAGGREGATION             CLASS_E_NOAGGREGATION
  772.  
  773. // The buffer memory has been lost, and must be restored
  774. #define DSERR_BUFFERLOST                MAKE_DSHRESULT(150)
  775.  
  776. // Another app has a higher priority level, preventing this call from
  777. // succeeding
  778. #define DSERR_OTHERAPPHASPRIO           MAKE_DSHRESULT(160)
  779.  
  780. // This object has not been initialized
  781. #define DSERR_UNINITIALIZED             MAKE_DSHRESULT(170)
  782.  
  783. // The requested COM interface is not available
  784. #define DSERR_NOINTERFACE               E_NOINTERFACE
  785.  
  786. // Access is denied
  787. #define DSERR_ACCESSDENIED              E_ACCESSDENIED
  788.  
  789. //
  790. // Flags
  791. //
  792.  
  793. #define DSCAPS_PRIMARYMONO          0x00000001
  794. #define DSCAPS_PRIMARYSTEREO        0x00000002
  795. #define DSCAPS_PRIMARY8BIT          0x00000004
  796. #define DSCAPS_PRIMARY16BIT         0x00000008
  797. #define DSCAPS_CONTINUOUSRATE       0x00000010
  798. #define DSCAPS_EMULDRIVER           0x00000020
  799. #define DSCAPS_CERTIFIED            0x00000040
  800. #define DSCAPS_SECONDARYMONO        0x00000100
  801. #define DSCAPS_SECONDARYSTEREO      0x00000200
  802. #define DSCAPS_SECONDARY8BIT        0x00000400
  803. #define DSCAPS_SECONDARY16BIT       0x00000800
  804.  
  805. #define DSSCL_NORMAL                0x00000001
  806. #define DSSCL_PRIORITY              0x00000002
  807. #define DSSCL_EXCLUSIVE             0x00000003
  808. #define DSSCL_WRITEPRIMARY          0x00000004
  809.  
  810. #define DSSPEAKER_HEADPHONE         0x00000001
  811. #define DSSPEAKER_MONO              0x00000002
  812. #define DSSPEAKER_QUAD              0x00000003
  813. #define DSSPEAKER_STEREO            0x00000004
  814. #define DSSPEAKER_SURROUND          0x00000005
  815. #define DSSPEAKER_5POINT1           0x00000006
  816.  
  817. #define DSSPEAKER_GEOMETRY_MIN      0x00000005  //   5 degrees
  818. #define DSSPEAKER_GEOMETRY_NARROW   0x0000000A  //  10 degrees
  819. #define DSSPEAKER_GEOMETRY_WIDE     0x00000014  //  20 degrees
  820. #define DSSPEAKER_GEOMETRY_MAX      0x000000B4  // 180 degrees
  821.  
  822. #define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
  823. #define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
  824. #define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
  825.  
  826. #define DSBCAPS_PRIMARYBUFFER       0x00000001
  827. #define DSBCAPS_STATIC              0x00000002
  828. #define DSBCAPS_LOCHARDWARE         0x00000004
  829. #define DSBCAPS_LOCSOFTWARE         0x00000008
  830. #define DSBCAPS_CTRL3D              0x00000010
  831. #define DSBCAPS_CTRLFREQUENCY       0x00000020
  832. #define DSBCAPS_CTRLPAN             0x00000040
  833. #define DSBCAPS_CTRLVOLUME          0x00000080
  834. #define DSBCAPS_CTRLPOSITIONNOTIFY  0x00000100
  835. #define DSBCAPS_STICKYFOCUS         0x00004000
  836. #define DSBCAPS_GLOBALFOCUS         0x00008000
  837. #define DSBCAPS_GETCURRENTPOSITION2 0x00010000
  838. #define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
  839. #define DSBCAPS_LOCDEFER            0x00040000
  840.  
  841. #define DSBPLAY_LOOPING             0x00000001
  842. #define DSBPLAY_LOCHARDWARE         0x00000002
  843. #define DSBPLAY_LOCSOFTWARE         0x00000004
  844. #define DSBPLAY_TERMINATEBY_TIME    0x00000008
  845. #define DSBPLAY_TERMINATEBY_DISTANCE    0x000000010
  846. #define DSBPLAY_TERMINATEBY_PRIORITY    0x000000020
  847.  
  848. #define DSBSTATUS_PLAYING           0x00000001
  849. #define DSBSTATUS_BUFFERLOST        0x00000002
  850. #define DSBSTATUS_LOOPING           0x00000004
  851. #define DSBSTATUS_LOCHARDWARE       0x00000008
  852. #define DSBSTATUS_LOCSOFTWARE       0x00000010
  853. #define DSBSTATUS_TERMINATED        0x00000020
  854.  
  855. #define DSBLOCK_FROMWRITECURSOR     0x00000001
  856. #define DSBLOCK_ENTIREBUFFER        0x00000002
  857.  
  858. #define DSBFREQUENCY_MIN            100
  859. #define DSBFREQUENCY_MAX            100000
  860. #define DSBFREQUENCY_ORIGINAL       0
  861.  
  862. #define DSBPAN_LEFT                 -10000
  863. #define DSBPAN_CENTER               0
  864. #define DSBPAN_RIGHT                10000
  865.  
  866. #define DSBVOLUME_MIN               -10000
  867. #define DSBVOLUME_MAX               0
  868.  
  869. #define DSBSIZE_MIN                 4
  870. #define DSBSIZE_MAX                 0x0FFFFFFF
  871.  
  872. #define DS3DMODE_NORMAL             0x00000000
  873. #define DS3DMODE_HEADRELATIVE       0x00000001
  874. #define DS3DMODE_DISABLE            0x00000002
  875.  
  876. #define DS3D_IMMEDIATE              0x00000000
  877. #define DS3D_DEFERRED               0x00000001
  878.  
  879. #define DS3D_MINDISTANCEFACTOR      FLT_MIN
  880. #define DS3D_MAXDISTANCEFACTOR      FLT_MAX
  881. #define DS3D_DEFAULTDISTANCEFACTOR  1.0f
  882.  
  883. #define DS3D_MINROLLOFFFACTOR       0.0f
  884. #define DS3D_MAXROLLOFFFACTOR       10.0f
  885. #define DS3D_DEFAULTROLLOFFFACTOR   1.0f
  886.  
  887. #define DS3D_MINDOPPLERFACTOR       0.0f
  888. #define DS3D_MAXDOPPLERFACTOR       10.0f
  889. #define DS3D_DEFAULTDOPPLERFACTOR   1.0f
  890.  
  891. #define DS3D_DEFAULTMINDISTANCE     1.0f
  892. #define DS3D_DEFAULTMAXDISTANCE     1000000000.0f
  893.  
  894. #define DS3D_MINCONEANGLE           0
  895. #define DS3D_MAXCONEANGLE           360
  896. #define DS3D_DEFAULTCONEANGLE       360
  897.  
  898. #define DS3D_DEFAULTCONEOUTSIDEVOLUME DSBVOLUME_MAX
  899.  
  900. #define DSCCAPS_EMULDRIVER          DSCAPS_EMULDRIVER
  901. #define DSCCAPS_CERTIFIED           DSCAPS_CERTIFIED
  902.  
  903. #define DSCBCAPS_WAVEMAPPED         0x80000000
  904.  
  905. #define DSCBLOCK_ENTIREBUFFER       0x00000001
  906.  
  907. #define DSCBSTATUS_CAPTURING        0x00000001
  908. #define DSCBSTATUS_LOOPING          0x00000002
  909.  
  910. #define DSCBSTART_LOOPING           0x00000001
  911.  
  912. #define DSBPN_OFFSETSTOP            0xFFFFFFFF
  913.  
  914.  
  915. //
  916. // DirectSound3D Algorithms
  917. //
  918.  
  919. // Default DirectSound3D algorithm {00000000-0000-0000-0000-000000000000}
  920. #define DS3DALG_DEFAULT GUID_NULL
  921.  
  922. // No virtualization {C241333F-1C1B-11d2-94F5-00C04FC28ACA}
  923. DEFINE_GUID(DS3DALG_NO_VIRTUALIZATION, 0xc241333f, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
  924.  
  925. // High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA}
  926. DEFINE_GUID(DS3DALG_HRTF_FULL, 0xc2413340, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
  927.  
  928. // Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA}
  929. DEFINE_GUID(DS3DALG_HRTF_LIGHT, 0xc2413342, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
  930.  
  931. #ifdef __cplusplus
  932. };
  933. #endif // __cplusplus
  934.  
  935. #pragma option pop /*P_O_Pop*/
  936. #endif  // __DSOUND_INCLUDED__
  937.  
  938.