Audacity 3.2.0
|
Generates EffectParameterMethods overrides from variadic template arguments. More...
#include <ShuttleAutomation.h>
Public Types | |
using | Params = std::remove_pointer_t< decltype(EffectType::FetchParameters(std::declval< EffectType & >(), std::declval< EffectSettings & >())) > |
using | PostSetFunction = std::function< bool(EffectType &, EffectSettings &, Params &, bool) > |
Public Member Functions | |
virtual | ~CapturedParameters ()=default |
CapturedParameters () | |
template<typename Fn , typename = decltype( std::declval<Fn>()( std::declval<EffectType &>(), std::declval<EffectSettings &>(), std::declval<Params &>(), true) )> | |
CapturedParameters (Fn &&PostSet) | |
void | Reset (Effect &effect) const override |
void | Visit (Effect &effect, SettingsVisitor &visitor, EffectSettings &settings) const override |
void | Visit (const Effect &effect, ConstSettingsVisitor &visitor, const EffectSettings &settings) const override |
void | Get (const Effect &effect, const EffectSettings &settings, CommandParameters &parms) const override |
bool | Set (Effect &effect, const CommandParameters &parms, EffectSettings &settings) const override |
Public Member Functions inherited from EffectParameterMethods | |
virtual | ~EffectParameterMethods () |
virtual void | Reset (Effect &effect) const =0 |
virtual void | Visit (Effect &effect, SettingsVisitor &visitor, EffectSettings &settings) const =0 |
virtual void | Visit (const Effect &effect, ConstSettingsVisitor &visitor, const EffectSettings &settings) const =0 |
virtual void | Get (const Effect &effect, const EffectSettings &settings, CommandParameters &parms) const =0 |
virtual bool | Set (Effect &effect, const CommandParameters &parms, EffectSettings &settings) const =0 |
Static Private Member Functions | |
template<typename Member , typename Type , typename Value > | |
static void | ResetOne (Params &structure, const EffectParameter< Params, Member, Type, Value > ¶m) |
static void | DoReset (Effect &effect, EffectSettings settings, Params &structure, const CapturedParameters &This) |
template<bool Const, typename Member , typename Type , typename Value > | |
static void | VisitOne (Params &structure, SettingsVisitorBase< Const > &visitor, const EffectParameter< Params, Member, Type, Value > ¶m) |
template<bool Const, typename Member > | |
static void | VisitOne (Params &structure, SettingsVisitorBase< Const > &visitor, const EnumParameter< Params, Member > ¶m) |
template<bool Const> | |
static void | DoVisit (Params &structure, SettingsVisitorBase< Const > &visitor) |
template<typename Member , typename Type , typename Value > | |
static void | GetOne (const Params &structure, CommandParameters &parms, const EffectParameter< Params, Member, Type, Value > ¶m) |
template<typename Member > | |
static void | GetOne (const Params &structure, CommandParameters &parms, const EnumParameter< Params, Member > ¶m) |
static void | DoGet (const Params &structure, CommandParameters &parms) |
template<typename Member , typename Type , typename Value > | |
static bool | SetOne (Params &structure, const CommandParameters &parms, const EffectParameter< Params, Member, Type, Value > ¶m) |
template<typename Member > | |
static bool | SetOne (Params &structure, const CommandParameters &parms, const EnumParameter< Params, Member > ¶m) |
static bool | DoSet (Effect &effect, EffectSettings &settings, Params &structure, const CapturedParameters &This, const CommandParameters &parms) |
Private Attributes | |
PostSetFunction | PostSetFn |
Generates EffectParameterMethods overrides from variadic template arguments.
For each effect parameter, the function... Reset resets it to a default Visit visits it with a SettingsVisitor object; there are overloads taking SettingsVisitor and ConstSettingsVisitor Get serializes it to a string Set deserializes it from a string and returns a success flag (if there is failure, parameters might not all be unchanged)
The constructor optionally takes an argument which is a function to be called at the end of Reset or Set, and returning a value for Set.
EffectType | subclass of Effect, expected to define a public static member function FetchParameters, taking EffectType & and EffectSettings &, and returning a pointer to something that holds the parameters |
Parameters | a pack of non-type template parameters, whose types are specializations of the class template EffectParameter |
TODO in C++20: could use simply auto ...Parameters
if they are constexpr
Definition at line 60 of file ShuttleAutomation.h.
using CapturedParameters< EffectType, Parameters >::Params = std::remove_pointer_t< decltype( EffectType::FetchParameters( std::declval<EffectType&>(), std::declval<EffectSettings &>()) ) > |
Definition at line 62 of file ShuttleAutomation.h.
using CapturedParameters< EffectType, Parameters >::PostSetFunction = std::function< bool(EffectType&, EffectSettings &, Params &, bool) > |
Definition at line 74 of file ShuttleAutomation.h.
|
virtualdefault |
|
inline |
Definition at line 79 of file ShuttleAutomation.h.
|
inlineexplicit |
Definition at line 90 of file ShuttleAutomation.h.
|
inlinestaticprivate |
Definition at line 199 of file ShuttleAutomation.h.
References CapturedParameters< EffectType, Parameters >::GetOne().
Referenced by CapturedParameters< EffectType, Parameters >::Get().
|
inlinestaticprivate |
Definition at line 152 of file ShuttleAutomation.h.
References CapturedParameters< EffectType, Parameters >::PostSetFn, CapturedParameters< EffectType, Parameters >::ResetOne(), and settings().
Referenced by CapturedParameters< EffectType, Parameters >::Reset().
|
inlinestaticprivate |
Definition at line 228 of file ShuttleAutomation.h.
References CapturedParameters< EffectType, Parameters >::PostSetFn, CapturedParameters< EffectType, Parameters >::SetOne(), and settings().
Referenced by CapturedParameters< EffectType, Parameters >::Set().
|
inlinestaticprivate |
Definition at line 181 of file ShuttleAutomation.h.
Referenced by CapturedParameters< EffectType, Parameters >::Visit().
|
inlineoverridevirtual |
Implements EffectParameterMethods.
Definition at line 119 of file ShuttleAutomation.h.
References CapturedParameters< EffectType, Parameters >::DoGet(), and settings().
|
inlinestaticprivate |
Definition at line 186 of file ShuttleAutomation.h.
References EffectParameter< Structure, Member, Type, Value >::key, and EffectParameter< Structure, Member, Type, Value >::mem.
Referenced by CapturedParameters< EffectType, Parameters >::DoGet().
|
inlinestaticprivate |
Definition at line 193 of file ShuttleAutomation.h.
References ComponentInterfaceSymbol::Internal(), EffectParameter< Structure, Member, Type, Value >::key, EffectParameter< Structure, Member, Type, Value >::mem, and EnumParameter< Structure, Member >::symbols.
|
inlineoverridevirtual |
Implements EffectParameterMethods.
Definition at line 94 of file ShuttleAutomation.h.
References CapturedParameters< EffectType, Parameters >::DoReset().
|
inlinestaticprivate |
Definition at line 147 of file ShuttleAutomation.h.
References EffectParameter< Structure, Member, Type, Value >::def, and EffectParameter< Structure, Member, Type, Value >::mem.
Referenced by CapturedParameters< EffectType, Parameters >::DoReset().
|
inlineoverridevirtual |
Implements EffectParameterMethods.
Definition at line 130 of file ShuttleAutomation.h.
References CapturedParameters< EffectType, Parameters >::DoSet(), and settings().
|
inlinestaticprivate |
Definition at line 204 of file ShuttleAutomation.h.
References EffectParameter< Structure, Member, Type, Value >::def, EffectParameter< Structure, Member, Type, Value >::key, EffectParameter< Structure, Member, Type, Value >::max, EffectParameter< Structure, Member, Type, Value >::mem, EffectParameter< Structure, Member, Type, Value >::min, and CommandParameters::ReadAndVerify().
Referenced by CapturedParameters< EffectType, Parameters >::DoSet().
|
inlinestaticprivate |
Definition at line 217 of file ShuttleAutomation.h.
References EffectParameter< Structure, Member, Type, Value >::def, EffectParameter< Structure, Member, Type, Value >::key, EffectParameter< Structure, Member, Type, Value >::mem, EnumParameter< Structure, Member >::nSymbols, CommandParameters::ReadAndVerify(), and EnumParameter< Structure, Member >::symbols.
|
inlineoverridevirtual |
Implements EffectParameterMethods.
Definition at line 107 of file ShuttleAutomation.h.
References CapturedParameters< EffectType, Parameters >::DoVisit(), and settings().
|
inlineoverridevirtual |
Implements EffectParameterMethods.
Definition at line 100 of file ShuttleAutomation.h.
References settings().
|
inlinestaticprivate |
Definition at line 163 of file ShuttleAutomation.h.
References EffectParameter< Structure, Member, Type, Value >::def, SettingsVisitorBase< Const >::Define(), EffectParameter< Structure, Member, Type, Value >::key, EffectParameter< Structure, Member, Type, Value >::max, EffectParameter< Structure, Member, Type, Value >::mem, EffectParameter< Structure, Member, Type, Value >::min, and EffectParameter< Structure, Member, Type, Value >::scale.
|
inlinestaticprivate |
Definition at line 174 of file ShuttleAutomation.h.
References EffectParameter< Structure, Member, Type, Value >::def, SettingsVisitorBase< Const >::DefineEnum(), EffectParameter< Structure, Member, Type, Value >::key, EffectParameter< Structure, Member, Type, Value >::mem, EnumParameter< Structure, Member >::nSymbols, and EnumParameter< Structure, Member >::symbols.
|
private |
Definition at line 140 of file ShuttleAutomation.h.
Referenced by CapturedParameters< EffectType, Parameters >::DoReset(), and CapturedParameters< EffectType, Parameters >::DoSet().