Remove redundant void argument list in function def
[openal-soft.git] / OpenAL32 / Include / alEffect.h
blob710f512a34f31afc98b2d7bd25ce6f43e0eeaf3d
1 #ifndef _AL_EFFECT_H_
2 #define _AL_EFFECT_H_
4 #include "alMain.h"
7 struct ALeffect;
9 enum {
10 EAXREVERB_EFFECT = 0,
11 REVERB_EFFECT,
12 AUTOWAH_EFFECT,
13 CHORUS_EFFECT,
14 COMPRESSOR_EFFECT,
15 DISTORTION_EFFECT,
16 ECHO_EFFECT,
17 EQUALIZER_EFFECT,
18 FLANGER_EFFECT,
19 FSHIFTER_EFFECT,
20 MODULATOR_EFFECT,
21 PSHIFTER_EFFECT,
22 DEDICATED_EFFECT,
24 MAX_EFFECTS
26 extern ALboolean DisabledEffects[MAX_EFFECTS];
28 extern ALfloat ReverbBoost;
30 struct EffectList {
31 const char name[16];
32 int type;
33 ALenum val;
35 extern const EffectList gEffectList[14];
37 struct ALeffectVtable {
38 void (*const setParami)(ALeffect *effect, ALCcontext *context, ALenum param, ALint val);
39 void (*const setParamiv)(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals);
40 void (*const setParamf)(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val);
41 void (*const setParamfv)(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals);
43 void (*const getParami)(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *val);
44 void (*const getParamiv)(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals);
45 void (*const getParamf)(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val);
46 void (*const getParamfv)(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals);
49 #define DEFINE_ALEFFECT_VTABLE(T) \
50 const ALeffectVtable T##_vtable = { \
51 T##_setParami, T##_setParamiv, \
52 T##_setParamf, T##_setParamfv, \
53 T##_getParami, T##_getParamiv, \
54 T##_getParamf, T##_getParamfv, \
57 extern const ALeffectVtable ALeaxreverb_vtable;
58 extern const ALeffectVtable ALreverb_vtable;
59 extern const ALeffectVtable ALautowah_vtable;
60 extern const ALeffectVtable ALchorus_vtable;
61 extern const ALeffectVtable ALcompressor_vtable;
62 extern const ALeffectVtable ALdistortion_vtable;
63 extern const ALeffectVtable ALecho_vtable;
64 extern const ALeffectVtable ALequalizer_vtable;
65 extern const ALeffectVtable ALflanger_vtable;
66 extern const ALeffectVtable ALfshifter_vtable;
67 extern const ALeffectVtable ALmodulator_vtable;
68 extern const ALeffectVtable ALnull_vtable;
69 extern const ALeffectVtable ALpshifter_vtable;
70 extern const ALeffectVtable ALdedicated_vtable;
73 union ALeffectProps {
74 struct {
75 // Shared Reverb Properties
76 ALfloat Density;
77 ALfloat Diffusion;
78 ALfloat Gain;
79 ALfloat GainHF;
80 ALfloat DecayTime;
81 ALfloat DecayHFRatio;
82 ALfloat ReflectionsGain;
83 ALfloat ReflectionsDelay;
84 ALfloat LateReverbGain;
85 ALfloat LateReverbDelay;
86 ALfloat AirAbsorptionGainHF;
87 ALfloat RoomRolloffFactor;
88 ALboolean DecayHFLimit;
90 // Additional EAX Reverb Properties
91 ALfloat GainLF;
92 ALfloat DecayLFRatio;
93 ALfloat ReflectionsPan[3];
94 ALfloat LateReverbPan[3];
95 ALfloat EchoTime;
96 ALfloat EchoDepth;
97 ALfloat ModulationTime;
98 ALfloat ModulationDepth;
99 ALfloat HFReference;
100 ALfloat LFReference;
101 } Reverb;
103 struct {
104 ALfloat AttackTime;
105 ALfloat ReleaseTime;
106 ALfloat Resonance;
107 ALfloat PeakGain;
108 } Autowah;
110 struct {
111 ALint Waveform;
112 ALint Phase;
113 ALfloat Rate;
114 ALfloat Depth;
115 ALfloat Feedback;
116 ALfloat Delay;
117 } Chorus; /* Also Flanger */
119 struct {
120 ALboolean OnOff;
121 } Compressor;
123 struct {
124 ALfloat Edge;
125 ALfloat Gain;
126 ALfloat LowpassCutoff;
127 ALfloat EQCenter;
128 ALfloat EQBandwidth;
129 } Distortion;
131 struct {
132 ALfloat Delay;
133 ALfloat LRDelay;
135 ALfloat Damping;
136 ALfloat Feedback;
138 ALfloat Spread;
139 } Echo;
141 struct {
142 ALfloat LowCutoff;
143 ALfloat LowGain;
144 ALfloat Mid1Center;
145 ALfloat Mid1Gain;
146 ALfloat Mid1Width;
147 ALfloat Mid2Center;
148 ALfloat Mid2Gain;
149 ALfloat Mid2Width;
150 ALfloat HighCutoff;
151 ALfloat HighGain;
152 } Equalizer;
154 struct {
155 ALfloat Frequency;
156 ALint LeftDirection;
157 ALint RightDirection;
158 } Fshifter;
160 struct {
161 ALfloat Frequency;
162 ALfloat HighPassCutoff;
163 ALint Waveform;
164 } Modulator;
166 struct {
167 ALint CoarseTune;
168 ALint FineTune;
169 } Pshifter;
171 struct {
172 ALfloat Gain;
173 } Dedicated;
176 struct ALeffect {
177 // Effect type (AL_EFFECT_NULL, ...)
178 ALenum type{AL_EFFECT_NULL};
180 ALeffectProps Props{};
182 const ALeffectVtable *vtab{nullptr};
184 /* Self ID */
185 ALuint id{0u};
187 #define ALeffect_setParami(o, c, p, v) ((o)->vtab->setParami(o, c, p, v))
188 #define ALeffect_setParamf(o, c, p, v) ((o)->vtab->setParamf(o, c, p, v))
189 #define ALeffect_setParamiv(o, c, p, v) ((o)->vtab->setParamiv(o, c, p, v))
190 #define ALeffect_setParamfv(o, c, p, v) ((o)->vtab->setParamfv(o, c, p, v))
191 #define ALeffect_getParami(o, c, p, v) ((o)->vtab->getParami(o, c, p, v))
192 #define ALeffect_getParamf(o, c, p, v) ((o)->vtab->getParamf(o, c, p, v))
193 #define ALeffect_getParamiv(o, c, p, v) ((o)->vtab->getParamiv(o, c, p, v))
194 #define ALeffect_getParamfv(o, c, p, v) ((o)->vtab->getParamfv(o, c, p, v))
196 inline ALboolean IsReverbEffect(ALenum type)
197 { return type == AL_EFFECT_REVERB || type == AL_EFFECT_EAXREVERB; }
199 void InitEffect(ALeffect *effect);
201 void LoadReverbPreset(const char *name, ALeffect *effect);
203 #endif