Audacity  2.3.1
SelectCommand.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity - A Digital Audio Editor
4  Copyright 1999-2018 Audacity Team
5  License: GPL v2 - see LICENSE.txt
6 
7  Dan Horgan
8  James Crook
9 
10 ******************************************************************//*******************************************************************/
16 
17 #ifndef __SELECT_COMMAND__
18 #define __SELECT_COMMAND__
19 
20 
21 
22 #include "CommandType.h"
23 #include "Command.h"
24 
25 //#include "../commands/AudacityCommand.h"
26 
27 
28 #define SELECT_TIME_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Select Time") }
29 #define SELECT_FREQUENCIES_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Select Frequencies") }
30 #define SELECT_TRACKS_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Select Tracks") }
31 #define SELECT_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Select") }
32 
34 {
35 public:
36  // ComponentInterface overrides
38  wxString GetDescription() override {return _("Selects a time range.");};
39  bool DefineParams( ShuttleParams & S ) override;
40  void PopulateOrExchange(ShuttleGui & S) override;
41  bool Apply(const CommandContext & context) override;
42 
43  // AudacityCommand overrides
44  wxString ManualPage() override {return wxT("Extra_Menu:_Scriptables_I#select_time");};
45 
46  bool bHasT0;
47  bool bHasT1;
50 
51  double mT0;
52  double mT1;
54  bool mFromEnd;
55 };
56 
58 {
59 public:
60  // ComponentInterface overrides
62  wxString GetDescription() override {return _("Selects a frequency range.");};
63  bool DefineParams( ShuttleParams & S ) override;
64  void PopulateOrExchange(ShuttleGui & S) override;
65  bool Apply(const CommandContext & context) override;
66 
67  // AudacityCommand overrides
68  wxString ManualPage() override {return wxT("Extra_Menu:_Scriptables_I#select_frequencies");};
69 
70  bool bHasBottom;
71  bool bHasTop;
72 
73  double mBottom;
74  double mTop;
75 };
76 
77 
79 {
80 public:
81  // ComponentInterface overrides
83  wxString GetDescription() override {return _("Selects a range of tracks.");};
84  bool DefineParams( ShuttleParams & S ) override;
85  void PopulateOrExchange(ShuttleGui & S) override;
86  bool Apply(const CommandContext & context) override;
87  // AudacityCommand overrides
88  wxString ManualPage() override {return wxT("Extra_Menu:_Scriptables_I#select_tracks");};
89 
90  bool bHasFirstTrack;
92  bool bHasMode;
93 
94  double mFirstTrack;
95  double mNumTracks;
96  int mMode;
97 };
98 
99 
101 {
102 public:
103  // ComponentInterface overrides
105  wxString GetDescription() override {return _("Selects Audio.");};
106  bool DefineParams( ShuttleParams & S ) override {
107  return
108  mSelTime.DefineParams(S) &&
109  mSelFreq.DefineParams(S) &&
111  };
112  void PopulateOrExchange(ShuttleGui & S) override {
116  };
117  bool Apply(const CommandContext & context) override {
118  return
119  mSelTime.Apply(context) &&
120  mSelFreq.Apply( context )&&
121  mSelTracks.Apply(context);
122  }
123  // AudacityCommand overrides
124  wxString ManualPage() override {return wxT("Extra_Menu:_Scriptables_II#select");};
125 private:
129 
130 
131 };
132 
133 #endif /* End of include guard: __SELECT_COMMAND__ */
#define SELECT_TIME_PLUGIN_SYMBOL
Definition: SelectCommand.h:28
bool Apply(const CommandContext &context) override
bool DefineParams(ShuttleParams &S) override
bool Apply(const CommandContext &context) override
SelectTimeCommand mSelTime
#define SELECT_PLUGIN_SYMBOL
Definition: SelectCommand.h:31
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
bool Apply(const CommandContext &context) override
ComponentInterfaceSymbol GetSymbol() override
Definition: SelectCommand.h:61
bool Apply(const CommandContext &context) override
#define SELECT_TRACKS_PLUGIN_SYMBOL
Definition: SelectCommand.h:30
void PopulateOrExchange(ShuttleGui &S) override
Contains declarations for CommandType class.
Contains declaration of Command base class.
Command for changing time, frequency and track selection. This class is a little baroque, as it uses the SelectTimeCommand, SelectFrequenciesCommand and SelectTracksCommand, when it could just explicitly code all three.
CommandContext provides addiitonal information to an 'Apply()' command. It provides the project...
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:60
wxString ManualPage() override
Definition: SelectCommand.h:44
#define SELECT_FREQUENCIES_PLUGIN_SYMBOL
Definition: SelectCommand.h:29
wxString ManualPage() override
Definition: SelectCommand.h:88
void PopulateOrExchange(ShuttleGui &S) override
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional...
bool DefineParams(ShuttleParams &S) override
SelectFrequenciesCommand mSelFreq
void PopulateOrExchange(ShuttleGui &S) override
SelectTracksCommand mSelTracks
wxString ManualPage() override
wxString GetDescription() override
Definition: SelectCommand.h:62
void PopulateOrExchange(ShuttleGui &S) override
Command for changing the time selection.
Definition: SelectCommand.h:33
bool DefineParams(ShuttleParams &S) override
wxString ManualPage() override
Definition: SelectCommand.h:68
Base class for command in Audacity.
wxString GetDescription() override
ComponentInterfaceSymbol GetSymbol() override
ComponentInterfaceSymbol GetSymbol() override
Definition: SelectCommand.h:37
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
bool DefineParams(ShuttleParams &S) override
Command for changing the selection of tracks.
Definition: SelectCommand.h:78
Command for changing the frequency selection.
Definition: SelectCommand.h:57
wxString GetDescription() override
Definition: SelectCommand.h:83
wxString GetDescription() override
Definition: SelectCommand.h:38
virtual bool Apply()
ComponentInterfaceSymbol GetSymbol() override
Definition: SelectCommand.h:82