Home | History | Annotate | Download | only in include
      1 #include <_mingw_unicode.h>
      2 #undef INTERFACE
      3 /*
      4  * Copyright (C) the Wine project
      5  *
      6  * This library is free software; you can redistribute it and/or
      7  * modify it under the terms of the GNU Lesser General Public
      8  * License as published by the Free Software Foundation; either
      9  * version 2.1 of the License, or (at your option) any later version.
     10  *
     11  * This library is distributed in the hope that it will be useful,
     12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     14  * Lesser General Public License for more details.
     15  *
     16  * You should have received a copy of the GNU Lesser General Public
     17  * License along with this library; if not, write to the Free Software
     18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
     19  */
     20 
     21 #ifndef __DSOUND_INCLUDED__
     22 #define __DSOUND_INCLUDED__
     23 
     24 #ifndef DIRECTSOUND_VERSION
     25 #define DIRECTSOUND_VERSION 0x0900
     26 #endif
     27 
     28 #define COM_NO_WINDOWS_H
     29 #include <objbase.h>
     30 #include <float.h>
     31 
     32 #ifdef __cplusplus
     33 extern "C" {
     34 #endif /* defined(__cplusplus) */
     35 
     36 #ifndef DX_SHARED_DEFINES
     37 
     38 typedef float D3DVALUE, *LPD3DVALUE;
     39 
     40 #ifndef D3DCOLOR_DEFINED
     41 typedef DWORD D3DCOLOR, *LPD3DCOLOR;
     42 #define D3DCOLOR_DEFINED
     43 #endif
     44 
     45 #ifndef D3DVECTOR_DEFINED
     46 typedef struct _D3DVECTOR {
     47     float x;
     48     float y;
     49     float z;
     50 } D3DVECTOR;
     51 #define D3DVECTOR_DEFINED
     52 #endif
     53 
     54 #ifndef LPD3DVECTOR_DEFINED
     55 typedef D3DVECTOR *LPD3DVECTOR;
     56 #define LPD3DVECTOR_DEFINED
     57 #endif
     58 
     59 #define DX_SHARED_DEFINES
     60 #endif /* DX_SHARED_DEFINES */
     61 
     62 /*****************************************************************************
     63  * Predeclare the interfaces
     64  */
     65 DEFINE_GUID(CLSID_DirectSound,		0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
     66 DEFINE_GUID(CLSID_DirectSound8,		0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b);
     67 DEFINE_GUID(CLSID_DirectSoundCapture,	0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x08, 0x00, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
     68 DEFINE_GUID(CLSID_DirectSoundCapture8,	0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1);
     69 DEFINE_GUID(CLSID_DirectSoundFullDuplex,0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d);
     70 
     71 DEFINE_GUID(IID_IDirectSound,		0x279AFA83,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
     72 typedef struct IDirectSound *LPDIRECTSOUND,**LPLPDIRECTSOUND;
     73 
     74 DEFINE_GUID(IID_IDirectSound8,		0xC50A7E93,0xF395,0x4834,0x9E,0xF6,0x7F,0xA9,0x9D,0xE5,0x09,0x66);
     75 typedef struct IDirectSound8 *LPDIRECTSOUND8,**LPLPDIRECTSOUND8;
     76 
     77 DEFINE_GUID(IID_IDirectSoundBuffer,	0x279AFA85,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
     78 typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER,**LPLPDIRECTSOUNDBUFFER;
     79 
     80 DEFINE_GUID(IID_IDirectSoundBuffer8,	0x6825A449,0x7524,0x4D82,0x92,0x0F,0x50,0xE3,0x6A,0xB3,0xAB,0x1E);
     81 typedef struct IDirectSoundBuffer8 *LPDIRECTSOUNDBUFFER8,**LPLPDIRECTSOUNDBUFFER8;
     82 
     83 DEFINE_GUID(IID_IDirectSoundNotify,	0xB0210783,0x89cd,0x11d0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
     84 typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY,**LPLPDIRECTSOUNDNOTIFY;
     85 #define	IID_IDirectSoundNotify8		IID_IDirectSoundNotify
     86 
     87 DEFINE_GUID(IID_IDirectSound3DListener,	0x279AFA84,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
     88 typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER,**LPLPDIRECTSOUND3DLISTENER;
     89 
     90 DEFINE_GUID(IID_IDirectSound3DBuffer,	0x279AFA86,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
     91 typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER,**LPLPDIRECTSOUND3DBUFFER;
     92 
     93 DEFINE_GUID(IID_IDirectSoundCapture,	0xB0210781,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
     94 typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE,**LPLPDIRECTSOUNDCAPTURE;
     95 #define	IID_IDirectSoundCapture8	IID_IDirectSoundCapture
     96 typedef struct IDirectSoundCapture IDirectSoundCapture8,*LPDIRECTSOUNDCAPTURE8,**LPLPDIRECTSOUNDCAPTURE8;
     97 
     98 DEFINE_GUID(IID_IDirectSoundCaptureBuffer,0xB0210782,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
     99 typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER,**LPLPDIRECTSOUNDCAPTUREBUFFER;
    100 
    101 DEFINE_GUID(IID_IDirectSoundCaptureBuffer8,0x00990DF4,0x0DBB,0x4872,0x83,0x3E,0x6D,0x30,0x3E,0x80,0xAE,0xB6);
    102 typedef struct IDirectSoundCaptureBuffer8 *LPDIRECTSOUNDCAPTUREBUFFER8,**LPLPDIRECTSOUNDCAPTUREBUFFER8;
    103 
    104 DEFINE_GUID(IID_IDirectSoundFullDuplex,	0xEDCB4C7A,0xDAAB,0x4216,0xA4,0x2E,0x6C,0x50,0x59,0x6D,0xDC,0x1D);
    105 typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX,**LPLPDIRECTSOUNDFULLDUPLEX;
    106 #define	IID_IDirectSoundFullDuplex8	IID_IDirectSoundFullDuplex
    107 
    108 DEFINE_GUID(DSDEVID_DefaultPlayback,     0xDEF00000,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
    109 DEFINE_GUID(DSDEVID_DefaultCapture,      0xDEF00001,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
    110 DEFINE_GUID(DSDEVID_DefaultVoicePlayback,0xDEF00002,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
    111 DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xDEF00003,0x9C6D,0x47ED,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
    112 
    113 DEFINE_GUID(DSDEVID_WinePlayback,        0x40316A1D,0x605B,0xD611,0x87,0xC6,0x00,0x80,0xAD,0x00,0x02,0xFE);
    114 
    115 #define	_FACDS		0x878
    116 #define	MAKE_DSHRESULT(code)		MAKE_HRESULT(1,_FACDS,code)
    117 
    118 #define DS_OK				0
    119 #define DS_NO_VIRTUALIZATION            MAKE_HRESULT(0, _FACDS, 10)
    120 #define DS_INCOMPLETE                   MAKE_HRESULT(0, _FACDS, 20)
    121 #define DSERR_ALLOCATED			MAKE_DSHRESULT(10)
    122 #define DSERR_CONTROLUNAVAIL		MAKE_DSHRESULT(30)
    123 #define DSERR_INVALIDPARAM		E_INVALIDARG
    124 #define DSERR_INVALIDCALL		MAKE_DSHRESULT(50)
    125 #define DSERR_GENERIC			E_FAIL
    126 #define DSERR_PRIOLEVELNEEDED		MAKE_DSHRESULT(70)
    127 #define DSERR_OUTOFMEMORY		E_OUTOFMEMORY
    128 #define DSERR_BADFORMAT			MAKE_DSHRESULT(100)
    129 #define DSERR_UNSUPPORTED		E_NOTIMPL
    130 #define DSERR_NODRIVER			MAKE_DSHRESULT(120)
    131 #define DSERR_ALREADYINITIALIZED	MAKE_DSHRESULT(130)
    132 #define DSERR_NOAGGREGATION		CLASS_E_NOAGGREGATION
    133 #define DSERR_BUFFERLOST		MAKE_DSHRESULT(150)
    134 #define DSERR_OTHERAPPHASPRIO		MAKE_DSHRESULT(160)
    135 #define DSERR_UNINITIALIZED		MAKE_DSHRESULT(170)
    136 #define DSERR_NOINTERFACE               E_NOINTERFACE
    137 #define DSERR_ACCESSDENIED              E_ACCESSDENIED
    138 #define DSERR_BUFFERTOOSMALL            MAKE_DSHRESULT(180)
    139 #define DSERR_DS8_REQUIRED              MAKE_DSHRESULT(190)
    140 #define DSERR_SENDLOOP                  MAKE_DSHRESULT(200)
    141 #define DSERR_BADSENDBUFFERGUID         MAKE_DSHRESULT(210)
    142 #define DSERR_FXUNAVAILABLE             MAKE_DSHRESULT(220)
    143 #define DSERR_OBJECTNOTFOUND            MAKE_DSHRESULT(4449)
    144 
    145 #define DSCAPS_PRIMARYMONO          0x00000001
    146 #define DSCAPS_PRIMARYSTEREO        0x00000002
    147 #define DSCAPS_PRIMARY8BIT          0x00000004
    148 #define DSCAPS_PRIMARY16BIT         0x00000008
    149 #define DSCAPS_CONTINUOUSRATE       0x00000010
    150 #define DSCAPS_EMULDRIVER           0x00000020
    151 #define DSCAPS_CERTIFIED            0x00000040
    152 #define DSCAPS_SECONDARYMONO        0x00000100
    153 #define DSCAPS_SECONDARYSTEREO      0x00000200
    154 #define DSCAPS_SECONDARY8BIT        0x00000400
    155 #define DSCAPS_SECONDARY16BIT       0x00000800
    156 
    157 #define	DSSCL_NORMAL		1
    158 #define	DSSCL_PRIORITY		2
    159 #define	DSSCL_EXCLUSIVE		3
    160 #define	DSSCL_WRITEPRIMARY	4
    161 
    162 typedef struct _DSCAPS
    163 {
    164     DWORD	dwSize;
    165     DWORD	dwFlags;
    166     DWORD	dwMinSecondarySampleRate;
    167     DWORD	dwMaxSecondarySampleRate;
    168     DWORD	dwPrimaryBuffers;
    169     DWORD	dwMaxHwMixingAllBuffers;
    170     DWORD	dwMaxHwMixingStaticBuffers;
    171     DWORD	dwMaxHwMixingStreamingBuffers;
    172     DWORD	dwFreeHwMixingAllBuffers;
    173     DWORD	dwFreeHwMixingStaticBuffers;
    174     DWORD	dwFreeHwMixingStreamingBuffers;
    175     DWORD	dwMaxHw3DAllBuffers;
    176     DWORD	dwMaxHw3DStaticBuffers;
    177     DWORD	dwMaxHw3DStreamingBuffers;
    178     DWORD	dwFreeHw3DAllBuffers;
    179     DWORD	dwFreeHw3DStaticBuffers;
    180     DWORD	dwFreeHw3DStreamingBuffers;
    181     DWORD	dwTotalHwMemBytes;
    182     DWORD	dwFreeHwMemBytes;
    183     DWORD	dwMaxContigFreeHwMemBytes;
    184     DWORD	dwUnlockTransferRateHwBuffers;
    185     DWORD	dwPlayCpuOverheadSwBuffers;
    186     DWORD	dwReserved1;
    187     DWORD	dwReserved2;
    188 } DSCAPS,*LPDSCAPS;
    189 typedef const DSCAPS *LPCDSCAPS;
    190 
    191 #define DSBPLAY_LOOPING             0x00000001
    192 #define DSBPLAY_LOCHARDWARE         0x00000002
    193 #define DSBPLAY_LOCSOFTWARE         0x00000004
    194 #define DSBPLAY_TERMINATEBY_TIME    0x00000008
    195 #define DSBPLAY_TERMINATEBY_DISTANCE    0x000000010
    196 #define DSBPLAY_TERMINATEBY_PRIORITY    0x000000020
    197 
    198 #define DSBSTATUS_PLAYING           0x00000001
    199 #define DSBSTATUS_BUFFERLOST        0x00000002
    200 #define DSBSTATUS_LOOPING           0x00000004
    201 #define DSBSTATUS_LOCHARDWARE       0x00000008
    202 #define DSBSTATUS_LOCSOFTWARE       0x00000010
    203 #define DSBSTATUS_TERMINATED        0x00000020
    204 
    205 #define DSBLOCK_FROMWRITECURSOR     0x00000001
    206 #define DSBLOCK_ENTIREBUFFER        0x00000002
    207 
    208 #define DSBCAPS_PRIMARYBUFFER       0x00000001
    209 #define DSBCAPS_STATIC              0x00000002
    210 #define DSBCAPS_LOCHARDWARE         0x00000004
    211 #define DSBCAPS_LOCSOFTWARE         0x00000008
    212 #define DSBCAPS_CTRL3D              0x00000010
    213 #define DSBCAPS_CTRLFREQUENCY       0x00000020
    214 #define DSBCAPS_CTRLPAN             0x00000040
    215 #define DSBCAPS_CTRLVOLUME          0x00000080
    216 #define DSBCAPS_CTRLDEFAULT         0x000000E0  /* Pan + volume + frequency. */
    217 #define DSBCAPS_CTRLPOSITIONNOTIFY  0x00000100
    218 #define DSBCAPS_CTRLFX              0x00000200
    219 #define DSBCAPS_CTRLALL             0x000001F0  /* All control capabilities */
    220 #define DSBCAPS_STICKYFOCUS         0x00004000
    221 #define DSBCAPS_GLOBALFOCUS         0x00008000
    222 #define DSBCAPS_GETCURRENTPOSITION2 0x00010000  /* More accurate play cursor under emulation*/
    223 #define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
    224 #define DSBCAPS_LOCDEFER            0x00040000
    225 
    226 #define DSBSIZE_MIN                 4
    227 #define DSBSIZE_MAX                 0xFFFFFFF
    228 #define DSBPAN_LEFT                 -10000
    229 #define DSBPAN_CENTER               0
    230 #define DSBPAN_RIGHT                 10000
    231 #define DSBVOLUME_MAX                    0
    232 #define DSBVOLUME_MIN               -10000
    233 #define DSBFREQUENCY_MIN            100
    234 #if (DIRECTSOUND_VERSION >= 0x0900)
    235 #define DSBFREQUENCY_MAX            200000
    236 #else
    237 #define DSBFREQUENCY_MAX            100000
    238 #endif
    239 #define DSBFREQUENCY_ORIGINAL       0
    240 
    241 #define DSBNOTIFICATIONS_MAX        100000U
    242 
    243 typedef struct _DSBCAPS
    244 {
    245     DWORD	dwSize;
    246     DWORD	dwFlags;
    247     DWORD	dwBufferBytes;
    248     DWORD	dwUnlockTransferRate;
    249     DWORD	dwPlayCpuOverhead;
    250 } DSBCAPS,*LPDSBCAPS;
    251 typedef const DSBCAPS *LPCDSBCAPS;
    252 
    253 #define DSSCL_NORMAL                1
    254 #define DSSCL_PRIORITY              2
    255 #define DSSCL_EXCLUSIVE             3
    256 #define DSSCL_WRITEPRIMARY          4
    257 
    258 typedef struct _DSEFFECTDESC
    259 {
    260     DWORD	dwSize;
    261     DWORD	dwFlags;
    262     GUID	guidDSFXClass;
    263     DWORD_PTR	dwReserved1;
    264     DWORD_PTR	dwReserved2;
    265 } DSEFFECTDESC,*LPDSEFFECTDESC;
    266 typedef const DSEFFECTDESC *LPCDSEFFECTDESC;
    267 
    268 #define DSFX_LOCHARDWARE    0x00000001
    269 #define DSFX_LOCSOFTWARE    0x00000002
    270 
    271 enum
    272 {
    273     DSFXR_PRESENT,
    274     DSFXR_LOCHARDWARE,
    275     DSFXR_LOCSOFTWARE,
    276     DSFXR_UNALLOCATED,
    277     DSFXR_FAILED,
    278     DSFXR_UNKNOWN,
    279     DSFXR_SENDLOOP
    280 };
    281 
    282 typedef struct _DSBUFFERDESC1
    283 {
    284     DWORD		dwSize;
    285     DWORD		dwFlags;
    286     DWORD		dwBufferBytes;
    287     DWORD		dwReserved;
    288     LPWAVEFORMATEX	lpwfxFormat;
    289 } DSBUFFERDESC1,*LPDSBUFFERDESC1;
    290 typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1;
    291 
    292 typedef struct _DSBUFFERDESC
    293 {
    294     DWORD		dwSize;
    295     DWORD		dwFlags;
    296     DWORD		dwBufferBytes;
    297     DWORD		dwReserved;
    298     LPWAVEFORMATEX	lpwfxFormat;
    299 #if (DIRECTSOUND_VERSION >= 0x0700)
    300     GUID		guid3DAlgorithm;
    301 #endif /* DS7 */
    302 } DSBUFFERDESC,*LPDSBUFFERDESC;
    303 typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
    304 
    305 typedef struct _DSBPOSITIONNOTIFY
    306 {
    307     DWORD	dwOffset;
    308     HANDLE	hEventNotify;
    309 } DSBPOSITIONNOTIFY,*LPDSBPOSITIONNOTIFY;
    310 typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
    311 
    312 #define DSSPEAKER_DIRECTOUT     0
    313 #define DSSPEAKER_HEADPHONE     1
    314 #define DSSPEAKER_MONO          2
    315 #define DSSPEAKER_QUAD          3
    316 #define DSSPEAKER_STEREO        4
    317 #define DSSPEAKER_SURROUND      5
    318 #define DSSPEAKER_5POINT1       6
    319 #define DSSPEAKER_5POINT1_BACK  6
    320 #define DSSPEAKER_7POINT1       7
    321 #define DSSPEAKER_7POINT1_WIDE  7
    322 #define DSSPEAKER_7POINT1_SURROUND  8
    323 #define DSSPEAKER_5POINT1_SURROUND  9
    324 
    325 #define DSSPEAKER_GEOMETRY_MIN      0x00000005  /* 5 degrees */
    326 #define DSSPEAKER_GEOMETRY_NARROW   0x0000000A  /* 10 degrees */
    327 #define DSSPEAKER_GEOMETRY_WIDE     0x00000014  /* 20 degrees */
    328 #define DSSPEAKER_GEOMETRY_MAX      0x000000B4  /* 180 degrees */
    329 
    330 #define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
    331 #define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
    332 #define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
    333 
    334 #define DS_CERTIFIED                0x00000000
    335 #define DS_UNCERTIFIED              0x00000001
    336 
    337 typedef struct _DSCEFFECTDESC
    338 {
    339     DWORD       dwSize;
    340     DWORD       dwFlags;
    341     GUID        guidDSCFXClass;
    342     GUID        guidDSCFXInstance;
    343     DWORD       dwReserved1;
    344     DWORD       dwReserved2;
    345 } DSCEFFECTDESC, *LPDSCEFFECTDESC;
    346 typedef const DSCEFFECTDESC *LPCDSCEFFECTDESC;
    347 
    348 #define DSCFX_LOCHARDWARE   0x00000001
    349 #define DSCFX_LOCSOFTWARE   0x00000002
    350 
    351 #define DSCFXR_LOCHARDWARE  0x00000010
    352 #define DSCFXR_LOCSOFTWARE  0x00000020
    353 
    354 typedef struct _DSCBUFFERDESC1
    355 {
    356   DWORD           dwSize;
    357   DWORD           dwFlags;
    358   DWORD           dwBufferBytes;
    359   DWORD           dwReserved;
    360   LPWAVEFORMATEX  lpwfxFormat;
    361 } DSCBUFFERDESC1, *LPDSCBUFFERDESC1;
    362 
    363 typedef struct _DSCBUFFERDESC
    364 {
    365   DWORD           dwSize;
    366   DWORD           dwFlags;
    367   DWORD           dwBufferBytes;
    368   DWORD           dwReserved;
    369   LPWAVEFORMATEX  lpwfxFormat;
    370 #if (DIRECTSOUND_VERSION >= 0x0800)
    371   DWORD           dwFXCount;
    372   LPDSCEFFECTDESC lpDSCFXDesc;
    373 #endif /* DS8 */
    374 } DSCBUFFERDESC, *LPDSCBUFFERDESC;
    375 typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
    376 
    377 typedef struct _DSCCAPS
    378 {
    379   DWORD dwSize;
    380   DWORD dwFlags;
    381   DWORD dwFormats;
    382   DWORD dwChannels;
    383 } DSCCAPS, *LPDSCCAPS;
    384 typedef const DSCCAPS *LPCDSCCAPS;
    385 
    386 typedef struct _DSCBCAPS
    387 {
    388   DWORD dwSize;
    389   DWORD dwFlags;
    390   DWORD dwBufferBytes;
    391   DWORD dwReserved;
    392 } DSCBCAPS, *LPDSCBCAPS;
    393 typedef const DSCBCAPS *LPCDSCBCAPS;
    394 
    395 #define DSCCAPS_EMULDRIVER          DSCAPS_EMULDRIVER
    396 #define DSCCAPS_CERTIFIED           DSCAPS_CERTIFIED
    397 #define DSCCAPS_MULTIPLECAPTURE     0x00000001
    398 
    399 #define DSCBCAPS_WAVEMAPPED         0x80000000
    400 #define DSCBCAPS_CTRLFX             0x00000200
    401 
    402 #define DSCBLOCK_ENTIREBUFFER       0x00000001
    403 #define DSCBSTART_LOOPING           0x00000001
    404 #define DSCBPN_OFFSET_STOP          0xffffffff
    405 
    406 #define DSCBSTATUS_CAPTURING        0x00000001
    407 #define DSCBSTATUS_LOOPING          0x00000002
    408 
    409 #ifndef __LPCGUID_DEFINED__
    410 #define __LPCGUID_DEFINED__
    411 typedef const GUID *LPCGUID;
    412 #endif
    413 
    414 typedef WINBOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID,LPCWSTR,LPCWSTR,LPVOID);
    415 typedef WINBOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID,LPCSTR,LPCSTR,LPVOID);
    416 __MINGW_TYPEDEF_AW(LPDSENUMCALLBACK)
    417 
    418 extern HRESULT WINAPI DirectSoundCreate(LPCGUID lpGUID,LPDIRECTSOUND *ppDS,LPUNKNOWN pUnkOuter);
    419 extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
    420 extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
    421 #define DirectSoundEnumerate __MINGW_NAME_AW(DirectSoundEnumerate)
    422 extern HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID lpGUID, LPDIRECTSOUNDCAPTURE *ppDSC, LPUNKNOWN pUnkOuter);
    423 extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
    424 extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
    425 #define DirectSoundCaptureEnumerate __MINGW_NAME_AW(DirectSoundCaptureEnumerate)
    426 
    427 extern HRESULT WINAPI DirectSoundCreate8(LPCGUID lpGUID,LPDIRECTSOUND8 *ppDS8,LPUNKNOWN pUnkOuter);
    428 extern HRESULT WINAPI DirectSoundCaptureCreate8(LPCGUID lpGUID, LPDIRECTSOUNDCAPTURE8 *ppDSC8, LPUNKNOWN pUnkOuter);
    429 extern HRESULT WINAPI DirectSoundFullDuplexCreate(LPCGUID pcGuidCaptureDevice, LPCGUID pcGuidRenderDevice,
    430     LPCDSCBUFFERDESC pcDSCBufferDesc, LPCDSBUFFERDESC pcDSBufferDesc, HWND hWnd, DWORD dwLevel,
    431     LPDIRECTSOUNDFULLDUPLEX *ppDSFD, LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8, LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, LPUNKNOWN pUnkOuter);
    432 #define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate
    433 extern HRESULT WINAPI GetDeviceID(LPCGUID lpGuidSrc, LPGUID lpGuidDest);
    434 
    435 
    436 /*****************************************************************************
    437  * IDirectSound interface
    438  */
    439 #define INTERFACE IDirectSound
    440 DECLARE_INTERFACE_(IDirectSound,IUnknown)
    441 {
    442     /*** IUnknown methods ***/
    443     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
    444     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
    445     STDMETHOD_(ULONG,Release)(THIS) PURE;
    446     /*** IDirectSound methods ***/
    447     STDMETHOD(CreateSoundBuffer)(THIS_ LPCDSBUFFERDESC lpcDSBufferDesc, LPLPDIRECTSOUNDBUFFER lplpDirectSoundBuffer, IUnknown *pUnkOuter) PURE;
    448     STDMETHOD(GetCaps)(THIS_ LPDSCAPS lpDSCaps) PURE;
    449     STDMETHOD(DuplicateSoundBuffer)(THIS_ LPDIRECTSOUNDBUFFER lpDsbOriginal, LPLPDIRECTSOUNDBUFFER lplpDsbDuplicate) PURE;
    450     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwLevel) PURE;
    451     STDMETHOD(Compact)(THIS) PURE;
    452     STDMETHOD(GetSpeakerConfig)(THIS_ LPDWORD lpdwSpeakerConfig) PURE;
    453     STDMETHOD(SetSpeakerConfig)(THIS_ DWORD dwSpeakerConfig) PURE;
    454     STDMETHOD(Initialize)(THIS_ LPCGUID lpcGuid) PURE;
    455 };
    456 #undef INTERFACE
    457 
    458 #if !defined(__cplusplus) || defined(CINTERFACE)
    459 /*** IUnknown methods ***/
    460 #define IDirectSound_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
    461 #define IDirectSound_AddRef(p)             (p)->lpVtbl->AddRef(p)
    462 #define IDirectSound_Release(p)            (p)->lpVtbl->Release(p)
    463 /*** IDirectSound methods ***/
    464 #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
    465 #define IDirectSound_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
    466 #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
    467 #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
    468 #define IDirectSound_Compact(p)                  (p)->lpVtbl->Compact(p)
    469 #define IDirectSound_GetSpeakerConfig(p,a)       (p)->lpVtbl->GetSpeakerConfig(p,a)
    470 #define IDirectSound_SetSpeakerConfig(p,a)       (p)->lpVtbl->SetSpeakerConfig(p,a)
    471 #define IDirectSound_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
    472 #else
    473 /*** IUnknown methods ***/
    474 #define IDirectSound_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
    475 #define IDirectSound_AddRef(p)             (p)->AddRef()
    476 #define IDirectSound_Release(p)            (p)->Release()
    477 /*** IDirectSound methods ***/
    478 #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->CreateSoundBuffer(a,b,c)
    479 #define IDirectSound_GetCaps(p,a)                (p)->GetCaps(a)
    480 #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
    481 #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
    482 #define IDirectSound_Compact(p)                  (p)->Compact()
    483 #define IDirectSound_GetSpeakerConfig(p,a)       (p)->GetSpeakerConfig(a)
    484 #define IDirectSound_SetSpeakerConfig(p,a)       (p)->SetSpeakerConfig(a)
    485 #define IDirectSound_Initialize(p,a)             (p)->Initialize(a)
    486 #endif
    487 
    488 
    489 /*****************************************************************************
    490  * IDirectSound8 interface
    491  */
    492 #define INTERFACE IDirectSound8
    493 DECLARE_INTERFACE_(IDirectSound8,IUnknown)
    494 {
    495     /*** IUnknown methods ***/
    496     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
    497     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
    498     STDMETHOD_(ULONG,Release)(THIS) PURE;
    499     /*** IDirectSound8 methods ***/
    500     STDMETHOD(CreateSoundBuffer)(THIS_ LPCDSBUFFERDESC lpcDSBufferDesc, LPLPDIRECTSOUNDBUFFER lplpDirectSoundBuffer, IUnknown *pUnkOuter) PURE;
    501     STDMETHOD(GetCaps)(THIS_ LPDSCAPS lpDSCaps) PURE;
    502     STDMETHOD(DuplicateSoundBuffer)(THIS_ LPDIRECTSOUNDBUFFER lpDsbOriginal, LPLPDIRECTSOUNDBUFFER lplpDsbDuplicate) PURE;
    503     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwLevel) PURE;
    504     STDMETHOD(Compact)(THIS) PURE;
    505     STDMETHOD(GetSpeakerConfig)(THIS_ LPDWORD lpdwSpeakerConfig) PURE;
    506     STDMETHOD(SetSpeakerConfig)(THIS_ DWORD dwSpeakerConfig) PURE;
    507     STDMETHOD(Initialize)(THIS_ LPCGUID lpcGuid) PURE;
    508     STDMETHOD(VerifyCertification)(THIS_ LPDWORD pdwCertified) PURE;
    509 };
    510 #undef INTERFACE
    511 
    512 #if !defined(__cplusplus) || defined(CINTERFACE)
    513 /*** IUnknown methods ***/
    514 #define IDirectSound8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
    515 #define IDirectSound8_AddRef(p)             (p)->lpVtbl->AddRef(p)
    516 #define IDirectSound8_Release(p)            (p)->lpVtbl->Release(p)
    517 /*** IDirectSound methods ***/
    518 #define IDirectSound8_CreateSoundBuffer(p,a,b,c)  (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
    519 #define IDirectSound8_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
    520 #define IDirectSound8_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
    521 #define IDirectSound8_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
    522 #define IDirectSound8_Compact(p)                  (p)->lpVtbl->Compact(p)
    523 #define IDirectSound8_GetSpeakerConfig(p,a)       (p)->lpVtbl->GetSpeakerConfig(p,a)
    524 #define IDirectSound8_SetSpeakerConfig(p,a)       (p)->lpVtbl->SetSpeakerConfig(p,a)
    525 #define IDirectSound8_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
    526 /*** IDirectSound8 methods ***/
    527 #define IDirectSound8_VerifyCertification(p,a)    (p)->lpVtbl->VerifyCertification(p,a)
    528 #else
    529 /*** IUnknown methods ***/
    530 #define IDirectSound8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
    531 #define IDirectSound8_AddRef(p)             (p)->AddRef()
    532 #define IDirectSound8_Release(p)            (p)->Release()
    533 /*** IDirectSound methods ***/
    534 #define IDirectSound8_CreateSoundBuffer(p,a,b,c)  (p)->CreateSoundBuffer(a,b,c)
    535 #define IDirectSound8_GetCaps(p,a)                (p)->GetCaps(a)
    536 #define IDirectSound8_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
    537 #define IDirectSound8_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
    538 #define IDirectSound8_Compact(p)                  (p)->Compact()
    539 #define IDirectSound8_GetSpeakerConfig(p,a)       (p)->GetSpeakerConfig(a)
    540 #define IDirectSound8_SetSpeakerConfig(p,a)       (p)->SetSpeakerConfig(a)
    541 #define IDirectSound8_Initialize(p,a)             (p)->Initialize(a)
    542 /*** IDirectSound8 methods ***/
    543 #define IDirectSound8_VerifyCertification(p,a)    (p)->VerifyCertification(a)
    544 #endif
    545 
    546 
    547 /*****************************************************************************
    548  * IDirectSoundBuffer interface
    549  */
    550 #define INTERFACE IDirectSoundBuffer
    551 DECLARE_INTERFACE_(IDirectSoundBuffer,IUnknown)
    552 {
    553     /*** IUnknown methods ***/
    554     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
    555     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
    556     STDMETHOD_(ULONG,Release)(THIS) PURE;
    557     /*** IDirectSoundBuffer methods ***/
    558     STDMETHOD(GetCaps)(THIS_ LPDSBCAPS lpDSBufferCaps) PURE;
    559     STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor) PURE;
    560     STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
    561     STDMETHOD(GetVolume)(THIS_ LPLONG lplVolume) PURE;
    562     STDMETHOD(GetPan)(THIS_ LPLONG lplpan) PURE;
    563     STDMETHOD(GetFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
    564     STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
    565     STDMETHOD(Initialize)(THIS_ LPDIRECTSOUND lpDirectSound, LPCDSBUFFERDESC lpcDSBufferDesc) PURE;
    566     STDMETHOD(Lock)(THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
    567     STDMETHOD(Play)(THIS_ DWORD dwReserved1, DWORD dwReserved2, DWORD dwFlags) PURE;
    568     STDMETHOD(SetCurrentPosition)(THIS_ DWORD dwNewPosition) PURE;
    569     STDMETHOD(SetFormat)(THIS_ LPCWAVEFORMATEX lpcfxFormat) PURE;
    570     STDMETHOD(SetVolume)(THIS_ LONG lVolume) PURE;
    571     STDMETHOD(SetPan)(THIS_ LONG lPan) PURE;
    572     STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE;
    573     STDMETHOD(Stop)(THIS) PURE;
    574     STDMETHOD(Unlock)(THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioPtr2) PURE;
    575     STDMETHOD(Restore)(THIS) PURE;
    576 };
    577 #undef INTERFACE
    578 
    579 #if !defined(__cplusplus) || defined(CINTERFACE)
    580 /*** IUnknown methods ***/
    581 #define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
    582 #define IDirectSoundBuffer_AddRef(p)             (p)->lpVtbl->AddRef(p)
    583 #define IDirectSoundBuffer_Release(p)            (p)->lpVtbl->Release(p)
    584 /*** IDirectSoundBuffer methods ***/
    585 #define IDirectSoundBuffer_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
    586 #define IDirectSoundBuffer_GetCurrentPosition(p,a,b)   (p)->lpVtbl->GetCurrentPosition(p,a,b)
    587 #define IDirectSoundBuffer_GetFormat(p,a,b,c)          (p)->lpVtbl->GetFormat(p,a,b,c)
    588 #define IDirectSoundBuffer_GetVolume(p,a)              (p)->lpVtbl->GetVolume(p,a)
    589 #define IDirectSoundBuffer_GetPan(p,a)                 (p)->lpVtbl->GetPan(p,a)
    590 #define IDirectSoundBuffer_GetFrequency(p,a)           (p)->lpVtbl->GetFrequency(p,a)
    591 #define IDirectSoundBuffer_GetStatus(p,a)              (p)->lpVtbl->GetStatus(p,a)
    592 #define IDirectSoundBuffer_Initialize(p,a,b)           (p)->lpVtbl->Initialize(p,a,b)
    593 #define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)       (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
    594 #define IDirectSoundBuffer_Play(p,a,b,c)               (p)->lpVtbl->Play(p,a,b,c)
    595 #define IDirectSoundBuffer_SetCurrentPosition(p,a)     (p)->lpVtbl->SetCurrentPosition(p,a)
    596 #define IDirectSoundBuffer_SetFormat(p,a)              (p)->lpVtbl->SetFormat(p,a)
    597 #define IDirectSoundBuffer_SetVolume(p,a)              (p)->lpVtbl->SetVolume(p,a)
    598 #define IDirectSoundBuffer_SetPan(p,a)                 (p)->lpVtbl->SetPan(p,a)
    599 #define IDirectSoundBuffer_SetFrequency(p,a)           (p)->lpVtbl->SetFrequency(p,a)
    600 #define IDirectSoundBuffer_Stop(p)                     (p)->lpVtbl->Stop(p)
    601 #define IDirectSoundBuffer_Unlock(p,a,b,c,d)           (p)->lpVtbl->Unlock(p,a,b,c,d)
    602 #define IDirectSoundBuffer_Restore(p)                  (p)->lpVtbl->Restore(p)
    603 #else
    604 /*** IUnknown methods ***/
    605 #define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
    606 #define IDirectSoundBuffer_AddRef(p)             (p)->AddRef()
    607 #define IDirectSoundBuffer_Release(p)            (p)->Release()
    608 /*** IDirectSoundBuffer methods ***/
    609 #define IDirectSoundBuffer_GetCaps(p,a)                (p)->GetCaps(a)
    610 #define IDirectSoundBuffer_GetCurrentPosition(p,a,b)   (p)->GetCurrentPosition(a,b)
    611 #define IDirectSoundBuffer_GetFormat(p,a,b,c)          (p)->GetFormat(a,b,c)
    612 #define IDirectSoundBuffer_GetVolume(p,a)              (p)->GetVolume(a)
    613 #define IDirectSoundBuffer_GetPan(p,a)                 (p)->GetPan(a)
    614 #define IDirectSoundBuffer_GetFrequency(p,a)           (p)->GetFrequency(a)
    615 #define IDirectSoundBuffer_GetStatus(p,a)              (p)->GetStatus(a)
    616 #define IDirectSoundBuffer_Initialize(p,a,b)           (p)->Initialize(a,b)
    617 #define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)       (p)->Lock(a,b,c,d,e,f,g)
    618 #define IDirectSoundBuffer_Play(p,a,b,c)               (p)->Play(a,b,c)
    619 #define IDirectSoundBuffer_SetCurrentPosition(p,a)     (p)->SetCurrentPosition(a)
    620 #define IDirectSoundBuffer_SetFormat(p,a)              (p)->SetFormat(a)
    621 #define IDirectSoundBuffer_SetVolume(p,a)              (p)->SetVolume(a)
    622 #define IDirectSoundBuffer_SetPan(p,a)                 (p)->SetPan(a)
    623 #define IDirectSoundBuffer_SetFrequency(p,a)           (p)->SetFrequency(a)
    624 #define IDirectSoundBuffer_Stop(p)                     (p)->Stop()
    625 #define IDirectSoundBuffer_Unlock(p,a,b,c,d)           (p)->Unlock(a,b,c,d)
    626 #define IDirectSoundBuffer_Restore(p)                  (p)->Restore()
    627 #endif
    628 
    629 
    630 /*****************************************************************************
    631  * IDirectSoundBuffer8 interface
    632  */
    633 #define INTERFACE IDirectSoundBuffer8
    634 DECLARE_INTERFACE_(IDirectSoundBuffer8,IUnknown)
    635 {
    636     /*** IUnknown methods ***/
    637     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
    638     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
    639     STDMETHOD_(ULONG,Release)(THIS) PURE;
    640     /*** IDirectSoundBuffer8 methods ***/
    641     STDMETHOD(GetCaps)(THIS_ LPDSBCAPS lpDSBufferCaps) PURE;
    642     STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor) PURE;
    643     STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
    644     STDMETHOD(GetVolume)(THIS_ LPLONG lplVolume) PURE;
    645     STDMETHOD(GetPan)(THIS_ LPLONG lplpan) PURE;
    646     STDMETHOD(GetFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
    647     STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
    648     STDMETHOD(Initialize)(THIS_ LPDIRECTSOUND lpDirectSound, LPCDSBUFFERDESC lpcDSBufferDesc) PURE;
    649     STDMETHOD(Lock)(THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
    650     STDMETHOD(Play)(THIS_ DWORD dwReserved1, DWORD dwReserved2, DWORD dwFlags) PURE;
    651     STDMETHOD(SetCurrentPosition)(THIS_ DWORD dwNewPosition) PURE;
    652     STDMETHOD(SetFormat)(THIS_ LPCWAVEFORMATEX lpcfxFormat) PURE;
    653     STDMETHOD(SetVolume)(THIS_ LONG lVolume) PURE;
    654     STDMETHOD(SetPan)(THIS_ LONG lPan) PURE;
    655     STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE;
    656     STDMETHOD(Stop)(THIS) PURE;
    657     STDMETHOD(Unlock)(THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioPtr2) PURE;
    658     STDMETHOD(Restore)(THIS) PURE;
    659     STDMETHOD(SetFX)(THIS_ DWORD dwEffectsCount, LPDSEFFECTDESC pDSFXDesc, LPDWORD pdwResultCodes) PURE;
    660     STDMETHOD(AcquireResources)(THIS_ DWORD dwFlags, DWORD dwEffectsCount, LPDWORD pdwResultCodes) PURE;
    661     STDMETHOD(GetObjectInPath)(THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
    662 };
    663 #undef INTERFACE
    664 
    665 #if !defined(__cplusplus) || defined(CINTERFACE)
    666 /*** IUnknown methods ***/
    667 #define IDirectSoundBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
    668 #define IDirectSoundBuffer8_AddRef(p)             (p)->lpVtbl->AddRef(p)
    669 #define IDirectSoundBuffer8_Release(p)            (p)->lpVtbl->Release(p)
    670 /*** IDirectSoundBuffer methods ***/
    671 #define IDirectSoundBuffer8_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
    672 #define IDirectSoundBuffer8_GetCurrentPosition(p,a,b)   (p)->lpVtbl->GetCurrentPosition(p,a,b)
    673 #define IDirectSoundBuffer8_GetFormat(p,a,b,c)          (p)->lpVtbl->GetFormat(p,a,b,c)
    674 #define IDirectSoundBuffer8_GetVolume(p,a)              (p)->lpVtbl->GetVolume(p,a)
    675 #define IDirectSoundBuffer8_GetPan(p,a)                 (p)->lpVtbl->GetPan(p,a)
    676 #define IDirectSoundBuffer8_GetFrequency(p,a)           (p)->lpVtbl->GetFrequency(p,a)
    677 #define IDirectSoundBuffer8_GetStatus(p,a)              (p)->lpVtbl->GetStatus(p,a)
    678 #define IDirectSoundBuffer8_Initialize(p,a,b)           (p)->lpVtbl->Initialize(p,a,b)
    679 #define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g)       (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
    680 #define IDirectSoundBuffer8_Play(p,a,b,c)               (p)->lpVtbl->Play(p,a,b,c)
    681 #define IDirectSoundBuffer8_SetCurrentPosition(p,a)     (p)->lpVtbl->SetCurrentPosition(p,a)
    682 #define IDirectSoundBuffer8_SetFormat(p,a)              (p)->lpVtbl->SetFormat(p,a)
    683 #define IDirectSoundBuffer8_SetVolume(p,a)              (p)->lpVtbl->SetVolume(p,a)
    684 #define IDirectSoundBuffer8_SetPan(p,a)                 (p)->lpVtbl->SetPan(p,a)
    685 #define IDirectSoundBuffer8_SetFrequency(p,a)           (p)->lpVtbl->SetFrequency(p,a)
    686 #define IDirectSoundBuffer8_Stop(p)                     (p)->lpVtbl->Stop(p)
    687 #define IDirectSoundBuffer8_Unlock(p,a,b,c,d)           (p)->lpVtbl->Unlock(p,a,b,c,d)
    688 #define IDirectSoundBuffer8_Restore(p)                  (p)->lpVtbl->Restore(p)
    689 /*** IDirectSoundBuffer8 methods ***/
    690 #define IDirectSoundBuffer8_SetFX(p,a,b,c)              (p)->lpVtbl->SetFX(p,a,b,c)
    691 #define IDirectSoundBuffer8_AcquireResources(p,a,b,c)   (p)->lpVtbl->AcquireResources(p,a,b,c)
    692 #define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d)  (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
    693 #else
    694 /*** IUnknown methods ***/
    695 #define IDirectSoundBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
    696 #define IDirectSoundBuffer8_AddRef(p)             (p)->AddRef()
    697 #define IDirectSoundBuffer8_Release(p)            (p)->Release()
    698 /*** IDirectSoundBuffer methods ***/
    699 #define IDirectSoundBuffer8_GetCaps(p,a)                (p)->GetCaps(a)
    700 #define IDirectSoundBuffer8_GetCurrentPosition(p,a,b)   (p)->GetCurrentPosition(a,b)
    701 #define IDirectSoundBuffer8_GetFormat(p,a,b,c)          (p)->GetFormat(a,b,c)
    702 #define IDirectSoundBuffer8_GetVolume(p,a)              (p)->GetVolume(a)
    703 #define IDirectSoundBuffer8_GetPan(p,a)                 (p)->GetPan(a)
    704 #define IDirectSoundBuffer8_GetFrequency(p,a)           (p)->GetFrequency(a)
    705 #define IDirectSoundBuffer8_GetStatus(p,a)              (p)->GetStatus(a)
    706 #define IDirectSoundBuffer8_Initialize(p,a,b)           (p)->Initialize(a,b)
    707 #define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g)       (p)->Lock(a,b,c,d,e,f,g)
    708 #define IDirectSoundBuffer8_Play(p,a,b,c)               (p)->Play(a,b,c)
    709 #define IDirectSoundBuffer8_SetCurrentPosition(p,a)     (p)->SetCurrentPosition(a)
    710 #define IDirectSoundBuffer8_SetFormat(p,a)              (p)->SetFormat(a)
    711 #define IDirectSoundBuffer8_SetVolume(p,a)              (p)->SetVolume(a)
    712 #define IDirectSoundBuffer8_SetPan(p,a)                 (p)->SetPan(a)
    713 #define IDirectSoundBuffer8_SetFrequency(p,a)           (p)->SetFrequency(a)
    714 #define IDirectSoundBuffer8_Stop(p)                     (p)->Stop()
    715 #define IDirectSoundBuffer8_Unlock(p,a,b,c,d)           (p)->Unlock(a,b,c,d)
    716 #define IDirectSoundBuffer8_Restore(p)                  (p)->Restore()
    717 /*** IDirectSoundBuffer8 methods ***/
    718 #define IDirectSoundBuffer8_SetFX(p,a,b,c)              (p)->SetFX(a,b,c)
    719 #define IDirectSoundBuffer8_AcquireResources(p,a,b,c)   (p)->AcquireResources(a,b,c)
    720 #define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d)  (p)->GetObjectInPath(a,b,c,d)
    721 #endif
    722 
    723 
    724 /*****************************************************************************
    725  * IDirectSoundCapture interface
    726  */
    727 #define INTERFACE IDirectSoundCapture
    728 DECLARE_INTERFACE_(IDirectSoundCapture,IUnknown)
    729 {
    730     /*** IUnknown methods ***/
    731     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
    732     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
    733     STDMETHOD_(ULONG,Release)(THIS) PURE;
    734     /*** IDirectSoundCapture methods ***/
    735     STDMETHOD(CreateCaptureBuffer)(THIS_ LPCDSCBUFFERDESC lpcDSCBufferDesc,LPDIRECTSOUNDCAPTUREBUFFER *lplpDSCaptureBuffer, LPUNKNOWN pUnk) PURE;
    736     STDMETHOD(GetCaps)(THIS_ LPDSCCAPS lpDSCCaps) PURE;
    737     STDMETHOD(Initialize)(THIS_ LPCGUID lpcGUID) PURE;
    738 };
    739 #undef INTERFACE
    740 
    741 #if !defined(__cplusplus) || defined(CINTERFACE)
    742 /*** IUnknown methods ***/
    743 #define IDirectSoundCapture_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
    744 #define IDirectSoundCapture_AddRef(p)                    (p)->lpVtbl->AddRef(p)
    745 #define IDirectSoundCapture_Release(p)                   (p)->lpVtbl->Release(p)
    746 /*** IDirectSoundCapture methods ***/
    747 #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
    748 #define IDirectSoundCapture_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
    749 #define IDirectSoundCapture_Initialize(p,a)              (p)->lpVtbl->Initialize(p,a)
    750 #else
    751 /*** IUnknown methods ***/
    752 #define IDirectSoundCapture_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
    753 #define IDirectSoundCapture_AddRef(p)                    (p)->AddRef()
    754 #define IDirectSoundCapture_Release(p)                   (p)->Release()
    755 /*** IDirectSoundCapture methods ***/
    756 #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c)
    757 #define IDirectSoundCapture_GetCaps(p,a)                 (p)->GetCaps(a)
    758 #define IDirectSoundCapture_Initialize(p,a)              (p)->Initialize(a)
    759 #endif
    760 
    761 /*****************************************************************************
    762  * IDirectSoundCaptureBuffer interface
    763  */
    764 #define INTERFACE IDirectSoundCaptureBuffer
    765 DECLARE_INTERFACE_(IDirectSoundCaptureBuffer,IUnknown)
    766 {
    767     /*** IUnknown methods ***/
    768     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
    769     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
    770     STDMETHOD_(ULONG,Release)(THIS) PURE;
    771     /*** IDirectSoundCaptureBuffer methods ***/
    772     STDMETHOD(GetCaps)(THIS_ LPDSCBCAPS lpDSCBCaps) PURE;
    773     STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCapturePosition,LPDWORD lpdwReadPosition) PURE;
    774     STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
    775     STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
    776     STDMETHOD(Initialize)(THIS_ LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc) PURE;
    777     STDMETHOD(Lock)(THIS_ DWORD dwReadCusor, DWORD dwReadBytes, LPVOID *lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID *lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE;
    778     STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE;
    779     STDMETHOD(Stop)(THIS) PURE;
    780     STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2) PURE;
    781 };
    782 #undef INTERFACE
    783 
    784 #if !defined(__cplusplus) || defined(CINTERFACE)
    785 /*** IUnknown methods ***/
    786 #define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)     (p)->lpVtbl->QueryInterface(p,a,b)
    787 #define IDirectSoundCaptureBuffer_AddRef(p)                 (p)->lpVtbl->AddRef(p)
    788 #define IDirectSoundCaptureBuffer_Release(p)                (p)->lpVtbl->Release(p)
    789 /*** IDirectSoundCaptureBuffer methods ***/
    790 #define IDirectSoundCaptureBuffer_GetCaps(p,a)              (p)->lpVtbl->GetCaps(p,a)
    791 #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
    792 #define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)        (p)->lpVtbl->GetFormat(p,a,b,c)
    793 #define IDirectSoundCaptureBuffer_GetStatus(p,a)            (p)->lpVtbl->GetStatus(p,a)
    794 #define IDirectSoundCaptureBuffer_Initialize(p,a,b)         (p)->lpVtbl->Initialize(p,a,b)
    795 #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)     (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
    796 #define IDirectSoundCaptureBuffer_Start(p,a)                (p)->lpVtbl->Start(p,a)
    797 #define IDirectSoundCaptureBuffer_Stop(p)                   (p)->lpVtbl->Stop(p)
    798 #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)         (p)->lpVtbl->Unlock(p,a,b,c,d)
    799 #else
    800 /*** IUnknown methods ***/
    801 #define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)     (p)->QueryInterface(a,b)
    802 #define IDirectSoundCaptureBuffer_AddRef(p)                 (p)->AddRef()
    803 #define IDirectSoundCaptureBuffer_Release(p)                (p)->Release()
    804 /*** IDirectSoundCaptureBuffer methods ***/
    805 #define IDirectSoundCaptureBuffer_GetCaps(p,a)              (p)->GetCaps(a)
    806 #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
    807 #define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)        (p)->GetFormat(a,b,c)
    808 #define IDirectSoundCaptureBuffer_GetStatus(p,a)            (p)->GetStatus(a)
    809 #define IDirectSoundCaptureBuffer_Initialize(p,a,b)         (p)->Initialize(a,b)
    810 #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)     (p)->Lock(a,b,c,d,e,f,g)
    811 #define IDirectSoundCaptureBuffer_Start(p,a)                (p)->Start(a)
    812 #define IDirectSoundCaptureBuffer_Stop(p)                   (p)->Stop()
    813 #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)         (p)->Unlock(a,b,c,d)
    814 #endif
    815 
    816 /*****************************************************************************
    817  * IDirectSoundCaptureBuffer8 interface
    818  */
    819 #define INTERFACE IDirectSoundCaptureBuffer8
    820 DECLARE_INTERFACE_(IDirectSoundCaptureBuffer8,IDirectSoundCaptureBuffer)
    821 {
    822     /*** IUnknown methods ***/
    823     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
    824     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
    825     STDMETHOD_(ULONG,Release)(THIS) PURE;
    826     /*** IDirectSoundCaptureBuffer methods ***/
    827     STDMETHOD(GetCaps)(THIS_ LPDSCBCAPS lpDSCBCaps) PURE;
    828     STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCapturePosition,LPDWORD lpdwReadPosition) PURE;
    829     STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
    830     STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
    831     STDMETHOD(Initialize)(THIS_ LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc) PURE;
    832     STDMETHOD(Lock)(THIS_ DWORD dwReadCusor, DWORD dwReadBytes, LPVOID *lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID *lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE;
    833     STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE;
    834     STDMETHOD(Stop)(THIS) PURE;
    835     STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2) PURE;
    836     /*** IDirectSoundCaptureBuffer8 methods ***/
    837     STDMETHOD(GetObjectInPath)(THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
    838     STDMETHOD(GetFXStatus)(THIS_ DWORD dwFXCount, LPDWORD pdwFXStatus) PURE;
    839 };
    840 #undef INTERFACE
    841 
    842 #if !defined(__cplusplus) || defined(CINTERFACE)
    843 /*** IUnknown methods ***/
    844 #define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
    845 #define IDirectSoundCaptureBuffer8_AddRef(p)                  (p)->lpVtbl->AddRef(p)
    846 #define IDirectSoundCaptureBuffer8_Release(p)                 (p)->lpVtbl->Release(p)
    847 /*** IDirectSoundCaptureBuffer methods ***/
    848 #define IDirectSoundCaptureBuffer8_GetCaps(p,a)               (p)->lpVtbl->GetCaps(p,a)
    849 #define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b)  (p)->lpVtbl->GetCurrentPosition(p,a,b)
    850 #define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c)         (p)->lpVtbl->GetFormat(p,a,b,c)
    851 #define IDirectSoundCaptureBuffer8_GetStatus(p,a)             (p)->lpVtbl->GetStatus(p,a)
    852 #define IDirectSoundCaptureBuffer8_Initialize(p,a,b)          (p)->lpVtbl->Initialize(p,a,b)
    853 #define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g)      (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
    854 #define IDirectSoundCaptureBuffer8_Start(p,a)                 (p)->lpVtbl->Start(p,a)
    855 #define IDirectSoundCaptureBuffer8_Stop(p)                    (p)->lpVtbl->Stop(p)
    856 #define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d)          (p)->lpVtbl->Unlock(p,a,b,c,d)
    857 /*** IDirectSoundCaptureBuffer8 methods ***/
    858 #define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
    859 #define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b)         (p)->lpVtbl->GetFXStatus(p,a,b)
    860 #else
    861 /*** IUnknown methods ***/
    862 #define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b)      (p)->QueryInterface(a,b)
    863 #define IDirectSoundCaptureBuffer8_AddRef(p)                  (p)->AddRef()
    864 #define IDirectSoundCaptureBuffer8_Release(p)                 (p)->Release()
    865 /*** IDirectSoundCaptureBuffer methods ***/
    866 #define IDirectSoundCaptureBuffer8_GetCaps(p,a)               (p)->GetCaps(a)
    867 #define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b)  (p)->GetCurrentPosition(a,b)
    868 #define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c)         (p)->GetFormat(a,b,c)
    869 #define IDirectSoundCaptureBuffer8_GetStatus(p,a)             (p)->GetStatus(a)
    870 #define IDirectSoundCaptureBuffer8_Initialize(p,a,b)          (p)->Initialize(a,b)
    871 #define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g)      (p)->Lock(a,b,c,d,e,f,g)
    872 #define IDirectSoundCaptureBuffer8_Start(p,a)                 (p)->Start(a)
    873 #define IDirectSoundCaptureBuffer8_Stop(p)                    (p)->Stop()
    874 #define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d)          (p)->Unlock(a,b,c,d)
    875 /*** IDirectSoundCaptureBuffer8 methods ***/
    876 #define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d)
    877 #define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b)         (p)->GetFXStatus(a,b)
    878 #endif
    879 
    880 /*****************************************************************************
    881  * IDirectSoundNotify interface
    882  */
    883 #define WINE_NOBUFFER                   0x80000000
    884 
    885 #define DSBPN_OFFSETSTOP		-1
    886 
    887 #define INTERFACE IDirectSoundNotify
    888 DECLARE_INTERFACE_(IDirectSoundNotify,IUnknown)
    889 {
    890     /*** IUnknown methods ***/
    891     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
    892     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
    893     STDMETHOD_(ULONG,Release)(THIS) PURE;
    894     /*** IDirectSoundNotify methods ***/
    895     STDMETHOD(SetNotificationPositions)(THIS_ DWORD cPositionNotifies, LPCDSBPOSITIONNOTIFY lpcPositionNotifies) PURE;
    896 };
    897 #undef INTERFACE
    898 
    899 #if !defined(__cplusplus) || defined(CINTERFACE)
    900 /*** IUnknown methods ***/
    901 #define IDirectSoundNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
    902 #define IDirectSoundNotify_AddRef(p)             (p)->lpVtbl->AddRef(p)
    903 #define IDirectSoundNotify_Release(p)            (p)->lpVtbl->Release(p)
    904 /*** IDirectSoundNotify methods ***/
    905 #define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
    906 #else
    907 /*** IUnknown methods ***/
    908 #define IDirectSoundNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
    909 #define IDirectSoundNotify_AddRef(p)             (p)->AddRef()
    910 #define IDirectSoundNotify_Release(p)            (p)->Release()
    911 /*** IDirectSoundNotify methods ***/
    912 #define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b)
    913 #endif
    914 
    915 
    916 /*****************************************************************************
    917  * IDirectSound3DListener interface
    918  */
    919 #define DS3DMODE_NORMAL             0x00000000
    920 #define DS3DMODE_HEADRELATIVE       0x00000001
    921 #define DS3DMODE_DISABLE            0x00000002
    922 
    923 #define DS3D_IMMEDIATE              0x00000000
    924 #define DS3D_DEFERRED               0x00000001
    925 
    926 #define DS3D_MINDISTANCEFACTOR      FLT_MIN
    927 #define DS3D_MAXDISTANCEFACTOR      FLT_MAX
    928 #define DS3D_DEFAULTDISTANCEFACTOR  1.0f
    929 
    930 #define DS3D_MINROLLOFFFACTOR       0.0f
    931 #define DS3D_MAXROLLOFFFACTOR       10.0f
    932 #define DS3D_DEFAULTROLLOFFFACTOR   1.0f
    933 
    934 #define DS3D_MINDOPPLERFACTOR       0.0f
    935 #define DS3D_MAXDOPPLERFACTOR       10.0f
    936 #define DS3D_DEFAULTDOPPLERFACTOR   1.0f
    937 
    938 #define DS3D_DEFAULTMINDISTANCE     1.0f
    939 #define DS3D_DEFAULTMAXDISTANCE     1000000000.0f
    940 
    941 #define DS3D_MINCONEANGLE           0
    942 #define DS3D_MAXCONEANGLE           360
    943 #define DS3D_DEFAULTCONEANGLE       360
    944 
    945 #define DS3D_DEFAULTCONEOUTSIDEVOLUME   DSBVOLUME_MAX
    946 
    947 typedef struct _DS3DLISTENER {
    948 	DWORD				dwSize;
    949 	D3DVECTOR			vPosition;
    950 	D3DVECTOR			vVelocity;
    951 	D3DVECTOR			vOrientFront;
    952 	D3DVECTOR			vOrientTop;
    953 	D3DVALUE			flDistanceFactor;
    954 	D3DVALUE			flRolloffFactor;
    955 	D3DVALUE			flDopplerFactor;
    956 } DS3DLISTENER, *LPDS3DLISTENER;
    957 
    958 typedef const DS3DLISTENER *LPCDS3DLISTENER;
    959 
    960 #define INTERFACE IDirectSound3DListener
    961 DECLARE_INTERFACE_(IDirectSound3DListener,IUnknown)
    962 {
    963     /*** IUnknown methods ***/
    964     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
    965     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
    966     STDMETHOD_(ULONG,Release)(THIS) PURE;
    967     /*** IDirectSound3DListener methods ***/
    968     STDMETHOD(GetAllParameters)(THIS_ LPDS3DLISTENER lpListener) PURE;
    969     STDMETHOD(GetDistanceFactor)(THIS_ LPD3DVALUE lpflDistanceFactor) PURE;
    970     STDMETHOD(GetDopplerFactor)(THIS_ LPD3DVALUE lpflDopplerFactor) PURE;
    971     STDMETHOD(GetOrientation)(THIS_ LPD3DVECTOR lpvOrientFront, LPD3DVECTOR lpvOrientTop) PURE;
    972     STDMETHOD(GetPosition)(THIS_ LPD3DVECTOR lpvPosition) PURE;
    973     STDMETHOD(GetRolloffFactor)(THIS_ LPD3DVALUE lpflRolloffFactor) PURE;
    974     STDMETHOD(GetVelocity)(THIS_ LPD3DVECTOR lpvVelocity) PURE;
    975     STDMETHOD(SetAllParameters)(THIS_ LPCDS3DLISTENER lpcListener, DWORD dwApply) PURE;
    976     STDMETHOD(SetDistanceFactor)(THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE;
    977     STDMETHOD(SetDopplerFactor)(THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE;
    978     STDMETHOD(SetOrientation)(THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront, D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE;
    979     STDMETHOD(SetPosition)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
    980     STDMETHOD(SetRolloffFactor)(THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE;
    981     STDMETHOD(SetVelocity)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
    982     STDMETHOD(CommitDeferredSettings)(THIS) PURE;
    983 };
    984 #undef INTERFACE
    985 
    986 #if !defined(__cplusplus) || defined(CINTERFACE)
    987 /*** IUnknown methods ***/
    988 #define IDirectSound3DListener_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
    989 #define IDirectSound3DListener_AddRef(p)             (p)->lpVtbl->AddRef(p)
    990 #define IDirectSound3DListener_Release(p)            (p)->lpVtbl->Release(p)
    991 /*** IDirectSound3DListener methods ***/
    992 #define IDirectSound3DListener_GetAllParameters(p,a)           (p)->lpVtbl->GetAllParameters(p,a)
    993 #define IDirectSound3DListener_GetDistanceFactor(p,a)          (p)->lpVtbl->GetDistanceFactor(p,a)
    994 #define IDirectSound3DListener_GetDopplerFactor(p,a)           (p)->lpVtbl->GetDopplerFactor(p,a)
    995 #define IDirectSound3DListener_GetOrientation(p,a,b)           (p)->lpVtbl->GetOrientation(p,a,b)
    996 #define IDirectSound3DListener_GetPosition(p,a)                (p)->lpVtbl->GetPosition(p,a)
    997 #define IDirectSound3DListener_GetRolloffFactor(p,a)           (p)->lpVtbl->GetRolloffFactor(p,a)
    998 #define IDirectSound3DListener_GetVelocity(p,a)                (p)->lpVtbl->GetVelocity(p,a)
    999 #define IDirectSound3DListener_SetAllParameters(p,a,b)         (p)->lpVtbl->SetAllParameters(p,a,b)
   1000 #define IDirectSound3DListener_SetDistanceFactor(p,a,b)        (p)->lpVtbl->SetDistanceFactor(p,a,b)
   1001 #define IDirectSound3DListener_SetDopplerFactor(p,a,b)         (p)->lpVtbl->SetDopplerFactor(p,a,b)
   1002 #define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
   1003 #define IDirectSound3DListener_SetPosition(p,a,b,c,d)          (p)->lpVtbl->SetPosition(p,a,b,c,d)
   1004 #define IDirectSound3DListener_SetRolloffFactor(p,a,b)         (p)->lpVtbl->SetRolloffFactor(p,a,b)
   1005 #define IDirectSound3DListener_SetVelocity(p,a,b,c,d)          (p)->lpVtbl->SetVelocity(p,a,b,c,d)
   1006 #define IDirectSound3DListener_CommitDeferredSettings(p)       (p)->lpVtbl->CommitDeferredSettings(p)
   1007 #else
   1008 /*** IUnknown methods ***/
   1009 #define IDirectSound3DListener_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   1010 #define IDirectSound3DListener_AddRef(p)             (p)->AddRef()
   1011 #define IDirectSound3DListener_Release(p)            (p)->Release()
   1012 /*** IDirectSound3DListener methods ***/
   1013 #define IDirectSound3DListener_GetAllParameters(p,a)           (p)->GetAllParameters(a)
   1014 #define IDirectSound3DListener_GetDistanceFactor(p,a)          (p)->GetDistanceFactor(a)
   1015 #define IDirectSound3DListener_GetDopplerFactor(p,a)           (p)->GetDopplerFactor(a)
   1016 #define IDirectSound3DListener_GetOrientation(p,a,b)           (p)->GetOrientation(a,b)
   1017 #define IDirectSound3DListener_GetPosition(p,a)                (p)->GetPosition(a)
   1018 #define IDirectSound3DListener_GetRolloffFactor(p,a)           (p)->GetRolloffFactor(a)
   1019 #define IDirectSound3DListener_GetVelocity(p,a)                (p)->GetVelocity(a)
   1020 #define IDirectSound3DListener_SetAllParameters(p,a,b)         (p)->SetAllParameters(a,b)
   1021 #define IDirectSound3DListener_SetDistanceFactor(p,a,b)        (p)->SetDistanceFactor(a,b)
   1022 #define IDirectSound3DListener_SetDopplerFactor(p,a,b)         (p)->SetDopplerFactor(a,b)
   1023 #define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g)
   1024 #define IDirectSound3DListener_SetPosition(p,a,b,c,d)          (p)->SetPosition(a,b,c,d)
   1025 #define IDirectSound3DListener_SetRolloffFactor(p,a,b)         (p)->SetRolloffFactor(a,b)
   1026 #define IDirectSound3DListener_SetVelocity(p,a,b,c,d)          (p)->SetVelocity(a,b,c,d)
   1027 #define IDirectSound3DListener_CommitDeferredSettings(p)       (p)->CommitDeferredSettings()
   1028 #endif
   1029 
   1030 
   1031 /*****************************************************************************
   1032  * IDirectSound3DBuffer interface
   1033  */
   1034 typedef struct  _DS3DBUFFER {
   1035 	DWORD				dwSize;
   1036 	D3DVECTOR			vPosition;
   1037 	D3DVECTOR			vVelocity;
   1038 	DWORD				dwInsideConeAngle;
   1039 	DWORD				dwOutsideConeAngle;
   1040 	D3DVECTOR			vConeOrientation;
   1041 	LONG				lConeOutsideVolume;
   1042 	D3DVALUE			flMinDistance;
   1043 	D3DVALUE			flMaxDistance;
   1044 	DWORD				dwMode;
   1045 } DS3DBUFFER, *LPDS3DBUFFER;
   1046 
   1047 typedef const DS3DBUFFER *LPCDS3DBUFFER;
   1048 
   1049 #define INTERFACE IDirectSound3DBuffer
   1050 DECLARE_INTERFACE_(IDirectSound3DBuffer,IUnknown)
   1051 {
   1052     /*** IUnknown methods ***/
   1053     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   1054     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   1055     STDMETHOD_(ULONG,Release)(THIS) PURE;
   1056     /*** IDirectSound3DBuffer methods ***/
   1057     STDMETHOD(GetAllParameters)(THIS_ LPDS3DBUFFER lpDs3dBuffer) PURE;
   1058     STDMETHOD(GetConeAngles)(THIS_ LPDWORD lpdwInsideConeAngle, LPDWORD lpdwOutsideConeAngle) PURE;
   1059     STDMETHOD(GetConeOrientation)(THIS_ LPD3DVECTOR lpvOrientation) PURE;
   1060     STDMETHOD(GetConeOutsideVolume)(THIS_ LPLONG lplConeOutsideVolume) PURE;
   1061     STDMETHOD(GetMaxDistance)(THIS_ LPD3DVALUE lpflMaxDistance) PURE;
   1062     STDMETHOD(GetMinDistance)(THIS_ LPD3DVALUE lpflMinDistance) PURE;
   1063     STDMETHOD(GetMode)(THIS_ LPDWORD lpwdMode) PURE;
   1064     STDMETHOD(GetPosition)(THIS_ LPD3DVECTOR lpvPosition) PURE;
   1065     STDMETHOD(GetVelocity)(THIS_ LPD3DVECTOR lpvVelocity) PURE;
   1066     STDMETHOD(SetAllParameters)(THIS_ LPCDS3DBUFFER lpcDs3dBuffer, DWORD dwApply) PURE;
   1067     STDMETHOD(SetConeAngles)(THIS_ DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) PURE;
   1068     STDMETHOD(SetConeOrientation)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
   1069     STDMETHOD(SetConeOutsideVolume)(THIS_ LONG lConeOutsideVolume, DWORD dwApply) PURE;
   1070     STDMETHOD(SetMaxDistance)(THIS_ D3DVALUE flMaxDistance, DWORD dwApply) PURE;
   1071     STDMETHOD(SetMinDistance)(THIS_ D3DVALUE flMinDistance, DWORD dwApply) PURE;
   1072     STDMETHOD(SetMode)(THIS_ DWORD dwMode, DWORD dwApply) PURE;
   1073     STDMETHOD(SetPosition)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
   1074     STDMETHOD(SetVelocity)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
   1075 };
   1076 #undef INTERFACE
   1077 
   1078 #if !defined(__cplusplus) || defined(CINTERFACE)
   1079 /*** IUnknown methods ***/
   1080 #define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   1081 #define IDirectSound3DBuffer_AddRef(p)             (p)->lpVtbl->AddRef(p)
   1082 #define IDirectSound3DBuffer_Release(p)            (p)->lpVtbl->Release(p)
   1083 /*** IDirectSound3DBuffer methods ***/
   1084 #define IDirectSound3DBuffer_GetAllParameters(p,a)         (p)->lpVtbl->GetAllParameters(p,a)
   1085 #define IDirectSound3DBuffer_GetConeAngles(p,a,b)          (p)->lpVtbl->GetConeAngles(p,a,b)
   1086 #define IDirectSound3DBuffer_GetConeOrientation(p,a)       (p)->lpVtbl->GetConeOrientation(p,a)
   1087 #define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)     (p)->lpVtbl->GetConeOutsideVolume(p,a)
   1088 #define IDirectSound3DBuffer_GetMaxDistance(p,a)           (p)->lpVtbl->GetMaxDistance(p,a)
   1089 #define IDirectSound3DBuffer_GetMinDistance(p,a)           (p)->lpVtbl->GetMinDistance(p,a)
   1090 #define IDirectSound3DBuffer_GetMode(p,a)                  (p)->lpVtbl->GetMode(p,a)
   1091 #define IDirectSound3DBuffer_GetPosition(p,a)              (p)->lpVtbl->GetPosition(p,a)
   1092 #define IDirectSound3DBuffer_GetVelocity(p,a)              (p)->lpVtbl->GetVelocity(p,a)
   1093 #define IDirectSound3DBuffer_SetAllParameters(p,a,b)       (p)->lpVtbl->SetAllParameters(p,a,b)
   1094 #define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)        (p)->lpVtbl->SetConeAngles(p,a,b,c)
   1095 #define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
   1096 #define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)   (p)->lpVtbl->SetConeOutsideVolume(p,a,b)
   1097 #define IDirectSound3DBuffer_SetMaxDistance(p,a,b)         (p)->lpVtbl->SetMaxDistance(p,a,b)
   1098 #define IDirectSound3DBuffer_SetMinDistance(p,a,b)         (p)->lpVtbl->SetMinDistance(p,a,b)
   1099 #define IDirectSound3DBuffer_SetMode(p,a,b)                (p)->lpVtbl->SetMode(p,a,b)
   1100 #define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)        (p)->lpVtbl->SetPosition(p,a,b,c,d)
   1101 #define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)        (p)->lpVtbl->SetVelocity(p,a,b,c,d)
   1102 #else
   1103 /*** IUnknown methods ***/
   1104 #define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   1105 #define IDirectSound3DBuffer_AddRef(p)             (p)->AddRef()
   1106 #define IDirectSound3DBuffer_Release(p)            (p)->Release()
   1107 /*** IDirectSound3DBuffer methods ***/
   1108 #define IDirectSound3DBuffer_GetAllParameters(p,a)         (p)->GetAllParameters(a)
   1109 #define IDirectSound3DBuffer_GetConeAngles(p,a,b)          (p)->GetConeAngles(a,b)
   1110 #define IDirectSound3DBuffer_GetConeOrientation(p,a)       (p)->GetConeOrientation(a)
   1111 #define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)     (p)->GetConeOutsideVolume(a)
   1112 #define IDirectSound3DBuffer_GetMaxDistance(p,a)           (p)->GetMaxDistance(a)
   1113 #define IDirectSound3DBuffer_GetMinDistance(p,a)           (p)->GetMinDistance(a)
   1114 #define IDirectSound3DBuffer_GetMode(p,a)                  (p)->GetMode(a)
   1115 #define IDirectSound3DBuffer_GetPosition(p,a)              (p)->GetPosition(a)
   1116 #define IDirectSound3DBuffer_GetVelocity(p,a)              (p)->GetVelocity(a)
   1117 #define IDirectSound3DBuffer_SetAllParameters(p,a,b)       (p)->SetAllParameters(a,b)
   1118 #define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)        (p)->SetConeAngles(a,b,c)
   1119 #define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
   1120 #define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)   (p)->SetConeOutsideVolume(a,b)
   1121 #define IDirectSound3DBuffer_SetMaxDistance(p,a,b)         (p)->SetMaxDistance(a,b)
   1122 #define IDirectSound3DBuffer_SetMinDistance(p,a,b)         (p)->SetMinDistance(a,b)
   1123 #define IDirectSound3DBuffer_SetMode(p,a,b)                (p)->SetMode(a,b)
   1124 #define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)        (p)->SetPosition(a,b,c,d)
   1125 #define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)        (p)->SetVelocity(a,b,c,d)
   1126 #endif
   1127 
   1128 /*****************************************************************************
   1129  * IKsPropertySet interface
   1130  */
   1131 #ifndef _IKsPropertySet_
   1132 #define _IKsPropertySet_
   1133 
   1134 typedef struct IKsPropertySet *LPKSPROPERTYSET;
   1135 
   1136 DEFINE_GUID(IID_IKsPropertySet,0x31EFAC30,0x515C,0x11D0,0xA9,0xAA,0x00,0xAA,0x00,0x61,0xBE,0x93);
   1137 
   1138 #define KSPROPERTY_SUPPORT_GET	1
   1139 #define KSPROPERTY_SUPPORT_SET	2
   1140 
   1141 #define INTERFACE IKsPropertySet
   1142 DECLARE_INTERFACE_(IKsPropertySet,IUnknown)
   1143 {
   1144     /*** IUnknown methods ***/
   1145     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   1146     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   1147     STDMETHOD_(ULONG,Release)(THIS) PURE;
   1148     /*** IKsPropertySet methods ***/
   1149     STDMETHOD(Get)(THIS_ REFGUID rgid,ULONG x1,LPVOID p1,ULONG x2,LPVOID p2,ULONG x3,ULONG *px4) PURE;
   1150     STDMETHOD(Set)(THIS_ REFGUID rgid,ULONG x1,LPVOID p1,ULONG x2,LPVOID p2,ULONG x3) PURE;
   1151     STDMETHOD(QuerySupport)(THIS_ REFGUID rgid,ULONG x1,ULONG *px2) PURE;
   1152 };
   1153 #undef INTERFACE
   1154 
   1155 #if !defined(__cplusplus) || defined(CINTERFACE)
   1156 /*** IUnknown methods ***/
   1157 #define IKsPropertySet_QueryInterface(p,a,b)    (p)->lpVtbl->QueryInterface(p,a,b)
   1158 #define IKsPropertySet_AddRef(p)                (p)->lpVtbl->AddRef(p)
   1159 #define IKsPropertySet_Release(p)               (p)->lpVtbl->Release(p)
   1160 /*** IKsPropertySet methods ***/
   1161 #define IKsPropertySet_Get(p,a,b,c,d,e,f,g)     (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
   1162 #define IKsPropertySet_Set(p,a,b,c,d,e,f)       (p)->lpVtbl->Set(p,a,b,c,d,e,f)
   1163 #define IKsPropertySet_QuerySupport(p,a,b,c)    (p)->lpVtbl->QuerySupport(p,a,b,c)
   1164 #else
   1165 /*** IUnknown methods ***/
   1166 #define IKsPropertySet_QueryInterface(p,a,b)    (p)->QueryInterface(a,b)
   1167 #define IKsPropertySet_AddRef(p)                (p)->AddRef()
   1168 #define IKsPropertySet_Release(p)               (p)->Release()
   1169 /*** IKsPropertySet methods ***/
   1170 #define IKsPropertySet_Get(p,a,b,c,d,e,f,g)     (p)->Get(a,b,c,d,e,f,g)
   1171 #define IKsPropertySet_Set(p,a,b,c,d,e,f)       (p)->Set(a,b,c,d,e,f)
   1172 #define IKsPropertySet_QuerySupport(p,a,b,c)    (p)->QuerySupport(a,b,c)
   1173 #endif
   1174 
   1175 #endif /* _IKsPropertySet_ */
   1176 
   1177 /*****************************************************************************
   1178  * IDirectSoundFullDuplex interface
   1179  */
   1180 #define INTERFACE IDirectSoundFullDuplex
   1181 DECLARE_INTERFACE_(IDirectSoundFullDuplex,IUnknown)
   1182 {
   1183     /*** IUnknown methods ***/
   1184     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   1185     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   1186     STDMETHOD_(ULONG,Release)(THIS) PURE;
   1187     /*** IDirectSoundFullDuplex methods ***/
   1188     STDMETHOD(Initialize)(THIS_ LPCGUID pCaptureGuid,LPCGUID pRendererGuid,LPCDSCBUFFERDESC lpDscBufferDesc,LPCDSBUFFERDESC lpDsBufferDesc,HWND hWnd,DWORD dwLevel,LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8,LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8) PURE;
   1189 };
   1190 #undef INTERFACE
   1191 
   1192 #if !defined(__cplusplus) || defined(CINTERFACE)
   1193 /*** IUnknown methods ***/
   1194 #define IDirectSoundFullDuplex_QueryInterface(p,a,b)    (p)->lpVtbl->QueryInterface(p,a,b)
   1195 #define IDirectSoundFullDuplex_AddRef(p)                (p)->lpVtbl->AddRef(p)
   1196 #define IDirectSoundFullDuplex_Release(p)               (p)->lpVtbl->Release(p)
   1197 /*** IDirectSoundFullDuplex methods ***/
   1198 #define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h)    (p)->lpVtbl->Initialize(p,a,b,c,d,e,f,g,h)
   1199 #else
   1200 /*** IUnknown methods ***/
   1201 #define IDirectSoundFullDuplex_QueryInterface(p,a,b)    (p)->QueryInterface(a,b)
   1202 #define IDirectSoundFullDuplex_AddRef(p)                (p)->AddRef()
   1203 #define IDirectSoundFullDuplex_Release(p)               (p)->Release()
   1204 /*** IDirectSoundFullDuplex methods ***/
   1205 #define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h)    (p)->Initialize(a,b,c,d,e,f,g,h)
   1206 #endif
   1207 
   1208 #ifdef __cplusplus
   1209 } /* extern "C" */
   1210 #endif /* defined(__cplusplus) */
   1211 
   1212 #endif /* __DSOUND_INCLUDED__ */
   1213