aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/equalizer.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-24 13:29:36 -0800
committerChris Robinson <[email protected]>2018-12-24 13:29:36 -0800
commitae86aef4db02675ec64d690556905ea034753c87 (patch)
tree9cfaf0b176150d2563ca62429ced1884c6db510d /Alc/effects/equalizer.cpp
parentcd213fe6b731269caa484eb3cb9b830dac7f5c58 (diff)
Provide effect target parameters through a common struct
Diffstat (limited to 'Alc/effects/equalizer.cpp')
-rw-r--r--Alc/effects/equalizer.cpp25
1 files changed, 7 insertions, 18 deletions
diff --git a/Alc/effects/equalizer.cpp b/Alc/effects/equalizer.cpp
index 53975d19..443bf118 100644
--- a/Alc/effects/equalizer.cpp
+++ b/Alc/effects/equalizer.cpp
@@ -91,7 +91,7 @@ struct ALequalizerState 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(ALequalizerState)
@@ -108,7 +108,7 @@ ALboolean ALequalizerState::deviceUpdate(const ALCdevice *UNUSED(device))
return AL_TRUE;
}
-void ALequalizerState::update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props)
+void ALequalizerState::update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props, const EffectTarget target)
{
const ALCdevice *device = context->Device;
ALfloat frequency = (ALfloat)device->Frequency;
@@ -152,22 +152,11 @@ void ALequalizerState::update(const ALCcontext *context, const ALeffectslot *slo
mChans[i].filter[3].copyParamsFrom(mChans[0].filter[3]);
}
- 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 ALequalizerState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT SamplesIn)[BUFFERSIZE], ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE], ALsizei NumChannels)