![]() |
Audacity 3.2.0
|
Presents a dialog box allowing the user to export multiple files either by exporting each track as a separate file, or by exporting each label as a separate file. More...
#include <ExportMultiple.h>
Public Types | |
using | ProgressResult = BasicUI::ProgressResult |
Public Member Functions | |
ExportMultipleDialog (AudacityProject *parent) | |
virtual | ~ExportMultipleDialog () |
int | ShowModal () |
![]() | |
wxDialogWrapper () | |
wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog")) | |
bool | Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog")) |
void | SetTitle (const TranslatableString &title) |
void | SetLabel (const TranslatableString &title) |
void | SetName (const TranslatableString &title) |
void | SetName () |
![]() | |
wxTabTraversalWrapper (Args &&... args) | |
wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete | |
wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete | |
wxTabTraversalWrapper & | operator= (const wxTabTraversalWrapper &)=delete |
wxTabTraversalWrapper & | operator= (wxTabTraversalWrapper &&)=delete |
Private Member Functions | |
void | CanExport () |
void | CountTracksAndLabels () |
bool | DirOk () |
ProgressResult | ExportMultipleByLabel (bool byName, const wxString &prefix, bool addNumber) |
Export multiple labeled regions of the project to separate files. More... | |
ProgressResult | ExportMultipleByTrack (bool byName, const wxString &prefix, bool addNumber) |
Export each track in the project to a separate file. More... | |
ProgressResult | DoExport (std::unique_ptr< BasicUI::ProgressDialog > &pDialog, unsigned channels, const wxFileName &name, bool selectedOnly, double t0, double t1, const Tags &tags) |
wxString | MakeFileName (const wxString &input) |
Takes an arbitrary text string and converts it to a form that can be used as a file name, if necessary prompting the user to edit the file name produced. More... | |
void | PopulateOrExchange (ShuttleGui &S) |
void | EnableControls () |
void | OnFormat (wxCommandEvent &event) |
void | OnOptions (wxCommandEvent &event) |
void | OnCreate (wxCommandEvent &event) |
void | OnChoose (wxCommandEvent &event) |
void | OnLabel (wxCommandEvent &event) |
void | OnFirst (wxCommandEvent &event) |
void | OnFirstFileName (wxCommandEvent &event) |
void | OnTrack (wxCommandEvent &event) |
void | OnByName (wxCommandEvent &event) |
void | OnByNumber (wxCommandEvent &event) |
void | OnPrefix (wxCommandEvent &event) |
void | OnCancel (wxCommandEvent &event) |
void | OnHelp (wxCommandEvent &event) |
void | OnExport (wxCommandEvent &event) |
Private Attributes | |
Exporter | mExporter |
std::vector< ExportPlugin * > | mPlugins |
AudacityProject * | mProject |
TrackList * | mTracks |
const LabelTrack * | mLabels |
int | mNumLabels |
int | mNumWaveTracks |
int | mFilterIndex |
int | mPluginIndex |
int | mSubFormatIndex |
bool | mInitialized |
FilePaths | mExported |
wxChoice * | mFormat |
wxButton * | mOptions |
wxTextCtrl * | mDir |
wxButton * | mCreate |
wxButton * | mChoose |
wxRadioButton * | mLabel |
wxStaticText * | mLabelLabel |
wxCheckBox * | mFirst |
wxStaticText * | mFirstFileLabel |
wxTextCtrl * | mFirstFileName |
wxRadioButton * | mTrack |
wxStaticText * | mTrackLabel |
wxRadioButton * | mByNumberAndName |
wxRadioButton * | mByName |
wxRadioButton * | mByNumber |
wxStaticText * | mPrefixLabel |
wxTextCtrl * | mPrefix |
wxCheckBox * | mOverwrite |
wxButton * | mCancel |
wxButton * | mExport |
wxSimplebook * | mBook |
SelectionState & | mSelectionState |
Presents a dialog box allowing the user to export multiple files either by exporting each track as a separate file, or by exporting each label as a separate file.
Definition at line 32 of file ExportMultiple.h.
Definition at line 35 of file ExportMultiple.h.
ExportMultipleDialog::ExportMultipleDialog | ( | AudacityProject * | parent | ) |
|
virtual |
Definition at line 162 of file ExportMultiple.cpp.
|
private |
|
private |
Definition at line 166 of file ExportMultiple.cpp.
References PackedArray::begin(), WaveTrack::GetMute(), PlayableTrack::GetNotSolo(), LabelTrack::GetNumLabels(), WaveTrack::GetSolo(), TrackList::Leaders(), mLabels, mNumLabels, mNumWaveTracks, mTracks, and size.
|
private |
Definition at line 677 of file ExportMultiple.cpp.
References AudacityMessageBox(), fn, mDir, and XO().
Referenced by OnExport().
|
private |
Export one file of an export multiple set
Called once for each file in the list to do a (non-interactive) export
channels | Number of channels to export |
name | The file name (and path) to export to |
selectedOnly | Should we export the selected tracks only? |
t0 | Start time for export |
t1 | End time for export |
tags | Metadata to include in the file (if possible). |
Definition at line 1024 of file ExportMultiple.cpp.
References RefreshCode::Cancelled, mOverwrite, name, BasicUI::Success, and wxT().
Referenced by ExportMultipleByLabel(), and ExportMultipleByTrack().
|
private |
Definition at line 449 of file ExportMultiple.cpp.
References mByName, mByNumber, mByNumberAndName, mExport, mFirst, mFirstFileLabel, mFirstFileName, mInitialized, mLabel, mPrefix, and mPrefixLabel.
Referenced by OnByName(), OnByNumber(), OnFirst(), OnFirstFileName(), OnFormat(), OnLabel(), OnPrefix(), OnTrack(), and ShowModal().
|
private |
Export multiple labeled regions of the project to separate files.
Uses a single label track in the project to split up the audio into a series of sections, each of which is exported to a separate file.
byName | Controls whether files are named after the text in the labels that define them (true), or just numbered (false). |
prefix | The string used to prefix the file number if files are being numbered rather than named |
Definition at line 718 of file ExportMultiple.cpp.
References _, RefreshCode::Cancelled, DoExport(), TranslatableString::empty(), ProjectWindow::Find(), Tags::Get(), ProjectSettings::Get(), TrackList::GetEndTime(), LabelTrack::GetLabel(), GetNumExportChannels(), gPrefs, SelectedRegion::isPoint(), MakeFileName(), FileNames::MakeNameUnique(), mDir, mFirst, mFirstFileName, mLabels, mNumLabels, mPluginIndex, mPlugins, mProject, mSubFormatIndex, mTracks, name, LabelStruct::selectedRegion, settings(), TagsEditorDialog::ShowEditDialog(), BasicUI::Success, SelectedRegion::t0(), SelectedRegion::t1(), TAG_TITLE, TAG_TRACK, LabelStruct::title, title, wxT(), and XO().
Referenced by OnExport().
|
private |
Export each track in the project to a separate file.
byName | Controls whether files are named after the track names (true), or just numbered (false). |
prefix | The string used to prefix the file number if files are being numbered rather than named |
Definition at line 872 of file ExportMultiple.cpp.
References _, RefreshCode::Cancelled, TrackList::Channels(), DoExport(), TrackList::empty(), ProjectWindow::Find(), Tags::Get(), ProjectSettings::Get(), Track::GetEndTime(), WaveTrack::GetMute(), PlayableTrack::GetNotSolo(), WaveTrack::GetSolo(), Track::GetStartTime(), gPrefs, AudioGraph::IsMono(), TrackList::Leaders(), MakeFileName(), FileNames::MakeNameUnique(), mDir, mNumWaveTracks, mPluginIndex, mPlugins, mProject, mSelectionState, mSubFormatIndex, mTracks, name, TrackList::SelectedLeaders(), settings(), TagsEditorDialog::ShowEditDialog(), BasicUI::Success, TAG_TITLE, TAG_TRACK, title, wxT(), and XO().
Referenced by OnExport().
|
private |
Takes an arbitrary text string and converts it to a form that can be used as a file name, if necessary prompting the user to edit the file name produced.
Definition at line 1110 of file ExportMultiple.cpp.
References Internat::GetExcludedCharacters(), Internat::SanitiseFilename(), wxT(), and XO().
Referenced by ExportMultipleByLabel(), and ExportMultipleByTrack().
|
private |
Definition at line 564 of file ExportMultiple.cpp.
References EnableControls().
|
private |
Definition at line 569 of file ExportMultiple.cpp.
References EnableControls().
|
private |
Definition at line 579 of file ExportMultiple.cpp.
|
private |
Definition at line 534 of file ExportMultiple.cpp.
|
private |
Definition at line 514 of file ExportMultiple.cpp.
References AudacityMessageBox(), fn, mDir, and XO().
|
private |
Definition at line 589 of file ExportMultiple.cpp.
References RefreshCode::Cancelled, DirOk(), eIsSavingToPrefs, ExportMultipleByLabel(), ExportMultipleByTrack(), FileConfig::Flush(), gPrefs, GuardedCall(), mBook, mByName, mByNumberAndName, mDir, mExported, mFilterIndex, mFormat, mLabel, mPluginIndex, mPlugins, mPrefix, mSubFormatIndex, PopulateOrExchange(), S, HelpSystem::ShowInfoDialog(), BasicUI::Success, FileNames::UpdateDefaultPath(), and XO().
|
private |
Definition at line 549 of file ExportMultiple.cpp.
References EnableControls().
|
private |
Definition at line 554 of file ExportMultiple.cpp.
References EnableControls().
|
private |
Definition at line 483 of file ExportMultiple.cpp.
References EnableControls(), mBook, and mFormat.
|
private |
Definition at line 584 of file ExportMultiple.cpp.
References HelpSystem::ShowHelp().
|
private |
Definition at line 544 of file ExportMultiple.cpp.
References EnableControls().
|
private |
Definition at line 490 of file ExportMultiple.cpp.
References mFormat, mPluginIndex, mPlugins, and mSubFormatIndex.
|
private |
Definition at line 574 of file ExportMultiple.cpp.
References EnableControls().
|
private |
Definition at line 559 of file ExportMultiple.cpp.
References EnableControls().
|
private |
Definition at line 230 of file ExportMultiple.cpp.
References _, ByColumns, ByNameAndNumberID, ByNameID, ByNumberID, ChooseID, CreateID, DirID, eCancelButton, eHelpButton, eIsCreating, eOkButton, FileNames::FindDefaultPath(), FirstFileNameID, FirstID, format, FormatID, AudacityProject::GetProjectName(), gPrefs, LabelID, mBook, mByName, mByNumber, mByNumberAndName, mDir, mExport, mFilterIndex, mFirst, mFirstFileLabel, mFirstFileName, mFormat, mLabel, mOverwrite, mPluginIndex, mPlugins, mPrefix, mPrefixLabel, mProject, mSubFormatIndex, mTrack, name, OptionsID, OverwriteID, PrefixID, S, TrackID, Verbatim(), wxT(), XO(), and XXO().
Referenced by OnExport().
int ExportMultipleDialog::ShowModal | ( | ) |
Definition at line 180 of file ExportMultiple.cpp.
References AudacityMessageBox(), EnableControls(), mDir, mLabel, mNumLabels, mNumWaveTracks, mTrack, and XO().
Referenced by anonymous_namespace{FileMenus.cpp}::OnExportMultiple().
|
private |
Definition at line 162 of file ExportMultiple.h.
Referenced by OnExport(), OnFormat(), and PopulateOrExchange().
|
private |
button to choose naming exported file from label text
Definition at line 151 of file ExportMultiple.h.
Referenced by EnableControls(), OnExport(), and PopulateOrExchange().
|
private |
button to choose numbering exported files
Definition at line 152 of file ExportMultiple.h.
Referenced by EnableControls(), and PopulateOrExchange().
|
private |
button to choose number AND name for exported files
Definition at line 150 of file ExportMultiple.h.
Referenced by EnableControls(), OnExport(), and PopulateOrExchange().
|
private |
Definition at line 159 of file ExportMultiple.h.
|
private |
Definition at line 137 of file ExportMultiple.h.
|
private |
Definition at line 136 of file ExportMultiple.h.
|
private |
The directory all the exported files will end up in
Definition at line 134 of file ExportMultiple.h.
Referenced by DirOk(), ExportMultipleByLabel(), ExportMultipleByTrack(), OnChoose(), OnCreate(), OnExport(), PopulateOrExchange(), and ShowModal().
|
private |
Definition at line 160 of file ExportMultiple.h.
Referenced by EnableControls(), and PopulateOrExchange().
|
private |
Definition at line 128 of file ExportMultiple.h.
Referenced by OnExport().
|
private |
Definition at line 107 of file ExportMultiple.h.
|
private |
The index in the drop-down list of export formats (mFormat) of the selected export format. This list includes all possible plug-in - subformat combinations.
Definition at line 117 of file ExportMultiple.h.
Referenced by OnExport(), and PopulateOrExchange().
|
private |
Check box to export audio before first label
Definition at line 142 of file ExportMultiple.h.
Referenced by EnableControls(), ExportMultipleByLabel(), and PopulateOrExchange().
|
private |
description text for mFirstFileName
Definition at line 143 of file ExportMultiple.h.
Referenced by EnableControls(), and PopulateOrExchange().
|
private |
Name to use for exporting audio before the first label in the file
Definition at line 144 of file ExportMultiple.h.
Referenced by EnableControls(), ExportMultipleByLabel(), and PopulateOrExchange().
|
private |
Drop-down list of export formats (combinations of plug-in and subformat)
Definition at line 130 of file ExportMultiple.h.
Referenced by OnExport(), OnFormat(), OnOptions(), and PopulateOrExchange().
|
private |
Definition at line 125 of file ExportMultiple.h.
Referenced by EnableControls().
|
private |
button to choose export based on Labels
Definition at line 139 of file ExportMultiple.h.
Referenced by EnableControls(), OnExport(), PopulateOrExchange(), and ShowModal().
|
private |
description text for mLabel
Definition at line 140 of file ExportMultiple.h.
|
private |
Definition at line 113 of file ExportMultiple.h.
Referenced by CountTracksAndLabels(), and ExportMultipleByLabel().
|
private |
Definition at line 114 of file ExportMultiple.h.
Referenced by CountTracksAndLabels(), ExportMultipleByLabel(), and ShowModal().
|
private |
Definition at line 115 of file ExportMultiple.h.
Referenced by CountTracksAndLabels(), ExportMultipleByTrack(), and ShowModal().
|
private |
Definition at line 132 of file ExportMultiple.h.
|
private |
Definition at line 157 of file ExportMultiple.h.
Referenced by DoExport(), and PopulateOrExchange().
|
private |
The index in mPlugins of the selected export plug-in
Definition at line 121 of file ExportMultiple.h.
Referenced by ExportMultipleByLabel(), ExportMultipleByTrack(), OnExport(), OnOptions(), and PopulateOrExchange().
|
private |
Array of references to available exporter plug-ins
Definition at line 108 of file ExportMultiple.h.
Referenced by ExportMultipleByLabel(), ExportMultipleByTrack(), OnExport(), OnOptions(), and PopulateOrExchange().
|
private |
Definition at line 155 of file ExportMultiple.h.
Referenced by EnableControls(), OnExport(), and PopulateOrExchange().
|
private |
Definition at line 154 of file ExportMultiple.h.
Referenced by EnableControls(), and PopulateOrExchange().
|
private |
Definition at line 110 of file ExportMultiple.h.
Referenced by ExportMultipleByLabel(), ExportMultipleByTrack(), and PopulateOrExchange().
|
private |
Definition at line 164 of file ExportMultiple.h.
Referenced by ExportMultipleByTrack().
|
private |
The selected subformat number within the selected export plug-in set by mPluginIndex
Definition at line 123 of file ExportMultiple.h.
Referenced by ExportMultipleByLabel(), ExportMultipleByTrack(), OnExport(), OnOptions(), and PopulateOrExchange().
|
private |
button to choose export based on tracks
Definition at line 147 of file ExportMultiple.h.
Referenced by PopulateOrExchange(), and ShowModal().
|
private |
Definition at line 148 of file ExportMultiple.h.
|
private |
The list of tracks in the project that is being exported
Definition at line 111 of file ExportMultiple.h.
Referenced by CountTracksAndLabels(), ExportMultipleByLabel(), and ExportMultipleByTrack().