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
bool Apply (const CommandContext &context) final
 
virtual bool ApplyInner (const CommandContext &context, Track &t)=0
 
- 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
 

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 32 of file SetTrackInfoCommand.h.

Member Function Documentation

◆ ApplyInner()

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

Implements SetTrackBase.

Definition at line 105 of file SetTrackInfoCommand.cpp.

106{
107 //auto wt = dynamic_cast<WaveTrack *>(t);
108 //auto pt = dynamic_cast<PlayableTrack *>(t);
109
110 if (bHasTrackName)
112
113 if (bHasSelected)
115
116 if (bHasFocused) {
117 auto &trackFocus = TrackFocus::Get(context.project);
118 if (bFocused)
119 trackFocus.Set(&t);
120 else if (&t == trackFocus.Get())
121 trackFocus.Set(nullptr);
122 }
123 return true;
124}
AudacityProject & project
Track * Get()
Definition: TrackFocus.cpp:156
virtual void SetSelected(bool s)
Definition: Track.cpp:83
void SetName(const wxString &n)
Definition: Track.cpp:69

References bFocused, bHasFocused, bHasSelected, bHasTrackName, 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 40 of file SetTrackInfoCommand.h.

40{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 39 of file SetTrackInfoCommand.h.

39{return Symbol;};
static const ComponentInterfaceSymbol Symbol

References Symbol.

◆ ManualPage()

ManualPageID SetTrackStatusCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 47 of file SetTrackInfoCommand.h.

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

◆ PopulateOrExchange()

void SetTrackStatusCommand::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 88 of file SetTrackInfoCommand.cpp.

89{
90 S.StartMultiColumn(3, wxEXPAND);
91 {
92 S.SetStretchyCol( 2 );
93 S.Optional( bHasTrackName ).TieTextBox( XXO("Name:"), mTrackName );
94 }
95 S.EndMultiColumn();
96 S.StartMultiColumn(2, wxEXPAND);
97 {
98 S.SetStretchyCol( 1 );
99 S.Optional( bHasSelected ).TieCheckBox( XXO("Selected"), bSelected );
100 S.Optional( bHasFocused ).TieCheckBox( XXO("Focused"), bFocused);
101 }
102 S.EndMultiColumn();
103}
XXO("&Cut/Copy/Paste Toolbar")
#define S(N)
Definition: ToChars.cpp:64

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

Definition at line 85 of file SetTrackInfoCommand.cpp.

86 { 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 AudacityCommand.

Definition at line 82 of file SetTrackInfoCommand.cpp.

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

References S.

◆ VisitSettings() [3/3]

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

Definition at line 74 of file SetTrackInfoCommand.cpp.

74 {
75 S.OptionalN( bHasTrackName ).Define( mTrackName, wxT("Name"), _("Unnamed") );
76 // There is also a select command. This is an alternative.
77 S.OptionalN( bHasSelected ).Define( bSelected, wxT("Selected"), false );
78 S.OptionalN( bHasFocused ).Define( bFocused, wxT("Focused"), false );
79 return true;
80};
wxT("CloseDown"))
#define _(s)
Definition: Internat.h:73

References _, bFocused, bHasFocused, bHasSelected, bHasTrackName, bSelected, mTrackName, S, 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 53 of file SetTrackInfoCommand.h.

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

◆ bHasFocused

bool SetTrackStatusCommand::bHasFocused

Definition at line 58 of file SetTrackInfoCommand.h.

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

◆ bHasSelected

bool SetTrackStatusCommand::bHasSelected

Definition at line 57 of file SetTrackInfoCommand.h.

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

◆ bHasTrackName

bool SetTrackStatusCommand::bHasTrackName

Definition at line 56 of file SetTrackInfoCommand.h.

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

◆ bSelected

bool SetTrackStatusCommand::bSelected

Definition at line 52 of file SetTrackInfoCommand.h.

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

◆ mTrackName

wxString SetTrackStatusCommand::mTrackName

Definition at line 51 of file SetTrackInfoCommand.h.

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

◆ Symbol

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

Definition at line 35 of file SetTrackInfoCommand.h.

Referenced by GetSymbol().


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