Audacity  2.2.2
Public Member Functions | List of all members
GetAllMenuCommands Class Referencefinal

Command which outputs a list of available menu commands on the status channel. More...

#include <GetAllMenuCommands.h>

Inheritance diagram for GetAllMenuCommands:
CommandImplementation Command

Public Member Functions

 GetAllMenuCommands (CommandType &type, std::unique_ptr< CommandOutputTarget > &&target)
 
virtual ~GetAllMenuCommands ()
 
bool Apply (CommandExecutionContext context) override
 
- Public Member Functions inherited from CommandImplementation
void Progress (double completed)
 
void Status (const wxString &status) override
 
void Error (const wxString &message) override
 
 CommandImplementation (CommandType &type, std::unique_ptr< CommandOutputTarget > &&output)
 
virtual ~CommandImplementation ()
 
wxString GetName ()
 An instance method for getting the command name (for consistency) More...
 
CommandSignatureGetSignature ()
 Get the signature of the command. More...
 
bool SetParameter (const wxString &paramName, const wxVariant &paramValue)
 
- Public Member Functions inherited from Command
virtual ~Command ()
 

Additional Inherited Members

- Protected Member Functions inherited from CommandImplementation
void TypeCheck (const wxString &typeName, const wxString &paramName, const wxVariant &param)
 
void CheckParam (const wxString &paramName)
 
bool GetBool (const wxString &paramName)
 
long GetLong (const wxString &paramName)
 
double GetDouble (const wxString &paramName)
 
wxString GetString (const wxString &paramName)
 
- Protected Attributes inherited from CommandImplementation
std::unique_ptr
< CommandOutputTarget
mOutput
 

Detailed Description

Command which outputs a list of available menu commands on the status channel.

Definition at line 34 of file GetAllMenuCommands.h.

Constructor & Destructor Documentation

GetAllMenuCommands::GetAllMenuCommands ( CommandType type,
std::unique_ptr< CommandOutputTarget > &&  target 
)
inline

Definition at line 37 of file GetAllMenuCommands.h.

39  : CommandImplementation(type, std::move(target))
40  { }
CommandImplementation(CommandType &type, std::unique_ptr< CommandOutputTarget > &&output)
Definition: Command.cpp:94
virtual GetAllMenuCommands::~GetAllMenuCommands ( )
inlinevirtual

Definition at line 42 of file GetAllMenuCommands.h.

43  { }

Member Function Documentation

bool GetAllMenuCommands::Apply ( CommandExecutionContext  context)
overridevirtual

Actually carry out the command. Return true if successful and false otherwise.

Reimplemented from CommandImplementation.

Definition at line 36 of file GetAllMenuCommands.cpp.

References CommandManager::GetAllCommandNames(), CommandImplementation::GetBool(), AudacityProject::GetCommandManager(), CommandManager::GetEnabled(), CommandExecutionContext::GetProject(), name, names(), and CommandImplementation::Status().

37 {
38  bool showStatus = GetBool(wxT("ShowStatus"));
39  wxArrayString names;
40  CommandManager *cmdManager = context.GetProject()->GetCommandManager();
41  cmdManager->GetAllCommandNames(names, false);
42  wxArrayString::iterator iter;
43  for (iter = names.begin(); iter != names.end(); ++iter)
44  {
45  wxString name = *iter;
46  wxString out = name;
47  if (showStatus)
48  {
49  out += wxT("\t");
50  out += cmdManager->GetEnabled(name) ? wxT("Enabled") : wxT("Disabled");
51  }
52  Status(out);
53  }
54  return true;
55 }
bool GetEnabled(const wxString &name)
static wxArrayString names()
Definition: Tags.cpp:698
CommandManager * GetCommandManager()
Definition: Project.h:325
CommandManager implements a system for organizing all user-callable commands.
void Status(const wxString &status) override
Definition: Command.cpp:169
const wxChar * name
Definition: Distortion.cpp:94
AudacityProject * GetProject() const
Definition: Command.h:60
void GetAllCommandNames(wxArrayString &names, bool includeMultis)
bool GetBool(const wxString &paramName)
Definition: Command.cpp:131

The documentation for this class was generated from the following files: