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/autowah.cpp | |
parent | cd213fe6b731269caa484eb3cb9b830dac7f5c58 (diff) |
Provide effect target parameters through a common struct
Diffstat (limited to 'Alc/effects/autowah.cpp')
-rw-r--r-- | Alc/effects/autowah.cpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/Alc/effects/autowah.cpp b/Alc/effects/autowah.cpp index e455acf2..8590360a 100644 --- a/Alc/effects/autowah.cpp +++ b/Alc/effects/autowah.cpp @@ -69,7 +69,7 @@ struct ALautowahState 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(ALautowahState) @@ -103,7 +103,7 @@ ALboolean ALautowahState::deviceUpdate(const ALCdevice *UNUSED(device)) return AL_TRUE; } -void ALautowahState::update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) +void ALautowahState::update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props, const EffectTarget target) { const ALCdevice *device = context->Device; ALfloat ReleaseTime; @@ -119,22 +119,11 @@ void ALautowahState::update(const ALCcontext *context, const ALeffectslot *slot, mFreqMinNorm = MIN_FREQ / device->Frequency; mBandwidthNorm = (MAX_FREQ-MIN_FREQ) / device->Frequency; - if(ALeffectslot *target{slot->Params.Target}) - { - mOutBuffer = target->WetBuffer; - mOutChannels = target->NumChannels; - for(i = 0;i < MAX_EFFECT_CHANNELS;i++) - ComputePanGains(target, alu::Matrix::Identity()[i].data(), slot->Params.Gain, - mChans[i].TargetGains); - } - else - { - mOutBuffer = device->FOAOut.Buffer; - mOutChannels = device->FOAOut.NumChannels; - for(i = 0;i < MAX_EFFECT_CHANNELS;i++) - ComputePanGains(&device->FOAOut, alu::Matrix::Identity()[i].data(), slot->Params.Gain, - mChans[i].TargetGains); - } + mOutBuffer = target.FOAOut->Buffer; + mOutChannels = target.FOAOut->NumChannels; + for(i = 0;i < MAX_EFFECT_CHANNELS;i++) + ComputePanGains(target.FOAOut, alu::Matrix::Identity()[i].data(), slot->Params.Gain, + mChans[i].TargetGains); } void ALautowahState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT SamplesIn)[BUFFERSIZE], ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE], ALsizei NumChannels) |