Audacity 3.2.0
TimerRecordExportDialog.cpp
Go to the documentation of this file.
2
3#include <wx/button.h>
4
5#include "ShuttleGui.h"
7#include "Export.h"
8#include "TagsEditor.h"
9
15
17 wxWindow* parent,
18 wxWindowID winid)
19 : wxDialogWrapper(parent, winid, XO("Export Audio"))
20 , mProject(project)
21{
22 SetMinSize({450, -1});
24 PopulateOrExchange(S);
25}
26
27void TimerRecordExportDialog::Bind(wxFileName& filename,
28 wxString& format,
29 int& sampleRate,
30 int& channels,
32{
33 mFileName = &filename;
34 mFormat = &format;
36 mChannels = &channels;
37 mParameters = &parameters;
38 mExportFilePanel->Init(filename, sampleRate, format, channels, parameters);
39}
40
42{
43 S.SetBorder(5);
44 S.StartVerticalLay();
45 {
46 if(S.GetMode() == eIsCreating)
47 {
49 S.AddWindow(mExportFilePanel, wxEXPAND);
50 }
51
52 S.StartHorizontalLay(wxEXPAND);
53 {
54 mEditMetadata = S.Id(EditMetadataID).AddButton(XO("Edit &Metadata..."), wxLEFT | wxBOTTOM);
55 S.AddSpace(1, 1, wxEXPAND);
56 S.Id(wxID_CANCEL).AddButton(XO("&Cancel"), wxBOTTOM);
57 S.Id(wxID_OK).AddButton(XO("O&K"), wxRIGHT | wxBOTTOM, true);
58 }
59 S.EndHorizontalLay();
60 }
61 S.EndVerticalLay();
62}
63
64void TimerRecordExportDialog::OnOK(wxCommandEvent& event)
65{
66 if(const auto parameters = mExportFilePanel->GetParameters())
67 *mParameters = std::move(*parameters);
68 else
69 return;
70
75
76 event.Skip();
77}
78
80{
82 XO("Edit Metadata Tags"),
83 XO("Exported Tags"));
84}
85
87{
88 Fit();
89 Layout();
90
91 auto enableMeta = false;
92 if(auto plugin = mExportFilePanel->GetPlugin())
93 enableMeta = plugin->GetFormatInfo(mExportFilePanel->GetFormat()).canMetaData;
94 mEditMetadata->Enable(enableMeta);
95}
END_EVENT_TABLE()
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
XO("Cut/Copy/Paste")
EVT_COMMAND(wxID_ANY, EVT_FREQUENCYTEXTCTRL_UPDATED, LabelDialog::OnFreqUpdate) LabelDialog
Definition: LabelDialog.cpp:89
#define safenew
Definition: MemoryX.h:9
@ eIsCreating
Definition: ShuttleGui.h:37
const auto project
#define S(N)
Definition: ToChars.cpp:64
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
const ExportPlugin * GetPlugin() const
int GetSampleRate() const
wxString GetPath() const
wxString GetFullName()
int GetFormat() const
int GetChannels() const
std::optional< ExportProcessor::Parameters > GetParameters() const
void Init(const wxFileName &filename, int sampleRate, const wxString &format=wxEmptyString, int channels=0, const ExportProcessor::Parameters &parameters={}, const MixerOptions::Downmix *mixerSpec=nullptr)
Initializes panel with export settings provided as arguments. Call is required.
Main class to control the export function.
virtual FormatInfo GetFormatInfo(int index) const =0
Returns FormatInfo structure for given index if it's valid, or a default one. FormatInfo::format isn'...
std::vector< std::tuple< ExportOptionID, ExportValue > > Parameters
Definition: ExportPlugin.h:93
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
static AUDACITY_DLL_API bool EditProjectMetadata(AudacityProject &project, const TranslatableString &title, const TranslatableString &shortUndoDescription)
void Bind(wxFileName &filename, wxString &format, int &sampleRate, int &channels, ExportProcessor::Parameters &paramters)
ExportFilePanel * mExportFilePanel
void OnFormatChanged(wxCommandEvent &)
void OnEditMetadata(wxCommandEvent &)
void PopulateOrExchange(ShuttleGui &S)
ExportProcessor::Parameters * mParameters
wxString format
Definition: ExportPlugin.h:35