27 extern ALboolean DisabledEffects
[MAX_EFFECTS
];
29 extern ALfloat ReverbBoost
;
30 extern ALboolean EmulateEAXReverb
;
32 struct ALeffectVtable
{
33 void (*const setParami
)(struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint val
);
34 void (*const setParamiv
)(struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALint
*vals
);
35 void (*const setParamf
)(struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat val
);
36 void (*const setParamfv
)(struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALfloat
*vals
);
38 void (*const getParami
)(const struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*val
);
39 void (*const getParamiv
)(const struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*vals
);
40 void (*const getParamf
)(const struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*val
);
41 void (*const getParamfv
)(const struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*vals
);
44 #define DEFINE_ALEFFECT_VTABLE(T) \
45 const struct ALeffectVtable T##_vtable = { \
46 T##_setParami, T##_setParamiv, \
47 T##_setParamf, T##_setParamfv, \
48 T##_getParami, T##_getParamiv, \
49 T##_getParamf, T##_getParamfv, \
52 extern const struct ALeffectVtable ALeaxreverb_vtable
;
53 extern const struct ALeffectVtable ALreverb_vtable
;
54 extern const struct ALeffectVtable ALautowah_vtable
;
55 extern const struct ALeffectVtable ALchorus_vtable
;
56 extern const struct ALeffectVtable ALcompressor_vtable
;
57 extern const struct ALeffectVtable ALdistortion_vtable
;
58 extern const struct ALeffectVtable ALecho_vtable
;
59 extern const struct ALeffectVtable ALequalizer_vtable
;
60 extern const struct ALeffectVtable ALflanger_vtable
;
61 extern const struct ALeffectVtable ALmodulator_vtable
;
62 extern const struct ALeffectVtable ALnull_vtable
;
63 extern const struct ALeffectVtable ALdedicated_vtable
;
66 typedef union ALeffectProps
{
68 // Shared Reverb Properties
75 ALfloat ReflectionsGain
;
76 ALfloat ReflectionsDelay
;
77 ALfloat LateReverbGain
;
78 ALfloat LateReverbDelay
;
79 ALfloat AirAbsorptionGainHF
;
80 ALfloat RoomRolloffFactor
;
81 ALboolean DecayHFLimit
;
83 // Additional EAX Reverb Properties
86 ALfloat ReflectionsPan
[3];
87 ALfloat LateReverbPan
[3];
90 ALfloat ModulationTime
;
91 ALfloat ModulationDepth
;
119 ALfloat LowpassCutoff
;
159 ALfloat HighPassCutoff
;
168 typedef struct ALeffect
{
169 // Effect type (AL_EFFECT_NULL, ...)
174 const struct ALeffectVtable
*vtbl
;
180 inline struct ALeffect
*LookupEffect(ALCdevice
*device
, ALuint id
)
181 { return (struct ALeffect
*)LookupUIntMapKey(&device
->EffectMap
, id
); }
182 inline struct ALeffect
*RemoveEffect(ALCdevice
*device
, ALuint id
)
183 { return (struct ALeffect
*)RemoveUIntMapKey(&device
->EffectMap
, id
); }
185 inline ALboolean
IsReverbEffect(ALenum type
)
186 { return type
== AL_EFFECT_REVERB
|| type
== AL_EFFECT_EAXREVERB
; }
188 ALenum
InitEffect(ALeffect
*effect
);
189 ALvoid
ReleaseALEffects(ALCdevice
*device
);
191 ALvoid
LoadReverbPreset(const char *name
, ALeffect
*effect
);