Audacity  2.2.0
GetProjectInfoCommand.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity - A Digital Audio Editor
4  Copyright 1999-2009 Audacity Team
5  License: wxwidgets
6 
7  Marty Goddard
8 
9 ******************************************************************//*******************************************************************/
15 
16 #ifndef __GETPROJECTINFOCOMMAND__
17 #define __GETPROJECTINFOCOMMAND__
18 
19 #include "Command.h"
20 #include "CommandType.h"
21 
23 {
24 public:
25  wxString BuildName() override;
26  void BuildSignature(CommandSignature &signature) override;
27  CommandHolder Create(std::unique_ptr<CommandOutputTarget> &&target) override;
28 };
29 
30 
32 {
33 public:
34  GetProjectInfoCommand(CommandType &type, std::unique_ptr<CommandOutputTarget> &&target)
35  : CommandImplementation(type, std::move(target))
36  { }
38  { }
39 
40  bool Apply(CommandExecutionContext context) override;
41 
42 private:
45 
46 // Function pointer to get a particular (Boolean only) Track parameter
47  typedef bool (GetProjectInfoCommand::*Getter)(const Track *track) const;
48 
49 // Uses the Function pointer to set a particular parameter within a loop of otherwise duplicate code
50  void SendTracksInfo(TrackList *projTracks, Getter);
51 
52 // Functions pointed to for getting track parameters
53  bool testSelected(const Track * track) const;
54  bool testLinked(const Track * track) const;
55  bool testSolo(const Track * track) const;
56  bool testMute(const Track * track) const;
57 };
58 
59 
60 
61 
62 
63 
64 
65 
66 #endif /* End of include guard: __GETPROJECTINFOCOMMAND__ */
A list of TrackListNode items.
Definition: Track.h:532
Command that returns requested project information.
Definition: GetProjectInfoCommand.h:31
std::shared_ptr< Command > CommandHolder
Definition: AppCommandEvent.h:26
Contains declarations for CommandType class.
bool(GetProjectInfoCommand::* Getter)(const Track *track) const
Definition: GetProjectInfoCommand.h:47
int SendNumberOfTracks(CommandExecutionContext context)
Definition: GetProjectInfoCommand.cpp:92
Contains declaration of Command base class.
GetProjectInfoCommand(CommandType &type, std::unique_ptr< CommandOutputTarget > &&target)
Definition: GetProjectInfoCommand.h:34
bool testSelected(const Track *track) const
Definition: GetProjectInfoCommand.cpp:152
bool Apply(CommandExecutionContext context) override
Definition: GetProjectInfoCommand.cpp:49
bool testSolo(const Track *track) const
Definition: GetProjectInfoCommand.cpp:162
Definition: Command.h:108
Base class for containing data common to all commands of a given type. Also acts as a factory...
Definition: CommandType.h:29
bool testMute(const Track *track) const
Definition: GetProjectInfoCommand.cpp:168
CommandHolder Create(std::unique_ptr< CommandOutputTarget > &&target) override
Definition: GetProjectInfoCommand.cpp:42
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:85
bool testLinked(const Track *track) const
Definition: GetProjectInfoCommand.cpp:157
Definition: GetProjectInfoCommand.h:22
int SendFocusedTrackIndex(CommandExecutionContext context)
Definition: GetProjectInfoCommand.cpp:109
void BuildSignature(CommandSignature &signature) override
Postcondition: signature is a 'signature' map containing parameter.
Definition: GetProjectInfoCommand.cpp:29
Represents a context to which a command may be applied.
Definition: Command.h:40
wxString BuildName() override
Definition: GetProjectInfoCommand.cpp:24
void SendTracksInfo(TrackList *projTracks, Getter)
Definition: GetProjectInfoCommand.cpp:135
Class that maps parameter names to default values and validators.
Definition: CommandSignature.h:28
virtual ~GetProjectInfoCommand()
Definition: GetProjectInfoCommand.h:37