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 void LockEffectsRead(ALCdevice
*device
);
38 extern inline void UnlockEffectsRead(ALCdevice
*device
);
39 extern inline void LockEffectsWrite(ALCdevice
*device
);
40 extern inline void UnlockEffectsWrite(ALCdevice
*device
);
41 extern inline struct ALeffect
*LookupEffect(ALCdevice
*device
, ALuint id
);
42 extern inline struct ALeffect
*RemoveEffect(ALCdevice
*device
, ALuint id
);
43 extern inline ALboolean
IsReverbEffect(ALenum type
);
45 static void InitEffectParams(ALeffect
*effect
, ALenum type
);
48 AL_API ALvoid AL_APIENTRY
alGenEffects(ALsizei n
, ALuint
*effects
)
54 context
= GetContextRef();
58 SET_ERROR_AND_GOTO(context
, AL_INVALID_VALUE
, done
);
60 device
= context
->Device
;
61 for(cur
= 0;cur
< n
;cur
++)
63 ALeffect
*effect
= al_calloc(16, sizeof(ALeffect
));
64 ALenum err
= AL_OUT_OF_MEMORY
;
65 if(!effect
|| (err
=InitEffect(effect
)) != AL_NO_ERROR
)
68 alDeleteEffects(cur
, effects
);
69 SET_ERROR_AND_GOTO(context
, err
, done
);
72 err
= NewThunkEntry(&effect
->id
);
73 if(err
== AL_NO_ERROR
)
74 err
= InsertUIntMapEntry(&device
->EffectMap
, effect
->id
, effect
);
75 if(err
!= AL_NO_ERROR
)
77 FreeThunkEntry(effect
->id
);
78 memset(effect
, 0, sizeof(ALeffect
));
81 alDeleteEffects(cur
, effects
);
82 SET_ERROR_AND_GOTO(context
, err
, done
);
85 effects
[cur
] = effect
->id
;
89 ALCcontext_DecRef(context
);
92 AL_API ALvoid AL_APIENTRY
alDeleteEffects(ALsizei n
, const ALuint
*effects
)
99 context
= GetContextRef();
102 device
= context
->Device
;
103 LockEffectsWrite(device
);
105 SET_ERROR_AND_GOTO(context
, AL_INVALID_VALUE
, done
);
108 if(effects
[i
] && LookupEffect(device
, effects
[i
]) == NULL
)
109 SET_ERROR_AND_GOTO(context
, AL_INVALID_NAME
, done
);
113 if((effect
=RemoveEffect(device
, effects
[i
])) == NULL
)
115 FreeThunkEntry(effect
->id
);
117 memset(effect
, 0, sizeof(*effect
));
122 UnlockEffectsWrite(device
);
123 ALCcontext_DecRef(context
);
126 AL_API ALboolean AL_APIENTRY
alIsEffect(ALuint effect
)
131 Context
= GetContextRef();
132 if(!Context
) return AL_FALSE
;
134 LockEffectsRead(Context
->Device
);
135 result
= ((!effect
|| LookupEffect(Context
->Device
, effect
)) ?
137 UnlockEffectsRead(Context
->Device
);
139 ALCcontext_DecRef(Context
);
144 AL_API ALvoid AL_APIENTRY
alEffecti(ALuint effect
, ALenum param
, ALint value
)
150 Context
= GetContextRef();
153 Device
= Context
->Device
;
154 LockEffectsWrite(Device
);
155 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
156 alSetError(Context
, AL_INVALID_NAME
);
159 if(param
== AL_EFFECT_TYPE
)
161 ALboolean isOk
= (value
== AL_EFFECT_NULL
);
163 for(i
= 0;!isOk
&& EffectList
[i
].val
;i
++)
165 if(value
== EffectList
[i
].val
&&
166 !DisabledEffects
[EffectList
[i
].type
])
171 InitEffectParams(ALEffect
, value
);
173 alSetError(Context
, AL_INVALID_VALUE
);
177 /* Call the appropriate handler */
178 V(ALEffect
,setParami
)(Context
, param
, value
);
181 UnlockEffectsWrite(Device
);
183 ALCcontext_DecRef(Context
);
186 AL_API ALvoid AL_APIENTRY
alEffectiv(ALuint effect
, ALenum param
, const ALint
*values
)
195 alEffecti(effect
, param
, values
[0]);
199 Context
= GetContextRef();
202 Device
= Context
->Device
;
203 LockEffectsWrite(Device
);
204 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
205 alSetError(Context
, AL_INVALID_NAME
);
208 /* Call the appropriate handler */
209 V(ALEffect
,setParamiv
)(Context
, param
, values
);
211 UnlockEffectsWrite(Device
);
213 ALCcontext_DecRef(Context
);
216 AL_API ALvoid AL_APIENTRY
alEffectf(ALuint effect
, ALenum param
, ALfloat value
)
222 Context
= GetContextRef();
225 Device
= Context
->Device
;
226 LockEffectsWrite(Device
);
227 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
228 alSetError(Context
, AL_INVALID_NAME
);
231 /* Call the appropriate handler */
232 V(ALEffect
,setParamf
)(Context
, param
, value
);
234 UnlockEffectsWrite(Device
);
236 ALCcontext_DecRef(Context
);
239 AL_API ALvoid AL_APIENTRY
alEffectfv(ALuint effect
, ALenum param
, const ALfloat
*values
)
245 Context
= GetContextRef();
248 Device
= Context
->Device
;
249 LockEffectsWrite(Device
);
250 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
251 alSetError(Context
, AL_INVALID_NAME
);
254 /* Call the appropriate handler */
255 V(ALEffect
,setParamfv
)(Context
, param
, values
);
257 UnlockEffectsWrite(Device
);
259 ALCcontext_DecRef(Context
);
262 AL_API ALvoid AL_APIENTRY
alGetEffecti(ALuint effect
, ALenum param
, ALint
*value
)
268 Context
= GetContextRef();
271 Device
= Context
->Device
;
272 LockEffectsRead(Device
);
273 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
274 alSetError(Context
, AL_INVALID_NAME
);
277 if(param
== AL_EFFECT_TYPE
)
278 *value
= ALEffect
->type
;
281 /* Call the appropriate handler */
282 V(ALEffect
,getParami
)(Context
, param
, value
);
285 UnlockEffectsRead(Device
);
287 ALCcontext_DecRef(Context
);
290 AL_API ALvoid AL_APIENTRY
alGetEffectiv(ALuint effect
, ALenum param
, ALint
*values
)
299 alGetEffecti(effect
, param
, values
);
303 Context
= GetContextRef();
306 Device
= Context
->Device
;
307 LockEffectsRead(Device
);
308 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
309 alSetError(Context
, AL_INVALID_NAME
);
312 /* Call the appropriate handler */
313 V(ALEffect
,getParamiv
)(Context
, param
, values
);
315 UnlockEffectsRead(Device
);
317 ALCcontext_DecRef(Context
);
320 AL_API ALvoid AL_APIENTRY
alGetEffectf(ALuint effect
, ALenum param
, ALfloat
*value
)
326 Context
= GetContextRef();
329 Device
= Context
->Device
;
330 LockEffectsRead(Device
);
331 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
332 alSetError(Context
, AL_INVALID_NAME
);
335 /* Call the appropriate handler */
336 V(ALEffect
,getParamf
)(Context
, param
, value
);
338 UnlockEffectsRead(Device
);
340 ALCcontext_DecRef(Context
);
343 AL_API ALvoid AL_APIENTRY
alGetEffectfv(ALuint effect
, ALenum param
, ALfloat
*values
)
349 Context
= GetContextRef();
352 Device
= Context
->Device
;
353 LockEffectsRead(Device
);
354 if((ALEffect
=LookupEffect(Device
, effect
)) == NULL
)
355 alSetError(Context
, AL_INVALID_NAME
);
358 /* Call the appropriate handler */
359 V(ALEffect
,getParamfv
)(Context
, param
, values
);
361 UnlockEffectsRead(Device
);
363 ALCcontext_DecRef(Context
);
367 ALenum
InitEffect(ALeffect
*effect
)
369 InitEffectParams(effect
, AL_EFFECT_NULL
);
373 ALvoid
ReleaseALEffects(ALCdevice
*device
)
376 for(i
= 0;i
< device
->EffectMap
.size
;i
++)
378 ALeffect
*temp
= device
->EffectMap
.values
[i
];
379 device
->EffectMap
.values
[i
] = NULL
;
381 // Release effect structure
382 FreeThunkEntry(temp
->id
);
383 memset(temp
, 0, sizeof(ALeffect
));
389 static void InitEffectParams(ALeffect
*effect
, ALenum type
)
393 case AL_EFFECT_EAXREVERB
:
394 effect
->Props
.Reverb
.Density
= AL_EAXREVERB_DEFAULT_DENSITY
;
395 effect
->Props
.Reverb
.Diffusion
= AL_EAXREVERB_DEFAULT_DIFFUSION
;
396 effect
->Props
.Reverb
.Gain
= AL_EAXREVERB_DEFAULT_GAIN
;
397 effect
->Props
.Reverb
.GainHF
= AL_EAXREVERB_DEFAULT_GAINHF
;
398 effect
->Props
.Reverb
.GainLF
= AL_EAXREVERB_DEFAULT_GAINLF
;
399 effect
->Props
.Reverb
.DecayTime
= AL_EAXREVERB_DEFAULT_DECAY_TIME
;
400 effect
->Props
.Reverb
.DecayHFRatio
= AL_EAXREVERB_DEFAULT_DECAY_HFRATIO
;
401 effect
->Props
.Reverb
.DecayLFRatio
= AL_EAXREVERB_DEFAULT_DECAY_LFRATIO
;
402 effect
->Props
.Reverb
.ReflectionsGain
= AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN
;
403 effect
->Props
.Reverb
.ReflectionsDelay
= AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY
;
404 effect
->Props
.Reverb
.ReflectionsPan
[0] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ
;
405 effect
->Props
.Reverb
.ReflectionsPan
[1] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ
;
406 effect
->Props
.Reverb
.ReflectionsPan
[2] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ
;
407 effect
->Props
.Reverb
.LateReverbGain
= AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN
;
408 effect
->Props
.Reverb
.LateReverbDelay
= AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY
;
409 effect
->Props
.Reverb
.LateReverbPan
[0] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ
;
410 effect
->Props
.Reverb
.LateReverbPan
[1] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ
;
411 effect
->Props
.Reverb
.LateReverbPan
[2] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ
;
412 effect
->Props
.Reverb
.EchoTime
= AL_EAXREVERB_DEFAULT_ECHO_TIME
;
413 effect
->Props
.Reverb
.EchoDepth
= AL_EAXREVERB_DEFAULT_ECHO_DEPTH
;
414 effect
->Props
.Reverb
.ModulationTime
= AL_EAXREVERB_DEFAULT_MODULATION_TIME
;
415 effect
->Props
.Reverb
.ModulationDepth
= AL_EAXREVERB_DEFAULT_MODULATION_DEPTH
;
416 effect
->Props
.Reverb
.AirAbsorptionGainHF
= AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF
;
417 effect
->Props
.Reverb
.HFReference
= AL_EAXREVERB_DEFAULT_HFREFERENCE
;
418 effect
->Props
.Reverb
.LFReference
= AL_EAXREVERB_DEFAULT_LFREFERENCE
;
419 effect
->Props
.Reverb
.RoomRolloffFactor
= AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR
;
420 effect
->Props
.Reverb
.DecayHFLimit
= AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT
;
421 SET_VTABLE1(ALeaxreverb
, effect
);
423 case AL_EFFECT_REVERB
:
424 effect
->Props
.Reverb
.Density
= AL_REVERB_DEFAULT_DENSITY
;
425 effect
->Props
.Reverb
.Diffusion
= AL_REVERB_DEFAULT_DIFFUSION
;
426 effect
->Props
.Reverb
.Gain
= AL_REVERB_DEFAULT_GAIN
;
427 effect
->Props
.Reverb
.GainHF
= AL_REVERB_DEFAULT_GAINHF
;
428 effect
->Props
.Reverb
.GainLF
= 1.0f
;
429 effect
->Props
.Reverb
.DecayTime
= AL_REVERB_DEFAULT_DECAY_TIME
;
430 effect
->Props
.Reverb
.DecayHFRatio
= AL_REVERB_DEFAULT_DECAY_HFRATIO
;
431 effect
->Props
.Reverb
.DecayLFRatio
= 1.0f
;
432 effect
->Props
.Reverb
.ReflectionsGain
= AL_REVERB_DEFAULT_REFLECTIONS_GAIN
;
433 effect
->Props
.Reverb
.ReflectionsDelay
= AL_REVERB_DEFAULT_REFLECTIONS_DELAY
;
434 effect
->Props
.Reverb
.ReflectionsPan
[0] = 0.0f
;
435 effect
->Props
.Reverb
.ReflectionsPan
[1] = 0.0f
;
436 effect
->Props
.Reverb
.ReflectionsPan
[2] = 0.0f
;
437 effect
->Props
.Reverb
.LateReverbGain
= AL_REVERB_DEFAULT_LATE_REVERB_GAIN
;
438 effect
->Props
.Reverb
.LateReverbDelay
= AL_REVERB_DEFAULT_LATE_REVERB_DELAY
;
439 effect
->Props
.Reverb
.LateReverbPan
[0] = 0.0f
;
440 effect
->Props
.Reverb
.LateReverbPan
[1] = 0.0f
;
441 effect
->Props
.Reverb
.LateReverbPan
[2] = 0.0f
;
442 effect
->Props
.Reverb
.EchoTime
= 0.25f
;
443 effect
->Props
.Reverb
.EchoDepth
= 0.0f
;
444 effect
->Props
.Reverb
.ModulationTime
= 0.25f
;
445 effect
->Props
.Reverb
.ModulationDepth
= 0.0f
;
446 effect
->Props
.Reverb
.AirAbsorptionGainHF
= AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF
;
447 effect
->Props
.Reverb
.HFReference
= 5000.0f
;
448 effect
->Props
.Reverb
.LFReference
= 250.0f
;
449 effect
->Props
.Reverb
.RoomRolloffFactor
= AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR
;
450 effect
->Props
.Reverb
.DecayHFLimit
= AL_REVERB_DEFAULT_DECAY_HFLIMIT
;
451 SET_VTABLE1(ALreverb
, effect
);
453 case AL_EFFECT_CHORUS
:
454 effect
->Props
.Chorus
.Waveform
= AL_CHORUS_DEFAULT_WAVEFORM
;
455 effect
->Props
.Chorus
.Phase
= AL_CHORUS_DEFAULT_PHASE
;
456 effect
->Props
.Chorus
.Rate
= AL_CHORUS_DEFAULT_RATE
;
457 effect
->Props
.Chorus
.Depth
= AL_CHORUS_DEFAULT_DEPTH
;
458 effect
->Props
.Chorus
.Feedback
= AL_CHORUS_DEFAULT_FEEDBACK
;
459 effect
->Props
.Chorus
.Delay
= AL_CHORUS_DEFAULT_DELAY
;
460 SET_VTABLE1(ALchorus
, effect
);
462 case AL_EFFECT_COMPRESSOR
:
463 effect
->Props
.Compressor
.OnOff
= AL_COMPRESSOR_DEFAULT_ONOFF
;
464 SET_VTABLE1(ALcompressor
, effect
);
466 case AL_EFFECT_DISTORTION
:
467 effect
->Props
.Distortion
.Edge
= AL_DISTORTION_DEFAULT_EDGE
;
468 effect
->Props
.Distortion
.Gain
= AL_DISTORTION_DEFAULT_GAIN
;
469 effect
->Props
.Distortion
.LowpassCutoff
= AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF
;
470 effect
->Props
.Distortion
.EQCenter
= AL_DISTORTION_DEFAULT_EQCENTER
;
471 effect
->Props
.Distortion
.EQBandwidth
= AL_DISTORTION_DEFAULT_EQBANDWIDTH
;
472 SET_VTABLE1(ALdistortion
, effect
);
475 effect
->Props
.Echo
.Delay
= AL_ECHO_DEFAULT_DELAY
;
476 effect
->Props
.Echo
.LRDelay
= AL_ECHO_DEFAULT_LRDELAY
;
477 effect
->Props
.Echo
.Damping
= AL_ECHO_DEFAULT_DAMPING
;
478 effect
->Props
.Echo
.Feedback
= AL_ECHO_DEFAULT_FEEDBACK
;
479 effect
->Props
.Echo
.Spread
= AL_ECHO_DEFAULT_SPREAD
;
480 SET_VTABLE1(ALecho
, effect
);
482 case AL_EFFECT_EQUALIZER
:
483 effect
->Props
.Equalizer
.LowCutoff
= AL_EQUALIZER_DEFAULT_LOW_CUTOFF
;
484 effect
->Props
.Equalizer
.LowGain
= AL_EQUALIZER_DEFAULT_LOW_GAIN
;
485 effect
->Props
.Equalizer
.Mid1Center
= AL_EQUALIZER_DEFAULT_MID1_CENTER
;
486 effect
->Props
.Equalizer
.Mid1Gain
= AL_EQUALIZER_DEFAULT_MID1_GAIN
;
487 effect
->Props
.Equalizer
.Mid1Width
= AL_EQUALIZER_DEFAULT_MID1_WIDTH
;
488 effect
->Props
.Equalizer
.Mid2Center
= AL_EQUALIZER_DEFAULT_MID2_CENTER
;
489 effect
->Props
.Equalizer
.Mid2Gain
= AL_EQUALIZER_DEFAULT_MID2_GAIN
;
490 effect
->Props
.Equalizer
.Mid2Width
= AL_EQUALIZER_DEFAULT_MID2_WIDTH
;
491 effect
->Props
.Equalizer
.HighCutoff
= AL_EQUALIZER_DEFAULT_HIGH_CUTOFF
;
492 effect
->Props
.Equalizer
.HighGain
= AL_EQUALIZER_DEFAULT_HIGH_GAIN
;
493 SET_VTABLE1(ALequalizer
, effect
);
495 case AL_EFFECT_FLANGER
:
496 effect
->Props
.Flanger
.Waveform
= AL_FLANGER_DEFAULT_WAVEFORM
;
497 effect
->Props
.Flanger
.Phase
= AL_FLANGER_DEFAULT_PHASE
;
498 effect
->Props
.Flanger
.Rate
= AL_FLANGER_DEFAULT_RATE
;
499 effect
->Props
.Flanger
.Depth
= AL_FLANGER_DEFAULT_DEPTH
;
500 effect
->Props
.Flanger
.Feedback
= AL_FLANGER_DEFAULT_FEEDBACK
;
501 effect
->Props
.Flanger
.Delay
= AL_FLANGER_DEFAULT_DELAY
;
502 SET_VTABLE1(ALflanger
, effect
);
504 case AL_EFFECT_RING_MODULATOR
:
505 effect
->Props
.Modulator
.Frequency
= AL_RING_MODULATOR_DEFAULT_FREQUENCY
;
506 effect
->Props
.Modulator
.HighPassCutoff
= AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF
;
507 effect
->Props
.Modulator
.Waveform
= AL_RING_MODULATOR_DEFAULT_WAVEFORM
;
508 SET_VTABLE1(ALmodulator
, effect
);
510 case AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT
:
511 case AL_EFFECT_DEDICATED_DIALOGUE
:
512 effect
->Props
.Dedicated
.Gain
= 1.0f
;
513 SET_VTABLE1(ALdedicated
, effect
);
516 SET_VTABLE1(ALnull
, effect
);
523 #include "AL/efx-presets.h"
525 #define DECL(x) { #x, EFX_REVERB_PRESET_##x }
526 static const struct {
528 EFXEAXREVERBPROPERTIES props
;
541 DECL(CARPETEDHALLWAY
),
557 DECL(CASTLE_SMALLROOM
),
558 DECL(CASTLE_SHORTPASSAGE
),
559 DECL(CASTLE_MEDIUMROOM
),
560 DECL(CASTLE_LARGEROOM
),
561 DECL(CASTLE_LONGPASSAGE
),
563 DECL(CASTLE_CUPBOARD
),
564 DECL(CASTLE_COURTYARD
),
567 DECL(FACTORY_SMALLROOM
),
568 DECL(FACTORY_SHORTPASSAGE
),
569 DECL(FACTORY_MEDIUMROOM
),
570 DECL(FACTORY_LARGEROOM
),
571 DECL(FACTORY_LONGPASSAGE
),
573 DECL(FACTORY_CUPBOARD
),
574 DECL(FACTORY_COURTYARD
),
575 DECL(FACTORY_ALCOVE
),
577 DECL(ICEPALACE_SMALLROOM
),
578 DECL(ICEPALACE_SHORTPASSAGE
),
579 DECL(ICEPALACE_MEDIUMROOM
),
580 DECL(ICEPALACE_LARGEROOM
),
581 DECL(ICEPALACE_LONGPASSAGE
),
582 DECL(ICEPALACE_HALL
),
583 DECL(ICEPALACE_CUPBOARD
),
584 DECL(ICEPALACE_COURTYARD
),
585 DECL(ICEPALACE_ALCOVE
),
587 DECL(SPACESTATION_SMALLROOM
),
588 DECL(SPACESTATION_SHORTPASSAGE
),
589 DECL(SPACESTATION_MEDIUMROOM
),
590 DECL(SPACESTATION_LARGEROOM
),
591 DECL(SPACESTATION_LONGPASSAGE
),
592 DECL(SPACESTATION_HALL
),
593 DECL(SPACESTATION_CUPBOARD
),
594 DECL(SPACESTATION_ALCOVE
),
596 DECL(WOODEN_SMALLROOM
),
597 DECL(WOODEN_SHORTPASSAGE
),
598 DECL(WOODEN_MEDIUMROOM
),
599 DECL(WOODEN_LARGEROOM
),
600 DECL(WOODEN_LONGPASSAGE
),
602 DECL(WOODEN_CUPBOARD
),
603 DECL(WOODEN_COURTYARD
),
606 DECL(SPORT_EMPTYSTADIUM
),
607 DECL(SPORT_SQUASHCOURT
),
608 DECL(SPORT_SMALLSWIMMINGPOOL
),
609 DECL(SPORT_LARGESWIMMINGPOOL
),
610 DECL(SPORT_GYMNASIUM
),
611 DECL(SPORT_FULLSTADIUM
),
612 DECL(SPORT_STADIUMTANNOY
),
614 DECL(PREFAB_WORKSHOP
),
615 DECL(PREFAB_SCHOOLROOM
),
616 DECL(PREFAB_PRACTISEROOM
),
617 DECL(PREFAB_OUTHOUSE
),
618 DECL(PREFAB_CARAVAN
),
622 DECL(DOME_SAINTPAULS
),
627 DECL(OUTDOORS_BACKYARD
),
628 DECL(OUTDOORS_ROLLINGPLAINS
),
629 DECL(OUTDOORS_DEEPCANYON
),
630 DECL(OUTDOORS_CREEK
),
631 DECL(OUTDOORS_VALLEY
),
637 DECL(DRIVING_COMMENTATOR
),
638 DECL(DRIVING_PITGARAGE
),
639 DECL(DRIVING_INCAR_RACER
),
640 DECL(DRIVING_INCAR_SPORTS
),
641 DECL(DRIVING_INCAR_LUXURY
),
642 DECL(DRIVING_FULLGRANDSTAND
),
643 DECL(DRIVING_EMPTYGRANDSTAND
),
644 DECL(DRIVING_TUNNEL
),
650 DECL(CITY_UNDERPASS
),
651 DECL(CITY_ABANDONED
),
655 DECL(SMALLWATERROOM
),
659 ALvoid
LoadReverbPreset(const char *name
, ALeffect
*effect
)
663 if(strcasecmp(name
, "NONE") == 0)
665 InitEffectParams(effect
, AL_EFFECT_NULL
);
666 TRACE("Loading reverb '%s'\n", "NONE");
670 if(!DisabledEffects
[AL__EAXREVERB
])
671 InitEffectParams(effect
, AL_EFFECT_EAXREVERB
);
672 else if(!DisabledEffects
[AL__REVERB
])
673 InitEffectParams(effect
, AL_EFFECT_REVERB
);
675 InitEffectParams(effect
, AL_EFFECT_NULL
);
676 for(i
= 0;i
< COUNTOF(reverblist
);i
++)
678 const EFXEAXREVERBPROPERTIES
*props
;
680 if(strcasecmp(name
, reverblist
[i
].name
) != 0)
683 TRACE("Loading reverb '%s'\n", reverblist
[i
].name
);
684 props
= &reverblist
[i
].props
;
685 effect
->Props
.Reverb
.Density
= props
->flDensity
;
686 effect
->Props
.Reverb
.Diffusion
= props
->flDiffusion
;
687 effect
->Props
.Reverb
.Gain
= props
->flGain
;
688 effect
->Props
.Reverb
.GainHF
= props
->flGainHF
;
689 effect
->Props
.Reverb
.GainLF
= props
->flGainLF
;
690 effect
->Props
.Reverb
.DecayTime
= props
->flDecayTime
;
691 effect
->Props
.Reverb
.DecayHFRatio
= props
->flDecayHFRatio
;
692 effect
->Props
.Reverb
.DecayLFRatio
= props
->flDecayLFRatio
;
693 effect
->Props
.Reverb
.ReflectionsGain
= props
->flReflectionsGain
;
694 effect
->Props
.Reverb
.ReflectionsDelay
= props
->flReflectionsDelay
;
695 effect
->Props
.Reverb
.ReflectionsPan
[0] = props
->flReflectionsPan
[0];
696 effect
->Props
.Reverb
.ReflectionsPan
[1] = props
->flReflectionsPan
[1];
697 effect
->Props
.Reverb
.ReflectionsPan
[2] = props
->flReflectionsPan
[2];
698 effect
->Props
.Reverb
.LateReverbGain
= props
->flLateReverbGain
;
699 effect
->Props
.Reverb
.LateReverbDelay
= props
->flLateReverbDelay
;
700 effect
->Props
.Reverb
.LateReverbPan
[0] = props
->flLateReverbPan
[0];
701 effect
->Props
.Reverb
.LateReverbPan
[1] = props
->flLateReverbPan
[1];
702 effect
->Props
.Reverb
.LateReverbPan
[2] = props
->flLateReverbPan
[2];
703 effect
->Props
.Reverb
.EchoTime
= props
->flEchoTime
;
704 effect
->Props
.Reverb
.EchoDepth
= props
->flEchoDepth
;
705 effect
->Props
.Reverb
.ModulationTime
= props
->flModulationTime
;
706 effect
->Props
.Reverb
.ModulationDepth
= props
->flModulationDepth
;
707 effect
->Props
.Reverb
.AirAbsorptionGainHF
= props
->flAirAbsorptionGainHF
;
708 effect
->Props
.Reverb
.HFReference
= props
->flHFReference
;
709 effect
->Props
.Reverb
.LFReference
= props
->flLFReference
;
710 effect
->Props
.Reverb
.RoomRolloffFactor
= props
->flRoomRolloffFactor
;
711 effect
->Props
.Reverb
.DecayHFLimit
= props
->iDecayHFLimit
;
715 WARN("Reverb preset '%s' not found\n", name
);