aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/compressor.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-11-07 08:36:49 -0800
committerChris Robinson <[email protected]>2020-11-07 08:36:49 -0800
commit4e760bbecc6ac4031dca45b4882c6faa71842e90 (patch)
treee639b40d42ef8f2c3511e93a965cddb31245a729 /alc/effects/compressor.cpp
parent120776bec5f908104f0e76453402ff45a0762846 (diff)
Use a separate structure for the active effect slot properties
Diffstat (limited to 'alc/effects/compressor.cpp')
-rw-r--r--alc/effects/compressor.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/alc/effects/compressor.cpp b/alc/effects/compressor.cpp
index e02dec3b..9d92fdc7 100644
--- a/alc/effects/compressor.cpp
+++ b/alc/effects/compressor.cpp
@@ -50,8 +50,10 @@ struct CompressorState final : public EffectState {
void deviceUpdate(const ALCdevice *device) override;
- void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override;
- void process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut) override;
+ void update(const ALCcontext *context, const EffectSlot *slot, const EffectProps *props,
+ const EffectTarget target) override;
+ void process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn,
+ const al::span<FloatBufferLine> samplesOut) override;
DEF_NEWDEL(CompressorState)
};
@@ -71,17 +73,19 @@ void CompressorState::deviceUpdate(const ALCdevice *device)
mReleaseMult = std::pow(AMP_ENVELOPE_MIN/AMP_ENVELOPE_MAX, 1.0f/releaseCount);
}
-void CompressorState::update(const ALCcontext*, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target)
+void CompressorState::update(const ALCcontext*, const EffectSlot *slot,
+ const EffectProps *props, const EffectTarget target)
{
mEnabled = props->Compressor.OnOff;
mOutTarget = target.Main->Buffer;
auto set_gains = [slot,target](auto &gains, al::span<const float,MAX_AMBI_CHANNELS> coeffs)
- { ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, gains); };
+ { ComputePanGains(target.Main, coeffs.data(), slot->Gain, gains); };
SetAmbiPanIdentity(std::begin(mGain), slot->Wet.Buffer.size(), set_gains);
}
-void CompressorState::process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut)
+void CompressorState::process(const size_t samplesToDo,
+ const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut)
{
for(size_t base{0u};base < samplesToDo;)
{