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

Command for saving an Audacity project. More...

#include <OpenSaveCommands.h>

Inheritance diagram for SaveProjectCommand:
CommandImplementation Command

Public Member Functions

 SaveProjectCommand (CommandType &type, std::unique_ptr< CommandOutputTarget > &&target)
virtual ~SaveProjectCommand ()
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 HasParam (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
< CommandOutputTarget

Detailed Description

Command for saving an Audacity project.

Definition at line 55 of file OpenSaveCommands.h.

Constructor & Destructor Documentation

SaveProjectCommand::SaveProjectCommand ( CommandType type,
std::unique_ptr< CommandOutputTarget > &&  target 

Definition at line 58 of file OpenSaveCommands.h.

60  : CommandImplementation(type, std::move(target))
61  { }
CommandImplementation(CommandType &type, std::unique_ptr< CommandOutputTarget > &&output)
Definition: Command.cpp:95
SaveProjectCommand::~SaveProjectCommand ( )

Definition at line 101 of file OpenSaveCommands.cpp.

102 { }

Member Function Documentation

bool SaveProjectCommand::Apply ( CommandExecutionContext  context)

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

Reimplemented from CommandImplementation.

Definition at line 90 of file OpenSaveCommands.cpp.

References CommandImplementation::GetBool(), CommandExecutionContext::GetProject(), CommandImplementation::GetString(), and AudacityProject::SaveAs().

91 {
92  wxString fileName = GetString(wxT("Filename"));
93  bool saveCompressed = GetBool(wxT("Compress"));
94  bool addToHistory = GetBool(wxT("AddToHistory"));
95  if(fileName == wxEmptyString)
96  return context.GetProject()->SaveAs(saveCompressed);
97  else
98  return context.GetProject()->SaveAs(fileName,saveCompressed,addToHistory);
99 }
wxString GetString(const wxString &paramName)
Definition: Command.cpp:165
bool SaveAs(bool bWantSaveCompressed=false)
Definition: Project.cpp:4364
AudacityProject * GetProject() const
Definition: Command.h:60
bool GetBool(const wxString &paramName)
Definition: Command.cpp:141

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