Audacity  2.2.0
ImportExportCommands.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4  Audacity(R) is copyright (c) 1999-2009 Audacity Team.
5  File License: wxwidgets
6 
7  ImportExportCommands.h
8  Dan Horgan
9 
10 ******************************************************************//*******************************************************************/
19 
20 #include "Command.h"
21 #include "CommandType.h"
22 
23 // Import
24 
25 class ImportCommandType final : public CommandType
26 {
27 public:
28  wxString BuildName() override;
29  void BuildSignature(CommandSignature &signature) override;
30  CommandHolder Create(std::unique_ptr<CommandOutputTarget> &&target) override;
31 };
32 
34 {
35 public:
37  std::unique_ptr<CommandOutputTarget> &&target)
38  : CommandImplementation(type, std::move(target))
39  { }
40 
41  virtual ~ImportCommand();
42  bool Apply(CommandExecutionContext context) override;
43 };
44 
45 // Export
46 
47 class ExportCommandType final : public CommandType
48 {
49 public:
50  wxString BuildName() override;
51  void BuildSignature(CommandSignature &signature) override;
52  CommandHolder Create(std::unique_ptr<CommandOutputTarget> &&target) override;
53 };
54 
56 {
57 public:
59  std::unique_ptr<CommandOutputTarget> &&target)
60  : CommandImplementation(type, std::move(target))
61  { }
62 
63  virtual ~ExportCommand();
64  bool Apply(CommandExecutionContext context) override;
65 };
CommandHolder Create(std::unique_ptr< CommandOutputTarget > &&target) override
Definition: ImportExportCommands.cpp:34
Definition: ImportExportCommands.h:25
bool Apply(CommandExecutionContext context) override
Definition: ImportExportCommands.cpp:39
std::shared_ptr< Command > CommandHolder
Definition: AppCommandEvent.h:26
Contains declarations for CommandType class.
Command for importing audio.
Definition: ImportExportCommands.h:33
Contains declaration of Command base class.
virtual ~ExportCommand()
Definition: ImportExportCommands.cpp:121
virtual ~ImportCommand()
Definition: ImportExportCommands.cpp:45
Command for exporting audio.
Definition: ImportExportCommands.h:55
void BuildSignature(CommandSignature &signature) override
Postcondition: signature is a 'signature' map containing parameter.
Definition: ImportExportCommands.cpp:28
is derived from Command. It validates and applies the command. CommandImplementation::Apply() is over...
Definition: Command.h:118
Base class for containing data common to all commands of a given type. Also acts as a factory...
Definition: CommandType.h:29
ExportCommand(CommandType &type, std::unique_ptr< CommandOutputTarget > &&target)
Definition: ImportExportCommands.h:58
Definition: ImportExportCommands.h:47
void BuildSignature(CommandSignature &signature) override
Postcondition: signature is a 'signature' map containing parameter.
Definition: ImportExportCommands.cpp:55
bool Apply(CommandExecutionContext context) override
Definition: ImportExportCommands.cpp:74
wxString BuildName() override
Definition: ImportExportCommands.cpp:50
Represents a context to which a command may be applied.
Definition: Command.h:50
ImportCommand(CommandType &type, std::unique_ptr< CommandOutputTarget > &&target)
Definition: ImportExportCommands.h:36
CommandHolder Create(std::unique_ptr< CommandOutputTarget > &&target) override
Definition: ImportExportCommands.cpp:69
Class that maps parameter names to default values and validators.
Definition: CommandSignature.h:28
wxString BuildName() override
Definition: ImportExportCommands.cpp:23