26 extern ALboolean DisabledEffects
[MAX_EFFECTS
];
28 extern ALfloat ReverbBoost
;
29 extern ALboolean EmulateEAXReverb
;
31 struct ALeffectVtable
{
32 void (*const setParami
)(struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint val
);
33 void (*const setParamiv
)(struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALint
*vals
);
34 void (*const setParamf
)(struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat val
);
35 void (*const setParamfv
)(struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALfloat
*vals
);
37 void (*const getParami
)(const struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*val
);
38 void (*const getParamiv
)(const struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*vals
);
39 void (*const getParamf
)(const struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*val
);
40 void (*const getParamfv
)(const struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*vals
);
43 #define DEFINE_ALEFFECT_VTABLE(T) \
44 const struct ALeffectVtable T##_vtable = { \
45 T##_setParami, T##_setParamiv, \
46 T##_setParamf, T##_setParamfv, \
47 T##_getParami, T##_getParamiv, \
48 T##_getParamf, T##_getParamfv, \
51 extern const struct ALeffectVtable ALeaxreverb_vtable
;
52 extern const struct ALeffectVtable ALreverb_vtable
;
53 extern const struct ALeffectVtable ALchorus_vtable
;
54 extern const struct ALeffectVtable ALcompressor_vtable
;
55 extern const struct ALeffectVtable ALdistortion_vtable
;
56 extern const struct ALeffectVtable ALecho_vtable
;
57 extern const struct ALeffectVtable ALequalizer_vtable
;
58 extern const struct ALeffectVtable ALflanger_vtable
;
59 extern const struct ALeffectVtable ALmodulator_vtable
;
60 extern const struct ALeffectVtable ALnull_vtable
;
61 extern const struct ALeffectVtable ALdedicated_vtable
;
64 typedef union ALeffectProps
{
66 // Shared Reverb Properties
73 ALfloat ReflectionsGain
;
74 ALfloat ReflectionsDelay
;
75 ALfloat LateReverbGain
;
76 ALfloat LateReverbDelay
;
77 ALfloat AirAbsorptionGainHF
;
78 ALfloat RoomRolloffFactor
;
79 ALboolean DecayHFLimit
;
81 // Additional EAX Reverb Properties
84 ALfloat ReflectionsPan
[3];
85 ALfloat LateReverbPan
[3];
88 ALfloat ModulationTime
;
89 ALfloat ModulationDepth
;
110 ALfloat LowpassCutoff
;
149 ALfloat HighPassCutoff
;
158 typedef struct ALeffect
{
159 // Effect type (AL_EFFECT_NULL, ...)
164 const struct ALeffectVtable
*vtbl
;
170 inline void LockEffectsRead(ALCdevice
*device
)
171 { LockUIntMapRead(&device
->EffectMap
); }
172 inline void UnlockEffectsRead(ALCdevice
*device
)
173 { UnlockUIntMapRead(&device
->EffectMap
); }
174 inline void LockEffectsWrite(ALCdevice
*device
)
175 { LockUIntMapWrite(&device
->EffectMap
); }
176 inline void UnlockEffectsWrite(ALCdevice
*device
)
177 { UnlockUIntMapWrite(&device
->EffectMap
); }
179 inline struct ALeffect
*LookupEffect(ALCdevice
*device
, ALuint id
)
180 { return (struct ALeffect
*)LookupUIntMapKeyNoLock(&device
->EffectMap
, id
); }
181 inline struct ALeffect
*RemoveEffect(ALCdevice
*device
, ALuint id
)
182 { return (struct ALeffect
*)RemoveUIntMapKeyNoLock(&device
->EffectMap
, id
); }
184 inline ALboolean
IsReverbEffect(ALenum type
)
185 { return type
== AL_EFFECT_REVERB
|| type
== AL_EFFECT_EAXREVERB
; }
187 ALenum
InitEffect(ALeffect
*effect
);
188 ALvoid
ReleaseALEffects(ALCdevice
*device
);
190 ALvoid
LoadReverbPreset(const char *name
, ALeffect
*effect
);