2019-07-28 21:29:59 -07:00
|
|
|
#ifndef AL_FILTER_H
|
|
|
|
#define AL_FILTER_H
|
2007-12-17 15:43:35 -08:00
|
|
|
|
2018-03-22 07:05:40 -07:00
|
|
|
#include "AL/al.h"
|
2019-07-28 21:29:59 -07:00
|
|
|
#include "AL/alc.h"
|
2020-03-23 16:31:08 -07:00
|
|
|
#include "AL/alext.h"
|
2015-11-01 04:43:55 -08:00
|
|
|
|
2020-03-23 16:00:50 -07:00
|
|
|
#include "almalloc.h"
|
|
|
|
|
2007-12-17 15:43:35 -08:00
|
|
|
|
2020-03-23 16:31:08 -07:00
|
|
|
#define LOWPASSFREQREF 5000.0f
|
|
|
|
#define HIGHPASSFREQREF 250.0f
|
2012-09-14 02:52:37 -07:00
|
|
|
|
2013-06-06 03:24:44 -07:00
|
|
|
|
2018-12-24 19:29:01 -08:00
|
|
|
struct ALfilter {
|
2020-03-23 16:31:08 -07:00
|
|
|
ALenum type{AL_FILTER_NULL};
|
2007-12-17 15:43:35 -08:00
|
|
|
|
2020-03-23 16:31:08 -07:00
|
|
|
float Gain{1.0f};
|
|
|
|
float GainHF{1.0f};
|
|
|
|
float HFReference{LOWPASSFREQREF};
|
|
|
|
float GainLF{1.0f};
|
|
|
|
float LFReference{HIGHPASSFREQREF};
|
2007-12-17 22:42:38 -08:00
|
|
|
|
2020-04-09 19:36:37 -07:00
|
|
|
struct Vtable {
|
|
|
|
void (*const setParami )(ALfilter *filter, ALenum param, int val);
|
|
|
|
void (*const setParamiv)(ALfilter *filter, ALenum param, const int *vals);
|
|
|
|
void (*const setParamf )(ALfilter *filter, ALenum param, float val);
|
|
|
|
void (*const setParamfv)(ALfilter *filter, ALenum param, const float *vals);
|
|
|
|
|
|
|
|
void (*const getParami )(const ALfilter *filter, ALenum param, int *val);
|
|
|
|
void (*const getParamiv)(const ALfilter *filter, ALenum param, int *vals);
|
|
|
|
void (*const getParamf )(const ALfilter *filter, ALenum param, float *val);
|
|
|
|
void (*const getParamfv)(const ALfilter *filter, ALenum param, float *vals);
|
|
|
|
};
|
|
|
|
const Vtable *vtab{nullptr};
|
2011-09-11 07:34:03 -07:00
|
|
|
|
2012-04-19 22:28:01 -07:00
|
|
|
/* Self ID */
|
2020-03-23 16:31:08 -07:00
|
|
|
ALuint id{0};
|
|
|
|
|
2020-04-09 19:36:37 -07:00
|
|
|
void setParami(ALenum param, int value) { vtab->setParami(this, param, value); }
|
|
|
|
void setParamiv(ALenum param, const int *values) { vtab->setParamiv(this, param, values); }
|
|
|
|
void setParamf(ALenum param, float value) { vtab->setParamf(this, param, value); }
|
|
|
|
void setParamfv(ALenum param, const float *values) { vtab->setParamfv(this, param, values); }
|
|
|
|
void getParami(ALenum param, int *value) const { vtab->getParami(this, param, value); }
|
|
|
|
void getParamiv(ALenum param, int *values) const { vtab->getParamiv(this, param, values); }
|
|
|
|
void getParamf(ALenum param, float *value) const { vtab->getParamf(this, param, value); }
|
|
|
|
void getParamfv(ALenum param, float *values) const { vtab->getParamfv(this, param, values); }
|
2020-03-23 16:00:50 -07:00
|
|
|
|
|
|
|
DISABLE_ALLOC()
|
2018-12-24 19:29:01 -08:00
|
|
|
};
|
2007-12-17 15:43:35 -08:00
|
|
|
|
|
|
|
#endif
|