Audacity 3.2.0
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
SetTrackAudioCommand Class Reference

A SetTrackBase that sets pan, gain, mute and solo. More...

#include <SetTrackInfoCommand.h>

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

Public Member Functions

ComponentInterfaceSymbol GetSymbol () const override
 
TranslatableString GetDescription () const override
 
template<bool Const>
bool VisitSettings (SettingsVisitorBase< Const > &S)
 
bool VisitSettings (SettingsVisitor &S) override
 
bool VisitSettings (ConstSettingsVisitor &S) override
 
void PopulateOrExchange (ShuttleGui &S) override
 
ManualPageID ManualPage () override
 
bool ApplyInner (const CommandContext &context, Track *t) override
 
- Public Member Functions inherited from SetTrackBase
 SetTrackBase ()
 
bool Apply (const CommandContext &context) override
 
virtual bool ApplyInner (const CommandContext &context, Track *t)
 
template<bool Const>
bool VisitSettings (SettingsVisitorBase< Const > &S)
 
bool VisitSettings (SettingsVisitor &S) override
 
bool VisitSettings (ConstSettingsVisitor &S) override
 
virtual void PopulateOrExchange (ShuttleGui &S) override
 
- Public Member Functions inherited from AudacityCommand
 AudacityCommand ()
 
virtual ~AudacityCommand ()
 
PluginPath GetPath () const override
 
VendorSymbol GetVendor () const override
 
wxString GetVersion () const override
 
ComponentInterfaceSymbol GetSymbol () const override=0
 
virtual TranslatableString GetDescription () const override
 
virtual ManualPageID ManualPage ()
 
virtual bool IsBatchProcessing () const
 
virtual void SetBatchProcessing (bool start)
 
virtual bool Apply (const CommandContext &WXUNUSED(context))
 
bool ShowInterface (wxWindow *parent, bool forceModal=false)
 
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
 
bool SaveSettingsAsString (wxString &parms)
 
bool LoadSettingsFromString (const wxString &parms)
 
bool DoAudacityCommand (wxWindow *parent, const CommandContext &context, bool shouldPrompt=true)
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
virtual bool Init ()
 
virtual bool PromptUser (wxWindow *parent)
 
virtual bool CheckWhetherSkipAudacityCommand ()
 
virtual void End ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual bool TransferDataToWindow ()
 
virtual bool TransferDataFromWindow ()
 
virtual bool VisitSettings (SettingsVisitor &)
 
virtual bool VisitSettings (ConstSettingsVisitor &)
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
virtual PluginPath GetPath () const =0
 
virtual ComponentInterfaceSymbol GetSymbol () const =0
 
virtual VendorSymbol GetVendor () const =0
 
virtual wxString GetVersion () const =0
 
virtual TranslatableString GetDescription () const =0
 
TranslatableString GetName () const
 

Public Attributes

double mPan
 
double mGain
 
bool bSolo
 
bool bMute
 
bool bHasPan
 
bool bHasGain
 
bool bHasSolo
 
bool bHasMute
 
- Public Attributes inherited from SetTrackBase
int mTrackIndex
 
int mChannelIndex
 
bool bHasTrackIndex
 
bool bHasChannelIndex
 
bool bIsSecondChannel
 
bool mbPromptForTracks
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Set Track Audio") }
 

Additional Inherited Members

- Public Types inherited from AudacityCommand
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Protected Attributes inherited from AudacityCommand
ProgressDialogmProgress
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 

Detailed Description

A SetTrackBase that sets pan, gain, mute and solo.

Definition at line 75 of file SetTrackInfoCommand.h.

Member Function Documentation

◆ ApplyInner()

bool SetTrackAudioCommand::ApplyInner ( const CommandContext context,
Track t 
)
overridevirtual

Reimplemented from SetTrackBase.

Definition at line 244 of file SetTrackInfoCommand.cpp.

245{
246 static_cast<void>(context);
247 auto wt = dynamic_cast<WaveTrack *>(t);
248 auto pt = dynamic_cast<PlayableTrack *>(t);
249
250 if( wt && bHasGain )
251 wt->SetGain(DB_TO_LINEAR(mGain));
252 if( wt && bHasPan )
253 wt->SetPan(mPan/100.0);
254
255 // These ones don't make sense on the second channel of a stereo track.
256 if( !bIsSecondChannel ){
257 if( pt && bHasSolo )
258 pt->SetSolo(bSolo);
259 if( pt && bHasMute )
260 pt->SetMute(bMute);
261 }
262 return true;
263}
#define DB_TO_LINEAR(x)
Definition: MemoryX.h:560
AudioTrack subclass that can also be audibly replayed by the program.
Definition: Track.h:917
virtual void SetPan(float)
Definition: Track.h:486
A Track that contains audio waveform data.
Definition: WaveTrack.h:51

References bHasGain, bHasMute, bHasPan, bHasSolo, SetTrackBase::bIsSecondChannel, bMute, bSolo, DB_TO_LINEAR, mGain, mPan, and Track::SetPan().

Referenced by SetTrackCommand::ApplyInner().

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

◆ GetDescription()

TranslatableString SetTrackAudioCommand::GetDescription ( ) const
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 83 of file SetTrackInfoCommand.h.

83{return XO("Sets various values for a track.");};
XO("Cut/Copy/Paste")

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol SetTrackAudioCommand::GetSymbol ( ) const
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 82 of file SetTrackInfoCommand.h.

