Correctly apply reverb coefficient fading over the entire fade length
[openal-soft.git] / OpenAL32 / Include / alFilter.h
blob2634d5e80b27952c5e61865b81a4ef86f9f7e490
1 #ifndef _AL_FILTER_H_
2 #define _AL_FILTER_H_
4 #include "AL/alc.h"
5 #include "AL/al.h"
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
11 #define LOWPASSFREQREF (5000.0f)
12 #define HIGHPASSFREQREF (250.0f)
15 struct ALfilter;
17 typedef struct ALfilterVtable {
18 void (*const setParami)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALint val);
19 void (*const setParamiv)(struct ALfilter *filter, ALCcontext *context, ALenum param, const ALint *vals);
20 void (*const setParamf)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALfloat val);
21 void (*const setParamfv)(struct ALfilter *filter, ALCcontext *context, ALenum param, const ALfloat *vals);
23 void (*const getParami)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALint *val);
24 void (*const getParamiv)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALint *vals);
25 void (*const getParamf)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val);
26 void (*const getParamfv)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *vals);
27 } ALfilterVtable;
29 #define DEFINE_ALFILTER_VTABLE(T) \
30 const struct ALfilterVtable T##_vtable = { \
31 T##_setParami, T##_setParamiv, \
32 T##_setParamf, T##_setParamfv, \
33 T##_getParami, T##_getParamiv, \
34 T##_getParamf, T##_getParamfv, \
37 typedef struct ALfilter {
38 // Filter type (AL_FILTER_NULL, ...)
39 ALenum type;
41 ALfloat Gain;
42 ALfloat GainHF;
43 ALfloat HFReference;
44 ALfloat GainLF;
45 ALfloat LFReference;
47 const struct ALfilterVtable *vtab;
49 /* Self ID */
50 ALuint id;
51 } ALfilter;
52 #define ALfilter_setParami(o, c, p, v) ((o)->vtab->setParami(o, c, p, v))
53 #define ALfilter_setParamf(o, c, p, v) ((o)->vtab->setParamf(o, c, p, v))
54 #define ALfilter_setParamiv(o, c, p, v) ((o)->vtab->setParamiv(o, c, p, v))
55 #define ALfilter_setParamfv(o, c, p, v) ((o)->vtab->setParamfv(o, c, p, v))
56 #define ALfilter_getParami(o, c, p, v) ((o)->vtab->getParami(o, c, p, v))
57 #define ALfilter_getParamf(o, c, p, v) ((o)->vtab->getParamf(o, c, p, v))
58 #define ALfilter_getParamiv(o, c, p, v) ((o)->vtab->getParamiv(o, c, p, v))
59 #define ALfilter_getParamfv(o, c, p, v) ((o)->vtab->getParamfv(o, c, p, v))
61 void ReleaseALFilters(ALCdevice *device);
63 #ifdef __cplusplus
65 #endif
67 #endif