aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/modulator.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-05-03 18:47:49 -0700
committerChris Robinson <[email protected]>2020-05-03 18:47:49 -0700
commitfe7a74b09ad601a07cd403be124e5e11a2eccd14 (patch)
tree8623881819cbb9051703919619d3f5895a80c07e /alc/effects/modulator.cpp
parentb52fde7c0e57b4965e3b87d9cc2d98611064b7e5 (diff)
Use a helper to set an identity ambisonic pan
Diffstat (limited to 'alc/effects/modulator.cpp')
-rw-r--r--alc/effects/modulator.cpp8
1 files changed, 3 insertions, 5 deletions
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)