diff options
author | Chris Robinson <[email protected]> | 2011-09-11 07:34:03 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-09-11 07:34:03 -0700 |
commit | ab2b62c98030aa545ee0043feeae05916329a521 (patch) | |
tree | 9a8814a11d529e371e88838a443abc4bb8bbcd82 /OpenAL32/Include/alFilter.h | |
parent | 97fa7cc9ac23ca0168617cc40800e690e6b03e73 (diff) |
Use function pointers to set type-specific filter properties
Diffstat (limited to 'OpenAL32/Include/alFilter.h')
-rw-r--r-- | OpenAL32/Include/alFilter.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h index fc91bb16..7d1f7ec0 100644 --- a/OpenAL32/Include/alFilter.h +++ b/OpenAL32/Include/alFilter.h @@ -70,18 +70,36 @@ static __inline ALfloat lpFilter1PC(FILTER *iir, ALuint offset, ALfloat input) ALfloat lpCoeffCalc(ALfloat g, ALfloat cw); -typedef struct ALfilter -{ +typedef struct ALfilter { // Filter type (AL_FILTER_NULL, ...) ALenum type; ALfloat Gain; ALfloat GainHF; + void (*SetParami)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALint val); + void (*SetParamiv)(struct ALfilter *filter, ALCcontext *context, ALenum param, const ALint *vals); + void (*SetParamf)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALfloat val); + void (*SetParamfv)(struct ALfilter *filter, ALCcontext *context, ALenum param, const ALfloat *vals); + + void (*GetParami)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALint *val); + void (*GetParamiv)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALint *vals); + void (*GetParamf)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val); + void (*GetParamfv)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *vals); + // Index to itself ALuint filter; } ALfilter; +#define ALfilter_SetParami(x, c, p, v) ((x)->SetParami((x),(c),(p),(v))) +#define ALfilter_SetParamiv(x, c, p, v) ((x)->SetParamiv((x),(c),(p),(v))) +#define ALfilter_SetParamf(x, c, p, v) ((x)->SetParamf((x),(c),(p),(v))) +#define ALfilter_SetParamfv(x, c, p, v) ((x)->SetParamfv((x),(c),(p),(v))) + +#define ALfilter_GetParami(x, c, p, v) ((x)->GetParami((x),(c),(p),(v))) +#define ALfilter_GetParamiv(x, c, p, v) ((x)->GetParamiv((x),(c),(p),(v))) +#define ALfilter_GetParamf(x, c, p, v) ((x)->GetParamf((x),(c),(p),(v))) +#define ALfilter_GetParamfv(x, c, p, v) ((x)->GetParamfv((x),(c),(p),(v))) ALvoid ReleaseALFilters(ALCdevice *device); |