Audacity  3.0.3
SetTrackInfoCommand.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity - A Digital Audio Editor
4  Copyright 1999-2018 Audacity Team
5  License: wxwidgets
6 
7  Dan Horgan
8  James Crook
9 
10 ******************************************************************//*******************************************************************/
16 
17 #ifndef __SET_TRACK_COMMAND__
18 #define __SET_TRACK_COMMAND__
19 
20 #include "Command.h"
21 #include "CommandType.h"
22 
23 class Track;
24 
26 {
27 public:
28  SetTrackBase();
29  bool Apply(const CommandContext & context) override;
30  virtual bool ApplyInner( const CommandContext &context, Track *t );
31  virtual bool DefineParams( ShuttleParams & S ) override;
32  virtual void PopulateOrExchange(ShuttleGui & S) override;
33 
38 
41 };
42 
43 
45 {
46 public:
48 
49  //SetTrackStatusCommand();
50  // ComponentInterface overrides
52  TranslatableString GetDescription() override {return XO("Sets various values for a track.");};
53  bool DefineParams( ShuttleParams & S ) override;
54  void PopulateOrExchange(ShuttleGui & S) override;
55 
56  // AudacityCommand overrides
57  ManualPageID ManualPage() override {return L"Extra_Menu:_Scriptables_I#set_track_status";}
58  bool ApplyInner( const CommandContext & context, Track * t ) override;
59 
60 public:
61  wxString mTrackName;
62  bool bSelected;
63  bool bFocused;
64 
65 // For tracking optional parameters.
69 };
70 
72 {
73 public:
75 
76  //SetTrackAudioCommand();
77  // ComponentInterface overrides
79  TranslatableString GetDescription() override {return XO("Sets various values for a track.");};
80  bool DefineParams( ShuttleParams & S ) override;
81  void PopulateOrExchange(ShuttleGui & S) override;
82 
83  // AudacityCommand overrides
84  ManualPageID ManualPage() override {return L"Extra_Menu:_Scriptables_I#set_track_audio";}
85  bool ApplyInner( const CommandContext & context, Track * t ) override;
86 
87 public:
88  double mPan;
89  double mGain;
90  bool bSolo;
91  bool bMute;
92 
93 // For tracking optional parameters.
94  bool bHasPan;
95  bool bHasGain;
96  bool bHasSolo;
97  bool bHasMute;
98 };
99 
101 {
102 public:
104 
105  //SetTrackVisualsCommand();
106  // ComponentInterface overrides
108  TranslatableString GetDescription() override {return XO("Sets various values for a track.");};
109  bool DefineParams( ShuttleParams & S ) override;
110  void PopulateOrExchange(ShuttleGui & S) override;
111 
112  // AudacityCommand overrides
113  ManualPageID ManualPage() override {return L"Extra_Menu:_Scriptables_I#set_track_visuals";}
114  bool ApplyInner( const CommandContext & context, Track * t ) override;
115 
116 public:
117  int mColour;
118  int mHeight;
121  int mVZoom;
122  double mVZoomTop;
123  double mVZoomBottom;
124 
128 
129 // For tracking optional parameters.
134  bool bHasVZoom;
137 
141 };
142 
144 {
145 public:
147 
148  SetTrackCommand();
149  // ComponentInterface overrides
151  TranslatableString GetDescription() override {return XO("Sets various values for a track.");};
152  // AudacityCommand overrides
153  ManualPageID ManualPage() override {return L"Extra_Menu:_Scriptables_II#set_track";}
154 
155 public:
156 
157  bool DefineParams( ShuttleParams & S ) override {
158  return
160  mSetStatus.DefineParams(S) &&
161  mSetAudio.DefineParams(S) &&
163  };
164  void PopulateOrExchange(ShuttleGui & S) override {
169  };
170  bool ApplyInner(const CommandContext & context, Track * t ) override {
174  return
175  mSetStatus.ApplyInner( context, t ) &&
176  mSetAudio.ApplyInner( context, t )&&
177  mSetVisuals.ApplyInner( context, t );
178  }
179 
180 private:
184 };
185 
186 
187 
188 #endif /* End of include guard: __SETTRACKINFOCOMMAND__ */
SetTrackBase::mTrackIndex
int mTrackIndex
Definition: SetTrackInfoCommand.h:34
SetTrackVisualsCommand::bHasScaleType
bool bHasScaleType
Definition: SetTrackInfoCommand.h:133
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
SetTrackAudioCommand::bHasGain
bool bHasGain
Definition: SetTrackInfoCommand.h:95
SetTrackVisualsCommand::mSpecColorScheme
int mSpecColorScheme
Definition: SetTrackInfoCommand.h:127
SetTrackAudioCommand::bMute
bool bMute
Definition: SetTrackInfoCommand.h:91
SetTrackVisualsCommand::bSpectralSelect
bool bSpectralSelect
Definition: SetTrackInfoCommand.h:126
SetTrackAudioCommand::ApplyInner
bool ApplyInner(const CommandContext &context, Track *t) override
Definition: SetTrackInfoCommand.cpp:221
SetTrackVisualsCommand::bHasVZoomBottom
bool bHasVZoomBottom
Definition: SetTrackInfoCommand.h:136
SetTrackVisualsCommand::bHasHeight
bool bHasHeight
Definition: SetTrackInfoCommand.h:131
SetTrackBase::mbPromptForTracks
bool mbPromptForTracks
Definition: SetTrackInfoCommand.h:40
SetTrackVisualsCommand::mColour
int mColour
Definition: SetTrackInfoCommand.h:117
SetTrackCommand::SetTrackCommand
SetTrackCommand()
Definition: SetTrackInfoCommand.cpp:460
SetTrackCommand::GetDescription
TranslatableString GetDescription() override
Definition: SetTrackInfoCommand.h:151
SetTrackStatusCommand::bHasFocused
bool bHasFocused
Definition: SetTrackInfoCommand.h:68
SetTrackBase::SetTrackBase
SetTrackBase()
Definition: SetTrackInfoCommand.cpp:52
SetTrackStatusCommand::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: SetTrackInfoCommand.cpp:130
SetTrackCommand::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: SetTrackInfoCommand.h:150
SetTrackStatusCommand::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: SetTrackInfoCommand.h:51
XO
#define XO(s)
Definition: Internat.h:31
SetTrackCommand::mSetStatus
SetTrackStatusCommand mSetStatus
Definition: SetTrackInfoCommand.h:181
ShuttleParams
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:62
SetTrackCommand::mSetAudio
SetTrackAudioCommand mSetAudio
Definition: SetTrackInfoCommand.h:182
SetTrackBase::DefineParams
virtual bool DefineParams(ShuttleParams &S) override
Definition: SetTrackInfoCommand.cpp:70
SetTrackVisualsCommand::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: SetTrackInfoCommand.cpp:306
SetTrackAudioCommand::bHasPan
bool bHasPan
Definition: SetTrackInfoCommand.h:94
SetTrackVisualsCommand::ManualPage
ManualPageID ManualPage() override
Definition: SetTrackInfoCommand.h:113
SetTrackStatusCommand::ManualPage
ManualPageID ManualPage() override
Definition: SetTrackInfoCommand.h:57
SetTrackStatusCommand::bHasSelected
bool bHasSelected
Definition: SetTrackInfoCommand.h:67
SetTrackStatusCommand::ApplyInner
bool ApplyInner(const CommandContext &context, Track *t) override
Definition: SetTrackInfoCommand.cpp:157
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
SetTrackAudioCommand::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: SetTrackInfoCommand.cpp:202
SetTrackCommand::ApplyInner
bool ApplyInner(const CommandContext &context, Track *t) override
Definition: SetTrackInfoCommand.h:170
SetTrackVisualsCommand
A SetTrackBase that sets appearance of a track.
Definition: SetTrackInfoCommand.h:101
SetTrackVisualsCommand::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: SetTrackInfoCommand.h:107
SetTrackBase::bIsSecondChannel
bool bIsSecondChannel
Definition: SetTrackInfoCommand.h:39
SetTrackVisualsCommand::bHasUseSpecPrefs
bool bHasUseSpecPrefs
Definition: SetTrackInfoCommand.h:138
SetTrackBase
Base class for the various SetTrackCommand classes. Sbclasses provide the settings that are relevan...
Definition: SetTrackInfoCommand.h:26
SetTrackVisualsCommand::mVZoomBottom
double mVZoomBottom
Definition: SetTrackInfoCommand.h:123
SetTrackVisualsCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: SetTrackInfoCommand.h:103
SetTrackAudioCommand::mPan
double mPan
Definition: SetTrackInfoCommand.h:88
SetTrackCommand::mSetVisuals
SetTrackVisualsCommand mSetVisuals
Definition: SetTrackInfoCommand.h:183
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition: CommandContext.h:34
SetTrackCommand::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: SetTrackInfoCommand.h:157
SetTrackBase::Apply
bool Apply(const CommandContext &context) override
Definition: SetTrackInfoCommand.cpp:97
SetTrackStatusCommand::bHasTrackName
bool bHasTrackName
Definition: SetTrackInfoCommand.h:66
SetTrackVisualsCommand::bHasDisplayType
bool bHasDisplayType
Definition: SetTrackInfoCommand.h:132
SetTrackStatusCommand::GetDescription
TranslatableString GetDescription() override
Definition: SetTrackInfoCommand.h:52
SetTrackBase::bHasChannelIndex
bool bHasChannelIndex
Definition: SetTrackInfoCommand.h:37
AudacityCommand
Base class for command in Audacity.
Definition: AudacityCommand.h:41
SetTrackAudioCommand::mGain
double mGain
Definition: SetTrackInfoCommand.h:89
SetTrackVisualsCommand::mScaleType
int mScaleType
Definition: SetTrackInfoCommand.h:120
SetTrackVisualsCommand::GetDescription
TranslatableString GetDescription() override
Definition: SetTrackInfoCommand.h:108
SetTrackStatusCommand::bSelected
bool bSelected
Definition: SetTrackInfoCommand.h:62
SetTrackCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: SetTrackInfoCommand.h:146
SetTrackStatusCommand::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: SetTrackInfoCommand.cpp:139
SetTrackVisualsCommand::bUseSpecPrefs
bool bUseSpecPrefs
Definition: SetTrackInfoCommand.h:125
SetTrackAudioCommand::GetDescription
TranslatableString GetDescription() override
Definition: SetTrackInfoCommand.h:79
SetTrackAudioCommand::bSolo
bool bSolo
Definition: SetTrackInfoCommand.h:90
SetTrackStatusCommand::bFocused
bool bFocused
Definition: SetTrackInfoCommand.h:63
CommandType.h
Contains declarations for CommandType class.
SetTrackAudioCommand
A SetTrackBase that sets pan, gain, mute and solo.
Definition: SetTrackInfoCommand.h:72
SetTrackAudioCommand::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: SetTrackInfoCommand.h:78
SetTrackStatusCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: SetTrackInfoCommand.h:47
SetTrackVisualsCommand::bHasSpectralSelect
bool bHasSpectralSelect
Definition: SetTrackInfoCommand.h:139
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:239
TaggedIdentifier< ManualPageIDTag >
SetTrackCommand
A SetTrackBase that combines SetTrackStatusCommand, SetTrackAudioCommand and SetTrackVisualsCommand.
Definition: SetTrackInfoCommand.h:144
SetTrackAudioCommand::ManualPage
ManualPageID ManualPage() override
Definition: SetTrackInfoCommand.h:84
SetTrackVisualsCommand::bHasColour
bool bHasColour
Definition: SetTrackInfoCommand.h:130
SetTrackStatusCommand
A SetTrackBase that sets name, selected and focus.
Definition: SetTrackInfoCommand.h:45
SetTrackVisualsCommand::bHasVZoom
bool bHasVZoom
Definition: SetTrackInfoCommand.h:134
SetTrackCommand::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: SetTrackInfoCommand.h:164
SetTrackCommand::ManualPage
ManualPageID ManualPage() override
Definition: SetTrackInfoCommand.h:153
SetTrackAudioCommand::bHasSolo
bool bHasSolo
Definition: SetTrackInfoCommand.h:96
SetTrackVisualsCommand::ApplyInner
bool ApplyInner(const CommandContext &context, Track *t) override
Definition: SetTrackInfoCommand.cpp:373
SetTrackBase::mChannelIndex
int mChannelIndex
Definition: SetTrackInfoCommand.h:35
SetTrackBase::bHasTrackIndex
bool bHasTrackIndex
Definition: SetTrackInfoCommand.h:36
SetTrackVisualsCommand::bHasSpecColorScheme
bool bHasSpecColorScheme
Definition: SetTrackInfoCommand.h:140
Command.h
Contains declaration of Command base class.
SetTrackBase::PopulateOrExchange
virtual void PopulateOrExchange(ShuttleGui &S) override
Definition: SetTrackInfoCommand.cpp:80
SetTrackBase::ApplyInner
virtual bool ApplyInner(const CommandContext &context, Track *t)
Definition: SetTrackInfoCommand.cpp:62
SetTrackVisualsCommand::mDisplayType
int mDisplayType
Definition: SetTrackInfoCommand.h:119
SetTrackVisualsCommand::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: SetTrackInfoCommand.cpp:330
SetTrackStatusCommand::mTrackName
wxString mTrackName
Definition: SetTrackInfoCommand.h:61
SetTrackVisualsCommand::mVZoom
int mVZoom
Definition: SetTrackInfoCommand.h:121
SetTrackAudioCommand::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: SetTrackInfoCommand.cpp:192
SetTrackVisualsCommand::mVZoomTop
double mVZoomTop
Definition: SetTrackInfoCommand.h:122
SetTrackVisualsCommand::mHeight
int mHeight
Definition: SetTrackInfoCommand.h:118
SetTrackVisualsCommand::bHasVZoomTop
bool bHasVZoomTop
Definition: SetTrackInfoCommand.h:135
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
SetTrackAudioCommand::bHasMute
bool bHasMute
Definition: SetTrackInfoCommand.h:97
SetTrackAudioCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: SetTrackInfoCommand.h:74