From 8a5153ce0dee072c283b04ff5a61faa764f81743 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 8 Apr 2020 07:28:07 -0700 Subject: Avoid ALfloat and ALint in the effects --- alc/effects/compressor.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'alc/effects/compressor.cpp') diff --git a/alc/effects/compressor.cpp b/alc/effects/compressor.cpp index e5e0339f..d5cb0c75 100644 --- a/alc/effects/compressor.cpp +++ b/alc/effects/compressor.cpp @@ -40,13 +40,13 @@ namespace { struct CompressorState final : public EffectState { /* Effect gains for each channel */ - ALfloat mGain[MAX_AMBI_CHANNELS][MAX_OUTPUT_CHANNELS]{}; + float mGain[MAX_AMBI_CHANNELS][MAX_OUTPUT_CHANNELS]{}; /* Effect parameters */ bool mEnabled{true}; - ALfloat mAttackMult{1.0f}; - ALfloat mReleaseMult{1.0f}; - ALfloat mEnvFollower{1.0f}; + float mAttackMult{1.0f}; + float mReleaseMult{1.0f}; + float mEnvFollower{1.0f}; bool deviceUpdate(const ALCdevice *device) override; @@ -61,8 +61,8 @@ bool CompressorState::deviceUpdate(const ALCdevice *device) /* Number of samples to do a full attack and release (non-integer sample * counts are okay). */ - const ALfloat attackCount = static_cast(device->Frequency) * ATTACK_TIME; - const ALfloat releaseCount = static_cast(device->Frequency) * RELEASE_TIME; + const float attackCount = static_cast(device->Frequency) * ATTACK_TIME; + const float releaseCount = static_cast(device->Frequency) * RELEASE_TIME; /* Calculate per-sample multipliers to attack and release at the desired * rates. @@ -89,11 +89,11 @@ void CompressorState::process(const size_t samplesToDo, const al::span env) env = minf(env*mAttackMult, amplitude); @@ -122,7 +122,7 @@ void CompressorState::process(const size_t samplesToDo, const al::span env) env = minf(env*mAttackMult, amplitude); else if(amplitude < env) @@ -137,10 +137,10 @@ void CompressorState::process(const size_t samplesToDo, const al::span GAIN_SILENCE_THRESHOLD)) continue; @@ -154,7 +154,7 @@ void CompressorState::process(const size_t samplesToDo, const al::spansetError(AL_INVALID_ENUM, "Invalid compressor float property 0x%04x", param); } -void Compressor_setParamfv(EffectProps*, ALCcontext *context, ALenum param, const ALfloat*) +void Compressor_setParamfv(EffectProps*, ALCcontext *context, ALenum param, const float*) { context->setError(AL_INVALID_ENUM, "Invalid compressor float-vector property 0x%04x", param); } -void Compressor_getParami(const EffectProps *props, ALCcontext *context, ALenum param, ALint *val) +void Compressor_getParami(const EffectProps *props, ALCcontext *context, ALenum param, int *val) { switch(param) { @@ -189,11 +189,11 @@ void Compressor_getParami(const EffectProps *props, ALCcontext *context, ALenum param); } } -void Compressor_getParamiv(const EffectProps *props, ALCcontext *context, ALenum param, ALint *vals) +void Compressor_getParamiv(const EffectProps *props, ALCcontext *context, ALenum param, int *vals) { Compressor_getParami(props, context, param, vals); } -void Compressor_getParamf(const EffectProps*, ALCcontext *context, ALenum param, ALfloat*) +void Compressor_getParamf(const EffectProps*, ALCcontext *context, ALenum param, float*) { context->setError(AL_INVALID_ENUM, "Invalid compressor float property 0x%04x", param); } -void Compressor_getParamfv(const EffectProps*, ALCcontext *context, ALenum param, ALfloat*) +void Compressor_getParamfv(const EffectProps*, ALCcontext *context, ALenum param, float*) { context->setError(AL_INVALID_ENUM, "Invalid compressor float-vector property 0x%04x", param); } DEFINE_ALEFFECT_VTABLE(Compressor); -- cgit v1.2.3