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 170 of file SetTrackInfoCommand.cpp.

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

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.");};
#define XO(s)
Definition: Internat.h:31

References XO.

◆ 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 152 of file SetTrackInfoCommand.cpp.

153{
155 S.StartMultiColumn(3, wxEXPAND);
156 {
157 S.SetStretchyCol( 2 );
158 S.Optional( bHasTrackName ).TieTextBox( XXO("Name:"), mTrackName );
159 }
160 S.EndMultiColumn();
161 S.StartMultiColumn(2, wxEXPAND);
162 {
163 S.SetStretchyCol( 1 );
164 S.Optional( bHasSelected ).TieCheckBox( XXO("Selected"), bSelected );
165 S.Optional( bHasFocused ).TieCheckBox( XXO("Focused"), bFocused);
166 }
167 S.EndMultiColumn();
168}
#define XXO(s)
Definition: Internat.h:44
#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 149 of file SetTrackInfoCommand.cpp.

150 { 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 146 of file SetTrackInfoCommand.cpp.

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

References S.

◆ VisitSettings() [3/3]

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

Definition at line 137 of file SetTrackInfoCommand.cpp.

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

References _, bFocused, bHasFocused, bHasSelected, bHasTrackName, bSelected, mTrackName, S, and SetTrackBase::VisitSettings().

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: