From 4e760bbecc6ac4031dca45b4882c6faa71842e90 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 7 Nov 2020 08:36:49 -0800 Subject: Use a separate structure for the active effect slot properties --- alc/effects/compressor.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'alc/effects/compressor.cpp') diff --git a/alc/effects/compressor.cpp b/alc/effects/compressor.cpp index e02dec3b..9d92fdc7 100644 --- a/alc/effects/compressor.cpp +++ b/alc/effects/compressor.cpp @@ -50,8 +50,10 @@ struct CompressorState final : public EffectState { void deviceUpdate(const ALCdevice *device) override; - void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; - void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; + void update(const ALCcontext *context, const EffectSlot *slot, const EffectProps *props, + const EffectTarget target) override; + void process(const size_t samplesToDo, const al::span samplesIn, + const al::span samplesOut) override; DEF_NEWDEL(CompressorState) }; @@ -71,17 +73,19 @@ void CompressorState::deviceUpdate(const ALCdevice *device) mReleaseMult = std::pow(AMP_ENVELOPE_MIN/AMP_ENVELOPE_MAX, 1.0f/releaseCount); } -void CompressorState::update(const ALCcontext*, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) +void CompressorState::update(const ALCcontext*, const EffectSlot *slot, + const EffectProps *props, const EffectTarget target) { mEnabled = props->Compressor.OnOff; mOutTarget = target.Main->Buffer; auto set_gains = [slot,target](auto &gains, al::span coeffs) - { ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, gains); }; + { ComputePanGains(target.Main, coeffs.data(), slot->Gain, gains); }; SetAmbiPanIdentity(std::begin(mGain), slot->Wet.Buffer.size(), set_gains); } -void CompressorState::process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) +void CompressorState::process(const size_t samplesToDo, + const al::span samplesIn, const al::span samplesOut) { for(size_t base{0u};base < samplesToDo;) { -- cgit v1.2.3