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

Base class for the various SetTrackCommand classes.
Sbclasses provide the settings that are relevant to them. More...

#include <SetTrackInfoCommand.h>

Inheritance diagram for SetTrackBase:
[legend]
Collaboration diagram for SetTrackBase:
[legend]

Public Member Functions

 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

int mTrackIndex
 
int mChannelIndex
 
bool bHasTrackIndex
 
bool bHasChannelIndex
 
bool bIsSecondChannel
 
bool mbPromptForTracks
 

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

Base class for the various SetTrackCommand classes.
Sbclasses provide the settings that are relevant to them.

Definition at line 25 of file SetTrackInfoCommand.h.

Constructor & Destructor Documentation

◆ SetTrackBase()

SetTrackBase::SetTrackBase ( )

Definition at line 55 of file SetTrackInfoCommand.cpp.

55 {
56 mbPromptForTracks = true;
57 bIsSecondChannel = false;
58}

References bIsSecondChannel, and mbPromptForTracks.

Member Function Documentation

◆ Apply()

bool SetTrackBase::Apply ( const CommandContext context)
override

Definition at line 106 of file SetTrackInfoCommand.cpp.

107{
108 long i = 0;// track counter
109 long j = 0;// channel counter
110 auto &tracks = TrackList::Get( context.project );
111 for ( auto t : tracks.Leaders() )
112 {
113 auto channels = TrackList::Channels(t);
114 for ( auto channel : channels ) {
115 bool bThisTrack =
116#ifdef USE_OWN_TRACK_SELECTION
117 (bHasTrackIndex && (i==mTrackIndex)) ||
118 (bHasChannelIndex && (j==mChannelIndex ) ) ||
120#else
121 channel->GetSelected();
122#endif
123
124 if( bThisTrack ){
125 ApplyInner( context, channel );
126 }
127 ++j; // count all channels
128 }
129 ++i; // count groups of channels
130 }
131 return true;
132}
AudacityProject & project
virtual bool ApplyInner(const CommandContext &context, Track *t)
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:487
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1544

References ApplyInner(), bHasChannelIndex, bHasTrackIndex, TrackList::Channels(), TrackList::Get(), mChannelIndex, mTrackIndex, and CommandContext::project.

Here is the call graph for this function:

◆ ApplyInner()

bool SetTrackBase::ApplyInner ( const CommandContext context,
Track t 
)
virtual

Reimplemented in SetClipCommand, SetEnvelopeCommand, SetTrackStatusCommand, SetTrackAudioCommand, SetTrackVisualsCommand, and SetTrackCommand.

Definition at line 65 of file SetTrackInfoCommand.cpp.

66{
67 static_cast<void>(&context);
68 static_cast<void>(&t);
69 return true;
70};

Referenced by Apply().

Here is the caller graph for this function:

◆ PopulateOrExchange()

void SetTrackBase::PopulateOrExchange ( ShuttleGui S)
overridevirtual

Reimplemented in SetClipCommand, SetEnvelopeCommand, SetTrackStatusCommand, SetTrackAudioCommand, SetTrackVisualsCommand, and SetTrackCommand.

Definition at line 89 of file SetTrackInfoCommand.cpp.

90{
91 static_cast<void>(S);
92#ifdef USE_OWN_TRACK_SELECTION
94 return;
95 S.AddSpace(0, 5);
96 S.StartMultiColumn(3, wxEXPAND);
97 {
98 S.SetStretchyCol( 2 );
99 S.Optional( bHasTrackIndex ).TieNumericTextBox( XO("Track Index:"), mTrackIndex );
100 S.Optional( bHasChannelIndex).TieNumericTextBox( XO("Channel Index:"), mChannelIndex );
101 }
102 S.EndMultiColumn();
103#endif
104}
XO("Cut/Copy/Paste")
#define S(N)
Definition: ToChars.cpp:64

References bHasChannelIndex, bHasTrackIndex, mbPromptForTracks, mChannelIndex, mTrackIndex, S, and XO().

Referenced by SetTrackStatusCommand::PopulateOrExchange(), SetTrackAudioCommand::PopulateOrExchange(), SetTrackVisualsCommand::PopulateOrExchange(), and SetTrackCommand::PopulateOrExchange().

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

◆ VisitSettings() [1/3]

bool SetTrackBase::VisitSettings ( ConstSettingsVisitor )
overridevirtual

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

Reimplemented from AudacityCommand.

Reimplemented in SetTrackStatusCommand, SetTrackAudioCommand, SetTrackVisualsCommand, and SetTrackCommand.

Definition at line 86 of file SetTrackInfoCommand.cpp.

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

References S.

◆ VisitSettings() [2/3]

bool SetTrackBase::VisitSettings ( SettingsVisitor )
overridevirtual

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

Reimplemented from AudacityCommand.

Reimplemented in SetTrackStatusCommand, SetTrackAudioCommand, SetTrackVisualsCommand, and SetTrackCommand.

Definition at line 83 of file SetTrackInfoCommand.cpp.

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

References S.

◆ VisitSettings() [3/3]

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

Definition at line 73 of file SetTrackInfoCommand.cpp.

74{
75 static_cast<void>(S);
76#ifdef USE_OWN_TRACK_SELECTION
77 S.OptionalY( bHasTrackIndex ).Define( mTrackIndex, wxT("Track"), 0, 0, 100 );
78 S.OptionalN( bHasChannelIndex ).Define( mChannelIndex, wxT("Channel"), 0, 0, 100 );
79#endif
80 return true;
81}
wxT("CloseDown"))

References bHasChannelIndex, bHasTrackIndex, mChannelIndex, mTrackIndex, S, and wxT().

Referenced by SetTrackStatusCommand::VisitSettings(), SetTrackAudioCommand::VisitSettings(), SetTrackVisualsCommand::VisitSettings(), and SetTrackCommand::VisitSettings().

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

Member Data Documentation

◆ bHasChannelIndex

bool SetTrackBase::bHasChannelIndex

Definition at line 39 of file SetTrackInfoCommand.h.

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

◆ bHasTrackIndex

bool SetTrackBase::bHasTrackIndex

Definition at line 38 of file SetTrackInfoCommand.h.

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

◆ bIsSecondChannel

bool SetTrackBase::bIsSecondChannel

◆ mbPromptForTracks

bool SetTrackBase::mbPromptForTracks

◆ mChannelIndex

int SetTrackBase::mChannelIndex

Definition at line 37 of file SetTrackInfoCommand.h.

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

◆ mTrackIndex

int SetTrackBase::mTrackIndex

Definition at line 36 of file SetTrackInfoCommand.h.

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


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