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/listbase.h>
#include <wx/filefn.h>
#include <wx/filename.h>
#include <wx/log.h>
#include <wx/radiobut.h>
#include <wx/simplebook.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 "HelpSystem.h"
#include "AudacityMessageBox.h"
#include "AudacityTextEntryDialog.h"
#include "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 79 of file ExportMultiple.cpp.

79 {
80 FormatID = 10001,
82 DirID,
85 LabelID,
86 FirstID,
88 TrackID,
94};
@ 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 120 of file ExportMultiple.cpp.

128: wxDialogWrapper( &GetProjectFrame( *project ),
129 wxID_ANY, XO("Export Multiple") )
130, mExporter{ *project }
131, mSelectionState{ SelectionState::Get( *project ) }
132{
133 SetName();
134
135 mProject = project;
136 mTracks = &TrackList::Get( *project );
137 // Construct an array of non-owning pointers
138 for (const auto &plugin : mExporter.GetPlugins())
139 mPlugins.push_back(plugin.get());
140
141 this->CountTracksAndLabels();
142
143 mBook = NULL;
144
146
147 // Creating some of the widgets cause events to fire
148 // and we don't want that until after we're completely
149 // created. (Observed on Windows)
150 mInitialized = false;
151 PopulateOrExchange(S);
152 mInitialized = true;
153
154 Layout();
155 Fit();
156 SetMinSize(GetSize());
157 Center();
158
159 EnableControls();
160}
XO("Cut/Copy/Paste")
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:46
#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:625
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:385

◆ GetNumExportChannels()

static unsigned GetNumExportChannels ( const TrackList tracks)
static

Definition at line 700 of file ExportMultiple.cpp.

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

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: