Audacity 3.2.0
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
SaveProjectCommand Class Reference

Command for saving an Audacity project. More...

#include <OpenSaveCommands.h>

Inheritance diagram for SaveProjectCommand:
[legend]
Collaboration diagram for SaveProjectCommand:
[legend]

Public Member Functions

ComponentInterfaceSymbol GetSymbol () const override
 
TranslatableString GetDescription () const override
 
template<bool Const>
bool VisitSettings (SettingsVisitorBase< Const > &S)
 
bool VisitSettings (SettingsVisitor &S) override
 
bool VisitSettings (ConstSettingsVisitor &S) override
 
void PopulateOrExchange (ShuttleGui &S) override
 
bool Apply (const CommandContext &context) override
 
ManualPageID ManualPage () override
 
- Public Member Functions inherited from AudacityCommand
 AudacityCommand ()
 
virtual ~AudacityCommand ()
 
PluginPath GetPath () const override
 
VendorSymbol GetVendor () const override
 
wxString GetVersion () const override
 
ComponentInterfaceSymbol GetSymbol () const override=0
 
virtual TranslatableString GetDescription () const override
 
virtual ManualPageID ManualPage ()
 
virtual bool IsBatchProcessing () const
 
virtual void SetBatchProcessing (bool start)
 
virtual bool Apply (const CommandContext &WXUNUSED(context))
 
bool ShowInterface (wxWindow *parent, bool forceModal=false)
 
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
 
bool SaveSettingsAsString (wxString &parms)
 
bool LoadSettingsFromString (const wxString &parms)
 
bool DoAudacityCommand (wxWindow *parent, const CommandContext &context, bool shouldPrompt=true)
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
virtual bool Init ()
 
virtual bool PromptUser (wxWindow *parent)
 
virtual bool CheckWhetherSkipAudacityCommand ()
 
virtual void End ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual bool TransferDataToWindow ()
 
virtual bool TransferDataFromWindow ()
 
virtual bool VisitSettings (SettingsVisitor &)
 
virtual bool VisitSettings (ConstSettingsVisitor &)
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
virtual PluginPath GetPath () const =0
 
virtual ComponentInterfaceSymbol GetSymbol () const =0
 
virtual VendorSymbol GetVendor () const =0
 
virtual wxString GetVersion () const =0
 
virtual TranslatableString GetDescription () const =0
 
TranslatableString GetName () const
 

Public Attributes

wxString mFileName
 
bool mbAddToHistory
 
bool bHasAddToHistory
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Save Project2") }
 

Additional Inherited Members

- Public Types inherited from AudacityCommand
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Protected Attributes inherited from AudacityCommand
ProgressDialogmProgress
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 

Detailed Description

Command for saving an Audacity project.

Definition at line 52 of file OpenSaveCommands.h.

Member Function Documentation

◆ Apply()

bool SaveProjectCommand::Apply ( const CommandContext context)
override

Definition at line 122 of file OpenSaveCommands.cpp.

123{
124 auto &projectFileManager = ProjectFileManager::Get( context.project );
125 if ( mFileName.empty() )
126 return projectFileManager.SaveAs();
127 else
128 return projectFileManager.SaveAs(mFileName, mbAddToHistory);
129}
AudacityProject & project
static ProjectFileManager & Get(AudacityProject &project)

References ProjectFileManager::Get(), mbAddToHistory, mFileName, and CommandContext::project.

Here is the call graph for this function:

◆ GetDescription()

TranslatableString SaveProjectCommand::GetDescription ( ) const
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 59 of file OpenSaveCommands.h.

59{return XO("Saves a project.");};
XO("Cut/Copy/Paste")

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol SaveProjectCommand::GetSymbol ( ) const
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 58 of file OpenSaveCommands.h.

58{return Symbol;};
static const ComponentInterfaceSymbol Symbol

References Symbol.

◆ ManualPage()

ManualPageID SaveProjectCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 67 of file OpenSaveCommands.h.

67{return L"Extra_Menu:_Scriptables_II#save_project";}

◆ PopulateOrExchange()

void SaveProjectCommand::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 110 of file OpenSaveCommands.cpp.

111{
112 S.AddSpace(0, 5);
113
114 S.StartMultiColumn(2, wxALIGN_CENTER);
115 {
116 S.TieTextBox(XXO("File Name:"),mFileName);
117 S.TieCheckBox(XXO("Add to History"), mbAddToHistory );
118 }
119 S.EndMultiColumn();
120}
XXO("&Cut/Copy/Paste Toolbar")
#define S(N)
Definition: ToChars.cpp:64

References mbAddToHistory, mFileName, S, and XXO().

Here is the call graph for this function:

◆ VisitSettings() [1/3]

bool SaveProjectCommand::VisitSettings ( ConstSettingsVisitor )
overridevirtual

Visit settings, if defined. false means no defined settings. Default implementation returns false

Reimplemented from AudacityCommand.

Definition at line 107 of file OpenSaveCommands.cpp.

108 { return VisitSettings<true>(S); }

References S.

◆ VisitSettings() [2/3]

bool SaveProjectCommand::VisitSettings ( SettingsVisitor )
overridevirtual

Visit settings, if defined. false means no defined settings. Default implementation returns false

Reimplemented from AudacityCommand.

Definition at line 104 of file OpenSaveCommands.cpp.

105 { return VisitSettings<false>(S); }

References S.

◆ VisitSettings() [3/3]

template<bool Const>
bool SaveProjectCommand::VisitSettings ( SettingsVisitorBase< Const > &  S)

Definition at line 98 of file OpenSaveCommands.cpp.

98 {
99 S.Define( mFileName, wxT("Filename"), wxString{"name.aup3"} );
100 S.Define( mbAddToHistory, wxT("AddToHistory"), false );
101 return true;
102}
wxT("CloseDown"))

References mbAddToHistory, mFileName, S, and wxT().

Here is the call graph for this function:

Member Data Documentation

◆ bHasAddToHistory

bool SaveProjectCommand::bHasAddToHistory

Definition at line 71 of file OpenSaveCommands.h.

◆ mbAddToHistory

bool SaveProjectCommand::mbAddToHistory

Definition at line 70 of file OpenSaveCommands.h.

Referenced by Apply(), PopulateOrExchange(), and VisitSettings().

◆ mFileName

wxString SaveProjectCommand::mFileName

Definition at line 69 of file OpenSaveCommands.h.

Referenced by Apply(), PopulateOrExchange(), and VisitSettings().

◆ Symbol

const ComponentInterfaceSymbol SaveProjectCommand::Symbol { XO("Save Project2") }
static

Definition at line 55 of file OpenSaveCommands.h.

Referenced by GetSymbol().


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