Add preliminary support for the EAX Reverb effect
[openal-soft.git] / OpenAL32 / Include / alEffect.h
blob592eb541e42c6e959ab0bae0408c4b7a685b740e
1 // NOTE: The effect structure is getting too large, it may be a good idea to
2 // start using a union or another form of unified storage.
3 #ifndef _AL_EFFECT_H_
4 #define _AL_EFFECT_H_
6 #include "AL/al.h"
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
12 #define AL_EFFECT_TYPE 0x8001
14 #define AL_EFFECT_NULL 0x0000
15 #define AL_EFFECT_REVERB 0x0001
16 #define AL_EFFECT_CHORUS 0x0002
17 #define AL_EFFECT_DISTORTION 0x0003
18 #define AL_EFFECT_ECHO 0x0004
19 #define AL_EFFECT_FLANGER 0x0005
20 #define AL_EFFECT_FREQUENCY_SHIFTER 0x0006
21 #define AL_EFFECT_VOCAL_MORPHER 0x0007
22 #define AL_EFFECT_PITCH_SHIFTER 0x0008
23 #define AL_EFFECT_RING_MODULATOR 0x0009
24 #define AL_EFFECT_AUTOWAH 0x000A
25 #define AL_EFFECT_COMPRESSOR 0x000B
26 #define AL_EFFECT_EQUALIZER 0x000C
27 #define AL_EFFECT_EAXREVERB 0x8000
29 #define AL_REVERB_DENSITY 0x0001
30 #define AL_REVERB_DIFFUSION 0x0002
31 #define AL_REVERB_GAIN 0x0003
32 #define AL_REVERB_GAINHF 0x0004
33 #define AL_REVERB_DECAY_TIME 0x0005
34 #define AL_REVERB_DECAY_HFRATIO 0x0006
35 #define AL_REVERB_REFLECTIONS_GAIN 0x0007
36 #define AL_REVERB_REFLECTIONS_DELAY 0x0008
37 #define AL_REVERB_LATE_REVERB_GAIN 0x0009
38 #define AL_REVERB_LATE_REVERB_DELAY 0x000A
39 #define AL_REVERB_AIR_ABSORPTION_GAINHF 0x000B
40 #define AL_REVERB_ROOM_ROLLOFF_FACTOR 0x000C
41 #define AL_REVERB_DECAY_HFLIMIT 0x000D
43 #define AL_REVERB_MIN_DENSITY (0.0f)
44 #define AL_REVERB_MAX_DENSITY (1.0f)
45 #define AL_REVERB_DEFAULT_DENSITY (1.0f)
46 #define AL_REVERB_MIN_DIFFUSION (0.0f)
47 #define AL_REVERB_MAX_DIFFUSION (1.0f)
48 #define AL_REVERB_DEFAULT_DIFFUSION (1.0f)
49 #define AL_REVERB_MIN_GAIN (0.0f)
50 #define AL_REVERB_MAX_GAIN (1.0f)
51 #define AL_REVERB_DEFAULT_GAIN (0.32f)
52 #define AL_REVERB_MIN_GAINHF (0.0f)
53 #define AL_REVERB_MAX_GAINHF (1.0f)
54 #define AL_REVERB_DEFAULT_GAINHF (0.89f)
55 #define AL_REVERB_MIN_DECAY_TIME (0.1f)
56 #define AL_REVERB_MAX_DECAY_TIME (20.0f)
57 #define AL_REVERB_DEFAULT_DECAY_TIME (1.49f)
58 #define AL_REVERB_MIN_DECAY_HFRATIO (0.1f)
59 #define AL_REVERB_MAX_DECAY_HFRATIO (2.0f)
60 #define AL_REVERB_DEFAULT_DECAY_HFRATIO (0.83f)
61 #define AL_REVERB_MIN_REFLECTIONS_GAIN (0.0f)
62 #define AL_REVERB_MAX_REFLECTIONS_GAIN (3.16f)
63 #define AL_REVERB_DEFAULT_REFLECTIONS_GAIN (0.05f)
64 #define AL_REVERB_MIN_REFLECTIONS_DELAY (0.0f)
65 #define AL_REVERB_MAX_REFLECTIONS_DELAY (0.3f)
66 #define AL_REVERB_DEFAULT_REFLECTIONS_DELAY (0.007f)
67 #define AL_REVERB_MIN_LATE_REVERB_GAIN (0.0f)
68 #define AL_REVERB_MAX_LATE_REVERB_GAIN (10.0f)
69 #define AL_REVERB_DEFAULT_LATE_REVERB_GAIN (1.26f)
70 #define AL_REVERB_MIN_LATE_REVERB_DELAY (0.0f)
71 #define AL_REVERB_MAX_LATE_REVERB_DELAY (0.1f)
72 #define AL_REVERB_DEFAULT_LATE_REVERB_DELAY (0.011f)
73 #define AL_REVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f)
74 #define AL_REVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f)
75 #define AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f)
76 #define AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f)
77 #define AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f)
78 #define AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f)
79 #define AL_REVERB_MIN_DECAY_HFLIMIT (AL_FALSE)
80 #define AL_REVERB_MAX_DECAY_HFLIMIT (AL_TRUE)
81 #define AL_REVERB_DEFAULT_DECAY_HFLIMIT (AL_TRUE)
83 #define AL_ECHO_DELAY 0x0001
84 #define AL_ECHO_LRDELAY 0x0002
85 #define AL_ECHO_DAMPING 0x0003
86 #define AL_ECHO_FEEDBACK 0x0004
87 #define AL_ECHO_SPREAD 0x0005
89 #define AL_ECHO_MIN_DELAY (0.0f)
90 #define AL_ECHO_MAX_DELAY (0.207f)
91 #define AL_ECHO_DEFAULT_DELAY (0.1f)
92 #define AL_ECHO_MIN_LRDELAY (0.0f)
93 #define AL_ECHO_MAX_LRDELAY (0.404f)
94 #define AL_ECHO_DEFAULT_LRDELAY (0.1f)
95 #define AL_ECHO_MIN_DAMPING (0.0f)
96 #define AL_ECHO_MAX_DAMPING (0.99f)
97 #define AL_ECHO_DEFAULT_DAMPING (0.5f)
98 #define AL_ECHO_MIN_FEEDBACK (0.0f)
99 #define AL_ECHO_MAX_FEEDBACK (1.0f)
100 #define AL_ECHO_DEFAULT_FEEDBACK (0.5f)
101 #define AL_ECHO_MIN_SPREAD (-1.0f)
102 #define AL_ECHO_MAX_SPREAD (1.0f)
103 #define AL_ECHO_DEFAULT_SPREAD (-1.0f)
105 #define AL_EAXREVERB_DENSITY 0x0001
106 #define AL_EAXREVERB_DIFFUSION 0x0002
107 #define AL_EAXREVERB_GAIN 0x0003
108 #define AL_EAXREVERB_GAINHF 0x0004
109 #define AL_EAXREVERB_GAINLF 0x0005
110 #define AL_EAXREVERB_DECAY_TIME 0x0006
111 #define AL_EAXREVERB_DECAY_HFRATIO 0x0007
112 #define AL_EAXREVERB_DECAY_LFRATIO 0x0008
113 #define AL_EAXREVERB_REFLECTIONS_GAIN 0x0009
114 #define AL_EAXREVERB_REFLECTIONS_DELAY 0x000A
115 #define AL_EAXREVERB_REFLECTIONS_PAN 0x000B
116 #define AL_EAXREVERB_LATE_REVERB_GAIN 0x000C
117 #define AL_EAXREVERB_LATE_REVERB_DELAY 0x000D
118 #define AL_EAXREVERB_LATE_REVERB_PAN 0x000E
119 #define AL_EAXREVERB_ECHO_TIME 0x000F
120 #define AL_EAXREVERB_ECHO_DEPTH 0x0010
121 #define AL_EAXREVERB_MODULATION_TIME 0x0011
122 #define AL_EAXREVERB_MODULATION_DEPTH 0x0012
123 #define AL_EAXREVERB_AIR_ABSORPTION_GAINHF 0x0013
124 #define AL_EAXREVERB_HFREFERENCE 0x0014
125 #define AL_EAXREVERB_LFREFERENCE 0x0015
126 #define AL_EAXREVERB_ROOM_ROLLOFF_FACTOR 0x0016
127 #define AL_EAXREVERB_DECAY_HFLIMIT 0x0017
129 #define AL_EAXREVERB_MIN_DENSITY (0.0f)
130 #define AL_EAXREVERB_MAX_DENSITY (1.0f)
131 #define AL_EAXREVERB_DEFAULT_DENSITY (1.0f)
132 #define AL_EAXREVERB_MIN_DIFFUSION (0.0f)
133 #define AL_EAXREVERB_MAX_DIFFUSION (1.0f)
134 #define AL_EAXREVERB_DEFAULT_DIFFUSION (1.0f)
135 #define AL_EAXREVERB_MIN_GAIN (0.0f)
136 #define AL_EAXREVERB_MAX_GAIN (1.0f)
137 #define AL_EAXREVERB_DEFAULT_GAIN (0.32f)
138 #define AL_EAXREVERB_MIN_GAINHF (0.0f)
139 #define AL_EAXREVERB_MAX_GAINHF (1.0f)
140 #define AL_EAXREVERB_DEFAULT_GAINHF (0.89f)
141 #define AL_EAXREVERB_MIN_GAINLF (0.0f)
142 #define AL_EAXREVERB_MAX_GAINLF (1.0f)
143 #define AL_EAXREVERB_DEFAULT_GAINLF (1.0f)
144 #define AL_EAXREVERB_MIN_DECAY_TIME (0.1f)
145 #define AL_EAXREVERB_MAX_DECAY_TIME (20.0f)
146 #define AL_EAXREVERB_DEFAULT_DECAY_TIME (1.49f)
147 #define AL_EAXREVERB_MIN_DECAY_HFRATIO (0.1f)
148 #define AL_EAXREVERB_MAX_DECAY_HFRATIO (2.0f)
149 #define AL_EAXREVERB_DEFAULT_DECAY_HFRATIO (0.83f)
150 #define AL_EAXREVERB_MIN_DECAY_LFRATIO (0.1f)
151 #define AL_EAXREVERB_MAX_DECAY_LFRATIO (2.0f)
152 #define AL_EAXREVERB_DEFAULT_DECAY_LFRATIO (1.0f)
153 #define AL_EAXREVERB_MIN_REFLECTIONS_GAIN (0.0f)
154 #define AL_EAXREVERB_MAX_REFLECTIONS_GAIN (3.16f)
155 #define AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN (0.05f)
156 #define AL_EAXREVERB_MIN_REFLECTIONS_DELAY (0.0f)
157 #define AL_EAXREVERB_MAX_REFLECTIONS_DELAY (0.3f)
158 #define AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY (0.007f)
159 #define AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ (0.0f)
160 #define AL_EAXREVERB_MIN_LATE_REVERB_GAIN (0.0f)
161 #define AL_EAXREVERB_MAX_LATE_REVERB_GAIN (10.0f)
162 #define AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN (1.26f)
163 #define AL_EAXREVERB_MIN_LATE_REVERB_DELAY (0.0f)
164 #define AL_EAXREVERB_MAX_LATE_REVERB_DELAY (0.1f)
165 #define AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY (0.011f)
166 #define AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ (0.0f)
167 #define AL_EAXREVERB_MIN_ECHO_TIME (0.075f)
168 #define AL_EAXREVERB_MAX_ECHO_TIME (0.25f)
169 #define AL_EAXREVERB_DEFAULT_ECHO_TIME (0.25f)
170 #define AL_EAXREVERB_MIN_ECHO_DEPTH (0.0f)
171 #define AL_EAXREVERB_MAX_ECHO_DEPTH (1.0f)
172 #define AL_EAXREVERB_DEFAULT_ECHO_DEPTH (0.0f)
173 #define AL_EAXREVERB_MIN_MODULATION_TIME (0.04f)
174 #define AL_EAXREVERB_MAX_MODULATION_TIME (4.0f)
175 #define AL_EAXREVERB_DEFAULT_MODULATION_TIME (0.25f)
176 #define AL_EAXREVERB_MIN_MODULATION_DEPTH (0.0f)
177 #define AL_EAXREVERB_MAX_MODULATION_DEPTH (1.0f)
178 #define AL_EAXREVERB_DEFAULT_MODULATION_DEPTH (0.0f)
179 #define AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f)
180 #define AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f)
181 #define AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f)
182 #define AL_EAXREVERB_MIN_HFREFERENCE (1000.0f)
183 #define AL_EAXREVERB_MAX_HFREFERENCE (20000.0f)
184 #define AL_EAXREVERB_DEFAULT_HFREFERENCE (5000.0f)
185 #define AL_EAXREVERB_MIN_LFREFERENCE (20.0f)
186 #define AL_EAXREVERB_MAX_LFREFERENCE (1000.0f)
187 #define AL_EAXREVERB_DEFAULT_LFREFERENCE (250.0f)
188 #define AL_EAXREVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f)
189 #define AL_EAXREVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f)
190 #define AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f)
191 #define AL_EAXREVERB_MIN_DECAY_HFLIMIT (AL_FALSE)
192 #define AL_EAXREVERB_MAX_DECAY_HFLIMIT (AL_TRUE)
193 #define AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT (AL_TRUE)
195 enum {
196 EAXREVERB = 0,
197 REVERB,
198 ECHO,
200 MAX_EFFECTS
202 extern ALboolean DisabledEffects[MAX_EFFECTS];
204 typedef struct ALeffect_struct
206 // Effect type (AL_EFFECT_NULL, ...)
207 ALenum type;
209 struct {
210 // Shared Reverb Properties
211 ALfloat Density;
212 ALfloat Diffusion;
213 ALfloat Gain;
214 ALfloat GainHF;
215 ALfloat DecayTime;
216 ALfloat DecayHFRatio;
217 ALfloat ReflectionsGain;
218 ALfloat ReflectionsDelay;
219 ALfloat LateReverbGain;
220 ALfloat LateReverbDelay;
221 ALfloat AirAbsorptionGainHF;
222 ALfloat RoomRolloffFactor;
223 ALboolean DecayHFLimit;
225 // Additional EAX Reverb Properties
226 ALfloat GainLF;
227 ALfloat DecayLFRatio;
228 ALfloat ReflectionsPan[3];
229 ALfloat LateReverbPan[3];
230 ALfloat EchoTime;
231 ALfloat EchoDepth;
232 ALfloat ModulationTime;
233 ALfloat ModulationDepth;
234 ALfloat HFReference;
235 ALfloat LFReference;
236 } Reverb;
238 struct {
239 ALfloat Delay;
240 ALfloat LRDelay;
242 ALfloat Damping;
243 ALfloat Feedback;
245 ALfloat Spread;
246 } Echo;
248 // Index to itself
249 ALuint effect;
251 struct ALeffect_struct *next;
252 } ALeffect;
254 ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects);
255 ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, ALuint *effects);
256 ALboolean AL_APIENTRY alIsEffect(ALuint effect);
258 ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue);
259 ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, ALint *piValues);
260 ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue);
261 ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflValues);
263 ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue);
264 ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues);
265 ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue);
266 ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues);
268 ALvoid ReleaseALEffects(ALvoid);
270 #ifdef __cplusplus
272 #endif
274 #endif