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 (const CommandContext &context, bool shouldPrompt=true)
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
virtual bool Init ()
 
virtual bool PromptUser (AudacityProject &)
 
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 106 of file SetTrackInfoCommand.cpp.

107{
108 //auto wt = dynamic_cast<WaveTrack *>(t);
109 //auto pt = dynamic_cast<PlayableTrack *>(t);
110
111 if (bHasTrackName)
113
114 if (bHasSelected)
116
117 if (bHasFocused) {
118 auto &trackFocus = TrackFocus::Get(context.project);
119 if (bFocused)
120 trackFocus.Set(&t);
121 else if (&t == trackFocus.Get())
122 trackFocus.Set(nullptr);
123 }
124 return true;
125}
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 89 of file SetTrackInfoCommand.cpp.

90{
91 S.StartMultiColumn(3, wxEXPAND);
92 {
93 S.SetStretchyCol( 2 );
94 S.Optional( bHasTrackName ).TieTextBox( XXO("Name:"), mTrackName );
95 }
96 S.EndMultiColumn();
97 S.StartMultiColumn(2, wxEXPAND);
98 {
99 S.SetStretchyCol( 1 );
100 S.Optional( bHasSelected ).TieCheckBox( XXO("Selected"), bSelected );
101 S.Optional( bHasFocused ).TieCheckBox( XXO("Focused"), bFocused);
102 }
103 S.EndMultiColumn();
104}
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 86 of file SetTrackInfoCommand.cpp.

87 { 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 83 of file SetTrackInfoCommand.cpp.

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

References S.

◆ VisitSettings() [3/3]

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

Definition at line 75 of file SetTrackInfoCommand.cpp.

75 {
76 S.OptionalN( bHasTrackName ).Define( mTrackName, wxT("Name"), _("Unnamed") );
77 // There is also a select command. This is an alternative.
78 S.OptionalN( bHasSelected ).Define( bSelected, wxT("Selected"), false );
79 S.OptionalN( bHasFocused ).Define( bFocused, wxT("Focused"), false );
80 return true;
81};
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: