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

A SetTrackBase that sets name, selected and focus. More...

#include <SetTrackInfoCommand.h>

Inheritance diagram for SetTrackStatusCommand:
[legend]
Collaboration diagram for SetTrackStatusCommand:
[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

wxString mTrackName
 
bool bSelected
 
bool bFocused
 
bool bHasTrackName
 
bool bHasSelected
 
bool bHasFocused
 
- 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 Status") }
 

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 name, selected and focus.

Definition at line 46 of file SetTrackInfoCommand.h.

Member Function Documentation

◆ ApplyInner()

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

Reimplemented from SetTrackBase.

Definition at line 173 of file SetTrackInfoCommand.cpp.

174{
175 //auto wt = dynamic_cast<WaveTrack *>(t);
176 //auto pt = dynamic_cast<PlayableTrack *>(t);
177
178 // You can get some intriguing effects by setting R and L channels to
179 // different values.
180 if( bHasTrackName )
182
183 // In stereo tracks, both channels need selecting/deselecting.
184 if( bHasSelected )
186
187 // These ones don't make sense on the second channel of a stereo track.
188 if( !bIsSecondChannel ){
189 if( bHasFocused )
190 {
191 auto &trackFocus = TrackFocus::Get( context.project );
192 if( bFocused)
193 trackFocus.Set( t );
194 else if( t == trackFocus.Get() )
195 trackFocus.Set( nullptr );
196 }
197 }
198 return true;
199}
AudacityProject & project
Track * Get()
virtual void SetSelected(bool s)
Definition: Track.cpp:88
void SetName(const wxString &n)
Definition: Track.cpp:80

References bFocused, bHasFocused, bHasSelected, bHasTrackName, SetTrackBase::bIsSecondChannel, bSelected, TrackFocus::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), mTrackName, CommandContext::project, Track::SetName(), and Track::SetSelected().

Referenced by SetTrackCommand::ApplyInner().

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

◆ GetDescription()

TranslatableString SetTrackStatusCommand::GetDescription ( ) const
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 54 of file SetTrackInfoCommand.h.

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

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol SetTrackStatusCommand::GetSymbol ( ) const
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 53 of file SetTrackInfoCommand.h.

53{return Symbol;};
static const ComponentInterfaceSymbol Symbol

References Symbol.

◆ ManualPage()

ManualPageID SetTrackStatusCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 61 of file SetTrackInfoCommand.h.

61{return L"Extra_Menu:_Scriptables_I#set_track_status";}

◆ PopulateOrExchange()

void SetTrackStatusCommand::PopulateOrExchange ( ShuttleGui S)
overridevirtual

Reimplemented from SetTrackBase.

Definition at line 155 of file SetTrackInfoCommand.cpp.

156{
158 S.StartMultiColumn(3, wxEXPAND);
159 {
160 S.SetStretchyCol( 2 );
161 S.Optional( bHasTrackName ).TieTextBox( XXO("Name:"), mTrackName );
162 }
163 S.EndMultiColumn();
164 S.StartMultiColumn(2, wxEXPAND);
165 {
166 S.SetStretchyCol( 1 );
167 S.Optional( bHasSelected ).TieCheckBox( XXO("Selected"), bSelected );
168 S.Optional( bHasFocused ).TieCheckBox( XXO("Focused"), bFocused);
169 }
170 S.EndMultiColumn();
171}
XXO("&Cut/Copy/Paste Toolbar")
#define S(N)
Definition: ToChars.cpp:64
virtual void PopulateOrExchange(ShuttleGui &S) override

References bFocused, bHasFocused, bHasSelected, bHasTrackName, bSelected, mTrackName, 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 SetTrackStatusCommand::VisitSettings ( ConstSettingsVisitor )
overridevirtual

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

Reimplemented from SetTrackBase.

Definition at line 152 of file SetTrackInfoCommand.cpp.

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

References S.

◆ VisitSettings() [2/3]

bool SetTrackStatusCommand::VisitSettings ( SettingsVisitor )
overridevirtual

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

Reimplemented from SetTrackBase.

Definition at line 149 of file SetTrackInfoCommand.cpp.

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

References S.

◆ VisitSettings() [3/3]

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

Definition at line 140 of file SetTrackInfoCommand.cpp.

140 {
142 S.OptionalN( bHasTrackName ).Define( mTrackName, wxT("Name"), _("Unnamed") );
143 // There is also a select command. This is an alternative.
144 S.OptionalN( bHasSelected ).Define( bSelected, wxT("Selected"), false );
145 S.OptionalN( bHasFocused ).Define( bFocused, wxT("Focused"), false );
146 return true;
147};
wxT("CloseDown"))
#define _(s)
Definition: Internat.h:73
bool VisitSettings(SettingsVisitorBase< Const > &S)

References _, bFocused, bHasFocused, bHasSelected, bHasTrackName, bSelected, mTrackName, 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

◆ bFocused

bool SetTrackStatusCommand::bFocused

Definition at line 67 of file SetTrackInfoCommand.h.

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

◆ bHasFocused

bool SetTrackStatusCommand::bHasFocused

Definition at line 72 of file SetTrackInfoCommand.h.

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

◆ bHasSelected

bool SetTrackStatusCommand::bHasSelected

Definition at line 71 of file SetTrackInfoCommand.h.

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

◆ bHasTrackName

bool SetTrackStatusCommand::bHasTrackName

Definition at line 70 of file SetTrackInfoCommand.h.

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

◆ bSelected

bool SetTrackStatusCommand::bSelected

Definition at line 66 of file SetTrackInfoCommand.h.

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

◆ mTrackName

wxString SetTrackStatusCommand::mTrackName

Definition at line 65 of file SetTrackInfoCommand.h.

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

◆ Symbol

const ComponentInterfaceSymbol SetTrackStatusCommand::Symbol { XO("Set Track Status") }
static

Definition at line 49 of file SetTrackInfoCommand.h.

Referenced by GetSymbol().


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