82{return Symbol;};
static const ComponentInterfaceSymbol Symbol

References Symbol.

◆ ManualPage()

ManualPageID SetTrackAudioCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 90 of file SetTrackInfoCommand.h.

90{return L"Extra_Menu:_Scriptables_I#set_track_audio";}

◆ PopulateOrExchange()

void SetTrackAudioCommand::PopulateOrExchange ( ShuttleGui S)
overridevirtual

Reimplemented from SetTrackBase.

Definition at line 225 of file SetTrackInfoCommand.cpp.

226{
228 S.StartMultiColumn(2, wxEXPAND);
229 {
230 S.SetStretchyCol( 1 );
231 S.Optional( bHasMute ).TieCheckBox( XXO("Mute"), bMute);
232 S.Optional( bHasSolo ).TieCheckBox( XXO("Solo"), bSolo);
233 }
234 S.EndMultiColumn();
235 S.StartMultiColumn(3, wxEXPAND);
236 {
237 S.SetStretchyCol( 2 );
238 S.Optional( bHasGain ).TieSlider( XXO("Gain:"), mGain, 36.0,-36.0);
239 S.Optional( bHasPan ).TieSlider( XXO("Pan:"), mPan, 100.0, -100.0);
240 }
241 S.EndMultiColumn();
242}
XXO("&Cut/Copy/Paste Toolbar")
#define S(N)
Definition: ToChars.cpp:64
virtual void PopulateOrExchange(ShuttleGui &S) override

References bHasGain, bHasMute, bHasPan, bHasSolo, bMute, bSolo, mGain, mPan, SetTrackBase::PopulateOrExchange(), S, and XXO().

Referenced by SetTrackCommand::PopulateOrExchange().

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

◆ VisitSettings() [1/3]

bool SetTrackAudioCommand::VisitSettings ( ConstSettingsVisitor )
overridevirtual

Visit settings, if defined. false means no defined settings. Default implementation returns false

Reimplemented from SetTrackBase.

Definition at line 222 of file SetTrackInfoCommand.cpp.

223 { return VisitSettings<true>(S); }

References S.

◆ VisitSettings() [2/3]

bool SetTrackAudioCommand::VisitSettings ( SettingsVisitor )
overridevirtual

Visit settings, if defined. false means no defined settings. Default implementation returns false

Reimplemented from SetTrackBase.

Definition at line 219 of file SetTrackInfoCommand.cpp.

220 { return VisitSettings<false>(S); }

References S.

◆ VisitSettings() [3/3]

template<bool Const>
bool SetTrackAudioCommand::VisitSettings ( SettingsVisitorBase< Const > &  S)

Definition at line 209 of file SetTrackInfoCommand.cpp.

209 {
211 S.OptionalN( bHasMute ).Define( bMute, wxT("Mute"), false );
212 S.OptionalN( bHasSolo ).Define( bSolo, wxT("Solo"), false );
213
214 S.OptionalN( bHasGain ).Define( mGain, wxT("Gain"), 0.0, -36.0, 36.0);
215 S.OptionalN( bHasPan ).Define( mPan, wxT("Pan"), 0.0, -100.0, 100.0);
216 return true;
217};
wxT("CloseDown"))
bool VisitSettings(SettingsVisitorBase< Const > &S)

References bHasGain, bHasMute, bHasPan, bHasSolo, bMute, bSolo, mGain, mPan, S, SetTrackBase::VisitSettings(), and wxT().

Referenced by SetTrackCommand::VisitSettings().

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

Member Data Documentation

◆ bHasGain

bool SetTrackAudioCommand::bHasGain

Definition at line 101 of file SetTrackInfoCommand.h.

Referenced by ApplyInner(), PopulateOrExchange(), and VisitSettings().

◆ bHasMute

bool SetTrackAudioCommand::bHasMute

Definition at line 103 of file SetTrackInfoCommand.h.

Referenced by ApplyInner(), PopulateOrExchange(), and VisitSettings().

◆ bHasPan

bool SetTrackAudioCommand::bHasPan

Definition at line 100 of file SetTrackInfoCommand.h.

Referenced by ApplyInner(), PopulateOrExchange(), and VisitSettings().

◆ bHasSolo

bool SetTrackAudioCommand::bHasSolo

Definition at line 102 of file SetTrackInfoCommand.h.

Referenced by ApplyInner(), PopulateOrExchange(), and VisitSettings().

◆ bMute

bool SetTrackAudioCommand::bMute

Definition at line 97 of file SetTrackInfoCommand.h.

Referenced by ApplyInner(), PopulateOrExchange(), and VisitSettings().

◆ bSolo

bool SetTrackAudioCommand::bSolo

Definition at line 96 of file SetTrackInfoCommand.h.

Referenced by ApplyInner(), PopulateOrExchange(), and VisitSettings().

◆ mGain

double SetTrackAudioCommand::mGain

Definition at line 95 of file SetTrackInfoCommand.h.

Referenced by ApplyInner(), PopulateOrExchange(), and VisitSettings().

◆ mPan

double SetTrackAudioCommand::mPan

Definition at line 94 of file SetTrackInfoCommand.h.

Referenced by ApplyInner(), PopulateOrExchange(), and VisitSettings().

◆ Symbol

const ComponentInterfaceSymbol SetTrackAudioCommand::Symbol { XO("Set Track Audio") }
static

Definition at line 78 of file SetTrackInfoCommand.h.

Referenced by GetSymbol().


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