Reset the ringbuffer when stopping OpenSL playback
[openal-soft.git] / al / filter.h
blob65a9e30fd2cdf09afd00adc76a54b479928be898
1 #ifndef AL_FILTER_H
2 #define AL_FILTER_H
5 #include "AL/al.h"
6 #include "AL/alc.h"
7 #include "AL/alext.h"
9 #include "almalloc.h"
11 #define LOWPASSFREQREF 5000.0f
12 #define HIGHPASSFREQREF 250.0f
15 struct ALfilter {
16 ALenum type{AL_FILTER_NULL};
18 float Gain{1.0f};
19 float GainHF{1.0f};
20 float HFReference{LOWPASSFREQREF};
21 float GainLF{1.0f};
22 float LFReference{HIGHPASSFREQREF};
24 struct Vtable {
25 void (*const setParami )(ALfilter *filter, ALenum param, int val);
26 void (*const setParamiv)(ALfilter *filter, ALenum param, const int *vals);
27 void (*const setParamf )(ALfilter *filter, ALenum param, float val);
28 void (*const setParamfv)(ALfilter *filter, ALenum param, const float *vals);
30 void (*const getParami )(const ALfilter *filter, ALenum param, int *val);
31 void (*const getParamiv)(const ALfilter *filter, ALenum param, int *vals);
32 void (*const getParamf )(const ALfilter *filter, ALenum param, float *val);
33 void (*const getParamfv)(const ALfilter *filter, ALenum param, float *vals);
35 const Vtable *vtab{nullptr};
37 /* Self ID */
38 ALuint id{0};
40 void setParami(ALenum param, int value) { vtab->setParami(this, param, value); }
41 void setParamiv(ALenum param, const int *values) { vtab->setParamiv(this, param, values); }
42 void setParamf(ALenum param, float value) { vtab->setParamf(this, param, value); }
43 void setParamfv(ALenum param, const float *values) { vtab->setParamfv(this, param, values); }
44 void getParami(ALenum param, int *value) const { vtab->getParami(this, param, value); }
45 void getParamiv(ALenum param, int *values) const { vtab->getParamiv(this, param, values); }
46 void getParamf(ALenum param, float *value) const { vtab->getParamf(this, param, value); }
47 void getParamfv(ALenum param, float *values) const { vtab->getParamfv(this, param, values); }
49 DISABLE_ALLOC()
52 #endif