28 extern ALboolean DisabledEffects
[MAX_EFFECTS
];
30 extern ALfloat ReverbBoost
;
37 #define EFFECTLIST_SIZE 13
38 extern const struct EffectList EffectList
[EFFECTLIST_SIZE
];
41 struct ALeffectVtable
{
42 void (*const setParami
)(struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint val
);
43 void (*const setParamiv
)(struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALint
*vals
);
44 void (*const setParamf
)(struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat val
);
45 void (*const setParamfv
)(struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALfloat
*vals
);
47 void (*const getParami
)(const struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*val
);
48 void (*const getParamiv
)(const struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*vals
);
49 void (*const getParamf
)(const struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*val
);
50 void (*const getParamfv
)(const struct ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*vals
);
53 #define DEFINE_ALEFFECT_VTABLE(T) \
54 const struct ALeffectVtable T##_vtable = { \
55 T##_setParami, T##_setParamiv, \
56 T##_setParamf, T##_setParamfv, \
57 T##_getParami, T##_getParamiv, \
58 T##_getParamf, T##_getParamfv, \
61 extern const struct ALeffectVtable ALeaxreverb_vtable
;
62 extern const struct ALeffectVtable ALreverb_vtable
;
63 extern const struct ALeffectVtable ALchorus_vtable
;
64 extern const struct ALeffectVtable ALcompressor_vtable
;
65 extern const struct ALeffectVtable ALdistortion_vtable
;
66 extern const struct ALeffectVtable ALecho_vtable
;
67 extern const struct ALeffectVtable ALequalizer_vtable
;
68 extern const struct ALeffectVtable ALflanger_vtable
;
69 extern const struct ALeffectVtable ALfshifter_vtable
;
70 extern const struct ALeffectVtable ALmodulator_vtable
;
71 extern const struct ALeffectVtable ALnull_vtable
;
72 extern const struct ALeffectVtable ALpshifter_vtable
;
73 extern const struct ALeffectVtable ALdedicated_vtable
;
76 typedef union ALeffectProps
{
78 // Shared Reverb Properties
85 ALfloat ReflectionsGain
;
86 ALfloat ReflectionsDelay
;
87 ALfloat LateReverbGain
;
88 ALfloat LateReverbDelay
;
89 ALfloat AirAbsorptionGainHF
;
90 ALfloat RoomRolloffFactor
;
91 ALboolean DecayHFLimit
;
93 // Additional EAX Reverb Properties
96 ALfloat ReflectionsPan
[3];
97 ALfloat LateReverbPan
[3];
100 ALfloat ModulationTime
;
101 ALfloat ModulationDepth
;
113 } Chorus
; /* Also Flanger */
122 ALfloat LowpassCutoff
;
153 ALint RightDirection
;
158 ALfloat HighPassCutoff
;
172 typedef struct ALeffect
{
173 // Effect type (AL_EFFECT_NULL, ...)
178 const struct ALeffectVtable
*vtab
;
183 #define ALeffect_setParami(o, c, p, v) ((o)->vtab->setParami(o, c, p, v))
184 #define ALeffect_setParamf(o, c, p, v) ((o)->vtab->setParamf(o, c, p, v))
185 #define ALeffect_setParamiv(o, c, p, v) ((o)->vtab->setParamiv(o, c, p, v))
186 #define ALeffect_setParamfv(o, c, p, v) ((o)->vtab->setParamfv(o, c, p, v))
187 #define ALeffect_getParami(o, c, p, v) ((o)->vtab->getParami(o, c, p, v))
188 #define ALeffect_getParamf(o, c, p, v) ((o)->vtab->getParamf(o, c, p, v))
189 #define ALeffect_getParamiv(o, c, p, v) ((o)->vtab->getParamiv(o, c, p, v))
190 #define ALeffect_getParamfv(o, c, p, v) ((o)->vtab->getParamfv(o, c, p, v))
192 inline ALboolean
IsReverbEffect(ALenum type
)
193 { return type
== AL_EFFECT_REVERB
|| type
== AL_EFFECT_EAXREVERB
; }
195 void InitEffect(ALeffect
*effect
);
196 void ReleaseALEffects(ALCdevice
*device
);
198 void LoadReverbPreset(const char *name
, ALeffect
*effect
);