diff options
author | Chris Robinson <[email protected]> | 2020-05-03 18:47:49 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-05-03 18:47:49 -0700 |
commit | fe7a74b09ad601a07cd403be124e5e11a2eccd14 (patch) | |
tree | 8623881819cbb9051703919619d3f5895a80c07e /alc/effects/compressor.cpp | |
parent | b52fde7c0e57b4965e3b87d9cc2d98611064b7e5 (diff) |
Use a helper to set an identity ambisonic pan
Diffstat (limited to 'alc/effects/compressor.cpp')
-rw-r--r-- | alc/effects/compressor.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
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) |