Audacity 3.2.0
ExportOptionsHandler.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ExportOptionsHandler.h
6
7 Vitaly Sverchinsky
8
9**********************************************************************/
10
11#pragma once
12
13#include <memory>
14#include <unordered_map>
15#include <wx/event.h>
16#include "ExportOptionsEditor.h"
17#include "ExportPlugin.h"
18#include "Observer.h"
19
20class ShuttleGui;
21
22class wxWindowUpdateLocker;
23class wxStaticText;
24class wxControl;
25
26// For a file suffix change from the options.
27wxDECLARE_EXPORTED_EVENT(AUDACITY_DLL_API,
28 AUDACITY_FILE_SUFFIX_EVENT, wxCommandEvent);
29
31{
32 enum {
36};
37
40 , public Observer::Publisher<ExportOptionsHandlerEvent>
41{
42public:
43
45
47
50 void SetParameters(const ExportProcessor::Parameters& parameters);
52
53 void OnExportOptionChangeBegin() override;
54 void OnExportOptionChangeEnd() override;
55 void OnExportOptionChange(const ExportOption& option) override;
56 void OnFormatInfoChange() override;
57 void OnSampleRateListChange() override;
58
59private:
60
63
65
66 wxWindow* mParent { nullptr };
67 std::unique_ptr<wxWindowUpdateLocker> mUpdateLocker;
68 std::unique_ptr<ExportOptionsEditor> mEditor;
69 std::vector<std::tuple<wxStaticText*, wxControl*>> mRows;
70 std::unordered_map<int, int> mIDRowIndexMap;
71};
wxDECLARE_EXPORTED_EVENT(AUDACITY_DLL_API, AUDACITY_FILE_SUFFIX_EVENT, wxCommandEvent)
#define S(N)
Definition: ToChars.cpp:64
Listener object that is used to report on option changes.
std::vector< int > SampleRateList
ExportOptionsHandler(ShuttleGui &S, const ExportPlugin &plugin, int format)
void PopulateOptions(ShuttleGui &S)
void OnExportOptionChange(const ExportOption &option) override
Called when option change.
std::unordered_map< int, int > mIDRowIndexMap
void PopulateEmpty(ShuttleGui &S)
void OnExportOptionChangeBegin() override
Called before OnExportOptionChange
ExportOptionsEditor::SampleRateList GetSampleRateList() const
void OnSampleRateListChange() override
std::vector< std::tuple< wxStaticText *, wxControl * > > mRows
void OnExportOptionChangeEnd() override
Called after OnExportOptionChange
void OnFormatInfoChange() override
Called when format extension change (usually in response parameter change)
void SetParameters(const ExportProcessor::Parameters &parameters)
std::unique_ptr< wxWindowUpdateLocker > mUpdateLocker
std::unique_ptr< ExportOptionsEditor > mEditor
ExportProcessor::Parameters GetParameters() const
std::vector< std::tuple< ExportOptionID, ExportValue > > Parameters
Definition: ExportPlugin.h:93
An object that sends messages to an open-ended list of subscribed callbacks.
Definition: Observer.h:108
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
A type that provides a description of an exporting option. Isn't allowed to change except non-type re...
Definition: ExportTypes.h:43
enum ExportOptionsHandlerEvent::@34 type