home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / DSOUND.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  40.1 KB  |  866 lines

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