Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ExportMixerDialog Class Referencefinal

Dialog for advanced mixing. More...

#include <ExportMixerDialog.h>

Inheritance diagram for ExportMixerDialog:
[legend]
Collaboration diagram for ExportMixerDialog:
[legend]

Public Member Functions

 ExportMixerDialog (TrackIterRange< const WaveTrack > tracks, MixerOptions::Downmix *mixerSpec, wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
 
virtual ~ExportMixerDialog ()
 
- Public Member Functions inherited from wxDialogWrapper
 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 ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Member Functions

void OnOk (wxCommandEvent &event)
 
void OnCancel (wxCommandEvent &event)
 
void OnMixerPanelHelp (wxCommandEvent &event)
 
void OnSlider (wxCommandEvent &event)
 
void OnSize (wxSizeEvent &event)
 

Private Attributes

wxStaticText * mChannelsText
 
MixerOptions::DownmixmMixerSpec
 
wxArrayString mTrackNames
 

Detailed Description

Dialog for advanced mixing.

Definition at line 29 of file ExportMixerDialog.h.

Constructor & Destructor Documentation

◆ ExportMixerDialog()

ExportMixerDialog::ExportMixerDialog ( TrackIterRange< const WaveTrack tracks,
MixerOptions::Downmix mixerSpec,
wxWindow *  parent,
wxWindowID  id,
const TranslatableString title,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER 
)

Definition at line 40 of file ExportMixerDialog.cpp.

43 : wxDialogWrapper( parent, id, title, position, size, style | wxRESIZE_BORDER )
44 , mMixerSpec(mixerSpec)
45{
46 SetName();
47
48 for (auto t : tracks)
49 {
50 const wxString sTrackName = (t->GetName()).Left(20);
51 if (IsMono(*t))
52 // No matter whether it's panned hard left or right
53 mTrackNames.push_back(sTrackName);
54 else {
55 /* i18n-hint: track name and L abbreviating Left channel */
56 mTrackNames.push_back(XO("%s - L").Format(sTrackName).Translation());
57 /* i18n-hint: track name and R abbreviating Right channel */
58 mTrackNames.push_back(XO("%s - R").Format(sTrackName).Translation());
59 }
60 }
61
62 auto label = XO("Output Channels: %2d")
63 .Format( mMixerSpec->GetNumChannels() );
64
65 ShuttleGui S{ this, eIsCreating };
66 {
67 S.SetBorder( 5 );
68
69 auto mixerPanel = safenew ExportMixerPanel(
70 S.GetParent(), ID_MIXERPANEL, mMixerSpec,
71 mTrackNames, wxDefaultPosition, wxSize(400, -1));
72 S.Prop(1)
73 .Name(XO("Mixer Panel"))
74 .Position(wxEXPAND | wxALL)
75 .AddWindow(mixerPanel);
76
77 S.StartHorizontalLay(wxALIGN_CENTER | wxALL, 0);
78 {
79 mChannelsText = S.AddVariableText(
80 label,
81 false, wxALIGN_LEFT | wxALL );
82
84 {
85 S
87 .Name(label)
88 .Size({300, -1})
89 .Style(wxSL_HORIZONTAL)
90 .Position(wxEXPAND | wxALL)
91 .AddSlider( {},
94 }
95 }
96 S.EndHorizontalLay();
97
98 S.AddStandardButtons( eCancelButton | eOkButton | eHelpButton );
99 }
100
101 SetAutoLayout(true);
102 GetSizer()->Fit( this );
103 GetSizer()->SetSizeHints( this );
104
105 SetSizeHints( 640, 480, 20000, 20000 );
106
107 SetSize( 640, 480 );
108 Center();
109}
@ ID_SLIDER_CHANNEL
@ ID_MIXERPANEL
XO("Cut/Copy/Paste")
#define safenew
Definition: MemoryX.h:9
static const auto title
@ eIsCreating
Definition: ShuttleGui.h:37
@ eOkButton
Definition: ShuttleGui.h:599
@ eCancelButton
Definition: ShuttleGui.h:600
@ eHelpButton
Definition: ShuttleGui.h:603
TranslatableString label
Definition: TagsEditor.cpp:165
const auto tracks
#define S(N)
Definition: ToChars.cpp:64
wxStaticText * mChannelsText
MixerOptions::Downmix * mMixerSpec
wxArrayString mTrackNames
Panel that displays mixing for advanced mixing option.
unsigned GetMaxNumChannels() const
Definition: MixerOptions.h:49
unsigned GetNumChannels() const
Definition: MixerOptions.h:47
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:630
bool IsMono(const Channel &channel)
Whether the channel is mono.

References eCancelButton, eHelpButton, eIsCreating, eOkButton, ID_MIXERPANEL, ID_SLIDER_CHANNEL, AudioGraph::IsMono(), label, S, safenew, tracks, and XO().

Here is the call graph for this function:

◆ ~ExportMixerDialog()

ExportMixerDialog::~ExportMixerDialog ( )
virtualdefault

Member Function Documentation

◆ OnCancel()

void ExportMixerDialog::OnCancel ( wxCommandEvent &  event)
private

Definition at line 136 of file ExportMixerDialog.cpp.

137{
138 EndModal( wxID_CANCEL );
139}

◆ OnMixerPanelHelp()

void ExportMixerDialog::OnMixerPanelHelp ( wxCommandEvent &  event)
private

Definition at line 141 of file ExportMixerDialog.cpp.

142{
143 HelpSystem::ShowHelp(this, L"Advanced_Mixing_Options", true);
144}
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:231

References HelpSystem::ShowHelp().

Here is the call graph for this function:

◆ OnOk()

void ExportMixerDialog::OnOk ( wxCommandEvent &  event)
private

Definition at line 131 of file ExportMixerDialog.cpp.

132{
133 EndModal( wxID_OK );
134}

◆ OnSize()

void ExportMixerDialog::OnSize ( wxSizeEvent &  event)
private

Definition at line 112 of file ExportMixerDialog.cpp.

113{
114 ExportMixerPanel *pnl = ( ( ExportMixerPanel* ) FindWindow( ID_MIXERPANEL ) );
115 pnl->Refresh( false );
116 event.Skip();
117}

References ID_MIXERPANEL.

◆ OnSlider()

void ExportMixerDialog::OnSlider ( wxCommandEvent &  event)
private

Definition at line 119 of file ExportMixerDialog.cpp.

120{
121 wxSlider *channels = ( wxSlider* )FindWindow( ID_SLIDER_CHANNEL );
122 ExportMixerPanel *pnl = ( ( ExportMixerPanel* ) FindWindow( ID_MIXERPANEL ) );
123 mMixerSpec->SetNumChannels( channels->GetValue() );
124 pnl->Refresh( false );
125 wxString label;
126 label.Printf( _( "Output Channels: %2d" ), mMixerSpec->GetNumChannels() );
127 mChannelsText->SetLabel( label );
128 channels->SetName( label );
129}
#define _(s)
Definition: Internat.h:73
bool SetNumChannels(unsigned numChannels)

References _, MixerOptions::Downmix::GetNumChannels(), ID_MIXERPANEL, ID_SLIDER_CHANNEL, label, mChannelsText, mMixerSpec, and MixerOptions::Downmix::SetNumChannels().

Here is the call graph for this function:

Member Data Documentation

◆ mChannelsText

wxStaticText* ExportMixerDialog::mChannelsText
private

Definition at line 41 of file ExportMixerDialog.h.

Referenced by OnSlider().

◆ mMixerSpec

MixerOptions::Downmix* ExportMixerDialog::mMixerSpec
private

Definition at line 42 of file ExportMixerDialog.h.

Referenced by OnSlider().

◆ mTrackNames

wxArrayString ExportMixerDialog::mTrackNames
private

Definition at line 43 of file ExportMixerDialog.h.


The documentation for this class was generated from the following files: