Add the ability to specify a preset for forced reverb
[openal-soft/android.git] / OpenAL32 / Include / alEffect.h
blob97def48a3c4f53fb6fdd71567f1e543f45f85431
1 #ifndef _AL_EFFECT_H_
2 #define _AL_EFFECT_H_
4 #include "AL/al.h"
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
10 enum {
11 EAXREVERB = 0,
12 REVERB,
13 ECHO,
14 MODULATOR,
15 DEDICATED,
17 MAX_EFFECTS
19 extern ALboolean DisabledEffects[MAX_EFFECTS];
21 extern ALfloat ReverbBoost;
22 extern ALboolean EmulateEAXReverb;
24 typedef struct ALeffect
26 // Effect type (AL_EFFECT_NULL, ...)
27 ALenum type;
29 struct {
30 // Shared Reverb Properties
31 ALfloat Density;
32 ALfloat Diffusion;
33 ALfloat Gain;
34 ALfloat GainHF;
35 ALfloat DecayTime;
36 ALfloat DecayHFRatio;
37 ALfloat ReflectionsGain;
38 ALfloat ReflectionsDelay;
39 ALfloat LateReverbGain;
40 ALfloat LateReverbDelay;
41 ALfloat AirAbsorptionGainHF;
42 ALfloat RoomRolloffFactor;
43 ALboolean DecayHFLimit;
45 // Additional EAX Reverb Properties
46 ALfloat GainLF;
47 ALfloat DecayLFRatio;
48 ALfloat ReflectionsPan[3];
49 ALfloat LateReverbPan[3];
50 ALfloat EchoTime;
51 ALfloat EchoDepth;
52 ALfloat ModulationTime;
53 ALfloat ModulationDepth;
54 ALfloat HFReference;
55 ALfloat LFReference;
56 } Reverb;
58 struct {
59 ALfloat Delay;
60 ALfloat LRDelay;
62 ALfloat Damping;
63 ALfloat Feedback;
65 ALfloat Spread;
66 } Echo;
68 struct {
69 ALfloat Frequency;
70 ALfloat HighPassCutoff;
71 ALint Waveform;
72 } Modulator;
74 struct {
75 ALfloat Gain;
76 } Dedicated;
78 void (*SetParami)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALint val);
79 void (*SetParamiv)(struct ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals);
80 void (*SetParamf)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val);
81 void (*SetParamfv)(struct ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals);
83 void (*GetParami)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALint *val);
84 void (*GetParamiv)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals);
85 void (*GetParamf)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val);
86 void (*GetParamfv)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals);
88 // Index to itself
89 ALuint effect;
90 } ALeffect;
92 #define ALeffect_SetParami(x, c, p, v) ((x)->SetParami((x),(c),(p),(v)))
93 #define ALeffect_SetParamiv(x, c, p, v) ((x)->SetParamiv((x),(c),(p),(v)))
94 #define ALeffect_SetParamf(x, c, p, v) ((x)->SetParamf((x),(c),(p),(v)))
95 #define ALeffect_SetParamfv(x, c, p, v) ((x)->SetParamfv((x),(c),(p),(v)))
97 #define ALeffect_GetParami(x, c, p, v) ((x)->GetParami((x),(c),(p),(v)))
98 #define ALeffect_GetParamiv(x, c, p, v) ((x)->GetParamiv((x),(c),(p),(v)))
99 #define ALeffect_GetParamf(x, c, p, v) ((x)->GetParamf((x),(c),(p),(v)))
100 #define ALeffect_GetParamfv(x, c, p, v) ((x)->GetParamfv((x),(c),(p),(v)))
102 static __inline ALboolean IsReverbEffect(ALenum type)
103 { return type == AL_EFFECT_REVERB || type == AL_EFFECT_EAXREVERB; }
105 ALvoid GetReverbEffect(const char *name, ALeffect *effect);
106 ALvoid ReleaseALEffects(ALCdevice *device);
108 #ifdef __cplusplus
110 #endif
112 #endif