Audacity 3.2.0
Classes | Namespaces | Enumerations | Functions
ExportMultiple.cpp File Reference
#include "ExportMultiple.h"
#include <wx/defs.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/choice.h>
#include <wx/dialog.h>
#include <wx/dirdlg.h>
#include <wx/event.h>
#include <wx/listbase.h>
#include <wx/filefn.h>
#include <wx/filename.h>
#include <wx/intl.h>
#include <wx/log.h>
#include <wx/radiobut.h>
#include <wx/simplebook.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/textdlg.h>
#include "FileNames.h"
#include "LabelTrack.h"
#include "Project.h"
#include "ProjectSettings.h"
#include "ProjectWindow.h"
#include "ProjectWindows.h"
#include "Prefs.h"
#include "../SelectionState.h"
#include "../ShuttleGui.h"
#include "../TagsEditor.h"
#include "../WaveTrack.h"
#include "../widgets/HelpSystem.h"
#include "../widgets/AudacityMessageBox.h"
#include "../widgets/AudacityTextEntryDialog.h"
#include "../widgets/ProgressDialog.h"
Include dependency graph for ExportMultiple.cpp:

Go to the source code of this file.

Classes

class  anonymous_namespace{ExportMultiple.cpp}::ExportKit
 A private class used to store the information needed to do an export. More...
 

Namespaces

namespace  anonymous_namespace{ExportMultiple.cpp}
 

Enumerations

enum  {
  FormatID = 10001 , OptionsID , DirID , CreateID ,
  ChooseID , LabelID , FirstID , FirstFileNameID ,
  TrackID , ByNameAndNumberID , ByNameID , ByNumberID ,
  PrefixID , OverwriteID
}
 

Functions

 EVT_LIST_ITEM_ACTIVATED (wxID_ANY, SuccessDialog::OnItemActivated) ExportMultipleDialog
 
static unsigned GetNumExportChannels (const TrackList &tracks)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FormatID 
OptionsID 
DirID 
CreateID 
ChooseID 
LabelID 
FirstID 
FirstFileNameID 
TrackID 
ByNameAndNumberID 
ByNameID 
ByNumberID 
PrefixID 
OverwriteID 

Definition at line 82 of file ExportMultiple.cpp.

82 {
83 FormatID = 10001,
85 DirID,
88 LabelID,
89 FirstID,
91 TrackID,
97};
@ LabelID
@ CreateID
@ TrackID
@ PrefixID
@ ByNumberID
@ ChooseID
@ OverwriteID
@ DirID
@ FormatID
@ ByNameAndNumberID
@ OptionsID
@ FirstFileNameID
@ ByNameID
@ FirstID

Function Documentation

◆ EVT_LIST_ITEM_ACTIVATED()

EVT_LIST_ITEM_ACTIVATED ( wxID_ANY  ,
SuccessDialog::OnItemActivated   
)

Definition at line 123 of file ExportMultiple.cpp.

131: wxDialogWrapper( &GetProjectFrame( *project ),
132 wxID_ANY, XO("Export Multiple") )
133, mExporter{ *project }
134, mSelectionState{ SelectionState::Get( *project ) }
135{
136 SetName();
137
138 mProject = project;
139 mTracks = &TrackList::Get( *project );
140 // Construct an array of non-owning pointers
141 for (const auto &plugin : mExporter.GetPlugins())
142 mPlugins.push_back(plugin.get());
143
144 this->CountTracksAndLabels();
145
146 mBook = NULL;
147
149
150 // Creating some of the widgets cause events to fire
151 // and we don't want that until after we're completely
152 // created. (Observed on Windows)
153 mInitialized = false;
154 PopulateOrExchange(S);
155 mInitialized = true;
156
157 Layout();
158 Fit();
159 SetMinSize(GetSize());
160 Center();
161
162 EnableControls();
163}
#define XO(s)
Definition: Internat.h:31
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:48
#define S(N)
Definition: ToChars.cpp:64
static SelectionState & Get(AudacityProject &project)
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:467

◆ GetNumExportChannels()

static unsigned GetNumExportChannels ( const TrackList tracks)
static

Definition at line 694 of file ExportMultiple.cpp.

695{
696 /* counters for tracks panned different places */
697 int numLeft = 0;
698 int numRight = 0;
699 //int numMono = 0;
700 /* track iteration kit */
701
702 bool anySolo = !(( tracks.Any<const WaveTrack>() + &WaveTrack::GetSolo ).empty());
703
704 // Want only unmuted wave tracks.
705 for (auto tr :
706 tracks.Any< const WaveTrack >() -
708 ) {
709 // Found a left channel
710 if (tr->GetChannel() == Track::LeftChannel) {
711 numLeft++;
712 }
713
714 // Found a right channel
715 else if (tr->GetChannel() == Track::RightChannel) {
716 numRight++;
717 }
718
719 // Found a mono channel, but it may be panned
720 else if (tr->GetChannel() == Track::MonoChannel) {
721 float pan = tr->GetPan();
722
723 // Figure out what kind of channel it should be
724 if (pan == -1.0) { // panned hard left
725 numLeft++;
726 }
727 else if (pan == 1.0) { // panned hard right
728 numRight++;
729 }
730 else if (pan == 0) { // panned dead center
731 // numMono++;
732 }
733 else { // panned somewhere else
734 numLeft++;
735 numRight++;
736 }
737 }
738 }
739
740 // if there is stereo content, report 2, else report 1
741 if (numRight > 0 || numLeft > 0) {
742 return 2;
743 }
744
745 return 1;
746}
bool GetSolo() const
Definition: Track.h:918
bool GetNotSolo() const
Definition: Track.h:920
bool GetMute() const
Definition: Track.h:917
@ LeftChannel
Definition: Track.h:275
@ RightChannel
Definition: Track.h:276
@ MonoChannel
Definition: Track.h:277
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1429
A Track that contains audio waveform data.
Definition: WaveTrack.h:57

References TrackList::Any(), PlayableTrack::GetMute(), PlayableTrack::GetNotSolo(), PlayableTrack::GetSolo(), Track::LeftChannel, Track::MonoChannel, and Track::RightChannel.

Referenced by ExportMultipleDialog::ExportMultipleByLabel().

Here is the call graph for this function:
Here is the caller graph for this function: