1 #ifndef __WINE_DSOUND_H
2 #define __WINE_DSOUND_H
6 DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
8 DEFINE_GUID(IID_IDirectSound, 0x279AFA83,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
9 DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
10 DEFINE_GUID(IID_IDirectSoundNotify, 0xB0210783,0x89cd,0x11d0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
11 DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
12 DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
13 DEFINE_GUID(IID_IDirectSoundCapture, 0xB0210781,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
14 DEFINE_GUID(IID_IDirectSoundCaptureBuffer,0xB0210782,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
15 DEFINE_GUID(IID_IKsPropertySet, 0x31EFAC30,0x515C,0x11D0,0xA9,0xAA,0x00,0xAA,0x00,0x61,0xBE,0x93);
19 typedef struct IDirectSound IDirectSound,*LPDIRECTSOUND;
20 typedef struct IDirectSoundNotify IDirectSoundNotify,*LPDIRECTSOUNDNOTIFY;
21 typedef struct IDirectSoundBuffer IDirectSoundBuffer,*LPDIRECTSOUNDBUFFER,**LPLPDIRECTSOUNDBUFFER;
24 #define MAKE_DSHRESULT(code) MAKE_HRESULT(1,_FACDS,code)
27 #define DSERR_ALLOCATED MAKE_DSHRESULT(10)
28 #define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30)
29 #define DSERR_INVALIDPARAM E_INVALIDARG
30 #define DSERR_INVALIDCALL MAKE_DSHRESULT(50)
31 #define DSERR_GENERIC E_FAIL
32 #define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70)
33 #define DSERR_OUTOFMEMORY E_OUTOFMEMORY
34 #define DSERR_BADFORMAT MAKE_DSHRESULT(100)
35 #define DSERR_UNSUPPORTED E_NOTIMPL
36 #define DSERR_NODRIVER MAKE_DSHRESULT(120)
37 #define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130)
38 #define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION
39 #define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
40 #define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160)
41 #define DSERR_UNINITIALIZED MAKE_DSHRESULT(170)
43 #define DSCAPS_PRIMARYMONO 0x00000001
44 #define DSCAPS_PRIMARYSTEREO 0x00000002
45 #define DSCAPS_PRIMARY8BIT 0x00000004
46 #define DSCAPS_PRIMARY16BIT 0x00000008
47 #define DSCAPS_CONTINUOUSRATE 0x00000010
48 #define DSCAPS_EMULDRIVER 0x00000020
49 #define DSCAPS_CERTIFIED 0x00000040
50 #define DSCAPS_SECONDARYMONO 0x00000100
51 #define DSCAPS_SECONDARYSTEREO 0x00000200
52 #define DSCAPS_SECONDARY8BIT 0x00000400
53 #define DSCAPS_SECONDARY16BIT 0x00000800
55 #define DSSCL_NORMAL 1
56 #define DSSCL_PRIORITY 2
57 #define DSSCL_EXCLUSIVE 3
58 #define DSSCL_WRITEPRIMARY 4
60 typedef struct _DSCAPS
64 DWORD dwMinSecondarySampleRate;
65 DWORD dwMaxSecondarySampleRate;
66 DWORD dwPrimaryBuffers;
67 DWORD dwMaxHwMixingAllBuffers;
68 DWORD dwMaxHwMixingStaticBuffers;
69 DWORD dwMaxHwMixingStreamingBuffers;
70 DWORD dwFreeHwMixingAllBuffers;
71 DWORD dwFreeHwMixingStaticBuffers;
72 DWORD dwFreeHwMixingStreamingBuffers;
73 DWORD dwMaxHw3DAllBuffers;
74 DWORD dwMaxHw3DStaticBuffers;
75 DWORD dwMaxHw3DStreamingBuffers;
76 DWORD dwFreeHw3DAllBuffers;
77 DWORD dwFreeHw3DStaticBuffers;
78 DWORD dwFreeHw3DStreamingBuffers;
79 DWORD dwTotalHwMemBytes;
80 DWORD dwFreeHwMemBytes;
81 DWORD dwMaxContigFreeHwMemBytes;
82 DWORD dwUnlockTransferRateHwBuffers;
83 DWORD dwPlayCpuOverheadSwBuffers;
88 #define DSBPLAY_LOOPING 0x00000001
90 #define DSBSTATUS_PLAYING 0x00000001
91 #define DSBSTATUS_BUFFERLOST 0x00000002
92 #define DSBSTATUS_LOOPING 0x00000004
95 #define DSBLOCK_FROMWRITECURSOR 0x00000001
97 #define DSBCAPS_PRIMARYBUFFER 0x00000001
98 #define DSBCAPS_STATIC 0x00000002
99 #define DSBCAPS_LOCHARDWARE 0x00000004
100 #define DSBCAPS_LOCSOFTWARE 0x00000008
101 #define DSBCAPS_CTRLFREQUENCY 0x00000020
102 #define DSBCAPS_CTRLPAN 0x00000040
103 #define DSBCAPS_CTRLVOLUME 0x00000080
104 #define DSBCAPS_CTRLDEFAULT 0x000000E0 /* Pan + volume + frequency. */
105 #define DSBCAPS_CTRLALL 0x000000E0 /* All control capabilities */
106 #define DSBCAPS_STICKYFOCUS 0x00004000
107 #define DSBCAPS_GETCURRENTPOSITION2 0x00010000 /* More accurate play cursor under emulation*/
109 typedef struct _DSBCAPS
114 DWORD dwUnlockTransferRate;
115 DWORD dwPlayCpuOverhead;
116 } DSBCAPS,*LPDSBCAPS;
118 #define DSSCL_NORMAL 1
119 #define DSSCL_PRIORITY 2
120 #define DSSCL_EXCLUSIVE 3
121 #define DSSCL_WRITEPRIMARY 4
123 typedef struct _DSBUFFERDESC
129 LPWAVEFORMATEX lpwfxFormat;
130 } DSBUFFERDESC,*LPDSBUFFERDESC;
132 typedef struct _DSBPOSITIONNOTIFY
135 HANDLE32 hEventNotify;
136 } DSBPOSITIONNOTIFY,*LPDSBPOSITIONNOTIFY;
138 typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
140 #define DSSPEAKER_HEADPHONE 1
141 #define DSSPEAKER_MONO 2
142 #define DSSPEAKER_QUAD 3
143 #define DSSPEAKER_STEREO 4
144 #define DSSPEAKER_SURROUND 5
147 typedef LPVOID* LPLPVOID;
149 typedef BOOL32 (CALLBACK *LPDSENUMCALLBACK32W)(LPGUID,LPWSTR,LPWSTR,LPVOID);
150 typedef BOOL32 (CALLBACK *LPDSENUMCALLBACK32A)(LPGUID,LPSTR,LPSTR,LPVOID);
152 extern HRESULT WINAPI DirectSoundCreate(LPGUID lpGUID,LPDIRECTSOUND * ppDS,IUnknown *pUnkOuter );
154 #define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
155 #define STDMETHOD_(ret,xfn) ret (CALLBACK *fn##xfn)
160 #define THIS LPDIRECTSOUND this
161 typedef struct tagLPDIRECTSOUND_VTABLE
163 /*** IUnknown methods ***/
164 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
165 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
166 STDMETHOD_(ULONG,Release) (THIS) PURE;
167 /*** IDirectSound methods ***/
169 STDMETHOD( CreateSoundBuffer)(THIS_ LPDSBUFFERDESC, LPLPDIRECTSOUNDBUFFER, IUnknown FAR *) PURE;
170 STDMETHOD( GetCaps)(THIS_ LPDSCAPS ) PURE;
171 STDMETHOD( DuplicateSoundBuffer)(THIS_ LPDIRECTSOUNDBUFFER, LPLPDIRECTSOUNDBUFFER ) PURE;
172 STDMETHOD( SetCooperativeLevel)(THIS_ HWND32, DWORD ) PURE;
173 STDMETHOD( Compact)(THIS ) PURE;
174 STDMETHOD( GetSpeakerConfig)(THIS_ LPDWORD ) PURE;
175 STDMETHOD( SetSpeakerConfig)(THIS_ DWORD ) PURE;
176 STDMETHOD( Initialize)(THIS_ GUID FAR * ) PURE;
177 } *LPDIRECTSOUND_VTABLE;
179 struct IDirectSound {
180 LPDIRECTSOUND_VTABLE lpvtbl;
183 LPDIRECTSOUNDBUFFER *buffers;
184 WAVEFORMATEX wfx; /* current main waveformat */
188 #define THIS LPDIRECTSOUNDBUFFER this
189 typedef struct tagLPDIRECTSOUNDBUFFER_VTABLE
191 /*** IUnknown methods ***/
192 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
193 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
194 STDMETHOD_(ULONG,Release) (THIS) PURE;
195 /*** IDirectSoundBuffer methods ***/
197 STDMETHOD( GetCaps)(THIS_ LPDSBCAPS ) PURE;
198 STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD,LPDWORD ) PURE;
199 STDMETHOD( GetFormat)(THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) PURE;
200 STDMETHOD( GetVolume)(THIS_ LPLONG ) PURE;
201 STDMETHOD( GetPan)(THIS_ LPLONG ) PURE;
202 STDMETHOD( GetFrequency)(THIS_ LPDWORD ) PURE;
203 STDMETHOD( GetStatus)(THIS_ LPDWORD ) PURE;
204 STDMETHOD( Initialize)(THIS_ LPDIRECTSOUND, LPDSBUFFERDESC ) PURE;
205 STDMETHOD( Lock)(THIS_ DWORD,DWORD,LPVOID,LPDWORD,LPVOID,LPDWORD,DWORD ) PURE;
206 STDMETHOD( Play)(THIS_ DWORD,DWORD,DWORD ) PURE;
207 STDMETHOD(SetCurrentPosition)(THIS_ DWORD ) PURE;
208 STDMETHOD( SetFormat)(THIS_ LPWAVEFORMATEX ) PURE;
209 STDMETHOD( SetVolume)(THIS_ LONG ) PURE;
210 STDMETHOD( SetPan)(THIS_ LONG ) PURE;
211 STDMETHOD( SetFrequency)(THIS_ DWORD ) PURE;
212 STDMETHOD( Stop)(THIS ) PURE;
213 STDMETHOD( Unlock)(THIS_ LPVOID,DWORD,LPVOID,DWORD ) PURE;
214 STDMETHOD( Restore)(THIS ) PURE;
215 } *LPDIRECTSOUNDBUFFER_VTABLE;
217 struct IDirectSoundBuffer {
218 LPDIRECTSOUNDBUFFER_VTABLE lpvtbl;
222 DWORD playflags,playing,playpos,writepos,buflen;
224 LPDIRECTSOUND dsound;
226 LPDSBPOSITIONNOTIFY notifies;
232 #define THIS LPDIRECTSOUNDNOTIFY this
233 typedef struct IDirectSoundNotify_VTable {
234 /* IUnknown methods */
235 STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
236 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
237 STDMETHOD_(ULONG,Release) (THIS) PURE;
239 /* IDirectSoundNotify methods */
240 STDMETHOD(SetNotificationPositions) (THIS_ DWORD, LPCDSBPOSITIONNOTIFY) PURE;
241 } *LPDIRECTSOUNDNOTIFY_VTABLE,IDirectSoundNotify_VTable;
243 struct IDirectSoundNotify {
244 LPDIRECTSOUNDNOTIFY_VTABLE lpvtbl;
246 LPDIRECTSOUNDBUFFER dsb;
255 /* DirectPlayLobby stuff */
256 /* {AF465C71-9588-11cf-A020-00AA006157AC} */
257 DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
258 /* {26C66A70-B367-11cf-A024-00AA006157AC} */
259 DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
260 /* {0194C220-A303-11d0-9C4F-00A0C905425E} */
261 DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
262 /* {1BB4AF80-A303-11d0-9C4F-00A0C905425E} */
263 DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
264 /* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} */
265 DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
267 typedef struct IDirectPlayLobby *LPDIRECTPLAYLOBBY;
268 typedef struct IDirectPlayLobby *LPDIRECTPLAYLOBBYA;
269 typedef struct IDirectPlayLobby IDirectPlayLobbyA;
271 typedef struct IDirectPlayLobby2 *LPDIRECTPLAYLOBBY2;
272 typedef struct IDirectPlayLobby2 *LPDIRECTPLAYLOBBY2A;
273 typedef struct IDirectPlayLobby2 IDirectPlayLobby2A;
275 extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD );
277 extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA *, IUnknown *, LPVOID, DWORD );