Audacity 3.2.0
ExportMultiple.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ExportMultiple.h
6
7 Dominic Mazzoni
8
9**********************************************************************/
10
11#ifndef __AUDACITY_EXPORT_MULTIPLE__
12#define __AUDACITY_EXPORT_MULTIPLE__
13
14#include "Export.h"
15#include "wxFileNameWrapper.h" // member variable
16
17class wxButton;
18class wxCheckBox;
19class wxChoice;
20class wxListEvent;
21class wxRadioButton;
22class wxSimplebook;
23class wxStaticText;
24class wxTextCtrl;
25
26class AudacityProject;
27class LabelTrack;
28class SelectionState;
29class ShuttleGui;
30class Track;
31
32class AUDACITY_DLL_API ExportMultipleDialog final : public wxDialogWrapper
33{
34public:
36
38 virtual ~ExportMultipleDialog();
39
40 int ShowModal();
41
42private:
43
44 // Export
45 void CanExport();
46 void CountTracksAndLabels();
47 bool DirOk();
56 ProgressResult ExportMultipleByLabel(bool byName, const wxString &prefix, bool addNumber);
57
64 ProgressResult ExportMultipleByTrack(bool byName, const wxString &prefix, bool addNumber);
65
76 ProgressResult DoExport(std::unique_ptr<ProgressDialog> &pDialog,
77 unsigned channels,
78 const wxFileName &name,
79 bool selectedOnly,
80 double t0,
81 double t1,
82 const Tags &tags);
86 wxString MakeFileName(const wxString &input);
87 // Dialog
88 void PopulateOrExchange(ShuttleGui& S);
89 void EnableControls();
90
91 void OnFormat(wxCommandEvent& event);
92 void OnOptions(wxCommandEvent& event);
93 void OnCreate(wxCommandEvent& event);
94 void OnChoose(wxCommandEvent& event);
95 void OnLabel(wxCommandEvent& event);
96 void OnFirst(wxCommandEvent& event);
97 void OnFirstFileName(wxCommandEvent& event);
98 void OnTrack(wxCommandEvent& event);
99 void OnByName(wxCommandEvent& event);
100 void OnByNumber(wxCommandEvent& event);
101 void OnPrefix(wxCommandEvent& event);
102 void OnCancel(wxCommandEvent& event);
103 void OnHelp(wxCommandEvent& event);
104 void OnExport(wxCommandEvent& event);
105
106private:
108 std::vector<ExportPlugin*> mPlugins;
116
126
127 // List of file actually exported
129
130 wxChoice *mFormat;
132 wxButton *mOptions;
133
134 wxTextCtrl *mDir;
136 wxButton *mCreate;
137 wxButton *mChoose;
138
139 wxRadioButton *mLabel;
140 wxStaticText *mLabelLabel;
142 wxCheckBox *mFirst;
143 wxStaticText *mFirstFileLabel;
144 wxTextCtrl *mFirstFileName;
147 wxRadioButton *mTrack;
148 wxStaticText *mTrackLabel;
149
150 wxRadioButton *mByNumberAndName;
151 wxRadioButton *mByName;
152 wxRadioButton *mByNumber;
154 wxStaticText *mPrefixLabel;
155 wxTextCtrl *mPrefix;
156
157 wxCheckBox *mOverwrite;
158
159 wxButton *mCancel;
160 wxButton *mExport;
161
162 wxSimplebook *mBook;
163
165
166 DECLARE_EVENT_TABLE()
167
168};
169
170class SuccessDialog final : public wxDialogWrapper
171{
172public:
173 SuccessDialog(wxWindow *parent, wxWindowID id, const TranslatableString &title) :
174 wxDialogWrapper(parent, id, title, wxDefaultPosition,
175 wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {};
176 void OnKeyDown(wxListEvent& event); // dismisses dialog when <enter> is pressed with list control having focus
177 void OnItemActivated(wxListEvent& event); // dismisses dialog when <enter> is pressed with list item having focus
178private:
179 DECLARE_EVENT_TABLE()
180};
181
182class MouseEvtHandler final : public wxEvtHandler
183{
184public:
185 void OnMouse(wxMouseEvent& event);
186private:
187 DECLARE_EVENT_TABLE()
188};
189
190
191#endif
const TranslatableString name
Definition: Distortion.cpp:82
static const auto title
#define S(N)
Definition: ToChars.cpp:64
int id
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
Presents a dialog box allowing the user to export multiple files either by exporting each track as a ...
wxSimplebook * mBook
wxStaticText * mLabelLabel
std::vector< ExportPlugin * > mPlugins
wxTextCtrl * mFirstFileName
wxRadioButton * mByName
wxCheckBox * mOverwrite
const LabelTrack * mLabels
wxRadioButton * mTrack
wxRadioButton * mLabel
wxStaticText * mFirstFileLabel
SelectionState & mSelectionState
wxStaticText * mTrackLabel
wxRadioButton * mByNumberAndName
wxStaticText * mPrefixLabel
ExportMultipleDialog(AudacityProject *parent)
wxRadioButton * mByNumber
AudacityProject * mProject
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:89
void OnMouse(wxMouseEvent &event)
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:628
void OnKeyDown(wxListEvent &event)
void OnItemActivated(wxListEvent &event)
SuccessDialog(wxWindow *parent, wxWindowID id, const TranslatableString &title)
ID3 Tags (for MP3)
Definition: Tags.h:73
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:225
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:1330
Holds a msgid for the translation catalog; may also bind format arguments.
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
ProgressResult
Definition: BasicUI.h:145
void DoExport(AudacityProject &project, const FileExtension &format)
Definition: FileMenus.cpp:43