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

52 {
53 mbPromptForTracks = true;
54 bIsSecondChannel = false;
55}

References bIsSecondChannel, and mbPromptForTracks.

Member Function Documentation

◆ Apply()

bool SetTrackBase::Apply ( const CommandContext context)
override

Definition at line 103 of file SetTrackInfoCommand.cpp.

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

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

63{
64 static_cast<void>(&context);
65 static_cast<void>(&t);
66 return true;
67};

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

87{
88 static_cast<void>(S);
89#ifdef USE_OWN_TRACK_SELECTION
91 return;
92 S.AddSpace(0, 5);
93 S.StartMultiColumn(3, wxEXPAND);
94 {
95 S.SetStretchyCol( 2 );
96 S.Optional( bHasTrackIndex ).TieNumericTextBox( XO("Track Index:"), mTrackIndex );
97 S.Optional( bHasChannelIndex).TieNumericTextBox( XO("Channel Index:"), mChannelIndex );
98 }
99 S.EndMultiColumn();
100#endif
101}
#define XO(s)
Definition: Internat.h:31
#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 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 83 of file SetTrackInfoCommand.cpp.

84 { 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 80 of file SetTrackInfoCommand.cpp.

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

References S.

◆ VisitSettings() [3/3]

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

Definition at line 70 of file SetTrackInfoCommand.cpp.

71{
72 static_cast<void>(S);
73#ifdef USE_OWN_TRACK_SELECTION
74 S.OptionalY( bHasTrackIndex ).Define( mTrackIndex, wxT("Track"), 0, 0, 100 );
75 S.OptionalN( bHasChannelIndex ).Define( mChannelIndex, wxT("Channel"), 0, 0, 100 );
76#endif
77 return true;
78}
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: