diff options
author | Chris Robinson <[email protected]> | 2018-12-24 13:29:36 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-24 13:29:36 -0800 |
commit | ae86aef4db02675ec64d690556905ea034753c87 (patch) | |
tree | 9cfaf0b176150d2563ca62429ced1884c6db510d /Alc/effects/pshifter.cpp | |
parent | cd213fe6b731269caa484eb3cb9b830dac7f5c58 (diff) |
Provide effect target parameters through a common struct
Diffstat (limited to 'Alc/effects/pshifter.cpp')
-rw-r--r-- | Alc/effects/pshifter.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/Alc/effects/pshifter.cpp b/Alc/effects/pshifter.cpp index 321e7492..a70fae52 100644 --- a/Alc/effects/pshifter.cpp +++ b/Alc/effects/pshifter.cpp @@ -144,7 +144,7 @@ struct ALpshifterState final : public EffectState { ALboolean deviceUpdate(const ALCdevice *device) override; - void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override; + void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props, const EffectTarget target) override; void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override; DEF_NEWDEL(ALpshifterState) @@ -173,7 +173,7 @@ ALboolean ALpshifterState::deviceUpdate(const ALCdevice *device) return AL_TRUE; } -void ALpshifterState::update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) +void ALpshifterState::update(const ALCcontext* UNUSED(context), const ALeffectslot *slot, const ALeffectProps *props, const EffectTarget target) { const float pitch{std::pow(2.0f, (ALfloat)(props->Pshifter.CoarseTune*100 + props->Pshifter.FineTune) / 1200.0f @@ -183,19 +183,10 @@ void ALpshifterState::update(const ALCcontext *context, const ALeffectslot *slot ALfloat coeffs[MAX_AMBI_COEFFS]; CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs); - if(ALeffectslot *target{slot->Params.Target}) - { - mOutBuffer = target->WetBuffer; - mOutChannels = target->NumChannels; - ComputePanGains(target, coeffs, slot->Params.Gain, mTargetGains); - } - else - { - const ALCdevice *device{context->Device}; - mOutBuffer = device->Dry.Buffer; - mOutChannels = device->Dry.NumChannels; - ComputePanGains(&device->Dry, coeffs, slot->Params.Gain, mTargetGains); - } + + mOutBuffer = target.Main->Buffer; + mOutChannels = target.Main->NumChannels; + ComputePanGains(target.Main, coeffs, slot->Params.Gain, mTargetGains); } void ALpshifterState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT SamplesIn)[BUFFERSIZE], ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE], ALsizei NumChannels) |