10 #include "intrusive_ptr.h"
17 // Shared Reverb Properties
24 ALfloat ReflectionsGain
;
25 ALfloat ReflectionsDelay
;
26 ALfloat LateReverbGain
;
27 ALfloat LateReverbDelay
;
28 ALfloat AirAbsorptionGainHF
;
29 ALfloat RoomRolloffFactor
;
32 // Additional EAX Reverb Properties
35 ALfloat ReflectionsPan
[3];
36 ALfloat LateReverbPan
[3];
39 ALfloat ModulationTime
;
40 ALfloat ModulationDepth
;
59 } Chorus
; /* Also Flanger */
68 ALfloat LowpassCutoff
;
104 ALfloat HighPassCutoff
;
117 ALint PhonemeACoarseTuning
;
118 ALint PhonemeBCoarseTuning
;
128 struct EffectVtable
{
129 void (*const setParami
)(EffectProps
*props
, ALCcontext
*context
, ALenum param
, ALint val
);
130 void (*const setParamiv
)(EffectProps
*props
, ALCcontext
*context
, ALenum param
, const ALint
*vals
);
131 void (*const setParamf
)(EffectProps
*props
, ALCcontext
*context
, ALenum param
, ALfloat val
);
132 void (*const setParamfv
)(EffectProps
*props
, ALCcontext
*context
, ALenum param
, const ALfloat
*vals
);
134 void (*const getParami
)(const EffectProps
*props
, ALCcontext
*context
, ALenum param
, ALint
*val
);
135 void (*const getParamiv
)(const EffectProps
*props
, ALCcontext
*context
, ALenum param
, ALint
*vals
);
136 void (*const getParamf
)(const EffectProps
*props
, ALCcontext
*context
, ALenum param
, ALfloat
*val
);
137 void (*const getParamfv
)(const EffectProps
*props
, ALCcontext
*context
, ALenum param
, ALfloat
*vals
);
140 #define DEFINE_ALEFFECT_VTABLE(T) \
141 const EffectVtable T##_vtable = { \
142 T##_setParami, T##_setParamiv, \
143 T##_setParamf, T##_setParamfv, \
144 T##_getParami, T##_getParamiv, \
145 T##_getParamf, T##_getParamfv, \
149 struct EffectTarget
{
151 RealMixParams
*RealOut
;
154 struct EffectState
: public al::intrusive_ref
<EffectState
> {
155 al::span
<FloatBufferLine
> mOutTarget
;
158 virtual ~EffectState() = default;
160 virtual ALboolean
deviceUpdate(const ALCdevice
*device
) = 0;
161 virtual void update(const ALCcontext
*context
, const ALeffectslot
*slot
, const EffectProps
*props
, const EffectTarget target
) = 0;
162 virtual void process(const size_t samplesToDo
, const al::span
<const FloatBufferLine
> samplesIn
, const al::span
<FloatBufferLine
> samplesOut
) = 0;
166 struct EffectStateFactory
{
167 virtual ~EffectStateFactory() { }
169 virtual EffectState
*create() = 0;
170 virtual EffectProps
getDefaultProps() const noexcept
= 0;
171 virtual const EffectVtable
*getEffectVtable() const noexcept
= 0;
175 EffectStateFactory
*NullStateFactory_getFactory(void);
176 EffectStateFactory
*ReverbStateFactory_getFactory(void);
177 EffectStateFactory
*StdReverbStateFactory_getFactory(void);
178 EffectStateFactory
*AutowahStateFactory_getFactory(void);
179 EffectStateFactory
*ChorusStateFactory_getFactory(void);
180 EffectStateFactory
*CompressorStateFactory_getFactory(void);
181 EffectStateFactory
*DistortionStateFactory_getFactory(void);
182 EffectStateFactory
*EchoStateFactory_getFactory(void);
183 EffectStateFactory
*EqualizerStateFactory_getFactory(void);
184 EffectStateFactory
*FlangerStateFactory_getFactory(void);
185 EffectStateFactory
*FshifterStateFactory_getFactory(void);
186 EffectStateFactory
*ModulatorStateFactory_getFactory(void);
187 EffectStateFactory
*PshifterStateFactory_getFactory(void);
188 EffectStateFactory
* VmorpherStateFactory_getFactory(void);
190 EffectStateFactory
*DedicatedStateFactory_getFactory(void);
193 #endif /* EFFECTS_BASE_H */