Audacity  3.0.3
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 () override
 
TranslatableString GetDescription () override
 
bool DefineParams (ShuttleParams &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
 
- Public Member Functions inherited from AudacityCommand
 AudacityCommand ()
 
virtual ~AudacityCommand ()
 
PluginPath GetPath () override
 
VendorSymbol GetVendor () override
 
wxString GetVersion () override
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
virtual bool Apply (const CommandContext &WXUNUSED(context))
 
bool ShowInterface (wxWindow *parent, bool forceModal=false)
 
virtual void SetHostUI (EffectUIHostInterface *WXUNUSED(host))
 
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
 
virtual bool GetAutomationParameters (wxString &parms)
 
virtual bool SetAutomationParameters (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 ()
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
TranslatableString GetName ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 

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 }
 
using VetoDialogHook = bool(*)(wxDialog *)
 
- Static Public Member Functions inherited from AudacityCommand
static VetoDialogHook SetVetoDialogHook (VetoDialogHook hook)
 
- Protected Attributes inherited from AudacityCommand
ProgressDialogmProgress
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 
int mUIResultID
 

Detailed Description

A SetTrackBase that sets name, selected and focus.

Definition at line 44 of file SetTrackInfoCommand.h.

Member Function Documentation

◆ ApplyInner()

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

Reimplemented from SetTrackBase.

Definition at line 157 of file SetTrackInfoCommand.cpp.

158 {
159  //auto wt = dynamic_cast<WaveTrack *>(t);
160  //auto pt = dynamic_cast<PlayableTrack *>(t);
161 
162  // You can get some intriguing effects by setting R and L channels to
163  // different values.
164  if( bHasTrackName )
165  t->SetName(mTrackName);
166 
167  // In stereo tracks, both channels need selecting/deselecting.
168  if( bHasSelected )
170 
171  // These ones don't make sense on the second channel of a stereo track.
172  if( !bIsSecondChannel ){
173  if( bHasFocused )
174  {
175  auto &trackFocus = TrackFocus::Get( context.project );
176  if( bFocused)
177  trackFocus.Set( t );
178  else if( t == trackFocus.Get() )
179  trackFocus.Set( nullptr );
180  }
181  }
182  return true;
183 }

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:

◆ DefineParams()

bool SetTrackStatusCommand::DefineParams ( ShuttleParams S)
overridevirtual

Reimplemented from SetTrackBase.

Definition at line 130 of file SetTrackInfoCommand.cpp.

130  {
132  S.OptionalN( bHasTrackName ).Define( mTrackName, wxT("Name"), _("Unnamed") );
133  // There is also a select command. This is an alternative.
134  S.OptionalN( bHasSelected ).Define( bSelected, wxT("Selected"), false );
135  S.OptionalN( bHasFocused ).Define( bFocused, wxT("Focused"), false );
136  return true;
137 };

References _, bFocused, bHasFocused, bHasSelected, bHasTrackName, bSelected, ShuttleParams::Define(), SetTrackBase::DefineParams(), mTrackName, and ShuttleParams::OptionalN().

Referenced by SetTrackCommand::DefineParams().

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

◆ GetDescription()

TranslatableString SetTrackStatusCommand::GetDescription ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 52 of file SetTrackInfoCommand.h.

52 {return XO("Sets various values for a track.");};

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol SetTrackStatusCommand::GetSymbol ( )
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 51 of file SetTrackInfoCommand.h.

51 {return Symbol;};

References Symbol.

◆ ManualPage()

ManualPageID SetTrackStatusCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 57 of file SetTrackInfoCommand.h.

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

◆ PopulateOrExchange()

void SetTrackStatusCommand::PopulateOrExchange ( ShuttleGui S)
overridevirtual

Reimplemented from SetTrackBase.

Definition at line 139 of file SetTrackInfoCommand.cpp.

140 {
142  S.StartMultiColumn(3, wxEXPAND);
143  {
144  S.SetStretchyCol( 2 );
145  S.Optional( bHasTrackName ).TieTextBox( XXO("Name:"), mTrackName );
146  }
147  S.EndMultiColumn();
148  S.StartMultiColumn(2, wxEXPAND);
149  {
150  S.SetStretchyCol( 1 );
151  S.Optional( bHasSelected ).TieCheckBox( XXO("Selected"), bSelected );
152  S.Optional( bHasFocused ).TieCheckBox( XXO("Focused"), bFocused);
153  }
154  S.EndMultiColumn();
155 }

References bFocused, bHasFocused, bHasSelected, bHasTrackName, bSelected, ShuttleGuiBase::EndMultiColumn(), mTrackName, ShuttleGui::Optional(), SetTrackBase::PopulateOrExchange(), ShuttleGuiBase::SetStretchyCol(), ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::TieCheckBox(), ShuttleGuiBase::TieTextBox(), and XXO.

Referenced by SetTrackCommand::PopulateOrExchange().

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

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

◆ bHasFocused

bool SetTrackStatusCommand::bHasFocused

Definition at line 68 of file SetTrackInfoCommand.h.

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

◆ bHasSelected

bool SetTrackStatusCommand::bHasSelected

Definition at line 67 of file SetTrackInfoCommand.h.

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

◆ bHasTrackName

bool SetTrackStatusCommand::bHasTrackName

Definition at line 66 of file SetTrackInfoCommand.h.

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

◆ bSelected

bool SetTrackStatusCommand::bSelected

Definition at line 62 of file SetTrackInfoCommand.h.

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

◆ mTrackName

wxString SetTrackStatusCommand::mTrackName

Definition at line 61 of file SetTrackInfoCommand.h.

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

◆ Symbol

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

Definition at line 47 of file SetTrackInfoCommand.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files:
ShuttleGuiBase::TieCheckBox
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1629
SetTrackStatusCommand::bHasFocused
bool bHasFocused
Definition: SetTrackInfoCommand.h:68
XO
#define XO(s)
Definition: Internat.h:31
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
SetTrackBase::DefineParams
virtual bool DefineParams(ShuttleParams &S) override
Definition: SetTrackInfoCommand.cpp:70
SetTrackStatusCommand::bHasSelected
bool bHasSelected
Definition: SetTrackInfoCommand.h:67
ShuttleParams::OptionalN
virtual ShuttleParams & OptionalN(bool &var)
Definition: Shuttle.h:72
ShuttleGuiBase::TieTextBox
wxTextCtrl * TieTextBox(const TranslatableString &Caption, wxString &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1652
SetTrackBase::bIsSecondChannel
bool bIsSecondChannel
Definition: SetTrackInfoCommand.h:39
Track::SetSelected
virtual void SetSelected(bool s)
Definition: Track.cpp:90
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
SetTrackStatusCommand::bHasTrackName
bool bHasTrackName
Definition: SetTrackInfoCommand.h:66
SetTrackStatusCommand::bSelected
bool bSelected
Definition: SetTrackInfoCommand.h:62
TrackFocus::Get
Track * Get()
Definition: TrackPanelAx.cpp:755
SetTrackStatusCommand::bFocused
bool bFocused
Definition: SetTrackInfoCommand.h:63
SetTrackStatusCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: SetTrackInfoCommand.h:47
Track::SetName
void SetName(const wxString &n)
Definition: Track.cpp:82
_
#define _(s)
Definition: Internat.h:75
ShuttleParams::Define
virtual void Define(bool &var, const wxChar *key, const bool vdefault, const bool vmin=false, const bool vmax=false, const bool vscl=false)
Definition: Shuttle.cpp:332
SetTrackBase::PopulateOrExchange
virtual void PopulateOrExchange(ShuttleGui &S) override
Definition: SetTrackInfoCommand.cpp:80
ShuttleGui::Optional
ShuttleGui & Optional(bool &bVar)
Definition: ShuttleGui.cpp:2280
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:202
SetTrackStatusCommand::mTrackName
wxString mTrackName
Definition: SetTrackInfoCommand.h:61
CommandContext::project
AudacityProject & project
Definition: CommandContext.h:64