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 /core/effects/base.h | |
parent | 29a1001a22891294ab63102e8868bdea52eb7b93 (diff) |
Rework effect property handling
To nake EffectProps a variant instead of a union, and avoid manual vtables.
Diffstat (limited to 'core/effects/base.h')
-rw-r--r-- | core/effects/base.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/core/effects/base.h b/core/effects/base.h index 66182bf5..df4eb129 100644 --- a/core/effects/base.h +++ b/core/effects/base.h @@ -2,7 +2,8 @@ #define CORE_EFFECTS_BASE_H #include <array> -#include <stddef.h> +#include <cstddef> +#include <variant> #include "almalloc.h" #include "alspan.h" @@ -145,7 +146,7 @@ struct EqualizerProps { float HighGain; }; -struct FshiterProps { +struct FshifterProps { float Frequency; FShifterDirection LeftDirection; FShifterDirection RightDirection; @@ -184,23 +185,22 @@ struct ConvolutionProps { std::array<float,3> OrientUp; }; -union EffectProps { - ReverbProps Reverb; - AutowahProps Autowah; - ChorusProps Chorus; - FlangerProps Flanger; - CompressorProps Compressor; - DistortionProps Distortion; - EchoProps Echo; - EqualizerProps Equalizer; - FshiterProps Fshifter; - ModulatorProps Modulator; - PshifterProps Pshifter; - VmorpherProps Vmorpher; - DedicatedDialogProps DedicatedDialog; - DedicatedLfeProps DedicatedLfe; - ConvolutionProps Convolution; -}; +using EffectProps = std::variant<std::monostate, + ReverbProps, + AutowahProps, + ChorusProps, + FlangerProps, + CompressorProps, + DistortionProps, + EchoProps, + EqualizerProps, + FshifterProps, + ModulatorProps, + PshifterProps, + VmorpherProps, + DedicatedDialogProps, + DedicatedLfeProps, + ConvolutionProps>; struct EffectTarget { |