diff options
author | Chris Robinson <[email protected]> | 2023-12-24 02:48:20 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-12-24 02:48:20 -0800 |
commit | dae225e88dbf795e776a2c9f2dbe5bb07c2228b9 (patch) | |
tree | 8a2e79a24fef5a99b3d0f883ab03cc070a2b584a /alc/effects/chorus.cpp | |
parent | 29a1001a22891294ab63102e8868bdea52eb7b93 (diff) |
Rework effect property handling
To nake EffectProps a variant instead of a union, and avoid manual vtables.
Diffstat (limited to 'alc/effects/chorus.cpp')
-rw-r--r-- | alc/effects/chorus.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/alc/effects/chorus.cpp b/alc/effects/chorus.cpp index 52aaa9a6..bc6ddaf0 100644 --- a/alc/effects/chorus.cpp +++ b/alc/effects/chorus.cpp @@ -93,11 +93,12 @@ struct ChorusState : public EffectState { void deviceUpdate(const DeviceBase *device, const BufferStorage*) override { deviceUpdate(device, ChorusMaxDelay); } - void update(const ContextBase *context, const EffectSlot *slot, const EffectProps *props, + void update(const ContextBase *context, const EffectSlot *slot, const EffectProps *props_, const EffectTarget target) override { - update(context, slot, props->Chorus.Waveform, props->Chorus.Delay, props->Chorus.Depth, - props->Chorus.Feedback, props->Chorus.Rate, props->Chorus.Phase, target); + auto &props = std::get<ChorusProps>(*props_); + update(context, slot, props.Waveform, props.Delay, props.Depth, props.Feedback, props.Rate, + props.Phase, target); } void process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut) final; @@ -106,12 +107,12 @@ struct ChorusState : public EffectState { struct FlangerState final : public ChorusState { void deviceUpdate(const DeviceBase *device, const BufferStorage*) final { ChorusState::deviceUpdate(device, FlangerMaxDelay); } - void update(const ContextBase *context, const EffectSlot *slot, const EffectProps *props, + void update(const ContextBase *context, const EffectSlot *slot, const EffectProps *props_, const EffectTarget target) final { - ChorusState::update(context, slot, props->Flanger.Waveform, props->Flanger.Delay, - props->Flanger.Depth, props->Flanger.Feedback, props->Flanger.Rate, - props->Flanger.Phase, target); + auto &props = std::get<FlangerProps>(*props_); + ChorusState::update(context, slot, props.Waveform, props.Delay, props.Depth, + props.Feedback, props.Rate, props.Phase, target); } }; |