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.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 * Or go to http://www.gnu.org/copyleft/lgpl.html
35 ALboolean DisabledEffects
[MAX_EFFECTS
];
37 extern inline struct ALeffect
*LookupEffect(ALCdevice
*device
, ALuint id
);
38 extern inline struct ALeffect
*RemoveEffect(ALCdevice
*device
, ALuint id
);
39 extern inline ALboolean
IsReverbEffect(ALenum type
);
41 static void InitEffectParams(ALeffect
*effect
, ALenum type
);
44 AL_API ALvoid AL_APIENTRY
alGenEffects(ALsizei n
, ALuint
*effects
)
50 context
= GetContextRef();
54 SET_ERROR_AND_GOTO(context
, AL_INVALID_VALUE
, done
);
56 device
= context
->Device
;
57 for(cur
= 0;cur
< n
;cur
++)
59 ALeffect
*effect
= calloc(1, sizeof(ALeffect
));
60 ALenum err
= AL_OUT_OF_MEMORY
;
61 if(!effect
|| (err
=InitEffect(effect
)) != AL_NO_ERROR
)
64 alDeleteEffects(cur
, effects
);
65 SET_ERROR_AND_GOTO(context
, err
, done
);
68 err
= NewThunkEntry(&effect
->id
);
69 if(err
== AL_NO_ERROR
)
70 err
= InsertUIntMapEntry(&device
->EffectMap
, effect
->id
, effect
);
71 if(err
!= AL_NO_ERROR
)
73 FreeThunkEntry(effect
->id
);
74 memset(effect
, 0, sizeof(ALeffect
));
77 alDeleteEffects(cur
, effects
);
78 SET_ERROR_AND_GOTO(context
, err
, done
);
81 effects
[cur
] = effect
->id
;
85 ALCcontext_DecRef(context
);
88 AL_API ALvoid AL_APIENTRY
alDeleteEffects(ALsizei n
, const ALuint
*effects
)
95 context
= GetContextRef();
99 SET_ERROR_AND_GOTO(context
, AL_INVALID_VALUE
, done
);
101 device
= context
->Device
;
104 if(effects
[i
] && LookupEffect(device
, effects
[i
]) == NULL
)
105 SET_ERROR_AND_GOTO(context
, AL_INVALID_NAME
, done
);
109 if((effect
=RemoveEffect(device
, effects
[i
])) == NULL
)
111 FreeThunkEntry(effect
->id
);
113 memset(effect
, 0, sizeof(*effect
));
118 ALCcontext_DecRef(context
);
121 AL_API ALboolean AL_APIENTRY
alIsEffect(ALuint effect
)
126 Context
= GetContextRef();
127 if(!Context
) return AL_FALSE
;
129 result
= ((!effect
|| LookupEffect(Context
->Device
, effect
)) ?
132 ALCcontext_DecRef(Context
);
137 AL_API ALvoid AL_APIENTRY
alEffecti(ALuint effect
, ALenum param
, ALint value
)
143 Context
= GetContextRef();
146 Device
= Context
->Device
;
147 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
148 alSetError(Context
, AL_INVALID_NAME
);
151 if(param
== AL_EFFECT_TYPE
)
153 ALboolean isOk
= (value
== AL_EFFECT_NULL
);
155 for(i
= 0;!isOk
&& EffectList
[i
].val
;i
++)
157 if(value
== EffectList
[i
].val
&&
158 !DisabledEffects
[EffectList
[i
].type
])
163 InitEffectParams(ALEffect
, value
);
165 alSetError(Context
, AL_INVALID_VALUE
);
169 /* Call the appropriate handler */
170 V(ALEffect
,setParami
)(Context
, param
, value
);
174 ALCcontext_DecRef(Context
);
177 AL_API ALvoid AL_APIENTRY
alEffectiv(ALuint effect
, ALenum param
, const ALint
*values
)
186 alEffecti(effect
, param
, values
[0]);
190 Context
= GetContextRef();
193 Device
= Context
->Device
;
194 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
195 alSetError(Context
, AL_INVALID_NAME
);
198 /* Call the appropriate handler */
199 V(ALEffect
,setParamiv
)(Context
, param
, values
);
202 ALCcontext_DecRef(Context
);
205 AL_API ALvoid AL_APIENTRY
alEffectf(ALuint effect
, ALenum param
, ALfloat value
)
211 Context
= GetContextRef();
214 Device
= Context
->Device
;
215 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
216 alSetError(Context
, AL_INVALID_NAME
);
219 /* Call the appropriate handler */
220 V(ALEffect
,setParamf
)(Context
, param
, value
);
223 ALCcontext_DecRef(Context
);
226 AL_API ALvoid AL_APIENTRY
alEffectfv(ALuint effect
, ALenum param
, const ALfloat
*values
)
232 Context
= GetContextRef();
235 Device
= Context
->Device
;
236 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
237 alSetError(Context
, AL_INVALID_NAME
);
240 /* Call the appropriate handler */
241 V(ALEffect
,setParamfv
)(Context
, param
, values
);
244 ALCcontext_DecRef(Context
);
247 AL_API ALvoid AL_APIENTRY
alGetEffecti(ALuint effect
, ALenum param
, ALint
*value
)
253 Context
= GetContextRef();
256 Device
= Context
->Device
;
257 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
258 alSetError(Context
, AL_INVALID_NAME
);
261 if(param
== AL_EFFECT_TYPE
)
262 *value
= ALEffect
->type
;
265 /* Call the appropriate handler */
266 V(ALEffect
,getParami
)(Context
, param
, value
);
270 ALCcontext_DecRef(Context
);
273 AL_API ALvoid AL_APIENTRY
alGetEffectiv(ALuint effect
, ALenum param
, ALint
*values
)
282 alGetEffecti(effect
, param
, values
);
286 Context
= GetContextRef();
289 Device
= Context
->Device
;
290 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
291 alSetError(Context
, AL_INVALID_NAME
);
294 /* Call the appropriate handler */
295 V(ALEffect
,getParamiv
)(Context
, param
, values
);
298 ALCcontext_DecRef(Context
);
301 AL_API ALvoid AL_APIENTRY
alGetEffectf(ALuint effect
, ALenum param
, ALfloat
*value
)
307 Context
= GetContextRef();
310 Device
= Context
->Device
;
311 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
312 alSetError(Context
, AL_INVALID_NAME
);
315 /* Call the appropriate handler */
316 V(ALEffect
,getParamf
)(Context
, param
, value
);
319 ALCcontext_DecRef(Context
);
322 AL_API ALvoid AL_APIENTRY
alGetEffectfv(ALuint effect
, ALenum param
, ALfloat
*values
)
328 Context
= GetContextRef();
331 Device
= Context
->Device
;
332 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
333 alSetError(Context
, AL_INVALID_NAME
);
336 /* Call the appropriate handler */
337 V(ALEffect
,getParamfv
)(Context
, param
, values
);
340 ALCcontext_DecRef(Context
);
344 ALenum
InitEffect(ALeffect
*effect
)
346 InitEffectParams(effect
, AL_EFFECT_NULL
);
350 ALvoid
ReleaseALEffects(ALCdevice
*device
)
353 for(i
= 0;i
< device
->EffectMap
.size
;i
++)
355 ALeffect
*temp
= device
->EffectMap
.array
[i
].value
;
356 device
->EffectMap
.array
[i
].value
= NULL
;
358 // Release effect structure
359 FreeThunkEntry(temp
->id
);
360 memset(temp
, 0, sizeof(ALeffect
));
366 static void InitEffectParams(ALeffect
*effect
, ALenum type
)
370 case AL_EFFECT_EAXREVERB
:
371 effect
->Props
.Reverb
.Density
= AL_EAXREVERB_DEFAULT_DENSITY
;
372 effect
->Props
.Reverb
.Diffusion
= AL_EAXREVERB_DEFAULT_DIFFUSION
;
373 effect
->Props
.Reverb
.Gain
= AL_EAXREVERB_DEFAULT_GAIN
;
374 effect
->Props
.Reverb
.GainHF
= AL_EAXREVERB_DEFAULT_GAINHF
;
375 effect
->Props
.Reverb
.GainLF
= AL_EAXREVERB_DEFAULT_GAINLF
;
376 effect
->Props
.Reverb
.DecayTime
= AL_EAXREVERB_DEFAULT_DECAY_TIME
;
377 effect
->Props
.Reverb
.DecayHFRatio
= AL_EAXREVERB_DEFAULT_DECAY_HFRATIO
;
378 effect
->Props
.Reverb
.DecayLFRatio
= AL_EAXREVERB_DEFAULT_DECAY_LFRATIO
;
379 effect
->Props
.Reverb
.ReflectionsGain
= AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN
;
380 effect
->Props
.Reverb
.ReflectionsDelay
= AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY
;
381 effect
->Props
.Reverb
.ReflectionsPan
[0] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ
;
382 effect
->Props
.Reverb
.ReflectionsPan
[1] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ
;
383 effect
->Props
.Reverb
.ReflectionsPan
[2] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ
;
384 effect
->Props
.Reverb
.LateReverbGain
= AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN
;
385 effect
->Props
.Reverb
.LateReverbDelay
= AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY
;
386 effect
->Props
.Reverb
.LateReverbPan
[0] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ
;
387 effect
->Props
.Reverb
.LateReverbPan
[1] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ
;
388 effect
->Props
.Reverb
.LateReverbPan
[2] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ
;
389 effect
->Props
.Reverb
.EchoTime
= AL_EAXREVERB_DEFAULT_ECHO_TIME
;
390 effect
->Props
.Reverb
.EchoDepth
= AL_EAXREVERB_DEFAULT_ECHO_DEPTH
;
391 effect
->Props
.Reverb
.ModulationTime
= AL_EAXREVERB_DEFAULT_MODULATION_TIME
;
392 effect
->Props
.Reverb
.ModulationDepth
= AL_EAXREVERB_DEFAULT_MODULATION_DEPTH
;
393 effect
->Props
.Reverb
.AirAbsorptionGainHF
= AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF
;
394 effect
->Props
.Reverb
.HFReference
= AL_EAXREVERB_DEFAULT_HFREFERENCE
;
395 effect
->Props
.Reverb
.LFReference
= AL_EAXREVERB_DEFAULT_LFREFERENCE
;
396 effect
->Props
.Reverb
.RoomRolloffFactor
= AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR
;
397 effect
->Props
.Reverb
.DecayHFLimit
= AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT
;
398 SET_VTABLE1(ALeaxreverb
, effect
);
400 case AL_EFFECT_REVERB
:
401 effect
->Props
.Reverb
.Density
= AL_REVERB_DEFAULT_DENSITY
;
402 effect
->Props
.Reverb
.Diffusion
= AL_REVERB_DEFAULT_DIFFUSION
;
403 effect
->Props
.Reverb
.Gain
= AL_REVERB_DEFAULT_GAIN
;
404 effect
->Props
.Reverb
.GainHF
= AL_REVERB_DEFAULT_GAINHF
;
405 effect
->Props
.Reverb
.GainLF
= 1.0f
;
406 effect
->Props
.Reverb
.DecayTime
= AL_REVERB_DEFAULT_DECAY_TIME
;
407 effect
->Props
.Reverb
.DecayHFRatio
= AL_REVERB_DEFAULT_DECAY_HFRATIO
;
408 effect
->Props
.Reverb
.DecayLFRatio
= 1.0f
;
409 effect
->Props
.Reverb
.ReflectionsGain
= AL_REVERB_DEFAULT_REFLECTIONS_GAIN
;
410 effect
->Props
.Reverb
.ReflectionsDelay
= AL_REVERB_DEFAULT_REFLECTIONS_DELAY
;
411 effect
->Props
.Reverb
.ReflectionsPan
[0] = 0.0f
;
412 effect
->Props
.Reverb
.ReflectionsPan
[1] = 0.0f
;
413 effect
->Props
.Reverb
.ReflectionsPan
[2] = 0.0f
;
414 effect
->Props
.Reverb
.LateReverbGain
= AL_REVERB_DEFAULT_LATE_REVERB_GAIN
;
415 effect
->Props
.Reverb
.LateReverbDelay
= AL_REVERB_DEFAULT_LATE_REVERB_DELAY
;
416 effect
->Props
.Reverb
.LateReverbPan
[0] = 0.0f
;
417 effect
->Props
.Reverb
.LateReverbPan
[1] = 0.0f
;
418 effect
->Props
.Reverb
.LateReverbPan
[2] = 0.0f
;
419 effect
->Props
.Reverb
.EchoTime
= 0.25f
;
420 effect
->Props
.Reverb
.EchoDepth
= 0.0f
;
421 effect
->Props
.Reverb
.ModulationTime
= 0.25f
;
422 effect
->Props
.Reverb
.ModulationDepth
= 0.0f
;
423 effect
->Props
.Reverb
.AirAbsorptionGainHF
= AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF
;
424 effect
->Props
.Reverb
.HFReference
= 5000.0f
;
425 effect
->Props
.Reverb
.LFReference
= 250.0f
;
426 effect
->Props
.Reverb
.RoomRolloffFactor
= AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR
;
427 effect
->Props
.Reverb
.DecayHFLimit
= AL_REVERB_DEFAULT_DECAY_HFLIMIT
;
428 SET_VTABLE1(ALreverb
, effect
);
430 case AL_EFFECT_AUTOWAH
:
431 effect
->Props
.Autowah
.AttackTime
= AL_AUTOWAH_DEFAULT_ATTACK_TIME
;
432 effect
->Props
.Autowah
.PeakGain
= AL_AUTOWAH_DEFAULT_PEAK_GAIN
;
433 effect
->Props
.Autowah
.ReleaseTime
= AL_AUTOWAH_DEFAULT_RELEASE_TIME
;
434 effect
->Props
.Autowah
.Resonance
= AL_AUTOWAH_DEFAULT_RESONANCE
;
435 SET_VTABLE1(ALautowah
, effect
);
437 case AL_EFFECT_CHORUS
:
438 effect
->Props
.Chorus
.Waveform
= AL_CHORUS_DEFAULT_WAVEFORM
;
439 effect
->Props
.Chorus
.Phase
= AL_CHORUS_DEFAULT_PHASE
;
440 effect
->Props
.Chorus
.Rate
= AL_CHORUS_DEFAULT_RATE
;
441 effect
->Props
.Chorus
.Depth
= AL_CHORUS_DEFAULT_DEPTH
;
442 effect
->Props
.Chorus
.Feedback
= AL_CHORUS_DEFAULT_FEEDBACK
;
443 effect
->Props
.Chorus
.Delay
= AL_CHORUS_DEFAULT_DELAY
;
444 SET_VTABLE1(ALchorus
, effect
);
446 case AL_EFFECT_COMPRESSOR
:
447 effect
->Props
.Compressor
.OnOff
= AL_COMPRESSOR_DEFAULT_ONOFF
;
448 SET_VTABLE1(ALcompressor
, effect
);
450 case AL_EFFECT_DISTORTION
:
451 effect
->Props
.Distortion
.Edge
= AL_DISTORTION_DEFAULT_EDGE
;
452 effect
->Props
.Distortion
.Gain
= AL_DISTORTION_DEFAULT_GAIN
;
453 effect
->Props
.Distortion
.LowpassCutoff
= AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF
;
454 effect
->Props
.Distortion
.EQCenter
= AL_DISTORTION_DEFAULT_EQCENTER
;
455 effect
->Props
.Distortion
.EQBandwidth
= AL_DISTORTION_DEFAULT_EQBANDWIDTH
;
456 SET_VTABLE1(ALdistortion
, effect
);
459 effect
->Props
.Echo
.Delay
= AL_ECHO_DEFAULT_DELAY
;
460 effect
->Props
.Echo
.LRDelay
= AL_ECHO_DEFAULT_LRDELAY
;
461 effect
->Props
.Echo
.Damping
= AL_ECHO_DEFAULT_DAMPING
;
462 effect
->Props
.Echo
.Feedback
= AL_ECHO_DEFAULT_FEEDBACK
;
463 effect
->Props
.Echo
.Spread
= AL_ECHO_DEFAULT_SPREAD
;
464 SET_VTABLE1(ALecho
, effect
);
466 case AL_EFFECT_EQUALIZER
:
467 effect
->Props
.Equalizer
.LowCutoff
= AL_EQUALIZER_DEFAULT_LOW_CUTOFF
;
468 effect
->Props
.Equalizer
.LowGain
= AL_EQUALIZER_DEFAULT_LOW_GAIN
;
469 effect
->Props
.Equalizer
.Mid1Center
= AL_EQUALIZER_DEFAULT_MID1_CENTER
;
470 effect
->Props
.Equalizer
.Mid1Gain
= AL_EQUALIZER_DEFAULT_MID1_GAIN
;
471 effect
->Props
.Equalizer
.Mid1Width
= AL_EQUALIZER_DEFAULT_MID1_WIDTH
;
472 effect
->Props
.Equalizer
.Mid2Center
= AL_EQUALIZER_DEFAULT_MID2_CENTER
;
473 effect
->Props
.Equalizer
.Mid2Gain
= AL_EQUALIZER_DEFAULT_MID2_GAIN
;
474 effect
->Props
.Equalizer
.Mid2Width
= AL_EQUALIZER_DEFAULT_MID2_WIDTH
;
475 effect
->Props
.Equalizer
.HighCutoff
= AL_EQUALIZER_DEFAULT_HIGH_CUTOFF
;
476 effect
->Props
.Equalizer
.HighGain
= AL_EQUALIZER_DEFAULT_HIGH_GAIN
;
477 SET_VTABLE1(ALequalizer
, effect
);
479 case AL_EFFECT_FLANGER
:
480 effect
->Props
.Flanger
.Waveform
= AL_FLANGER_DEFAULT_WAVEFORM
;
481 effect
->Props
.Flanger
.Phase
= AL_FLANGER_DEFAULT_PHASE
;
482 effect
->Props
.Flanger
.Rate
= AL_FLANGER_DEFAULT_RATE
;
483 effect
->Props
.Flanger
.Depth
= AL_FLANGER_DEFAULT_DEPTH
;
484 effect
->Props
.Flanger
.Feedback
= AL_FLANGER_DEFAULT_FEEDBACK
;
485 effect
->Props
.Flanger
.Delay
= AL_FLANGER_DEFAULT_DELAY
;
486 SET_VTABLE1(ALflanger
, effect
);
488 case AL_EFFECT_RING_MODULATOR
:
489 effect
->Props
.Modulator
.Frequency
= AL_RING_MODULATOR_DEFAULT_FREQUENCY
;
490 effect
->Props
.Modulator
.HighPassCutoff
= AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF
;
491 effect
->Props
.Modulator
.Waveform
= AL_RING_MODULATOR_DEFAULT_WAVEFORM
;
492 SET_VTABLE1(ALmodulator
, effect
);
494 case AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT
:
495 case AL_EFFECT_DEDICATED_DIALOGUE
:
496 effect
->Props
.Dedicated
.Gain
= 1.0f
;
497 SET_VTABLE1(ALdedicated
, effect
);
500 SET_VTABLE1(ALnull
, effect
);
507 #include "AL/efx-presets.h"
509 #define DECL(x) { #x, EFX_REVERB_PRESET_##x }
510 static const struct {
512 EFXEAXREVERBPROPERTIES props
;
525 DECL(CARPETEDHALLWAY
),
541 DECL(CASTLE_SMALLROOM
),
542 DECL(CASTLE_SHORTPASSAGE
),
543 DECL(CASTLE_MEDIUMROOM
),
544 DECL(CASTLE_LARGEROOM
),
545 DECL(CASTLE_LONGPASSAGE
),
547 DECL(CASTLE_CUPBOARD
),
548 DECL(CASTLE_COURTYARD
),
551 DECL(FACTORY_SMALLROOM
),
552 DECL(FACTORY_SHORTPASSAGE
),
553 DECL(FACTORY_MEDIUMROOM
),
554 DECL(FACTORY_LARGEROOM
),
555 DECL(FACTORY_LONGPASSAGE
),
557 DECL(FACTORY_CUPBOARD
),
558 DECL(FACTORY_COURTYARD
),
559 DECL(FACTORY_ALCOVE
),
561 DECL(ICEPALACE_SMALLROOM
),
562 DECL(ICEPALACE_SHORTPASSAGE
),
563 DECL(ICEPALACE_MEDIUMROOM
),
564 DECL(ICEPALACE_LARGEROOM
),
565 DECL(ICEPALACE_LONGPASSAGE
),
566 DECL(ICEPALACE_HALL
),
567 DECL(ICEPALACE_CUPBOARD
),
568 DECL(ICEPALACE_COURTYARD
),
569 DECL(ICEPALACE_ALCOVE
),
571 DECL(SPACESTATION_SMALLROOM
),
572 DECL(SPACESTATION_SHORTPASSAGE
),
573 DECL(SPACESTATION_MEDIUMROOM
),
574 DECL(SPACESTATION_LARGEROOM
),
575 DECL(SPACESTATION_LONGPASSAGE
),
576 DECL(SPACESTATION_HALL
),
577 DECL(SPACESTATION_CUPBOARD
),
578 DECL(SPACESTATION_ALCOVE
),
580 DECL(WOODEN_SMALLROOM
),
581 DECL(WOODEN_SHORTPASSAGE
),
582 DECL(WOODEN_MEDIUMROOM
),
583 DECL(WOODEN_LARGEROOM
),
584 DECL(WOODEN_LONGPASSAGE
),
586 DECL(WOODEN_CUPBOARD
),
587 DECL(WOODEN_COURTYARD
),
590 DECL(SPORT_EMPTYSTADIUM
),
591 DECL(SPORT_SQUASHCOURT
),
592 DECL(SPORT_SMALLSWIMMINGPOOL
),
593 DECL(SPORT_LARGESWIMMINGPOOL
),
594 DECL(SPORT_GYMNASIUM
),
595 DECL(SPORT_FULLSTADIUM
),
596 DECL(SPORT_STADIUMTANNOY
),
598 DECL(PREFAB_WORKSHOP
),
599 DECL(PREFAB_SCHOOLROOM
),
600 DECL(PREFAB_PRACTISEROOM
),
601 DECL(PREFAB_OUTHOUSE
),
602 DECL(PREFAB_CARAVAN
),
606 DECL(DOME_SAINTPAULS
),
611 DECL(OUTDOORS_BACKYARD
),
612 DECL(OUTDOORS_ROLLINGPLAINS
),
613 DECL(OUTDOORS_DEEPCANYON
),
614 DECL(OUTDOORS_CREEK
),
615 DECL(OUTDOORS_VALLEY
),
621 DECL(DRIVING_COMMENTATOR
),
622 DECL(DRIVING_PITGARAGE
),
623 DECL(DRIVING_INCAR_RACER
),
624 DECL(DRIVING_INCAR_SPORTS
),
625 DECL(DRIVING_INCAR_LUXURY
),
626 DECL(DRIVING_FULLGRANDSTAND
),
627 DECL(DRIVING_EMPTYGRANDSTAND
),
628 DECL(DRIVING_TUNNEL
),
634 DECL(CITY_UNDERPASS
),
635 DECL(CITY_ABANDONED
),
639 DECL(SMALLWATERROOM
),
643 ALvoid
LoadReverbPreset(const char *name
, ALeffect
*effect
)
647 if(strcasecmp(name
, "NONE") == 0)
649 InitEffectParams(effect
, AL_EFFECT_NULL
);
650 TRACE("Loading reverb '%s'\n", "NONE");
654 if(!DisabledEffects
[EAXREVERB
])
655 InitEffectParams(effect
, AL_EFFECT_EAXREVERB
);
656 else if(!DisabledEffects
[REVERB
])
657 InitEffectParams(effect
, AL_EFFECT_REVERB
);
659 InitEffectParams(effect
, AL_EFFECT_NULL
);
660 for(i
= 0;i
< COUNTOF(reverblist
);i
++)
662 const EFXEAXREVERBPROPERTIES
*props
;
664 if(strcasecmp(name
, reverblist
[i
].name
) != 0)
667 TRACE("Loading reverb '%s'\n", reverblist
[i
].name
);
668 props
= &reverblist
[i
].props
;
669 effect
->Props
.Reverb
.Density
= props
->flDensity
;
670 effect
->Props
.Reverb
.Diffusion
= props
->flDiffusion
;
671 effect
->Props
.Reverb
.Gain
= props
->flGain
;
672 effect
->Props
.Reverb
.GainHF
= props
->flGainHF
;
673 effect
->Props
.Reverb
.GainLF
= props
->flGainLF
;
674 effect
->Props
.Reverb
.DecayTime
= props
->flDecayTime
;
675 effect
->Props
.Reverb
.DecayHFRatio
= props
->flDecayHFRatio
;
676 effect
->Props
.Reverb
.DecayLFRatio
= props
->flDecayLFRatio
;
677 effect
->Props
.Reverb
.ReflectionsGain
= props
->flReflectionsGain
;
678 effect
->Props
.Reverb
.ReflectionsDelay
= props
->flReflectionsDelay
;
679 effect
->Props
.Reverb
.ReflectionsPan
[0] = props
->flReflectionsPan
[0];
680 effect
->Props
.Reverb
.ReflectionsPan
[1] = props
->flReflectionsPan
[1];
681 effect
->Props
.Reverb
.ReflectionsPan
[2] = props
->flReflectionsPan
[2];
682 effect
->Props
.Reverb
.LateReverbGain
= props
->flLateReverbGain
;
683 effect
->Props
.Reverb
.LateReverbDelay
= props
->flLateReverbDelay
;
684 effect
->Props
.Reverb
.LateReverbPan
[0] = props
->flLateReverbPan
[0];
685 effect
->Props
.Reverb
.LateReverbPan
[1] = props
->flLateReverbPan
[1];
686 effect
->Props
.Reverb
.LateReverbPan
[2] = props
->flLateReverbPan
[2];
687 effect
->Props
.Reverb
.EchoTime
= props
->flEchoTime
;
688 effect
->Props
.Reverb
.EchoDepth
= props
->flEchoDepth
;
689 effect
->Props
.Reverb
.ModulationTime
= props
->flModulationTime
;
690 effect
->Props
.Reverb
.ModulationDepth
= props
->flModulationDepth
;
691 effect
->Props
.Reverb
.AirAbsorptionGainHF
= props
->flAirAbsorptionGainHF
;
692 effect
->Props
.Reverb
.HFReference
= props
->flHFReference
;
693 effect
->Props
.Reverb
.LFReference
= props
->flLFReference
;
694 effect
->Props
.Reverb
.RoomRolloffFactor
= props
->flRoomRolloffFactor
;
695 effect
->Props
.Reverb
.DecayHFLimit
= props
->iDecayHFLimit
;
699 WARN("Reverb preset '%s' not found\n", name
);