Make a function static
[openal-soft.git] / OpenAL32 / alEffect.c
blob0814cfe03e1bfcb0758c9c831b83d9785bd6d072
1 /**
2 * OpenAL cross platform audio library
3 * Copyright (C) 1999-2007 by authors.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 * Or go to http://www.gnu.org/copyleft/lgpl.html
21 #include "config.h"
23 #include <stdlib.h>
24 #include <math.h>
26 #include "AL/al.h"
27 #include "AL/alc.h"
28 #include "alMain.h"
29 #include "alEffect.h"
30 #include "alThunk.h"
31 #include "alError.h"
34 ALboolean DisabledEffects[MAX_EFFECTS];
37 static void InitEffectParams(ALeffect *effect, ALenum type);
39 #define LookupEffect(m, k) ((ALeffect*)LookupUIntMapKey(&(m), (k)))
41 AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
43 ALCcontext *Context;
44 ALsizei i=0;
46 Context = GetContextSuspended();
47 if(!Context) return;
49 if(n < 0 || IsBadWritePtr((void*)effects, n * sizeof(ALuint)))
50 alSetError(Context, AL_INVALID_VALUE);
51 else
53 ALCdevice *device = Context->Device;
54 ALenum err;
56 while(i < n)
58 ALeffect *effect = calloc(1, sizeof(ALeffect));
59 if(!effect)
61 alSetError(Context, AL_OUT_OF_MEMORY);
62 alDeleteEffects(i, effects);
63 break;
66 effect->effect = ALTHUNK_ADDENTRY(effect);
67 err = InsertUIntMapEntry(&device->EffectMap, effect->effect, effect);
68 if(err != AL_NO_ERROR)
70 ALTHUNK_REMOVEENTRY(effect->effect);
71 memset(effect, 0, sizeof(ALeffect));
72 free(effect);
74 alSetError(Context, err);
75 alDeleteEffects(i, effects);
76 break;
79 effects[i++] = effect->effect;
80 InitEffectParams(effect, AL_EFFECT_NULL);
84 ProcessContext(Context);
87 AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, ALuint *effects)
89 ALCcontext *Context;
90 ALCdevice *device;
91 ALeffect *ALEffect;
92 ALboolean Failed;
93 ALsizei i;
95 Context = GetContextSuspended();
96 if(!Context) return;
98 Failed = AL_TRUE;
99 device = Context->Device;
100 if(n < 0)
101 alSetError(Context, AL_INVALID_VALUE);
102 else
104 Failed = AL_FALSE;
105 // Check that all effects are valid
106 for(i = 0;i < n;i++)
108 if(!effects[i])
109 continue;
111 if(LookupEffect(device->EffectMap, effects[i]) == NULL)
113 alSetError(Context, AL_INVALID_NAME);
114 Failed = AL_TRUE;
115 break;
120 if(!Failed)
122 // All effects are valid
123 for(i = 0;i < n;i++)
125 // Recheck that the effect is valid, because there could be duplicated names
126 if((ALEffect=LookupEffect(device->EffectMap, effects[i])) == NULL)
127 continue;
129 RemoveUIntMapKey(&device->EffectMap, ALEffect->effect);
130 ALTHUNK_REMOVEENTRY(ALEffect->effect);
132 memset(ALEffect, 0, sizeof(ALeffect));
133 free(ALEffect);
137 ProcessContext(Context);
140 AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect)
142 ALCcontext *Context;
143 ALboolean result;
145 Context = GetContextSuspended();
146 if(!Context) return AL_FALSE;
148 result = ((!effect || LookupEffect(Context->Device->EffectMap, effect)) ?
149 AL_TRUE : AL_FALSE);
151 ProcessContext(Context);
153 return result;
156 AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue)
158 ALCcontext *Context;
159 ALCdevice *Device;
160 ALeffect *ALEffect;
162 Context = GetContextSuspended();
163 if(!Context) return;
165 Device = Context->Device;
166 if((ALEffect=LookupEffect(Device->EffectMap, effect)) != NULL)
168 if(param == AL_EFFECT_TYPE)
170 ALboolean isOk = (iValue == AL_EFFECT_NULL ||
171 (iValue == AL_EFFECT_EAXREVERB && !DisabledEffects[EAXREVERB]) ||
172 (iValue == AL_EFFECT_REVERB && !DisabledEffects[REVERB]) ||
173 (iValue == AL_EFFECT_ECHO && !DisabledEffects[ECHO]) ||
174 (iValue == AL_EFFECT_RING_MODULATOR && !DisabledEffects[MODULATOR]));
176 if(isOk)
177 InitEffectParams(ALEffect, iValue);
178 else
179 alSetError(Context, AL_INVALID_VALUE);
181 else if(ALEffect->type == AL_EFFECT_EAXREVERB)
183 switch(param)
185 case AL_EAXREVERB_DECAY_HFLIMIT:
186 if(iValue >= AL_EAXREVERB_MIN_DECAY_HFLIMIT &&
187 iValue <= AL_EAXREVERB_MAX_DECAY_HFLIMIT)
188 ALEffect->Reverb.DecayHFLimit = iValue;
189 else
190 alSetError(Context, AL_INVALID_VALUE);
191 break;
193 default:
194 alSetError(Context, AL_INVALID_ENUM);
195 break;
198 else if(ALEffect->type == AL_EFFECT_REVERB)
200 switch(param)
202 case AL_REVERB_DECAY_HFLIMIT:
203 if(iValue >= AL_REVERB_MIN_DECAY_HFLIMIT &&
204 iValue <= AL_REVERB_MAX_DECAY_HFLIMIT)
205 ALEffect->Reverb.DecayHFLimit = iValue;
206 else
207 alSetError(Context, AL_INVALID_VALUE);
208 break;
210 default:
211 alSetError(Context, AL_INVALID_ENUM);
212 break;
215 else if(ALEffect->type == AL_EFFECT_ECHO)
217 switch(param)
219 default:
220 alSetError(Context, AL_INVALID_ENUM);
221 break;
224 else if(ALEffect->type == AL_EFFECT_RING_MODULATOR)
226 switch(param)
228 case AL_RING_MODULATOR_FREQUENCY:
229 case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
230 alEffectf(effect, param, (ALfloat)iValue);
231 break;
233 case AL_RING_MODULATOR_WAVEFORM:
234 if(iValue >= AL_RING_MODULATOR_MIN_WAVEFORM &&
235 iValue <= AL_RING_MODULATOR_MAX_WAVEFORM)
236 ALEffect->Modulator.Waveform = iValue;
237 else
238 alSetError(Context, AL_INVALID_VALUE);
239 break;
241 default:
242 alSetError(Context, AL_INVALID_ENUM);
243 break;
246 else
247 alSetError(Context, AL_INVALID_ENUM);
249 else
250 alSetError(Context, AL_INVALID_NAME);
252 ProcessContext(Context);
255 AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, ALint *piValues)
257 ALCcontext *Context;
258 ALCdevice *Device;
259 ALeffect *ALEffect;
261 Context = GetContextSuspended();
262 if(!Context) return;
264 Device = Context->Device;
265 if((ALEffect=LookupEffect(Device->EffectMap, effect)) != NULL)
267 if(param == AL_EFFECT_TYPE)
269 alEffecti(effect, param, piValues[0]);
271 else if(ALEffect->type == AL_EFFECT_EAXREVERB)
273 switch(param)
275 case AL_EAXREVERB_DECAY_HFLIMIT:
276 alEffecti(effect, param, piValues[0]);
277 break;
279 default:
280 alSetError(Context, AL_INVALID_ENUM);
281 break;
284 else if(ALEffect->type == AL_EFFECT_REVERB)
286 switch(param)
288 case AL_REVERB_DECAY_HFLIMIT:
289 alEffecti(effect, param, piValues[0]);
290 break;
292 default:
293 alSetError(Context, AL_INVALID_ENUM);
294 break;
297 else if(ALEffect->type == AL_EFFECT_ECHO)
299 switch(param)
301 default:
302 alSetError(Context, AL_INVALID_ENUM);
303 break;
306 else if(ALEffect->type == AL_EFFECT_RING_MODULATOR)
308 switch(param)
310 case AL_RING_MODULATOR_FREQUENCY:
311 case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
312 case AL_RING_MODULATOR_WAVEFORM:
313 alEffecti(effect, param, piValues[0]);
314 break;
316 default:
317 alSetError(Context, AL_INVALID_ENUM);
318 break;
321 else
322 alSetError(Context, AL_INVALID_ENUM);
324 else
325 alSetError(Context, AL_INVALID_NAME);
327 ProcessContext(Context);
330 AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue)
332 ALCcontext *Context;
333 ALCdevice *Device;
334 ALeffect *ALEffect;
336 Context = GetContextSuspended();
337 if(!Context) return;
339 Device = Context->Device;
340 if((ALEffect=LookupEffect(Device->EffectMap, effect)) != NULL)
342 if(ALEffect->type == AL_EFFECT_EAXREVERB)
344 switch(param)
346 case AL_EAXREVERB_DENSITY:
347 if(flValue >= AL_EAXREVERB_MIN_DENSITY &&
348 flValue <= AL_EAXREVERB_MAX_DENSITY)
349 ALEffect->Reverb.Density = flValue;
350 else
351 alSetError(Context, AL_INVALID_VALUE);
352 break;
354 case AL_EAXREVERB_DIFFUSION:
355 if(flValue >= AL_EAXREVERB_MIN_DIFFUSION &&
356 flValue <= AL_EAXREVERB_MAX_DIFFUSION)
357 ALEffect->Reverb.Diffusion = flValue;
358 else
359 alSetError(Context, AL_INVALID_VALUE);
360 break;
362 case AL_EAXREVERB_GAIN:
363 if(flValue >= AL_EAXREVERB_MIN_GAIN &&
364 flValue <= AL_EAXREVERB_MAX_GAIN)
365 ALEffect->Reverb.Gain = flValue;
366 else
367 alSetError(Context, AL_INVALID_VALUE);
368 break;
370 case AL_EAXREVERB_GAINHF:
371 if(flValue >= AL_EAXREVERB_MIN_GAINHF &&
372 flValue <= AL_EAXREVERB_MAX_GAIN)
373 ALEffect->Reverb.GainHF = flValue;
374 else
375 alSetError(Context, AL_INVALID_VALUE);
376 break;
378 case AL_EAXREVERB_GAINLF:
379 if(flValue >= AL_EAXREVERB_MIN_GAINLF &&
380 flValue <= AL_EAXREVERB_MAX_GAINLF)
381 ALEffect->Reverb.GainLF = flValue;
382 else
383 alSetError(Context, AL_INVALID_VALUE);
384 break;
386 case AL_EAXREVERB_DECAY_TIME:
387 if(flValue >= AL_EAXREVERB_MIN_DECAY_TIME &&
388 flValue <= AL_EAXREVERB_MAX_DECAY_TIME)
389 ALEffect->Reverb.DecayTime = flValue;
390 else
391 alSetError(Context, AL_INVALID_VALUE);
392 break;
394 case AL_EAXREVERB_DECAY_HFRATIO:
395 if(flValue >= AL_EAXREVERB_MIN_DECAY_HFRATIO &&
396 flValue <= AL_EAXREVERB_MAX_DECAY_HFRATIO)
397 ALEffect->Reverb.DecayHFRatio = flValue;
398 else
399 alSetError(Context, AL_INVALID_VALUE);
400 break;
402 case AL_EAXREVERB_DECAY_LFRATIO:
403 if(flValue >= AL_EAXREVERB_MIN_DECAY_LFRATIO &&
404 flValue <= AL_EAXREVERB_MAX_DECAY_LFRATIO)
405 ALEffect->Reverb.DecayLFRatio = flValue;
406 else
407 alSetError(Context, AL_INVALID_VALUE);
408 break;
410 case AL_EAXREVERB_REFLECTIONS_GAIN:
411 if(flValue >= AL_EAXREVERB_MIN_REFLECTIONS_GAIN &&
412 flValue <= AL_EAXREVERB_MAX_REFLECTIONS_GAIN)
413 ALEffect->Reverb.ReflectionsGain = flValue;
414 else
415 alSetError(Context, AL_INVALID_VALUE);
416 break;
418 case AL_EAXREVERB_REFLECTIONS_DELAY:
419 if(flValue >= AL_EAXREVERB_MIN_REFLECTIONS_DELAY &&
420 flValue <= AL_EAXREVERB_MAX_REFLECTIONS_DELAY)
421 ALEffect->Reverb.ReflectionsDelay = flValue;
422 else
423 alSetError(Context, AL_INVALID_VALUE);
424 break;
426 case AL_EAXREVERB_LATE_REVERB_GAIN:
427 if(flValue >= AL_EAXREVERB_MIN_LATE_REVERB_GAIN &&
428 flValue <= AL_EAXREVERB_MAX_LATE_REVERB_GAIN)
429 ALEffect->Reverb.LateReverbGain = flValue;
430 else
431 alSetError(Context, AL_INVALID_VALUE);
432 break;
434 case AL_EAXREVERB_LATE_REVERB_DELAY:
435 if(flValue >= AL_EAXREVERB_MIN_LATE_REVERB_DELAY &&
436 flValue <= AL_EAXREVERB_MAX_LATE_REVERB_DELAY)
437 ALEffect->Reverb.LateReverbDelay = flValue;
438 else
439 alSetError(Context, AL_INVALID_VALUE);
440 break;
442 case AL_EAXREVERB_AIR_ABSORPTION_GAINHF:
443 if(flValue >= AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF &&
444 flValue <= AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF)
445 ALEffect->Reverb.AirAbsorptionGainHF = flValue;
446 else
447 alSetError(Context, AL_INVALID_VALUE);
448 break;
450 case AL_EAXREVERB_ECHO_TIME:
451 if(flValue >= AL_EAXREVERB_MIN_ECHO_TIME &&
452 flValue <= AL_EAXREVERB_MAX_ECHO_TIME)
453 ALEffect->Reverb.EchoTime = flValue;
454 else
455 alSetError(Context, AL_INVALID_VALUE);
456 break;
458 case AL_EAXREVERB_ECHO_DEPTH:
459 if(flValue >= AL_EAXREVERB_MIN_ECHO_DEPTH &&
460 flValue <= AL_EAXREVERB_MAX_ECHO_DEPTH)
461 ALEffect->Reverb.EchoDepth = flValue;
462 else
463 alSetError(Context, AL_INVALID_VALUE);
464 break;
466 case AL_EAXREVERB_MODULATION_TIME:
467 if(flValue >= AL_EAXREVERB_MIN_MODULATION_TIME &&
468 flValue <= AL_EAXREVERB_MAX_MODULATION_TIME)
469 ALEffect->Reverb.ModulationTime = flValue;
470 else
471 alSetError(Context, AL_INVALID_VALUE);
472 break;
474 case AL_EAXREVERB_MODULATION_DEPTH:
475 if(flValue >= AL_EAXREVERB_MIN_MODULATION_DEPTH &&
476 flValue <= AL_EAXREVERB_MAX_MODULATION_DEPTH)
477 ALEffect->Reverb.ModulationDepth = flValue;
478 else
479 alSetError(Context, AL_INVALID_VALUE);
480 break;
482 case AL_EAXREVERB_HFREFERENCE:
483 if(flValue >= AL_EAXREVERB_MIN_HFREFERENCE &&
484 flValue <= AL_EAXREVERB_MAX_HFREFERENCE)
485 ALEffect->Reverb.HFReference = flValue;
486 else
487 alSetError(Context, AL_INVALID_VALUE);
488 break;
490 case AL_EAXREVERB_LFREFERENCE:
491 if(flValue >= AL_EAXREVERB_MIN_LFREFERENCE &&
492 flValue <= AL_EAXREVERB_MAX_LFREFERENCE)
493 ALEffect->Reverb.LFReference = flValue;
494 else
495 alSetError(Context, AL_INVALID_VALUE);
496 break;
498 case AL_EAXREVERB_ROOM_ROLLOFF_FACTOR:
499 if(flValue >= 0.0f && flValue <= 10.0f)
500 ALEffect->Reverb.RoomRolloffFactor = flValue;
501 else
502 alSetError(Context, AL_INVALID_VALUE);
503 break;
505 default:
506 alSetError(Context, AL_INVALID_ENUM);
507 break;
510 else if(ALEffect->type == AL_EFFECT_REVERB)
512 switch(param)
514 case AL_REVERB_DENSITY:
515 if(flValue >= AL_REVERB_MIN_DENSITY &&
516 flValue <= AL_REVERB_MAX_DENSITY)
517 ALEffect->Reverb.Density = flValue;
518 else
519 alSetError(Context, AL_INVALID_VALUE);
520 break;
522 case AL_REVERB_DIFFUSION:
523 if(flValue >= AL_REVERB_MIN_DIFFUSION &&
524 flValue <= AL_REVERB_MAX_DIFFUSION)
525 ALEffect->Reverb.Diffusion = flValue;
526 else
527 alSetError(Context, AL_INVALID_VALUE);
528 break;
530 case AL_REVERB_GAIN:
531 if(flValue >= AL_REVERB_MIN_GAIN &&
532 flValue <= AL_REVERB_MAX_GAIN)
533 ALEffect->Reverb.Gain = flValue;
534 else
535 alSetError(Context, AL_INVALID_VALUE);
536 break;
538 case AL_REVERB_GAINHF:
539 if(flValue >= AL_REVERB_MIN_GAINHF &&
540 flValue <= AL_REVERB_MAX_GAINHF)
541 ALEffect->Reverb.GainHF = flValue;
542 else
543 alSetError(Context, AL_INVALID_VALUE);
544 break;
546 case AL_REVERB_DECAY_TIME:
547 if(flValue >= AL_REVERB_MIN_DECAY_TIME &&
548 flValue <= AL_REVERB_MAX_DECAY_TIME)
549 ALEffect->Reverb.DecayTime = flValue;
550 else
551 alSetError(Context, AL_INVALID_VALUE);
552 break;
554 case AL_REVERB_DECAY_HFRATIO:
555 if(flValue >= AL_REVERB_MIN_DECAY_HFRATIO &&
556 flValue <= AL_REVERB_MAX_DECAY_HFRATIO)
557 ALEffect->Reverb.DecayHFRatio = flValue;
558 else
559 alSetError(Context, AL_INVALID_VALUE);
560 break;
562 case AL_REVERB_REFLECTIONS_GAIN:
563 if(flValue >= AL_REVERB_MIN_REFLECTIONS_GAIN &&
564 flValue <= AL_REVERB_MAX_REFLECTIONS_GAIN)
565 ALEffect->Reverb.ReflectionsGain = flValue;
566 else
567 alSetError(Context, AL_INVALID_VALUE);
568 break;
570 case AL_REVERB_REFLECTIONS_DELAY:
571 if(flValue >= AL_REVERB_MIN_REFLECTIONS_DELAY &&
572 flValue <= AL_REVERB_MAX_REFLECTIONS_DELAY)
573 ALEffect->Reverb.ReflectionsDelay = flValue;
574 else
575 alSetError(Context, AL_INVALID_VALUE);
576 break;
578 case AL_REVERB_LATE_REVERB_GAIN:
579 if(flValue >= AL_REVERB_MIN_LATE_REVERB_GAIN &&
580 flValue <= AL_REVERB_MAX_LATE_REVERB_GAIN)
581 ALEffect->Reverb.LateReverbGain = flValue;
582 else
583 alSetError(Context, AL_INVALID_VALUE);
584 break;
586 case AL_REVERB_LATE_REVERB_DELAY:
587 if(flValue >= AL_REVERB_MIN_LATE_REVERB_DELAY &&
588 flValue <= AL_REVERB_MAX_LATE_REVERB_DELAY)
589 ALEffect->Reverb.LateReverbDelay = flValue;
590 else
591 alSetError(Context, AL_INVALID_VALUE);
592 break;
594 case AL_REVERB_AIR_ABSORPTION_GAINHF:
595 if(flValue >= AL_REVERB_MIN_AIR_ABSORPTION_GAINHF &&
596 flValue <= AL_REVERB_MAX_AIR_ABSORPTION_GAINHF)
597 ALEffect->Reverb.AirAbsorptionGainHF = flValue;
598 else
599 alSetError(Context, AL_INVALID_VALUE);
600 break;
602 case AL_REVERB_ROOM_ROLLOFF_FACTOR:
603 if(flValue >= AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR &&
604 flValue <= AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR)
605 ALEffect->Reverb.RoomRolloffFactor = flValue;
606 else
607 alSetError(Context, AL_INVALID_VALUE);
608 break;
610 default:
611 alSetError(Context, AL_INVALID_ENUM);
612 break;
615 else if(ALEffect->type == AL_EFFECT_ECHO)
617 switch(param)
619 case AL_ECHO_DELAY:
620 if(flValue >= AL_ECHO_MIN_DELAY && flValue <= AL_ECHO_MAX_DELAY)
621 ALEffect->Echo.Delay = flValue;
622 else
623 alSetError(Context, AL_INVALID_VALUE);
624 break;
626 case AL_ECHO_LRDELAY:
627 if(flValue >= AL_ECHO_MIN_LRDELAY && flValue <= AL_ECHO_MAX_LRDELAY)
628 ALEffect->Echo.LRDelay = flValue;
629 else
630 alSetError(Context, AL_INVALID_VALUE);
631 break;
633 case AL_ECHO_DAMPING:
634 if(flValue >= AL_ECHO_MIN_DAMPING && flValue <= AL_ECHO_MAX_DAMPING)
635 ALEffect->Echo.Damping = flValue;
636 else
637 alSetError(Context, AL_INVALID_VALUE);
638 break;
640 case AL_ECHO_FEEDBACK:
641 if(flValue >= AL_ECHO_MIN_FEEDBACK && flValue <= AL_ECHO_MAX_FEEDBACK)
642 ALEffect->Echo.Feedback = flValue;
643 else
644 alSetError(Context, AL_INVALID_VALUE);
645 break;
647 case AL_ECHO_SPREAD:
648 if(flValue >= AL_ECHO_MIN_SPREAD && flValue <= AL_ECHO_MAX_SPREAD)
649 ALEffect->Echo.Spread = flValue;
650 else
651 alSetError(Context, AL_INVALID_VALUE);
652 break;
654 default:
655 alSetError(Context, AL_INVALID_ENUM);
656 break;
659 else if(ALEffect->type == AL_EFFECT_RING_MODULATOR)
661 switch(param)
663 case AL_RING_MODULATOR_FREQUENCY:
664 if(flValue >= AL_RING_MODULATOR_MIN_FREQUENCY &&
665 flValue <= AL_RING_MODULATOR_MAX_FREQUENCY)
666 ALEffect->Modulator.Frequency = flValue;
667 else
668 alSetError(Context, AL_INVALID_VALUE);
669 break;
671 case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
672 if(flValue >= AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF &&
673 flValue <= AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF)
674 ALEffect->Modulator.HighPassCutoff = flValue;
675 else
676 alSetError(Context, AL_INVALID_VALUE);
677 break;
679 default:
680 alSetError(Context, AL_INVALID_ENUM);
681 break;
684 else
685 alSetError(Context, AL_INVALID_ENUM);
687 else
688 alSetError(Context, AL_INVALID_NAME);
690 ProcessContext(Context);
693 AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflValues)
695 ALCcontext *Context;
696 ALCdevice *Device;
697 ALeffect *ALEffect;
699 Context = GetContextSuspended();
700 if(!Context) return;
702 Device = Context->Device;
703 if((ALEffect=LookupEffect(Device->EffectMap, effect)) != NULL)
705 if(ALEffect->type == AL_EFFECT_EAXREVERB)
707 switch(param)
709 case AL_EAXREVERB_DENSITY:
710 case AL_EAXREVERB_DIFFUSION:
711 case AL_EAXREVERB_GAIN:
712 case AL_EAXREVERB_GAINHF:
713 case AL_EAXREVERB_GAINLF:
714 case AL_EAXREVERB_DECAY_TIME:
715 case AL_EAXREVERB_DECAY_HFRATIO:
716 case AL_EAXREVERB_DECAY_LFRATIO:
717 case AL_EAXREVERB_REFLECTIONS_GAIN:
718 case AL_EAXREVERB_REFLECTIONS_DELAY:
719 case AL_EAXREVERB_LATE_REVERB_GAIN:
720 case AL_EAXREVERB_LATE_REVERB_DELAY:
721 case AL_EAXREVERB_AIR_ABSORPTION_GAINHF:
722 case AL_EAXREVERB_ECHO_TIME:
723 case AL_EAXREVERB_ECHO_DEPTH:
724 case AL_EAXREVERB_MODULATION_TIME:
725 case AL_EAXREVERB_MODULATION_DEPTH:
726 case AL_EAXREVERB_HFREFERENCE:
727 case AL_EAXREVERB_LFREFERENCE:
728 case AL_EAXREVERB_ROOM_ROLLOFF_FACTOR:
729 alEffectf(effect, param, pflValues[0]);
730 break;
732 case AL_EAXREVERB_REFLECTIONS_PAN:
733 if(!isnan(pflValues[0]) && !isnan(pflValues[1]) && !isnan(pflValues[2]))
735 ALEffect->Reverb.ReflectionsPan[0] = pflValues[0];
736 ALEffect->Reverb.ReflectionsPan[1] = pflValues[1];
737 ALEffect->Reverb.ReflectionsPan[2] = pflValues[2];
739 else
740 alSetError(Context, AL_INVALID_VALUE);
741 break;
742 case AL_EAXREVERB_LATE_REVERB_PAN:
743 if(!isnan(pflValues[0]) && !isnan(pflValues[1]) && !isnan(pflValues[2]))
745 ALEffect->Reverb.LateReverbPan[0] = pflValues[0];
746 ALEffect->Reverb.LateReverbPan[1] = pflValues[1];
747 ALEffect->Reverb.LateReverbPan[2] = pflValues[2];
749 else
750 alSetError(Context, AL_INVALID_VALUE);
751 break;
753 default:
754 alSetError(Context, AL_INVALID_ENUM);
755 break;
758 else if(ALEffect->type == AL_EFFECT_REVERB)
760 switch(param)
762 case AL_REVERB_DENSITY:
763 case AL_REVERB_DIFFUSION:
764 case AL_REVERB_GAIN:
765 case AL_REVERB_GAINHF:
766 case AL_REVERB_DECAY_TIME:
767 case AL_REVERB_DECAY_HFRATIO:
768 case AL_REVERB_REFLECTIONS_GAIN:
769 case AL_REVERB_REFLECTIONS_DELAY:
770 case AL_REVERB_LATE_REVERB_GAIN:
771 case AL_REVERB_LATE_REVERB_DELAY:
772 case AL_REVERB_AIR_ABSORPTION_GAINHF:
773 case AL_REVERB_ROOM_ROLLOFF_FACTOR:
774 alEffectf(effect, param, pflValues[0]);
775 break;
777 default:
778 alSetError(Context, AL_INVALID_ENUM);
779 break;
782 else if(ALEffect->type == AL_EFFECT_ECHO)
784 switch(param)
786 case AL_ECHO_DELAY:
787 case AL_ECHO_LRDELAY:
788 case AL_ECHO_DAMPING:
789 case AL_ECHO_FEEDBACK:
790 case AL_ECHO_SPREAD:
791 alEffectf(effect, param, pflValues[0]);
792 break;
794 default:
795 alSetError(Context, AL_INVALID_ENUM);
796 break;
799 else if(ALEffect->type == AL_EFFECT_RING_MODULATOR)
801 switch(param)
803 case AL_RING_MODULATOR_FREQUENCY:
804 case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
805 alEffectf(effect, param, pflValues[0]);
806 break;
808 default:
809 alSetError(Context, AL_INVALID_ENUM);
810 break;
813 else
814 alSetError(Context, AL_INVALID_ENUM);
816 else
817 alSetError(Context, AL_INVALID_NAME);
819 ProcessContext(Context);
822 AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue)
824 ALCcontext *Context;
825 ALCdevice *Device;
826 ALeffect *ALEffect;
828 Context = GetContextSuspended();
829 if(!Context) return;
831 Device = Context->Device;
832 if((ALEffect=LookupEffect(Device->EffectMap, effect)) != NULL)
834 if(param == AL_EFFECT_TYPE)
836 *piValue = ALEffect->type;
838 else if(ALEffect->type == AL_EFFECT_EAXREVERB)
840 switch(param)
842 case AL_EAXREVERB_DECAY_HFLIMIT:
843 *piValue = ALEffect->Reverb.DecayHFLimit;
844 break;
846 default:
847 alSetError(Context, AL_INVALID_ENUM);
848 break;
851 else if(ALEffect->type == AL_EFFECT_REVERB)
853 switch(param)
855 case AL_REVERB_DECAY_HFLIMIT:
856 *piValue = ALEffect->Reverb.DecayHFLimit;
857 break;
859 default:
860 alSetError(Context, AL_INVALID_ENUM);
861 break;
864 else if(ALEffect->type == AL_EFFECT_ECHO)
866 switch(param)
868 default:
869 alSetError(Context, AL_INVALID_ENUM);
870 break;
873 else if(ALEffect->type == AL_EFFECT_RING_MODULATOR)
875 switch(param)
877 case AL_RING_MODULATOR_FREQUENCY:
878 *piValue = (ALint)ALEffect->Modulator.Frequency;
879 break;
880 case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
881 *piValue = (ALint)ALEffect->Modulator.HighPassCutoff;
882 break;
883 case AL_RING_MODULATOR_WAVEFORM:
884 *piValue = ALEffect->Modulator.Waveform;
885 break;
887 default:
888 alSetError(Context, AL_INVALID_ENUM);
889 break;
892 else
893 alSetError(Context, AL_INVALID_ENUM);
895 else
896 alSetError(Context, AL_INVALID_NAME);
898 ProcessContext(Context);
901 AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues)
903 ALCcontext *Context;
904 ALCdevice *Device;
905 ALeffect *ALEffect;
907 Context = GetContextSuspended();
908 if(!Context) return;
910 Device = Context->Device;
911 if((ALEffect=LookupEffect(Device->EffectMap, effect)) != NULL)
913 if(param == AL_EFFECT_TYPE)
915 alGetEffecti(effect, param, piValues);
917 else if(ALEffect->type == AL_EFFECT_EAXREVERB)
919 switch(param)
921 case AL_EAXREVERB_DECAY_HFLIMIT:
922 alGetEffecti(effect, param, piValues);
923 break;
925 default:
926 alSetError(Context, AL_INVALID_ENUM);
927 break;
930 else if(ALEffect->type == AL_EFFECT_REVERB)
932 switch(param)
934 case AL_REVERB_DECAY_HFLIMIT:
935 alGetEffecti(effect, param, piValues);
936 break;
938 default:
939 alSetError(Context, AL_INVALID_ENUM);
940 break;
943 else if(ALEffect->type == AL_EFFECT_ECHO)
945 switch(param)
947 default:
948 alSetError(Context, AL_INVALID_ENUM);
949 break;
952 else if(ALEffect->type == AL_EFFECT_RING_MODULATOR)
954 switch(param)
956 case AL_RING_MODULATOR_FREQUENCY:
957 case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
958 case AL_RING_MODULATOR_WAVEFORM:
959 alGetEffecti(effect, param, piValues);
960 break;
962 default:
963 alSetError(Context, AL_INVALID_ENUM);
964 break;
967 else
968 alSetError(Context, AL_INVALID_ENUM);
970 else
971 alSetError(Context, AL_INVALID_NAME);
973 ProcessContext(Context);
976 AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue)
978 ALCcontext *Context;
979 ALCdevice *Device;
980 ALeffect *ALEffect;
982 Context = GetContextSuspended();
983 if(!Context) return;
985 Device = Context->Device;
986 if((ALEffect=LookupEffect(Device->EffectMap, effect)) != NULL)
988 if(ALEffect->type == AL_EFFECT_EAXREVERB)
990 switch(param)
992 case AL_EAXREVERB_DENSITY:
993 *pflValue = ALEffect->Reverb.Density;
994 break;
996 case AL_EAXREVERB_DIFFUSION:
997 *pflValue = ALEffect->Reverb.Diffusion;
998 break;
1000 case AL_EAXREVERB_GAIN:
1001 *pflValue = ALEffect->Reverb.Gain;
1002 break;
1004 case AL_EAXREVERB_GAINHF:
1005 *pflValue = ALEffect->Reverb.GainHF;
1006 break;
1008 case AL_EAXREVERB_GAINLF:
1009 *pflValue = ALEffect->Reverb.GainLF;
1010 break;
1012 case AL_EAXREVERB_DECAY_TIME:
1013 *pflValue = ALEffect->Reverb.DecayTime;
1014 break;
1016 case AL_EAXREVERB_DECAY_HFRATIO:
1017 *pflValue = ALEffect->Reverb.DecayHFRatio;
1018 break;
1020 case AL_EAXREVERB_DECAY_LFRATIO:
1021 *pflValue = ALEffect->Reverb.DecayLFRatio;
1022 break;
1024 case AL_EAXREVERB_REFLECTIONS_GAIN:
1025 *pflValue = ALEffect->Reverb.ReflectionsGain;
1026 break;
1028 case AL_EAXREVERB_REFLECTIONS_DELAY:
1029 *pflValue = ALEffect->Reverb.ReflectionsDelay;
1030 break;
1032 case AL_EAXREVERB_LATE_REVERB_GAIN:
1033 *pflValue = ALEffect->Reverb.LateReverbGain;
1034 break;
1036 case AL_EAXREVERB_LATE_REVERB_DELAY:
1037 *pflValue = ALEffect->Reverb.LateReverbDelay;
1038 break;
1040 case AL_EAXREVERB_AIR_ABSORPTION_GAINHF:
1041 *pflValue = ALEffect->Reverb.AirAbsorptionGainHF;
1042 break;
1044 case AL_EAXREVERB_ECHO_TIME:
1045 *pflValue = ALEffect->Reverb.EchoTime;
1046 break;
1048 case AL_EAXREVERB_ECHO_DEPTH:
1049 *pflValue = ALEffect->Reverb.EchoDepth;
1050 break;
1052 case AL_EAXREVERB_MODULATION_TIME:
1053 *pflValue = ALEffect->Reverb.ModulationTime;
1054 break;
1056 case AL_EAXREVERB_MODULATION_DEPTH:
1057 *pflValue = ALEffect->Reverb.ModulationDepth;
1058 break;
1060 case AL_EAXREVERB_HFREFERENCE:
1061 *pflValue = ALEffect->Reverb.HFReference;
1062 break;
1064 case AL_EAXREVERB_LFREFERENCE:
1065 *pflValue = ALEffect->Reverb.LFReference;
1066 break;
1068 case AL_EAXREVERB_ROOM_ROLLOFF_FACTOR:
1069 *pflValue = ALEffect->Reverb.RoomRolloffFactor;
1070 break;
1072 default:
1073 alSetError(Context, AL_INVALID_ENUM);
1074 break;
1077 else if(ALEffect->type == AL_EFFECT_REVERB)
1079 switch(param)
1081 case AL_REVERB_DENSITY:
1082 *pflValue = ALEffect->Reverb.Density;
1083 break;
1085 case AL_REVERB_DIFFUSION:
1086 *pflValue = ALEffect->Reverb.Diffusion;
1087 break;
1089 case AL_REVERB_GAIN:
1090 *pflValue = ALEffect->Reverb.Gain;
1091 break;
1093 case AL_REVERB_GAINHF:
1094 *pflValue = ALEffect->Reverb.GainHF;
1095 break;
1097 case AL_REVERB_DECAY_TIME:
1098 *pflValue = ALEffect->Reverb.DecayTime;
1099 break;
1101 case AL_REVERB_DECAY_HFRATIO:
1102 *pflValue = ALEffect->Reverb.DecayHFRatio;
1103 break;
1105 case AL_REVERB_REFLECTIONS_GAIN:
1106 *pflValue = ALEffect->Reverb.ReflectionsGain;
1107 break;
1109 case AL_REVERB_REFLECTIONS_DELAY:
1110 *pflValue = ALEffect->Reverb.ReflectionsDelay;
1111 break;
1113 case AL_REVERB_LATE_REVERB_GAIN:
1114 *pflValue = ALEffect->Reverb.LateReverbGain;
1115 break;
1117 case AL_REVERB_LATE_REVERB_DELAY:
1118 *pflValue = ALEffect->Reverb.LateReverbDelay;
1119 break;
1121 case AL_REVERB_AIR_ABSORPTION_GAINHF:
1122 *pflValue = ALEffect->Reverb.AirAbsorptionGainHF;
1123 break;
1125 case AL_REVERB_ROOM_ROLLOFF_FACTOR:
1126 *pflValue = ALEffect->Reverb.RoomRolloffFactor;
1127 break;
1129 default:
1130 alSetError(Context, AL_INVALID_ENUM);
1131 break;
1134 else if(ALEffect->type == AL_EFFECT_ECHO)
1136 switch(param)
1138 case AL_ECHO_DELAY:
1139 *pflValue = ALEffect->Echo.Delay;
1140 break;
1142 case AL_ECHO_LRDELAY:
1143 *pflValue = ALEffect->Echo.LRDelay;
1144 break;
1146 case AL_ECHO_DAMPING:
1147 *pflValue = ALEffect->Echo.Damping;
1148 break;
1150 case AL_ECHO_FEEDBACK:
1151 *pflValue = ALEffect->Echo.Feedback;
1152 break;
1154 case AL_ECHO_SPREAD:
1155 *pflValue = ALEffect->Echo.Spread;
1156 break;
1158 default:
1159 alSetError(Context, AL_INVALID_ENUM);
1160 break;
1163 else if(ALEffect->type == AL_EFFECT_RING_MODULATOR)
1165 switch(param)
1167 case AL_RING_MODULATOR_FREQUENCY:
1168 *pflValue = ALEffect->Modulator.Frequency;
1169 break;
1170 case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
1171 *pflValue = ALEffect->Modulator.HighPassCutoff;
1172 break;
1174 default:
1175 alSetError(Context, AL_INVALID_ENUM);
1176 break;
1179 else
1180 alSetError(Context, AL_INVALID_ENUM);
1182 else
1183 alSetError(Context, AL_INVALID_NAME);
1185 ProcessContext(Context);
1188 AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues)
1190 ALCcontext *Context;
1191 ALCdevice *Device;
1192 ALeffect *ALEffect;
1194 Context = GetContextSuspended();
1195 if(!Context) return;
1197 Device = Context->Device;
1198 if((ALEffect=LookupEffect(Device->EffectMap, effect)) != NULL)
1200 if(ALEffect->type == AL_EFFECT_EAXREVERB)
1202 switch(param)
1204 case AL_EAXREVERB_DENSITY:
1205 case AL_EAXREVERB_DIFFUSION:
1206 case AL_EAXREVERB_GAIN:
1207 case AL_EAXREVERB_GAINHF:
1208 case AL_EAXREVERB_GAINLF:
1209 case AL_EAXREVERB_DECAY_TIME:
1210 case AL_EAXREVERB_DECAY_HFRATIO:
1211 case AL_EAXREVERB_DECAY_LFRATIO:
1212 case AL_EAXREVERB_REFLECTIONS_GAIN:
1213 case AL_EAXREVERB_REFLECTIONS_DELAY:
1214 case AL_EAXREVERB_LATE_REVERB_GAIN:
1215 case AL_EAXREVERB_LATE_REVERB_DELAY:
1216 case AL_EAXREVERB_AIR_ABSORPTION_GAINHF:
1217 case AL_EAXREVERB_ECHO_TIME:
1218 case AL_EAXREVERB_ECHO_DEPTH:
1219 case AL_EAXREVERB_MODULATION_TIME:
1220 case AL_EAXREVERB_MODULATION_DEPTH:
1221 case AL_EAXREVERB_HFREFERENCE:
1222 case AL_EAXREVERB_LFREFERENCE:
1223 case AL_EAXREVERB_ROOM_ROLLOFF_FACTOR:
1224 alGetEffectf(effect, param, pflValues);
1225 break;
1227 case AL_EAXREVERB_REFLECTIONS_PAN:
1228 pflValues[0] = ALEffect->Reverb.ReflectionsPan[0];
1229 pflValues[1] = ALEffect->Reverb.ReflectionsPan[1];
1230 pflValues[2] = ALEffect->Reverb.ReflectionsPan[2];
1231 break;
1232 case AL_EAXREVERB_LATE_REVERB_PAN:
1233 pflValues[0] = ALEffect->Reverb.LateReverbPan[0];
1234 pflValues[1] = ALEffect->Reverb.LateReverbPan[1];
1235 pflValues[2] = ALEffect->Reverb.LateReverbPan[2];
1236 break;
1238 default:
1239 alSetError(Context, AL_INVALID_ENUM);
1240 break;
1243 else if(ALEffect->type == AL_EFFECT_REVERB)
1245 switch(param)
1247 case AL_REVERB_DENSITY:
1248 case AL_REVERB_DIFFUSION:
1249 case AL_REVERB_GAIN:
1250 case AL_REVERB_GAINHF:
1251 case AL_REVERB_DECAY_TIME:
1252 case AL_REVERB_DECAY_HFRATIO:
1253 case AL_REVERB_REFLECTIONS_GAIN:
1254 case AL_REVERB_REFLECTIONS_DELAY:
1255 case AL_REVERB_LATE_REVERB_GAIN:
1256 case AL_REVERB_LATE_REVERB_DELAY:
1257 case AL_REVERB_AIR_ABSORPTION_GAINHF:
1258 case AL_REVERB_ROOM_ROLLOFF_FACTOR:
1259 alGetEffectf(effect, param, pflValues);
1260 break;
1262 default:
1263 alSetError(Context, AL_INVALID_ENUM);
1264 break;
1267 else if(ALEffect->type == AL_EFFECT_ECHO)
1269 switch(param)
1271 case AL_ECHO_DELAY:
1272 case AL_ECHO_LRDELAY:
1273 case AL_ECHO_DAMPING:
1274 case AL_ECHO_FEEDBACK:
1275 case AL_ECHO_SPREAD:
1276 alGetEffectf(effect, param, pflValues);
1277 break;
1279 default:
1280 alSetError(Context, AL_INVALID_ENUM);
1281 break;
1284 else if(ALEffect->type == AL_EFFECT_RING_MODULATOR)
1286 switch(param)
1288 case AL_RING_MODULATOR_FREQUENCY:
1289 case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
1290 alGetEffectf(effect, param, pflValues);
1291 break;
1293 default:
1294 alSetError(Context, AL_INVALID_ENUM);
1295 break;
1298 else
1299 alSetError(Context, AL_INVALID_ENUM);
1301 else
1302 alSetError(Context, AL_INVALID_NAME);
1304 ProcessContext(Context);
1308 ALvoid ReleaseALEffects(ALCdevice *device)
1310 ALsizei i;
1311 for(i = 0;i < device->EffectMap.size;i++)
1313 ALeffect *temp = device->EffectMap.array[i].value;
1314 device->EffectMap.array[i].value = NULL;
1316 // Release effect structure
1317 ALTHUNK_REMOVEENTRY(temp->effect);
1318 memset(temp, 0, sizeof(ALeffect));
1319 free(temp);
1324 static void InitEffectParams(ALeffect *effect, ALenum type)
1326 effect->type = type;
1327 switch(type)
1329 /* NOTE: Standard reverb and EAX reverb use the same defaults for the
1330 * shared parameters, and EAX's additional parameters default to
1331 * values assumed by standard reverb.
1333 case AL_EFFECT_EAXREVERB:
1334 case AL_EFFECT_REVERB:
1335 effect->Reverb.Density = AL_EAXREVERB_DEFAULT_DENSITY;
1336 effect->Reverb.Diffusion = AL_EAXREVERB_DEFAULT_DIFFUSION;
1337 effect->Reverb.Gain = AL_EAXREVERB_DEFAULT_GAIN;
1338 effect->Reverb.GainHF = AL_EAXREVERB_DEFAULT_GAINHF;
1339 effect->Reverb.GainLF = AL_EAXREVERB_DEFAULT_GAINLF;
1340 effect->Reverb.DecayTime = AL_EAXREVERB_DEFAULT_DECAY_TIME;
1341 effect->Reverb.DecayHFRatio = AL_EAXREVERB_DEFAULT_DECAY_HFRATIO;
1342 effect->Reverb.DecayLFRatio = AL_EAXREVERB_DEFAULT_DECAY_LFRATIO;
1343 effect->Reverb.ReflectionsGain = AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN;
1344 effect->Reverb.ReflectionsDelay = AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY;
1345 effect->Reverb.ReflectionsPan[0] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ;
1346 effect->Reverb.ReflectionsPan[1] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ;
1347 effect->Reverb.ReflectionsPan[2] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ;
1348 effect->Reverb.LateReverbGain = AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN;
1349 effect->Reverb.LateReverbDelay = AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY;
1350 effect->Reverb.LateReverbPan[0] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ;
1351 effect->Reverb.LateReverbPan[1] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ;
1352 effect->Reverb.LateReverbPan[2] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ;
1353 effect->Reverb.EchoTime = AL_EAXREVERB_DEFAULT_ECHO_TIME;
1354 effect->Reverb.EchoDepth = AL_EAXREVERB_DEFAULT_ECHO_DEPTH;
1355 effect->Reverb.ModulationTime = AL_EAXREVERB_DEFAULT_MODULATION_TIME;
1356 effect->Reverb.ModulationDepth = AL_EAXREVERB_DEFAULT_MODULATION_DEPTH;
1357 effect->Reverb.AirAbsorptionGainHF = AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF;
1358 effect->Reverb.HFReference = AL_EAXREVERB_DEFAULT_HFREFERENCE;
1359 effect->Reverb.LFReference = AL_EAXREVERB_DEFAULT_LFREFERENCE;
1360 effect->Reverb.RoomRolloffFactor = AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR;
1361 effect->Reverb.DecayHFLimit = AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT;
1362 break;
1363 case AL_EFFECT_ECHO:
1364 effect->Echo.Delay = AL_ECHO_DEFAULT_DELAY;
1365 effect->Echo.LRDelay = AL_ECHO_DEFAULT_LRDELAY;
1366 effect->Echo.Damping = AL_ECHO_DEFAULT_DAMPING;
1367 effect->Echo.Feedback = AL_ECHO_DEFAULT_FEEDBACK;
1368 effect->Echo.Spread = AL_ECHO_DEFAULT_SPREAD;
1369 break;
1370 case AL_EFFECT_RING_MODULATOR:
1371 effect->Modulator.Frequency = AL_RING_MODULATOR_DEFAULT_FREQUENCY;
1372 effect->Modulator.HighPassCutoff = AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF;
1373 effect->Modulator.Waveform = AL_RING_MODULATOR_DEFAULT_WAVEFORM;
1374 break;