Audacity  2.2.2
MessageCommand.cpp
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  Dan Horgan
8 
9 ******************************************************************//*******************************************************************/
15 
16 #include "../Audacity.h"
17 #include "MessageCommand.h"
18 #include "CommandType.h"
19 
21 {
22  return wxT("Message");
23 }
24 
26 {
27  auto stringValidator = make_movable<DefaultValidator>();
28  signature.AddParameter(wxT("MessageString"), wxT("Connected"), std::move(stringValidator));
29 }
30 
31 CommandHolder MessageCommandType::Create(std::unique_ptr<CommandOutputTarget> &&target)
32 {
33  return std::make_shared<MessageCommand>(*this, std::move(target));
34 }
35 
37 {
38  wxString message = GetString(wxT("MessageString"));
39  Status(message);
40  return true;
41 }
void BuildSignature(CommandSignature &signature) override
Postcondition: signature is a 'signature' map containing parameter.
std::shared_ptr< Command > CommandHolder
Contains declarations for CommandType class.
void AddParameter(const wxString &name, const wxVariant &dft, movable_ptr< Validator > &&valid)
wxString GetString(const wxString &paramName)
Definition: Command.cpp:165
void Status(const wxString &status) override
Definition: Command.cpp:179
Represents a context to which a command may be applied.
Definition: Command.h:50
bool Apply(CommandExecutionContext context) override
CommandHolder Create(std::unique_ptr< CommandOutputTarget > &&target) override
Contains definition of MessageCommand class.
wxString BuildName() override
Class that maps parameter names to default values and validators.