diff options
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) |