-
Notifications
You must be signed in to change notification settings - Fork 51
/
eax.c
308 lines (279 loc) · 10.2 KB
/
eax.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
/* DirectSound EAX interface
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define CONST_VTABLE
#include <stdarg.h>
#include <string.h>
#include "windows.h"
#include "dsound.h"
#include "dsound_private.h"
#include "eax-presets.h"
/*******************
* EAX 4 stuff
******************/
HRESULT EAX4Context_Query(DSPrimary *prim, DWORD propid, ULONG *pTypeSupport)
{
if(!HAS_EXTENSION(prim->share, EXT_EAX))
return E_PROP_ID_UNSUPPORTED;
switch((propid&~EAXCONTEXT_PARAMETER_DEFERRED))
{
case EAXCONTEXT_NONE:
case EAXCONTEXT_ALLPARAMETERS:
case EAXCONTEXT_PRIMARYFXSLOTID:
case EAXCONTEXT_DISTANCEFACTOR:
case EAXCONTEXT_AIRABSORPTIONHF:
case EAXCONTEXT_HFREFERENCE:
case EAXCONTEXT_LASTERROR:
*pTypeSupport = KSPROPERTY_SUPPORT_GET | KSPROPERTY_SUPPORT_SET;
return DS_OK;
}
FIXME("Unhandled propid: 0x%08lx\n", propid);
return E_PROP_ID_UNSUPPORTED;
}
HRESULT EAX4Slot_Query(DSPrimary *prim, DWORD propid, ULONG *pTypeSupport)
{
if(!HAS_EXTENSION(prim->share, EXT_EAX))
return E_PROP_ID_UNSUPPORTED;
switch((propid&~EAXFXSLOT_PARAMETER_DEFERRED))
{
case EAXFXSLOT_NONE:
case EAXFXSLOT_ALLPARAMETERS:
case EAXFXSLOT_LOADEFFECT:
case EAXFXSLOT_VOLUME:
case EAXFXSLOT_LOCK:
case EAXFXSLOT_FLAGS:
*pTypeSupport = KSPROPERTY_SUPPORT_GET | KSPROPERTY_SUPPORT_SET;
return DS_OK;
}
/* FIXME: This should probably only succeed for the available parameters of
* the current effect type.
*/
if((propid&~EAXFXSLOT_PARAMETER_DEFERRED) <= EAXREVERB_FLAGS)
{
*pTypeSupport = KSPROPERTY_SUPPORT_GET | KSPROPERTY_SUPPORT_SET;
return DS_OK;
}
FIXME("Unhandled propid: 0x%08lx\n", propid);
return E_PROP_ID_UNSUPPORTED;
}
HRESULT EAX4Source_Query(DSBuffer *buf, DWORD propid, ULONG *pTypeSupport)
{
if(!HAS_EXTENSION(buf->share, EXT_EAX))
return E_PROP_ID_UNSUPPORTED;
switch((propid&~EAXSOURCE_PARAMETER_DEFERRED))
{
case EAXSOURCE_NONE:
case EAXSOURCE_ALLPARAMETERS:
case EAXSOURCE_OBSTRUCTIONPARAMETERS:
case EAXSOURCE_OCCLUSIONPARAMETERS:
case EAXSOURCE_EXCLUSIONPARAMETERS:
case EAXSOURCE_DIRECT:
case EAXSOURCE_DIRECTHF:
case EAXSOURCE_ROOM:
case EAXSOURCE_ROOMHF:
case EAXSOURCE_OBSTRUCTION:
case EAXSOURCE_OBSTRUCTIONLFRATIO:
case EAXSOURCE_OCCLUSION:
case EAXSOURCE_OCCLUSIONLFRATIO:
case EAXSOURCE_OCCLUSIONROOMRATIO:
case EAXSOURCE_OCCLUSIONDIRECTRATIO:
case EAXSOURCE_EXCLUSION:
case EAXSOURCE_EXCLUSIONLFRATIO:
case EAXSOURCE_OUTSIDEVOLUMEHF:
case EAXSOURCE_DOPPLERFACTOR:
case EAXSOURCE_ROLLOFFFACTOR:
case EAXSOURCE_ROOMROLLOFFFACTOR:
case EAXSOURCE_AIRABSORPTIONFACTOR:
case EAXSOURCE_FLAGS:
case EAXSOURCE_SENDPARAMETERS:
case EAXSOURCE_ALLSENDPARAMETERS:
case EAXSOURCE_OCCLUSIONSENDPARAMETERS:
case EAXSOURCE_EXCLUSIONSENDPARAMETERS:
case EAXSOURCE_ACTIVEFXSLOTID:
*pTypeSupport = KSPROPERTY_SUPPORT_GET | KSPROPERTY_SUPPORT_SET;
return DS_OK;
}
FIXME("Unhandled propid: 0x%08lx\n", propid);
return E_PROP_ID_UNSUPPORTED;
}
/*******************
* EAX 3 stuff
******************/
HRESULT EAX3_Query(DSPrimary *prim, DWORD propid, ULONG *pTypeSupport)
{
if(!HAS_EXTENSION(prim->share, EXT_EAX))
return E_PROP_ID_UNSUPPORTED;
switch((propid&~DSPROPERTY_EAX30LISTENER_DEFERRED))
{
case DSPROPERTY_EAX30LISTENER_NONE:
case DSPROPERTY_EAX30LISTENER_ALLPARAMETERS:
case DSPROPERTY_EAX30LISTENER_ENVIRONMENT:
case DSPROPERTY_EAX30LISTENER_ENVIRONMENTSIZE:
case DSPROPERTY_EAX30LISTENER_ENVIRONMENTDIFFUSION:
case DSPROPERTY_EAX30LISTENER_ROOM:
case DSPROPERTY_EAX30LISTENER_ROOMHF:
case DSPROPERTY_EAX30LISTENER_ROOMLF:
case DSPROPERTY_EAX30LISTENER_DECAYTIME:
case DSPROPERTY_EAX30LISTENER_DECAYHFRATIO:
case DSPROPERTY_EAX30LISTENER_DECAYLFRATIO:
case DSPROPERTY_EAX30LISTENER_REFLECTIONS:
case DSPROPERTY_EAX30LISTENER_REFLECTIONSDELAY:
case DSPROPERTY_EAX30LISTENER_REFLECTIONSPAN:
case DSPROPERTY_EAX30LISTENER_REVERB:
case DSPROPERTY_EAX30LISTENER_REVERBDELAY:
case DSPROPERTY_EAX30LISTENER_REVERBPAN:
case DSPROPERTY_EAX30LISTENER_ECHOTIME:
case DSPROPERTY_EAX30LISTENER_ECHODEPTH:
case DSPROPERTY_EAX30LISTENER_MODULATIONTIME:
case DSPROPERTY_EAX30LISTENER_MODULATIONDEPTH:
case DSPROPERTY_EAX30LISTENER_AIRABSORPTIONHF:
case DSPROPERTY_EAX30LISTENER_HFREFERENCE:
case DSPROPERTY_EAX30LISTENER_LFREFERENCE:
case DSPROPERTY_EAX30LISTENER_ROOMROLLOFFFACTOR:
case DSPROPERTY_EAX30LISTENER_FLAGS:
*pTypeSupport = KSPROPERTY_SUPPORT_GET | KSPROPERTY_SUPPORT_SET;
return DS_OK;
}
FIXME("Unhandled propid: 0x%08lx\n", propid);
return E_PROP_ID_UNSUPPORTED;
}
HRESULT EAX3Buffer_Query(DSBuffer *buf, DWORD propid, ULONG *pTypeSupport)
{
if(!HAS_EXTENSION(buf->share, EXT_EAX))
return E_PROP_ID_UNSUPPORTED;
switch((propid&~DSPROPERTY_EAX30BUFFER_DEFERRED))
{
case DSPROPERTY_EAX30BUFFER_NONE:
case DSPROPERTY_EAX30BUFFER_ALLPARAMETERS:
case DSPROPERTY_EAX30BUFFER_OBSTRUCTIONPARAMETERS:
case DSPROPERTY_EAX30BUFFER_OCCLUSIONPARAMETERS:
case DSPROPERTY_EAX30BUFFER_EXCLUSIONPARAMETERS:
case DSPROPERTY_EAX30BUFFER_DIRECT:
case DSPROPERTY_EAX30BUFFER_DIRECTHF:
case DSPROPERTY_EAX30BUFFER_ROOM:
case DSPROPERTY_EAX30BUFFER_ROOMHF:
case DSPROPERTY_EAX30BUFFER_OBSTRUCTION:
case DSPROPERTY_EAX30BUFFER_OBSTRUCTIONLFRATIO:
case DSPROPERTY_EAX30BUFFER_OCCLUSION:
case DSPROPERTY_EAX30BUFFER_OCCLUSIONLFRATIO:
case DSPROPERTY_EAX30BUFFER_OCCLUSIONROOMRATIO:
case DSPROPERTY_EAX30BUFFER_OCCLUSIONDIRECTRATIO:
case DSPROPERTY_EAX30BUFFER_EXCLUSION:
case DSPROPERTY_EAX30BUFFER_EXCLUSIONLFRATIO:
case DSPROPERTY_EAX30BUFFER_OUTSIDEVOLUMEHF:
case DSPROPERTY_EAX30BUFFER_DOPPLERFACTOR:
case DSPROPERTY_EAX30BUFFER_ROLLOFFFACTOR:
case DSPROPERTY_EAX30BUFFER_ROOMROLLOFFFACTOR:
case DSPROPERTY_EAX30BUFFER_AIRABSORPTIONFACTOR:
case DSPROPERTY_EAX30BUFFER_FLAGS:
*pTypeSupport = KSPROPERTY_SUPPORT_GET | KSPROPERTY_SUPPORT_SET;
return DS_OK;
}
FIXME("Unhandled propid: 0x%08lx\n", propid);
return E_PROP_ID_UNSUPPORTED;
}
/*******************
* EAX 2 stuff
******************/
HRESULT EAX2_Query(DSPrimary *prim, DWORD propid, ULONG *pTypeSupport)
{
if(!HAS_EXTENSION(prim->share, EXT_EAX))
return E_PROP_ID_UNSUPPORTED;
switch((propid&~DSPROPERTY_EAX20LISTENER_DEFERRED))
{
case DSPROPERTY_EAX20LISTENER_NONE:
case DSPROPERTY_EAX20LISTENER_ALLPARAMETERS:
case DSPROPERTY_EAX20LISTENER_ROOM:
case DSPROPERTY_EAX20LISTENER_ROOMHF:
case DSPROPERTY_EAX20LISTENER_ROOMROLLOFFFACTOR:
case DSPROPERTY_EAX20LISTENER_DECAYTIME:
case DSPROPERTY_EAX20LISTENER_DECAYHFRATIO:
case DSPROPERTY_EAX20LISTENER_REFLECTIONS:
case DSPROPERTY_EAX20LISTENER_REFLECTIONSDELAY:
case DSPROPERTY_EAX20LISTENER_REVERB:
case DSPROPERTY_EAX20LISTENER_REVERBDELAY:
case DSPROPERTY_EAX20LISTENER_ENVIRONMENT:
case DSPROPERTY_EAX20LISTENER_ENVIRONMENTSIZE:
case DSPROPERTY_EAX20LISTENER_ENVIRONMENTDIFFUSION:
case DSPROPERTY_EAX20LISTENER_AIRABSORPTIONHF:
case DSPROPERTY_EAX20LISTENER_FLAGS:
*pTypeSupport = KSPROPERTY_SUPPORT_GET | KSPROPERTY_SUPPORT_SET;
return DS_OK;
}
FIXME("Unhandled propid: 0x%08lx\n", propid);
return E_PROP_ID_UNSUPPORTED;
}
HRESULT EAX2Buffer_Query(DSBuffer *buf, DWORD propid, ULONG *pTypeSupport)
{
if(!HAS_EXTENSION(buf->share, EXT_EAX))
return E_PROP_ID_UNSUPPORTED;
switch((propid&~DSPROPERTY_EAX20BUFFER_DEFERRED))
{
case DSPROPERTY_EAX20BUFFER_NONE:
case DSPROPERTY_EAX20BUFFER_ALLPARAMETERS:
case DSPROPERTY_EAX20BUFFER_DIRECT:
case DSPROPERTY_EAX20BUFFER_DIRECTHF:
case DSPROPERTY_EAX20BUFFER_ROOM:
case DSPROPERTY_EAX20BUFFER_ROOMHF:
case DSPROPERTY_EAX20BUFFER_ROOMROLLOFFFACTOR:
case DSPROPERTY_EAX20BUFFER_OBSTRUCTION:
case DSPROPERTY_EAX20BUFFER_OBSTRUCTIONLFRATIO:
case DSPROPERTY_EAX20BUFFER_OCCLUSION:
case DSPROPERTY_EAX20BUFFER_OCCLUSIONLFRATIO:
case DSPROPERTY_EAX20BUFFER_OCCLUSIONROOMRATIO:
case DSPROPERTY_EAX20BUFFER_OUTSIDEVOLUMEHF:
case DSPROPERTY_EAX20BUFFER_AIRABSORPTIONFACTOR:
case DSPROPERTY_EAX20BUFFER_FLAGS:
*pTypeSupport = KSPROPERTY_SUPPORT_GET | KSPROPERTY_SUPPORT_SET;
return DS_OK;
}
FIXME("Unhandled propid: 0x%08lx\n", propid);
return E_PROP_ID_UNSUPPORTED;
}
/*******************
* EAX 1 stuff
******************/
HRESULT EAX1_Query(DSPrimary *prim, DWORD propid, ULONG *pTypeSupport)
{
if(!HAS_EXTENSION(prim->share, EXT_EAX))
return E_PROP_ID_UNSUPPORTED;
switch(propid)
{
case DSPROPERTY_EAX10LISTENER_ALL:
case DSPROPERTY_EAX10LISTENER_ENVIRONMENT:
case DSPROPERTY_EAX10LISTENER_VOLUME:
case DSPROPERTY_EAX10LISTENER_DECAYTIME:
case DSPROPERTY_EAX10LISTENER_DAMPING:
*pTypeSupport = KSPROPERTY_SUPPORT_GET | KSPROPERTY_SUPPORT_SET;
return DS_OK;
}
FIXME("Unhandled propid: 0x%08lx\n", propid);
return E_PROP_ID_UNSUPPORTED;
}
HRESULT EAX1Buffer_Query(DSBuffer *buf, DWORD propid, ULONG *pTypeSupport)
{
if(!HAS_EXTENSION(buf->share, EXT_EAX))
return E_PROP_ID_UNSUPPORTED;
switch(propid)
{
case DSPROPERTY_EAX10BUFFER_ALL:
case DSPROPERTY_EAX10BUFFER_REVERBMIX:
*pTypeSupport = KSPROPERTY_SUPPORT_GET | KSPROPERTY_SUPPORT_SET;
return DS_OK;
}
FIXME("Unhandled propid: 0x%08lx\n", propid);
return E_PROP_ID_UNSUPPORTED;
}