18 : mOptionsListener(listener)
26 : mRates(
std::move(sampleRates))
27 , mOptionsListener(listener)
34 return static_cast<int>(
mOptions.size());
39 if(index >= 0 && index <
static_cast<int>(
mOptions.size()))
49 const auto it =
mValues.find(
id);
60 const auto it =
mValues.find(
id);
61 if(it !=
mValues.end() && it->second.index() == value.index())
74 auto it =
mValues.find(option.id);
76 if(
auto val = std::get_if<bool>(&it->second))
78 else if(
auto val = std::get_if<int>(&it->second))
80 else if(
auto val = std::get_if<double>(&it->second))
82 else if(
auto val = std::get_if<std::string>(&it->second))
86 *val = wxstr.ToStdString();
97 auto it =
mValues.find(option.id);
99 if(
auto val = std::get_if<bool>(&it->second))
101 else if(
auto val = std::get_if<int>(&it->second))
103 else if(
auto val = std::get_if<double>(&it->second))
105 else if(
auto val = std::get_if<std::string>(&it->second))
119 mRates = std::move(rates);
129 mValues.reserve(options.size());
130 for(
auto&
desc : options)
std::variant< bool, int, double, std::string > ExportValue
A type of option values (parameters) used by exporting plugins.
Listener object that is used to report on option changes.
virtual void OnSampleRateListChange()=0
std::vector< int > SampleRateList
std::vector< ExportOption > mOptions
Listener * mOptionsListener
std::unordered_map< int, ExportValue > mValues
void InitOptions(std::initializer_list< OptionDesc > options)
PlainExportOptionsEditor(std::initializer_list< OptionDesc > options, Listener *listener=nullptr)
void Load(const audacity::BasicSettings &config) override
void SetSampleRateList(SampleRateList rates)
bool GetValue(int id, ExportValue &value) const override
void Store(audacity::BasicSettings &) const override
SampleRateList GetSampleRateList() const override
wxArrayString mConfigKeys
bool GetOption(int index, ExportOption &option) const override
int GetOptionsCount() const override
bool SetValue(int id, const ExportValue &value) override
Base class for objects that provide facility to store data persistently, and access it with string ke...
virtual bool Write(const wxString &key, bool value)=0
virtual bool Read(const wxString &key, bool *value) const =0
const TranslatableString desc
A type that provides a description of an exporting option. Isn't allowed to change except non-type re...