Audacity 3.2.0
PlainExportOptionsEditor.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 PlainExportOptionsEditor.h
6
7 Vitaly Sverchinsky
8
9**********************************************************************/
10
11#pragma once
12
13#include "ExportOptionsEditor.h"
14#include <wx/string.h>
15#include <wx/arrstr.h>
16#include <vector>
17#include <unordered_map>
18
19class IMPORT_EXPORT_API PlainExportOptionsEditor final : public ExportOptionsEditor
20{
21 std::vector<ExportOption> mOptions;
22 wxArrayString mConfigKeys;
23 std::unordered_map<int, ExportValue> mValues;
25 Listener* mOptionsListener{};
26
27public:
29 {
31 wxString configKey;
32 };
33
34 explicit PlainExportOptionsEditor(std::initializer_list<OptionDesc> options,
35 Listener* listener = nullptr);
36 explicit PlainExportOptionsEditor(std::initializer_list<OptionDesc> options,
37 SampleRateList samplerates,
38 Listener* listener = nullptr);
39
40 int GetOptionsCount() const override;
41 bool GetOption(int index, ExportOption& option) const override;
42
43 bool GetValue(int id, ExportValue& value) const override;
44 bool SetValue(int id, const ExportValue& value) override;
45
46 void Load(const audacity::BasicSettings& config) override;
47 void Store(audacity::BasicSettings&) const override;
48
49 SampleRateList GetSampleRateList() const override;
50
51 void SetSampleRateList(SampleRateList rates);
52
53private:
54 void InitOptions(std::initializer_list<OptionDesc> options);
55};
std::variant< bool, int, double, std::string > ExportValue
A type of option values (parameters) used by exporting plugins.
Definition: ExportTypes.h:38
Listener object that is used to report on option changes.
Editor objects are used to retrieve a set of export options, and configure exporting parameters accor...
virtual void Store(audacity::BasicSettings &settings) const =0
virtual bool GetValue(ExportOptionID id, ExportValue &value) const =0
std::vector< int > SampleRateList
virtual bool SetValue(ExportOptionID id, const ExportValue &value)=0
virtual bool GetOption(int index, ExportOption &option) const =0
virtual int GetOptionsCount() const =0
virtual void Load(const audacity::BasicSettings &config)=0
virtual SampleRateList GetSampleRateList() const =0
std::vector< ExportOption > mOptions
std::unordered_map< int, ExportValue > mValues
Base class for objects that provide facility to store data persistently, and access it with string ke...
Definition: BasicSettings.h:31
A type that provides a description of an exporting option. Isn't allowed to change except non-type re...
Definition: ExportTypes.h:43