1
|
1 module win32.directx.dsound8;
|
|
2
|
|
3 //import tango.sys.win32.Types;
|
|
4 import win32.windows;
|
|
5
|
|
6 alias GUID* LPCGUID;
|
|
7
|
|
8 interface IUnknown
|
|
9 {
|
|
10 HRESULT QueryInterface(IID* riid, void** pvObject);
|
|
11 ULONG AddRef();
|
|
12 ULONG Release();
|
|
13 }
|
|
14
|
|
15 alias IUnknown LPUNKNOWN;
|
|
16
|
|
17 interface IDirectSound : IUnknown
|
|
18 {
|
|
19 extern(Windows):
|
|
20
|
|
21 // IDirectSound methods
|
|
22 HRESULT CreateSoundBuffer (LPCDSBUFFERDESC pcDSBufferDesc, LPDIRECTSOUNDBUFFER *ppDSBuffer, LPUNKNOWN pUnkOuter);
|
|
23 HRESULT GetCaps (LPDSCAPS pDSCaps);
|
|
24 HRESULT DuplicateSoundBuffer (LPDIRECTSOUNDBUFFER pDSBufferOriginal, LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate);
|
|
25 HRESULT SetCooperativeLevel (HWND hwnd, DWORD dwLevel);
|
|
26 HRESULT Compact ();
|
|
27 HRESULT GetSpeakerConfig (LPDWORD pdwSpeakerConfig);
|
|
28 HRESULT SetSpeakerConfig (DWORD dwSpeakerConfig);
|
|
29 HRESULT Initialize (LPCGUID pcGuidDevice);
|
|
30 }
|
|
31
|
|
32 alias IDirectSound LPDIRECTSOUND;
|
|
33
|
|
34 interface IDirectSound8 : IDirectSound
|
|
35 {
|
|
36 extern(Windows):
|
|
37
|
|
38 // IDirectSound8 methods
|
|
39 HRESULT VerifyCertification (LPDWORD pdwCertified);
|
|
40 }
|
|
41
|
|
42 alias IDirectSound8 LPDIRECTSOUND8;
|
|
43
|
|
44 interface IDirectSoundBuffer : IUnknown
|
|
45 {
|
|
46 extern(Windows):
|
|
47
|
|
48 // IDirectSoundBuffer methods
|
|
49 HRESULT GetCaps (LPDSBCAPS pDSBufferCaps);
|
|
50 HRESULT GetCurrentPosition (LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor);
|
|
51 HRESULT GetFormat (LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten);
|
|
52 HRESULT GetVolume (LPLONG plVolume);
|
|
53 HRESULT GetPan (LPLONG plPan);
|
|
54 HRESULT GetFrequency (LPDWORD pdwFrequency);
|
|
55 HRESULT GetStatus (LPDWORD pdwStatus);
|
|
56 HRESULT Initialize (LPDIRECTSOUND pDirectSound, LPCDSBUFFERDESC pcDSBufferDesc);
|
|
57 HRESULT Lock (DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
|
|
58 LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags);
|
|
59 HRESULT Play (DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags);
|
|
60 HRESULT SetCurrentPosition (DWORD dwNewPosition);
|
|
61 HRESULT SetFormat (LPCWAVEFORMATEX pcfxFormat);
|
|
62 HRESULT SetVolume (LONG lVolume);
|
|
63 HRESULT SetPan (LONG lPan);
|
|
64 HRESULT SetFrequency (DWORD dwFrequency);
|
|
65 HRESULT Stop ();
|
|
66 HRESULT Unlock (LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2);
|
|
67 HRESULT Restore ();
|
|
68 }
|
|
69
|
|
70 alias IDirectSoundBuffer LPDIRECTSOUNDBUFFER;
|
|
71
|
|
72 interface IDirectSound3DListener : IUnknown
|
|
73 {
|
|
74 extern(Windows):
|
|
75
|
|
76 // IDirectSound3DListener methods
|
|
77 HRESULT GetAllParameters (LPDS3DLISTENER pListener);
|
|
78 HRESULT GetDistanceFactor (D3DVALUE* pflDistanceFactor);
|
|
79 HRESULT GetDopplerFactor (D3DVALUE* pflDopplerFactor);
|
|
80 HRESULT GetOrientation (D3DVECTOR* pvOrientFront, D3DVECTOR* pvOrientTop);
|
|
81 HRESULT GetPosition (D3DVECTOR* pvPosition);
|
|
82 HRESULT GetRolloffFactor (D3DVALUE* pflRolloffFactor);
|
|
83 HRESULT GetVelocity (D3DVECTOR* pvVelocity);
|
|
84 HRESULT SetAllParameters (LPCDS3DLISTENER pcListener, DWORD dwApply);
|
|
85 HRESULT SetDistanceFactor (D3DVALUE flDistanceFactor, DWORD dwApply);
|
|
86 HRESULT SetDopplerFactor (D3DVALUE flDopplerFactor, DWORD dwApply);
|
|
87 HRESULT SetOrientation (D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront,
|
|
88 D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply);
|
|
89 HRESULT SetPosition (D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply);
|
|
90 HRESULT SetRolloffFactor (D3DVALUE flRolloffFactor, DWORD dwApply);
|
|
91 HRESULT SetVelocity (D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply);
|
|
92 HRESULT CommitDeferredSettings ();
|
|
93 }
|
|
94
|
|
95 struct WAVEFORMATEX
|
|
96 {
|
|
97 ushort wFormatTag;
|
|
98 ushort nChannels;
|
|
99 uint nSamplesPerSec;
|
|
100 uint nAvgBytesPerSec;
|
|
101 ushort nBlockAlign;
|
|
102 ushort wBitsPerSample;
|
|
103 ushort cbSize;
|
|
104 }
|
|
105
|
|
106 alias WAVEFORMATEX* LPWAVEFORMATEX, LPCWAVEFORMATEX;
|
|
107
|
|
108 enum : uint
|
|
109 {
|
|
110 WAVE_FORMAT_PCM = 1
|
|
111 }
|
|
112
|
|
113 struct DSCBUFFERDESC
|
|
114 {
|
|
115 DWORD dwSize;
|
|
116 DWORD dwFlags;
|
|
117 DWORD dwBufferBytes;
|
|
118 DWORD dwReserved;
|
|
119 LPWAVEFORMATEX lpwfxFormat;
|
|
120 DWORD dwFXCount;
|
|
121 LPDSCEFFECTDESC lpDSCFXDesc;
|
|
122 }
|
|
123
|
|
124 alias DSCBUFFERDESC* LPDSCBUFFERDESC;
|
|
125
|
|
126 struct DSBUFFERDESC
|
|
127 {
|
|
128 DWORD dwSize;
|
|
129 DWORD dwFlags;
|
|
130 DWORD dwBufferBytes;
|
|
131 DWORD dwReserved;
|
|
132 LPWAVEFORMATEX lpwfxFormat;
|
|
133 GUID guid3DAlgorithm;
|
|
134 }
|
|
135
|
|
136 alias DSBUFFERDESC* LPCDSBUFFERDESC;
|
|
137
|
|
138 struct DSCAPS
|
|
139 {
|
|
140 DWORD dwSize;
|
|
141 DWORD dwFlags;
|
|
142 DWORD dwMinSecondarySampleRate;
|
|
143 DWORD dwMaxSecondarySampleRate;
|
|
144 DWORD dwPrimaryBuffers;
|
|
145 DWORD dwMaxHwMixingAllBuffers;
|
|
146 DWORD dwMaxHwMixingStaticBuffers;
|
|
147 DWORD dwMaxHwMixingStreamingBuffers;
|
|
148 DWORD dwFreeHwMixingAllBuffers;
|
|
149 DWORD dwFreeHwMixingStaticBuffers;
|
|
150 DWORD dwFreeHwMixingStreamingBuffers;
|
|
151 DWORD dwMaxHw3DAllBuffers;
|
|
152 DWORD dwMaxHw3DStaticBuffers;
|
|
153 DWORD dwMaxHw3DStreamingBuffers;
|
|
154 DWORD dwFreeHw3DAllBuffers;
|
|
155 DWORD dwFreeHw3DStaticBuffers;
|
|
156 DWORD dwFreeHw3DStreamingBuffers;
|
|
157 DWORD dwTotalHwMemBytes;
|
|
158 DWORD dwFreeHwMemBytes;
|
|
159 DWORD dwMaxContigFreeHwMemBytes;
|
|
160 DWORD dwUnlockTransferRateHwBuffers;
|
|
161 DWORD dwPlayCpuOverheadSwBuffers;
|
|
162 DWORD dwReserved1;
|
|
163 DWORD dwReserved2;
|
|
164 }
|
|
165
|
|
166 alias DSCAPS* LPDSCAPS;
|
|
167
|
|
168 struct DSBCAPS
|
|
169 {
|
|
170 DWORD dwSize;
|
|
171 DWORD dwFlags;
|
|
172 DWORD dwBufferBytes;
|
|
173 DWORD dwUnlockTransferRate;
|
|
174 DWORD dwPlayCpuOverhead;
|
|
175 }
|
|
176
|
|
177 alias DSBCAPS *LPDSBCAPS;
|
|
178
|
|
179 struct DSCEFFECTDESC
|
|
180 {
|
|
181 DWORD dwSize;
|
|
182 DWORD dwFlags;
|
|
183 GUID guidDSCFXClass;
|
|
184 GUID guidDSCFXInstance;
|
|
185 DWORD dwReserved1;
|
|
186 DWORD dwReserved2;
|
|
187 }
|
|
188
|
|
189 alias DSCEFFECTDESC *LPDSCEFFECTDESC;
|
|
190
|
|
191 struct DS3DLISTENER
|
|
192 {
|
|
193 DWORD dwSize;
|
|
194 D3DVECTOR vPosition;
|
|
195 D3DVECTOR vVelocity;
|
|
196 D3DVECTOR vOrientFront;
|
|
197 D3DVECTOR vOrientTop;
|
|
198 D3DVALUE flDistanceFactor;
|
|
199 D3DVALUE flRolloffFactor;
|
|
200 D3DVALUE flDopplerFactor;
|
|
201 }
|
|
202
|
|
203 alias DS3DLISTENER *LPDS3DLISTENER, LPCDS3DLISTENER;
|
|
204
|
|
205 alias float D3DVALUE;
|
|
206
|
|
207 struct D3DVECTOR
|
|
208 {
|
|
209 float x;
|
|
210 float y;
|
|
211 float z;
|
|
212 }
|
|
213
|
|
214 extern(Windows) export HRESULT DirectSoundCreate8(LPCGUID pcGuidDevice, LPDIRECTSOUND8 *ppDS8, LPUNKNOWN pUnkOuter);
|
|
215
|
|
216 const DSSCL_PRIORITY = 0x00000002;
|
|
217 const DSBCAPS_PRIMARYBUFFER = 0x00000001;
|
|
218 const DSBCAPS_CTRL3D = 0x00000010;
|
|
219 const DSBCAPS_GETCURRENTPOSITION2 = 0x00010000;
|
|
220 const DSBCAPS_LOCDEFER = 0x00040000;
|
|
221 const DSBPLAY_LOOPING = 0x00000001;
|
|
222 const DSBSTATUS_PLAYING = 0x00000001;
|
|
223 const DSBCAPS_CTRLFREQUENCY = 0x00000020;
|
|
224 const DSBCAPS_CTRLPAN = 0x00000040;
|
|
225 const DSBCAPS_CTRLVOLUME = 0x00000080;
|
|
226 const DSBLOCK_ENTIREBUFFER = 0x00000002;
|
|
227
|
|
228 const GUID IID_IDirectSound3DListener8 = {0x279AFA84,0x4981,0x11CE,[0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60]}; |