Audacity 3.2.0
CommandType.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 Dan Horgan
8
9******************************************************************//*******************************************************************/
15
16#ifndef __COMMANDTYPE__
17#define __COMMANDTYPE__
18
19#include "CommandSignature.h"
20#include "../commands/AudacityCommand.h"
21
22class OldStyleCommand;
23
24/**************************************************************/
37using OldStyleCommandPointer = std::shared_ptr<OldStyleCommand>;
40class wxString;
41
42#include <optional>
43
44class AUDACITY_DLL_API OldStyleCommandType : public AudacityCommand
45{
46private:
47 std::optional<CommandSignature> mSignature;
48
49public:
51 virtual ~OldStyleCommandType();
52 ComponentInterfaceSymbol GetSymbol() const override;
53 CommandSignature &GetSignature();
54 wxString Describe(); // for debugging only ?
55
56 // Subclasses should override the following:
57 // =========================================
58
59 // Return the name of the command type
61
63 // names, validators and default values.
64 virtual void BuildSignature(CommandSignature &signature) = 0;
65
66 // Create a command instance with the specified output target
68 AudacityProject &project, std::unique_ptr<CommandOutputTargets> &&target) = 0;
69};
70
71#endif /* End of include guard: __COMMANDTYPE__ */
Declaration of CommandSignature class.
const auto project
Base class for command in Audacity.
ComponentInterfaceSymbol GetSymbol() const override=0
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
CommandOutputTargets a mix of three output classes to output progress indication, status messages and...
Class that maps parameter names to default values and validators.
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Abstract base class for command interface. This is the version created by Dan Horgan....
Definition: Command.h:30
OldStyleCommandPointer is a unique_ptr to an OldStyleCommand.
Base class for containing data common to all commands of a given type. Also acts as a factory.
Definition: CommandType.h:45
virtual ComponentInterfaceSymbol BuildName() const =0
std::optional< CommandSignature > mSignature
Definition: CommandType.h:47
virtual OldStyleCommandPointer Create(AudacityProject &project, std::unique_ptr< CommandOutputTargets > &&target)=0
virtual void BuildSignature(CommandSignature &signature)=0
Postcondition: signature is a 'signature' map containing parameter.