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