Audacity  3.0.3
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)
 
virtual bool DefineParams (ShuttleParams &S) override
 
virtual void PopulateOrExchange (ShuttleGui &S) override
 
- Public Member Functions inherited from AudacityCommand
 AudacityCommand ()
 
virtual ~AudacityCommand ()
 
PluginPath GetPath () override
 
VendorSymbol GetVendor () override
 
wxString GetVersion () override
 
ComponentInterfaceSymbol GetSymbol () override=0
 
virtual TranslatableString GetDescription () override
 
virtual ManualPageID ManualPage ()
 
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

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 }
 
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

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

98 {
99  long i = 0;// track counter
100  long j = 0;// channel counter
101  auto &tracks = TrackList::Get( context.project );
102  for ( auto t : tracks.Leaders() )
103  {
104  auto channels = TrackList::Channels(t);
105  for ( auto channel : channels ) {
106  bool bThisTrack =
107 #ifdef USE_OWN_TRACK_SELECTION
108  (bHasTrackIndex && (i==mTrackIndex)) ||
109  (bHasChannelIndex && (j==mChannelIndex ) ) ||
111 #else
112  channel->GetSelected();
113 #endif
114 
115  if( bThisTrack ){
116  ApplyInner( context, channel );
117  }
118  ++j; // count all channels
119  }
120  ++i; // count groups of channels
121  }
122  return true;
123 }

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 SetTrackCommand, SetTrackVisualsCommand, SetTrackAudioCommand, SetTrackStatusCommand, SetEnvelopeCommand, and SetClipCommand.

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:

◆ DefineParams()

bool SetTrackBase::DefineParams ( ShuttleParams S)
overridevirtual

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

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 }

References bHasChannelIndex, bHasTrackIndex, ShuttleParams::Define(), mChannelIndex, mTrackIndex, ShuttleParams::OptionalN(), and ShuttleParams::OptionalY().

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

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

◆ PopulateOrExchange()

void SetTrackBase::PopulateOrExchange ( ShuttleGui S)
overridevirtual

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

Definition at line 80 of file SetTrackInfoCommand.cpp.

81 {
82  static_cast<void>(S);
83 #ifdef USE_OWN_TRACK_SELECTION
84  if( !mbPromptForTracks )
85  return;
86  S.AddSpace(0, 5);
87  S.StartMultiColumn(3, wxEXPAND);
88  {
89  S.SetStretchyCol( 2 );
90  S.Optional( bHasTrackIndex ).TieNumericTextBox( XO("Track Index:"), mTrackIndex );
92  }
93  S.EndMultiColumn();
94 #endif
95 }

References ShuttleGui::AddSpace(), bHasChannelIndex, bHasTrackIndex, ShuttleGuiBase::EndMultiColumn(), mbPromptForTracks, mChannelIndex, mTrackIndex, ShuttleGui::Optional(), ShuttleGuiBase::SetStretchyCol(), ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::TieNumericTextBox(), 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:

Member Data Documentation

◆ bHasChannelIndex

bool SetTrackBase::bHasChannelIndex

Definition at line 37 of file SetTrackInfoCommand.h.

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

◆ bHasTrackIndex

bool SetTrackBase::bHasTrackIndex

Definition at line 36 of file SetTrackInfoCommand.h.

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

◆ bIsSecondChannel

bool SetTrackBase::bIsSecondChannel

◆ mbPromptForTracks

bool SetTrackBase::mbPromptForTracks

◆ mChannelIndex

int SetTrackBase::mChannelIndex

Definition at line 35 of file SetTrackInfoCommand.h.

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

◆ mTrackIndex

int SetTrackBase::mTrackIndex

Definition at line 34 of file SetTrackInfoCommand.h.

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


The documentation for this class was generated from the following files:
SetTrackBase::mTrackIndex
int mTrackIndex
Definition: SetTrackInfoCommand.h:34
SetTrackBase::mbPromptForTracks
bool mbPromptForTracks
Definition: SetTrackInfoCommand.h:40
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1484
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2459
XO
#define XO(s)
Definition: Internat.h:31
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
ShuttleParams::OptionalN
virtual ShuttleParams & OptionalN(bool &var)
Definition: Shuttle.h:72
SetTrackBase::bIsSecondChannel
bool bIsSecondChannel
Definition: SetTrackInfoCommand.h:39
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
SetTrackBase::bHasChannelIndex
bool bHasChannelIndex
Definition: SetTrackInfoCommand.h:37
ShuttleParams::OptionalY
virtual ShuttleParams & OptionalY(bool &var)
Definition: Shuttle.h:71
ShuttleGuiBase::TieNumericTextBox
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, int &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1673
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:506
SetTrackBase::mChannelIndex
int mChannelIndex
Definition: SetTrackInfoCommand.h:35
SetTrackBase::bHasTrackIndex
bool bHasTrackIndex
Definition: SetTrackInfoCommand.h:36
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
ShuttleGui::Optional
ShuttleGui & Optional(bool &bVar)
Definition: ShuttleGui.cpp:2280
SetTrackBase::ApplyInner
virtual bool ApplyInner(const CommandContext &context, Track *t)
Definition: SetTrackInfoCommand.cpp:62
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:202
CommandContext::project
AudacityProject & project
Definition: CommandContext.h:64