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"
|
2015-11-01 04:43:55 -08:00
|
|
|
|
2007-12-17 15:43:35 -08:00
|
|
|
|
2014-05-11 10:09:52 -07:00
|
|
|
#define LOWPASSFREQREF (5000.0f)
|
2014-05-17 07:29:50 -07:00
|
|
|
#define HIGHPASSFREQREF (250.0f)
|
2012-09-14 02:52:37 -07:00
|
|
|
|
2013-06-06 03:24:44 -07:00
|
|
|
|
2018-01-13 08:07:03 -08:00
|
|
|
struct ALfilter;
|
|
|
|
|
2018-12-24 19:29:01 -08:00
|
|
|
struct ALfilterVtable {
|
|
|
|
void (*const setParami)(ALfilter *filter, ALCcontext *context, ALenum param, ALint val);
|
|
|
|
void (*const setParamiv)(ALfilter *filter, ALCcontext *context, ALenum param, const ALint *vals);
|
|
|
|
void (*const setParamf)(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat val);
|
|
|
|
void (*const setParamfv)(ALfilter *filter, ALCcontext *context, ALenum param, const ALfloat *vals);
|
|
|
|
|
|
|
|
void (*const getParami)(ALfilter *filter, ALCcontext *context, ALenum param, ALint *val);
|
|
|
|
void (*const getParamiv)(ALfilter *filter, ALCcontext *context, ALenum param, ALint *vals);
|
|
|
|
void (*const getParamf)(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val);
|
|
|
|
void (*const getParamfv)(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *vals);
|
|
|
|
};
|
|
|
|
|
|
|
|
#define DEFINE_ALFILTER_VTABLE(T) \
|
|
|
|
const ALfilterVtable T##_vtable = { \
|
|
|
|
T##_setParami, T##_setParamiv, T##_setParamf, T##_setParamfv, \
|
|
|
|
T##_getParami, T##_getParamiv, T##_getParamf, T##_getParamfv, \
|
2018-01-13 08:07:03 -08:00
|
|
|
}
|
|
|
|
|
2018-12-24 19:29:01 -08:00
|
|
|
struct ALfilter {
|
2007-12-17 15:43:35 -08:00
|
|
|
// Filter type (AL_FILTER_NULL, ...)
|
|
|
|
ALenum type;
|
|
|
|
|
2007-12-17 22:42:38 -08:00
|
|
|
ALfloat Gain;
|
|
|
|
ALfloat GainHF;
|
2014-05-14 01:24:18 -07:00
|
|
|
ALfloat HFReference;
|
2014-05-17 07:29:50 -07:00
|
|
|
ALfloat GainLF;
|
|
|
|
ALfloat LFReference;
|
2007-12-17 22:42:38 -08:00
|
|
|
|
2018-12-24 19:29:01 -08:00
|
|
|
const ALfilterVtable *vtab;
|
2011-09-11 07:34:03 -07:00
|
|
|
|
2012-04-19 22:28:01 -07:00
|
|
|
/* Self ID */
|
|
|
|
ALuint id;
|
2018-12-24 19:29:01 -08:00
|
|
|
};
|
2018-03-05 11:29:03 -08:00
|
|
|
#define ALfilter_setParami(o, c, p, v) ((o)->vtab->setParami(o, c, p, v))
|
|
|
|
#define ALfilter_setParamf(o, c, p, v) ((o)->vtab->setParamf(o, c, p, v))
|
|
|
|
#define ALfilter_setParamiv(o, c, p, v) ((o)->vtab->setParamiv(o, c, p, v))
|
|
|
|
#define ALfilter_setParamfv(o, c, p, v) ((o)->vtab->setParamfv(o, c, p, v))
|
|
|
|
#define ALfilter_getParami(o, c, p, v) ((o)->vtab->getParami(o, c, p, v))
|
|
|
|
#define ALfilter_getParamf(o, c, p, v) ((o)->vtab->getParamf(o, c, p, v))
|
|
|
|
#define ALfilter_getParamiv(o, c, p, v) ((o)->vtab->getParamiv(o, c, p, v))
|
|
|
|
#define ALfilter_getParamfv(o, c, p, v) ((o)->vtab->getParamfv(o, c, p, v))
|
2007-12-17 15:43:35 -08:00
|
|
|
|
|
|
|
#endif
|