11#ifndef __AUDACITY_SHUTTLE__
12#define __AUDACITY_SHUTTLE__
27 Member Structure::*
const mem{};
28 const wxChar *
const key{};
37template<
typename Structure,
typename Member,
38 typename Type,
typename... Args>
40 const wxChar *
key,
const Type &def, Args...)
43template<
typename Structure,
typename Member,
44 typename Char,
size_t N,
typename... Args>
46 const wxChar *
key,
const Char (&def)[N], Args...)
49template<
typename Structure,
typename Member>
66template<
typename Structure,
typename Member,
typename... Args>
81 virtual bool TransferBool(
const wxString & Name,
bool & bValue,
const bool & bDefault );
82 virtual bool TransferFloat(
const wxString & Name,
float & fValue,
const float &fDefault );
83 virtual bool TransferDouble(
const wxString & Name,
double & dValue,
const double &dDefault );
84 virtual bool TransferInt(
const wxString & Name,
int & iValue,
const int &iDefault );
85 virtual bool TransferInt(
const wxString & Name, wxLongLong_t & iValue,
const wxLongLong_t &iDefault );
86 virtual bool TransferLongLong(
const wxString & Name, wxLongLong_t & iValue,
const wxLongLong_t &iDefault );
87 virtual bool TransferString(
const wxString & Name, wxString & strValue,
const wxString &strDefault );
88 virtual bool TransferEnum(
const wxString & Name,
int & iValue,
89 const int nChoices,
const wxString * pFirstStr);
118 template<
typename T>
using Ref = std::conditional_t<Const, const T&, T&>;
120 template<
typename T>
using Arg = std::conditional_t<Const, T, T&>;
134 bool vmin =
false,
bool vmax =
false,
bool vscl =
false );
136 int vmin = 0,
int vmax = 100000,
int vscl = 1 );
138 int vmin = 0,
int vmax = 100000,
int vscl = 1 );
140 float vmin,
float vmax,
float vscl = 1.0f );
142 float vmin,
float vmax,
float vscl = 1.0f );
144 double vmin,
double vmax,
double vscl = 1.0f );
147 wxString vmin = {}, wxString vmax = {},
148 wxString vscl = {} );
149 virtual void DefineEnum( Arg<int> var,
const wxChar *
key,
int vdefault,
static const AudacityProject::AttachedObjects::RegisteredFactory key
EnumParameter(Member Structure::*const mem, Args...) -> EnumParameter< Structure, Member >
EffectParameter(Member Structure::*const mem, const wxChar *key, const Type &def, Args...) -> EffectParameter< Structure, Member, Type >
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the SettingsVis...
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Visitor of effect or command parameters. This is a base class with lots of virtual functions that do ...
virtual void Define(Arg< bool > var, const wxChar *key, bool vdefault, bool vmin=false, bool vmax=false, bool vscl=false)
virtual SettingsVisitorBase & OptionalY(Ref< bool > var)
std::conditional_t< Const, T, T & > Arg
CommandParameters * mpEap
std::conditional_t< Const, const bool, bool > * pOptionalFlag
virtual ~SettingsVisitorBase()
virtual SettingsVisitorBase & Optional(Ref< bool > var)
virtual void DefineEnum(Arg< int > var, const wxChar *key, int vdefault, const EnumValueSymbol strings[], size_t nStrings)
std::conditional_t< Const, const T &, T & > Ref
virtual SettingsVisitorBase & OptionalN(Ref< bool > var)
Derived from Shuttle, this class exchanges string parameters with a binary representation.
bool ExchangeWithMaster(const wxString &Name) override
Moves data from one place to another, converting it as required.
virtual bool TransferBool(const wxString &Name, bool &bValue, const bool &bDefault)
virtual bool TransferString(const wxString &Name, wxString &strValue, const wxString &strDefault)
virtual bool TransferDouble(const wxString &Name, double &dValue, const double &dDefault)
virtual bool TransferWrappedType(const wxString &Name, WrappedType &W)
virtual bool ExchangeWithMaster(const wxString &Name)
virtual bool TransferFloat(const wxString &Name, float &fValue, const float &fDefault)
virtual bool TransferLongLong(const wxString &Name, wxLongLong_t &iValue, const wxLongLong_t &iDefault)
virtual bool TransferInt(const wxString &Name, int &iValue, const int &iDefault)
virtual bool TransferEnum(const wxString &Name, int &iValue, const int nChoices, const wxString *pFirstStr)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
const wxChar *const key
Identifier in configuration file.
const Type scale
Scaling factor, for slider control.
Member Structure::*const mem
Member holding the parameter.
const Type def
Default value.
const Type min
Minimum value.
const Type max
Maximum value.
constexpr EnumParameter(Member Structure::*const mem, const wxChar *key, int def, int min, int max, int scale, const EnumValueSymbol *symbols_, size_t nSymbols_)
const EnumValueSymbol *const symbols