diff options
Diffstat (limited to 'alc/effects')
-rw-r--r-- | alc/effects/autowah.cpp | 8 | ||||
-rw-r--r-- | alc/effects/compressor.cpp | 8 | ||||
-rw-r--r-- | alc/effects/equalizer.cpp | 8 | ||||
-rw-r--r-- | alc/effects/modulator.cpp | 8 | ||||
-rw-r--r-- | alc/effects/vmorpher.cpp | 8 |
5 files changed, 15 insertions, 25 deletions
diff --git a/alc/effects/autowah.cpp b/alc/effects/autowah.cpp index 0bf2450d..3ebb1544 100644 --- a/alc/effects/autowah.cpp +++ b/alc/effects/autowah.cpp @@ -118,11 +118,9 @@ void AutowahState::update(const ALCcontext *context, const ALeffectslot *slot, c mBandwidthNorm = (MAX_FREQ-MIN_FREQ) / frequency; mOutTarget = target.Main->Buffer; - for(size_t i{0u};i < slot->Wet.Buffer.size();++i) - { - auto coeffs = GetAmbiIdentityRow(i); - ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains); - } + auto set_gains = [slot,target](auto &chan, al::span<const float,MAX_AMBI_CHANNELS> coeffs) + { ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, chan.TargetGains); }; + SetAmbiPanIdentity(std::begin(mChans), slot->Wet.Buffer.size(), set_gains); } void AutowahState::process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut) diff --git a/alc/effects/compressor.cpp b/alc/effects/compressor.cpp index 03751ef0..6724482e 100644 --- a/alc/effects/compressor.cpp +++ b/alc/effects/compressor.cpp @@ -76,11 +76,9 @@ void CompressorState::update(const ALCcontext*, const ALeffectslot *slot, const mEnabled = props->Compressor.OnOff; mOutTarget = target.Main->Buffer; - for(size_t i{0u};i < slot->Wet.Buffer.size();++i) - { - auto coeffs = GetAmbiIdentityRow(i); - ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mGain[i]); - } + auto set_gains = [slot,target](auto &gains, al::span<const float,MAX_AMBI_CHANNELS> coeffs) + { ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, gains); }; + SetAmbiPanIdentity(std::begin(mGain), slot->Wet.Buffer.size(), set_gains); } void CompressorState::process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut) diff --git a/alc/effects/equalizer.cpp b/alc/effects/equalizer.cpp index 14ef1758..3005f2f7 100644 --- a/alc/effects/equalizer.cpp +++ b/alc/effects/equalizer.cpp @@ -147,11 +147,9 @@ void EqualizerState::update(const ALCcontext *context, const ALeffectslot *slot, } mOutTarget = target.Main->Buffer; - for(size_t i{0u};i < slot->Wet.Buffer.size();++i) - { - auto coeffs = GetAmbiIdentityRow(i); - ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains); - } + auto set_gains = [slot,target](auto &chan, al::span<const float,MAX_AMBI_CHANNELS> coeffs) + { ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, chan.TargetGains); }; + SetAmbiPanIdentity(std::begin(mChans), slot->Wet.Buffer.size(), set_gains); } void EqualizerState::process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut) diff --git a/alc/effects/modulator.cpp b/alc/effects/modulator.cpp index 051f631a..f75e4dc6 100644 --- a/alc/effects/modulator.cpp +++ b/alc/effects/modulator.cpp @@ -122,11 +122,9 @@ void ModulatorState::update(const ALCcontext *context, const ALeffectslot *slot, mChans[i].Filter.copyParamsFrom(mChans[0].Filter); mOutTarget = target.Main->Buffer; - for(size_t i{0u};i < slot->Wet.Buffer.size();++i) - { - auto coeffs = GetAmbiIdentityRow(i); - ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains); - } + auto set_gains = [slot,target](auto &chan, al::span<const float,MAX_AMBI_CHANNELS> coeffs) + { ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, chan.TargetGains); }; + SetAmbiPanIdentity(std::begin(mChans), slot->Wet.Buffer.size(), set_gains); } void ModulatorState::process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut) diff --git a/alc/effects/vmorpher.cpp b/alc/effects/vmorpher.cpp index 249958c3..8b412d22 100644 --- a/alc/effects/vmorpher.cpp +++ b/alc/effects/vmorpher.cpp @@ -237,11 +237,9 @@ void VmorpherState::update(const ALCcontext *context, const ALeffectslot *slot, } mOutTarget = target.Main->Buffer; - for(size_t i{0u};i < slot->Wet.Buffer.size();++i) - { - auto coeffs = GetAmbiIdentityRow(i); - ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains); - } + auto set_gains = [slot,target](auto &chan, al::span<const float,MAX_AMBI_CHANNELS> coeffs) + { ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, chan.TargetGains); }; + SetAmbiPanIdentity(std::begin(mChans), slot->Wet.Buffer.size(), set_gains); } void VmorpherState::process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut) |