diff options
-rw-r--r-- | Alc/effects/chorus.c | 26 | ||||
-rw-r--r-- | Alc/effects/dedicated.c | 26 | ||||
-rw-r--r-- | Alc/effects/distortion.c | 26 | ||||
-rw-r--r-- | Alc/effects/echo.c | 26 | ||||
-rw-r--r-- | Alc/effects/equalizer.c | 26 | ||||
-rw-r--r-- | Alc/effects/flanger.c | 26 | ||||
-rw-r--r-- | Alc/effects/modulator.c | 28 | ||||
-rw-r--r-- | Alc/effects/null.c | 18 | ||||
-rw-r--r-- | Alc/effects/reverb.c | 51 | ||||
-rw-r--r-- | OpenAL32/Include/alEffect.h | 154 | ||||
-rw-r--r-- | OpenAL32/alEffect.c | 90 |
11 files changed, 191 insertions, 306 deletions
diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c index e5a20b5d..c74bf0b5 100644 --- a/Alc/effects/chorus.c +++ b/Alc/effects/chorus.c @@ -290,7 +290,7 @@ ALeffectStateFactory *ALchorusStateFactory_getFactory(void) } -void chorus_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) +void ALchorus_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) { switch(param) { @@ -313,11 +313,11 @@ void chorus_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint break; } } -void chorus_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) +void ALchorus_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) { - chorus_SetParami(effect, context, param, vals[0]); + ALchorus_SetParami(effect, context, param, vals[0]); } -void chorus_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) +void ALchorus_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) { switch(param) { @@ -354,12 +354,12 @@ void chorus_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALflo break; } } -void chorus_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) +void ALchorus_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) { - chorus_SetParamf(effect, context, param, vals[0]); + ALchorus_SetParamf(effect, context, param, vals[0]); } -void chorus_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) +void ALchorus_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) { switch(param) { @@ -376,11 +376,11 @@ void chorus_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint break; } } -void chorus_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) +void ALchorus_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) { - chorus_GetParami(effect, context, param, vals); + ALchorus_GetParami(effect, context, param, vals); } -void chorus_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) +void ALchorus_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) { switch(param) { @@ -405,7 +405,9 @@ void chorus_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALflo break; } } -void chorus_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) +void ALchorus_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) { - chorus_GetParamf(effect, context, param, vals); + ALchorus_GetParamf(effect, context, param, vals); } + +DEFINE_ALEFFECT_VTABLE(ALchorus); diff --git a/Alc/effects/dedicated.c b/Alc/effects/dedicated.c index bd266b0e..6b3ce1ae 100644 --- a/Alc/effects/dedicated.c +++ b/Alc/effects/dedicated.c @@ -131,13 +131,13 @@ ALeffectStateFactory *ALdedicatedStateFactory_getFactory(void) } -void ded_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) +void ALdedicated_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); } -void ded_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) +void ALdedicated_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) { - ded_SetParami(effect, context, param, vals[0]); + ALdedicated_SetParami(effect, context, param, vals[0]); } -void ded_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) +void ALdedicated_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) { switch(param) { @@ -153,18 +153,18 @@ void ded_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat break; } } -void ded_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) +void ALdedicated_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) { - ded_SetParamf(effect, context, param, vals[0]); + ALdedicated_SetParamf(effect, context, param, vals[0]); } -void ded_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) +void ALdedicated_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); } -void ded_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) +void ALdedicated_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) { - ded_GetParami(effect, context, param, vals); + ALdedicated_GetParami(effect, context, param, vals); } -void ded_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) +void ALdedicated_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) { switch(param) { @@ -177,7 +177,9 @@ void ded_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat break; } } -void ded_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) +void ALdedicated_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) { - ded_GetParamf(effect, context, param, vals); + ALdedicated_GetParamf(effect, context, param, vals); } + +DEFINE_ALEFFECT_VTABLE(ALdedicated); diff --git a/Alc/effects/distortion.c b/Alc/effects/distortion.c index 7828377c..e92fb9a8 100644 --- a/Alc/effects/distortion.c +++ b/Alc/effects/distortion.c @@ -286,7 +286,7 @@ ALeffectStateFactory *ALdistortionStateFactory_getFactory(void) } -void distortion_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) +void ALdistortion_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) { effect=effect; val=val; @@ -298,11 +298,11 @@ void distortion_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, A break; } } -void distortion_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) +void ALdistortion_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) { - distortion_SetParami(effect, context, param, vals[0]); + ALdistortion_SetParami(effect, context, param, vals[0]); } -void distortion_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) +void ALdistortion_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) { switch(param) { @@ -346,12 +346,12 @@ void distortion_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, A break; } } -void distortion_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) +void ALdistortion_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) { - distortion_SetParamf(effect, context, param, vals[0]); + ALdistortion_SetParamf(effect, context, param, vals[0]); } -void distortion_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) +void ALdistortion_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) { effect=effect; val=val; @@ -363,11 +363,11 @@ void distortion_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, A break; } } -void distortion_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) +void ALdistortion_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) { - distortion_GetParami(effect, context, param, vals); + ALdistortion_GetParami(effect, context, param, vals); } -void distortion_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) +void ALdistortion_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) { switch(param) { @@ -396,7 +396,9 @@ void distortion_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, A break; } } -void distortion_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) +void ALdistortion_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) { - distortion_GetParamf(effect, context, param, vals); + ALdistortion_GetParamf(effect, context, param, vals); } + +DEFINE_ALEFFECT_VTABLE(ALdistortion); diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c index d5915295..8f679c41 100644 --- a/Alc/effects/echo.c +++ b/Alc/effects/echo.c @@ -228,13 +228,13 @@ ALeffectStateFactory *ALechoStateFactory_getFactory(void) } -void echo_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) +void ALecho_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); } -void echo_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) +void ALecho_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) { - echo_SetParami(effect, context, param, vals[0]); + ALecho_SetParami(effect, context, param, vals[0]); } -void echo_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) +void ALecho_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) { switch(param) { @@ -278,18 +278,18 @@ void echo_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat break; } } -void echo_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) +void ALecho_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) { - echo_SetParamf(effect, context, param, vals[0]); + ALecho_SetParamf(effect, context, param, vals[0]); } -void echo_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) +void ALecho_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); } -void echo_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) +void ALecho_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) { - echo_GetParami(effect, context, param, vals); + ALecho_GetParami(effect, context, param, vals); } -void echo_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) +void ALecho_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) { switch(param) { @@ -318,7 +318,9 @@ void echo_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat break; } } -void echo_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) +void ALecho_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) { - echo_GetParamf(effect, context, param, vals); + ALecho_GetParamf(effect, context, param, vals); } + +DEFINE_ALEFFECT_VTABLE(ALecho); diff --git a/Alc/effects/equalizer.c b/Alc/effects/equalizer.c index d397a9ba..adcd40f4 100644 --- a/Alc/effects/equalizer.c +++ b/Alc/effects/equalizer.c @@ -328,7 +328,7 @@ ALeffectStateFactory *ALequalizerStateFactory_getFactory(void) } -void equalizer_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) +void ALequalizer_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) { effect=effect; val=val; @@ -340,11 +340,11 @@ void equalizer_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, AL break; } } -void equalizer_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) +void ALequalizer_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) { - equalizer_SetParami(effect, context, param, vals[0]); + ALequalizer_SetParami(effect, context, param, vals[0]); } -void equalizer_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) +void ALequalizer_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) { switch(param) { @@ -423,12 +423,12 @@ void equalizer_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, AL break; } } -void equalizer_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) +void ALequalizer_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) { - equalizer_SetParamf(effect, context, param, vals[0]); + ALequalizer_SetParamf(effect, context, param, vals[0]); } -void equalizer_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) +void ALequalizer_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) { effect=effect; val=val; @@ -440,11 +440,11 @@ void equalizer_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, AL break; } } -void equalizer_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) +void ALequalizer_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) { - equalizer_GetParami(effect, context, param, vals); + ALequalizer_GetParami(effect, context, param, vals); } -void equalizer_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) +void ALequalizer_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) { switch(param) { @@ -493,7 +493,9 @@ void equalizer_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, AL break; } } -void equalizer_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) +void ALequalizer_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) { - equalizer_GetParamf(effect, context, param, vals); + ALequalizer_GetParamf(effect, context, param, vals); } + +DEFINE_ALEFFECT_VTABLE(ALequalizer); diff --git a/Alc/effects/flanger.c b/Alc/effects/flanger.c index a0f94a46..de98a06d 100644 --- a/Alc/effects/flanger.c +++ b/Alc/effects/flanger.c @@ -290,7 +290,7 @@ ALeffectStateFactory *ALflangerStateFactory_getFactory(void) } -void flanger_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) +void ALflanger_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) { switch(param) { @@ -313,11 +313,11 @@ void flanger_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALin break; } } -void flanger_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) +void ALflanger_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) { - flanger_SetParami(effect, context, param, vals[0]); + ALflanger_SetParami(effect, context, param, vals[0]); } -void flanger_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) +void ALflanger_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) { switch(param) { @@ -354,12 +354,12 @@ void flanger_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfl break; } } -void flanger_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) +void ALflanger_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) { - flanger_SetParamf(effect, context, param, vals[0]); + ALflanger_SetParamf(effect, context, param, vals[0]); } -void flanger_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) +void ALflanger_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) { switch(param) { @@ -376,11 +376,11 @@ void flanger_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALin break; } } -void flanger_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) +void ALflanger_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) { - flanger_GetParami(effect, context, param, vals); + ALflanger_GetParami(effect, context, param, vals); } -void flanger_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) +void ALflanger_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) { switch(param) { @@ -405,7 +405,9 @@ void flanger_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfl break; } } -void flanger_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) +void ALflanger_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) { - flanger_GetParamf(effect, context, param, vals); + ALflanger_GetParamf(effect, context, param, vals); } + +DEFINE_ALEFFECT_VTABLE(ALflanger); diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c index ec99bd53..e48a6d94 100644 --- a/Alc/effects/modulator.c +++ b/Alc/effects/modulator.c @@ -245,7 +245,7 @@ ALeffectStateFactory *ALmodulatorStateFactory_getFactory(void) } -void mod_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) +void ALmodulator_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) { switch(param) { @@ -268,17 +268,17 @@ void mod_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat break; } } -void mod_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) +void ALmodulator_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) { - mod_SetParamf(effect, context, param, vals[0]); + ALmodulator_SetParamf(effect, context, param, vals[0]); } -void mod_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) +void ALmodulator_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) { switch(param) { case AL_RING_MODULATOR_FREQUENCY: case AL_RING_MODULATOR_HIGHPASS_CUTOFF: - mod_SetParamf(effect, context, param, (ALfloat)val); + ALmodulator_SetParamf(effect, context, param, (ALfloat)val); break; case AL_RING_MODULATOR_WAVEFORM: @@ -293,12 +293,12 @@ void mod_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint va break; } } -void mod_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) +void ALmodulator_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) { - mod_SetParami(effect, context, param, vals[0]); + ALmodulator_SetParami(effect, context, param, vals[0]); } -void mod_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) +void ALmodulator_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) { switch(param) { @@ -317,11 +317,11 @@ void mod_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *v break; } } -void mod_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) +void ALmodulator_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) { - mod_GetParami(effect, context, param, vals); + ALmodulator_GetParami(effect, context, param, vals); } -void mod_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) +void ALmodulator_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) { switch(param) { @@ -337,7 +337,9 @@ void mod_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat break; } } -void mod_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) +void ALmodulator_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) { - mod_GetParamf(effect, context, param, vals); + ALmodulator_GetParamf(effect, context, param, vals); } + +DEFINE_ALEFFECT_VTABLE(ALmodulator); diff --git a/Alc/effects/null.c b/Alc/effects/null.c index 8636d573..cdca1adf 100644 --- a/Alc/effects/null.c +++ b/Alc/effects/null.c @@ -85,20 +85,22 @@ ALeffectStateFactory *ALnullStateFactory_getFactory(void) } -void null_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) +void ALnull_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); } -void null_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) +void ALnull_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) { (void)effect;(void)param;(void)vals; alSetError(context, AL_INVALID_ENUM); } -void null_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) +void ALnull_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); } -void null_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) +void ALnull_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) { (void)effect;(void)param;(void)vals; alSetError(context, AL_INVALID_ENUM); } -void null_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) +void ALnull_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); } -void null_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) +void ALnull_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) { (void)effect;(void)param;(void)vals; alSetError(context, AL_INVALID_ENUM); } -void null_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) +void ALnull_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); } -void null_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) +void ALnull_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) { (void)effect;(void)param;(void)vals; alSetError(context, AL_INVALID_ENUM); } + +DEFINE_ALEFFECT_VTABLE(ALnull); diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index a13a5693..eb47f27f 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -1307,7 +1307,7 @@ ALeffectStateFactory *ALreverbStateFactory_getFactory(void) } -void eaxreverb_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) +void ALeaxreverb_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) { switch(param) { @@ -1323,11 +1323,11 @@ void eaxreverb_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, AL break; } } -void eaxreverb_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) +void ALeaxreverb_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) { - eaxreverb_SetParami(effect, context, param, vals[0]); + ALeaxreverb_SetParami(effect, context, param, vals[0]); } -void eaxreverb_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) +void ALeaxreverb_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) { switch(param) { @@ -1476,7 +1476,7 @@ void eaxreverb_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, AL break; } } -void eaxreverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) +void ALeaxreverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) { switch(param) { @@ -1506,12 +1506,12 @@ void eaxreverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, c break; default: - eaxreverb_SetParamf(effect, context, param, vals[0]); + ALeaxreverb_SetParamf(effect, context, param, vals[0]); break; } } -void eaxreverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) +void ALeaxreverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) { switch(param) { @@ -1524,11 +1524,11 @@ void eaxreverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, AL break; } } -void eaxreverb_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) +void ALeaxreverb_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) { - eaxreverb_GetParami(effect, context, param, vals); + ALeaxreverb_GetParami(effect, context, param, vals); } -void eaxreverb_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) +void ALeaxreverb_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) { switch(param) { @@ -1617,7 +1617,7 @@ void eaxreverb_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, AL break; } } -void eaxreverb_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) +void ALeaxreverb_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) { switch(param) { @@ -1637,13 +1637,14 @@ void eaxreverb_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, A break; default: - eaxreverb_GetParamf(effect, context, param, vals); + ALeaxreverb_GetParamf(effect, context, param, vals); break; } } +DEFINE_ALEFFECT_VTABLE(ALeaxreverb); -void reverb_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) +void ALreverb_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val) { switch(param) { @@ -1659,11 +1660,11 @@ void reverb_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint break; } } -void reverb_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) +void ALreverb_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals) { - reverb_SetParami(effect, context, param, vals[0]); + ALreverb_SetParami(effect, context, param, vals[0]); } -void reverb_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) +void ALreverb_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) { switch(param) { @@ -1756,12 +1757,12 @@ void reverb_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALflo break; } } -void reverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) +void ALreverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals) { - reverb_SetParamf(effect, context, param, vals[0]); + ALreverb_SetParamf(effect, context, param, vals[0]); } -void reverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) +void ALreverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val) { switch(param) { @@ -1774,11 +1775,11 @@ void reverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint break; } } -void reverb_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) +void ALreverb_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals) { - reverb_GetParami(effect, context, param, vals); + ALreverb_GetParami(effect, context, param, vals); } -void reverb_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) +void ALreverb_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) { switch(param) { @@ -1835,7 +1836,9 @@ void reverb_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALflo break; } } -void reverb_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) +void ALreverb_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals) { - reverb_GetParamf(effect, context, param, vals); + ALreverb_GetParamf(effect, context, param, vals); } + +DEFINE_ALEFFECT_VTABLE(ALreverb); diff --git a/OpenAL32/Include/alEffect.h b/OpenAL32/Include/alEffect.h index a3d40b82..cea785dc 100644 --- a/OpenAL32/Include/alEffect.h +++ b/OpenAL32/Include/alEffect.h @@ -7,6 +7,8 @@ extern "C" { #endif +typedef struct ALeffect ALeffect; + enum { EAXREVERB = 0, REVERB, @@ -25,7 +27,39 @@ extern ALboolean DisabledEffects[MAX_EFFECTS]; extern ALfloat ReverbBoost; extern ALboolean EmulateEAXReverb; -typedef struct ALeffect +struct ALeffectVtable { + void (*const SetParami)(ALeffect *effect, ALCcontext *context, ALenum param, ALint val); + void (*const SetParamiv)(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals); + void (*const SetParamf)(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val); + void (*const SetParamfv)(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals); + + void (*const GetParami)(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val); + void (*const GetParamiv)(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals); + void (*const GetParamf)(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val); + void (*const GetParamfv)(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals); +}; + +#define DEFINE_ALEFFECT_VTABLE(T) \ +const struct ALeffectVtable T##_vtable = { \ + T##_SetParami, T##_SetParamiv, \ + T##_SetParamf, T##_SetParamfv, \ + T##_GetParami, T##_GetParamiv, \ + T##_GetParamf, T##_GetParamfv, \ +} + +extern const struct ALeffectVtable ALeaxreverb_vtable; +extern const struct ALeffectVtable ALreverb_vtable; +extern const struct ALeffectVtable ALchorus_vtable; +extern const struct ALeffectVtable ALdistortion_vtable; +extern const struct ALeffectVtable ALecho_vtable; +extern const struct ALeffectVtable ALequalizer_vtable; +extern const struct ALeffectVtable ALflanger_vtable; +extern const struct ALeffectVtable ALmodulator_vtable; +extern const struct ALeffectVtable ALnull_vtable; +extern const struct ALeffectVtable ALdedicated_vtable; + + +struct ALeffect { // Effect type (AL_EFFECT_NULL, ...) ALenum type; @@ -119,123 +153,25 @@ typedef struct ALeffect ALfloat EQBandwidth; } Distortion; - void (*SetParami)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALint val); - void (*SetParamiv)(struct ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals); - void (*SetParamf)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val); - void (*SetParamfv)(struct ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals); - - void (*GetParami)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALint *val); - void (*GetParamiv)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals); - void (*GetParamf)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val); - void (*GetParamfv)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals); + const struct ALeffectVtable *vtbl; /* Self ID */ ALuint id; -} ALeffect; +}; -#define ALeffect_SetParami(x, c, p, v) ((x)->SetParami((x),(c),(p),(v))) -#define ALeffect_SetParamiv(x, c, p, v) ((x)->SetParamiv((x),(c),(p),(v))) -#define ALeffect_SetParamf(x, c, p, v) ((x)->SetParamf((x),(c),(p),(v))) -#define ALeffect_SetParamfv(x, c, p, v) ((x)->SetParamfv((x),(c),(p),(v))) +#define ALeffect_SetParami(x, c, p, v) ((x)->vtbl->SetParami((x),(c),(p),(v))) +#define ALeffect_SetParamiv(x, c, p, v) ((x)->vtbl->SetParamiv((x),(c),(p),(v))) +#define ALeffect_SetParamf(x, c, p, v) ((x)->vtbl->SetParamf((x),(c),(p),(v))) +#define ALeffect_SetParamfv(x, c, p, v) ((x)->vtbl->SetParamfv((x),(c),(p),(v))) -#define ALeffect_GetParami(x, c, p, v) ((x)->GetParami((x),(c),(p),(v))) -#define ALeffect_GetParamiv(x, c, p, v) ((x)->GetParamiv((x),(c),(p),(v))) -#define ALeffect_GetParamf(x, c, p, v) ((x)->GetParamf((x),(c),(p),(v))) -#define ALeffect_GetParamfv(x, c, p, v) ((x)->GetParamfv((x),(c),(p),(v))) +#define ALeffect_GetParami(x, c, p, v) ((x)->vtbl->GetParami((x),(c),(p),(v))) +#define ALeffect_GetParamiv(x, c, p, v) ((x)->vtbl->GetParamiv((x),(c),(p),(v))) +#define ALeffect_GetParamf(x, c, p, v) ((x)->vtbl->GetParamf((x),(c),(p),(v))) +#define ALeffect_GetParamfv(x, c, p, v) ((x)->vtbl->GetParamfv((x),(c),(p),(v))) static __inline ALboolean IsReverbEffect(ALenum type) { return type == AL_EFFECT_REVERB || type == AL_EFFECT_EAXREVERB; } -void eaxreverb_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val); -void eaxreverb_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals); -void eaxreverb_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val); -void eaxreverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals); -void eaxreverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val); -void eaxreverb_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals); -void eaxreverb_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val); -void eaxreverb_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals); - -void reverb_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val); -void reverb_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals); -void reverb_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val); -void reverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals); -void reverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val); -void reverb_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals); -void reverb_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val); -void reverb_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals); - -void chorus_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val); -void chorus_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals); -void chorus_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val); -void chorus_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals); -void chorus_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val); -void chorus_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals); -void chorus_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val); -void chorus_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals); - -void distortion_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val); -void distortion_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals); -void distortion_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val); -void distortion_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals); -void distortion_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val); -void distortion_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals); -void distortion_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val); -void distortion_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals); - -void echo_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val); -void echo_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals); -void echo_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val); -void echo_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals); -void echo_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val); -void echo_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals); -void echo_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val); -void echo_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals); - -void equalizer_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val); -void equalizer_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals); -void equalizer_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val); -void equalizer_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals); -void equalizer_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val); -void equalizer_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals); -void equalizer_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val); -void equalizer_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals); - -void flanger_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val); -void flanger_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals); -void flanger_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val); -void flanger_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals); -void flanger_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val); -void flanger_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals); -void flanger_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val); -void flanger_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals); - -void mod_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val); -void mod_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals); -void mod_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val); -void mod_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals); -void mod_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val); -void mod_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals); -void mod_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val); -void mod_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals); - -void ded_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val); -void ded_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals); -void ded_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val); -void ded_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals); -void ded_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val); -void ded_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals); -void ded_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val); -void ded_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals); - -void null_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val); -void null_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals); -void null_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val); -void null_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals); -void null_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val); -void null_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals); -void null_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val); -void null_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals); - ALenum InitEffect(ALeffect *effect); ALvoid ReleaseALEffects(ALCdevice *device); diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c index 23176beb..dded17b1 100644 --- a/OpenAL32/alEffect.c +++ b/OpenAL32/alEffect.c @@ -395,14 +395,7 @@ static void InitEffectParams(ALeffect *effect, ALenum type) effect->Reverb.LFReference = AL_EAXREVERB_DEFAULT_LFREFERENCE; effect->Reverb.RoomRolloffFactor = AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR; effect->Reverb.DecayHFLimit = AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT; - effect->SetParami = eaxreverb_SetParami; - effect->SetParamiv = eaxreverb_SetParamiv; - effect->SetParamf = eaxreverb_SetParamf; - effect->SetParamfv = eaxreverb_SetParamfv; - effect->GetParami = eaxreverb_GetParami; - effect->GetParamiv = eaxreverb_GetParamiv; - effect->GetParamf = eaxreverb_GetParamf; - effect->GetParamfv = eaxreverb_GetParamfv; + effect->vtbl = &ALeaxreverb_vtable; break; case AL_EFFECT_REVERB: effect->Reverb.Density = AL_REVERB_DEFAULT_DENSITY; @@ -418,14 +411,7 @@ static void InitEffectParams(ALeffect *effect, ALenum type) effect->Reverb.AirAbsorptionGainHF = AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF; effect->Reverb.RoomRolloffFactor = AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR; effect->Reverb.DecayHFLimit = AL_REVERB_DEFAULT_DECAY_HFLIMIT; - effect->SetParami = reverb_SetParami; - effect->SetParamiv = reverb_SetParamiv; - effect->SetParamf = reverb_SetParamf; - effect->SetParamfv = reverb_SetParamfv; - effect->GetParami = reverb_GetParami; - effect->GetParamiv = reverb_GetParamiv; - effect->GetParamf = reverb_GetParamf; - effect->GetParamfv = reverb_GetParamfv; + effect->vtbl = &ALreverb_vtable; break; case AL_EFFECT_CHORUS: effect->Chorus.Waveform = AL_CHORUS_DEFAULT_WAVEFORM; @@ -434,14 +420,7 @@ static void InitEffectParams(ALeffect *effect, ALenum type) effect->Chorus.Depth = AL_CHORUS_DEFAULT_DEPTH; effect->Chorus.Feedback = AL_CHORUS_DEFAULT_FEEDBACK; effect->Chorus.Delay = AL_CHORUS_DEFAULT_DELAY; - effect->SetParami = chorus_SetParami; - effect->SetParamiv = chorus_SetParamiv; - effect->SetParamf = chorus_SetParamf; - effect->SetParamfv = chorus_SetParamfv; - effect->GetParami = chorus_GetParami; - effect->GetParamiv = chorus_GetParamiv; - effect->GetParamf = chorus_GetParamf; - effect->GetParamfv = chorus_GetParamfv; + effect->vtbl = &ALchorus_vtable; break; case AL_EFFECT_DISTORTION: effect->Distortion.Edge = AL_DISTORTION_DEFAULT_EDGE; @@ -449,14 +428,7 @@ static void InitEffectParams(ALeffect *effect, ALenum type) effect->Distortion.LowpassCutoff = AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF; effect->Distortion.EQCenter = AL_DISTORTION_DEFAULT_EQCENTER; effect->Distortion.EQBandwidth = AL_DISTORTION_DEFAULT_EQBANDWIDTH; - effect->SetParami = distortion_SetParami; - effect->SetParamiv = distortion_SetParamiv; - effect->SetParamf = distortion_SetParamf; - effect->SetParamfv = distortion_SetParamfv; - effect->GetParami = distortion_GetParami; - effect->GetParamiv = distortion_GetParamiv; - effect->GetParamf = distortion_GetParamf; - effect->GetParamfv = distortion_GetParamfv; + effect->vtbl = &ALdistortion_vtable; break; case AL_EFFECT_ECHO: effect->Echo.Delay = AL_ECHO_DEFAULT_DELAY; @@ -464,14 +436,7 @@ static void InitEffectParams(ALeffect *effect, ALenum type) effect->Echo.Damping = AL_ECHO_DEFAULT_DAMPING; effect->Echo.Feedback = AL_ECHO_DEFAULT_FEEDBACK; effect->Echo.Spread = AL_ECHO_DEFAULT_SPREAD; - effect->SetParami = echo_SetParami; - effect->SetParamiv = echo_SetParamiv; - effect->SetParamf = echo_SetParamf; - effect->SetParamfv = echo_SetParamfv; - effect->GetParami = echo_GetParami; - effect->GetParamiv = echo_GetParamiv; - effect->GetParamf = echo_GetParamf; - effect->GetParamfv = echo_GetParamfv; + effect->vtbl = &ALecho_vtable; break; case AL_EFFECT_EQUALIZER: effect->Equalizer.LowCutoff = AL_EQUALIZER_DEFAULT_LOW_CUTOFF; @@ -484,14 +449,7 @@ static void InitEffectParams(ALeffect *effect, ALenum type) effect->Equalizer.Mid2Width = AL_EQUALIZER_DEFAULT_MID2_WIDTH; effect->Equalizer.HighCutoff = AL_EQUALIZER_DEFAULT_HIGH_CUTOFF; effect->Equalizer.HighGain = AL_EQUALIZER_DEFAULT_HIGH_GAIN; - effect->SetParami = equalizer_SetParami; - effect->SetParamiv = equalizer_SetParamiv; - effect->SetParamf = equalizer_SetParamf; - effect->SetParamfv = equalizer_SetParamfv; - effect->GetParami = equalizer_GetParami; - effect->GetParamiv = equalizer_GetParamiv; - effect->GetParamf = equalizer_GetParamf; - effect->GetParamfv = equalizer_GetParamfv; + effect->vtbl = &ALequalizer_vtable; break; case AL_EFFECT_FLANGER: effect->Flanger.Waveform = AL_FLANGER_DEFAULT_WAVEFORM; @@ -500,49 +458,21 @@ static void InitEffectParams(ALeffect *effect, ALenum type) effect->Flanger.Depth = AL_FLANGER_DEFAULT_DEPTH; effect->Flanger.Feedback = AL_FLANGER_DEFAULT_FEEDBACK; effect->Flanger.Delay = AL_FLANGER_DEFAULT_DELAY; - effect->SetParami = flanger_SetParami; - effect->SetParamiv = flanger_SetParamiv; - effect->SetParamf = flanger_SetParamf; - effect->SetParamfv = flanger_SetParamfv; - effect->GetParami = flanger_GetParami; - effect->GetParamiv = flanger_GetParamiv; - effect->GetParamf = flanger_GetParamf; - effect->GetParamfv = flanger_GetParamfv; + effect->vtbl = &ALflanger_vtable; break; case AL_EFFECT_RING_MODULATOR: effect->Modulator.Frequency = AL_RING_MODULATOR_DEFAULT_FREQUENCY; effect->Modulator.HighPassCutoff = AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF; effect->Modulator.Waveform = AL_RING_MODULATOR_DEFAULT_WAVEFORM; - effect->SetParami = mod_SetParami; - effect->SetParamiv = mod_SetParamiv; - effect->SetParamf = mod_SetParamf; - effect->SetParamfv = mod_SetParamfv; - effect->GetParami = mod_GetParami; - effect->GetParamiv = mod_GetParamiv; - effect->GetParamf = mod_GetParamf; - effect->GetParamfv = mod_GetParamfv; + effect->vtbl = &ALmodulator_vtable; break; case AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT: case AL_EFFECT_DEDICATED_DIALOGUE: effect->Dedicated.Gain = 1.0f; - effect->SetParami = ded_SetParami; - effect->SetParamiv = ded_SetParamiv; - effect->SetParamf = ded_SetParamf; - effect->SetParamfv = ded_SetParamfv; - effect->GetParami = ded_GetParami; - effect->GetParamiv = ded_GetParamiv; - effect->GetParamf = ded_GetParamf; - effect->GetParamfv = ded_GetParamfv; + effect->vtbl = &ALdedicated_vtable; break; default: - effect->SetParami = null_SetParami; - effect->SetParamiv = null_SetParamiv; - effect->SetParamf = null_SetParamf; - effect->SetParamfv = null_SetParamfv; - effect->GetParami = null_GetParami; - effect->GetParamiv = null_GetParamiv; - effect->GetParamf = null_GetParamf; - effect->GetParamfv = null_GetParamfv; + effect->vtbl = &ALnull_vtable; break; } effect->type = type; |