Audacity  3.0.3
Public Member Functions | Private Attributes | List of all members
OldStyleCommandType Class Referenceabstract

Base class for containing data common to all commands of a given type. Also acts as a factory. More...

#include <CommandType.h>

Inheritance diagram for OldStyleCommandType:
Collaboration diagram for OldStyleCommandType:

Public Member Functions

 OldStyleCommandType ()
virtual ~OldStyleCommandType ()
ComponentInterfaceSymbol GetSymbol () override
CommandSignatureGetSignature ()
wxString Describe ()
virtual ComponentInterfaceSymbol BuildName ()=0
virtual void BuildSignature (CommandSignature &signature)=0
 Postcondition: signature is a 'signature' map containing parameter. More...
virtual OldStyleCommandPointer Create (AudacityProject &project, std::unique_ptr< CommandOutputTargets > &&target)=0
- Public Member Functions inherited from AudacityCommand
 AudacityCommand ()
virtual ~AudacityCommand ()
PluginPath GetPath () override
VendorSymbol GetVendor () override
wxString GetVersion () override
virtual TranslatableString GetDescription () override
virtual ManualPageID ManualPage ()
virtual bool IsBatchProcessing ()
virtual void SetBatchProcessing (bool start)
virtual bool Apply (const CommandContext &WXUNUSED(context))
bool ShowInterface (wxWindow *parent, bool forceModal=false)
virtual void SetHostUI (EffectUIHostInterface *WXUNUSED(host))
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
virtual bool GetAutomationParameters (wxString &parms)
virtual bool SetAutomationParameters (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 ()
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
TranslatableString GetName ()
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))

Private Attributes

ComponentInterfaceSymbol mSymbol
Optional< CommandSignaturemSignature

Additional Inherited Members

- Public Types inherited from AudacityCommand
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
using VetoDialogHook = bool(*)(wxDialog *)
- Static Public Member Functions inherited from AudacityCommand
static VetoDialogHook SetVetoDialogHook (VetoDialogHook hook)
- Protected Attributes inherited from AudacityCommand
wxDialog * mUIDialog
wxWindow * mUIParent
int mUIResultID

Detailed Description

Base class for containing data common to all commands of a given type. Also acts as a factory.

Definition at line 42 of file CommandType.h.

Constructor & Destructor Documentation

◆ OldStyleCommandType()

OldStyleCommandType::OldStyleCommandType ( )

Definition at line 25 of file CommandType.cpp.

26  : mSymbol{}, mSignature{}
27 { }

◆ ~OldStyleCommandType()

OldStyleCommandType::~OldStyleCommandType ( )

Definition at line 29 of file CommandType.cpp.

30 {
31 }

Member Function Documentation

◆ BuildName()

virtual ComponentInterfaceSymbol OldStyleCommandType::BuildName ( )
pure virtual

Implemented in BatchEvalCommandType.

Referenced by GetSymbol().

Here is the caller graph for this function:

◆ BuildSignature()

virtual void OldStyleCommandType::BuildSignature ( CommandSignature signature)
pure virtual

Postcondition: signature is a 'signature' map containing parameter.

Implemented in BatchEvalCommandType.

Referenced by GetSignature().

Here is the caller graph for this function:

◆ Create()

virtual OldStyleCommandPointer OldStyleCommandType::Create ( AudacityProject project,
std::unique_ptr< CommandOutputTargets > &&  target 
pure virtual

Implemented in BatchEvalCommandType.

Referenced by CommandBuilder::BuildCommand().

Here is the caller graph for this function:

◆ Describe()

wxString OldStyleCommandType::Describe ( )

Definition at line 50 of file CommandType.cpp.

51 {
52  // PRL: Is this intended for end-user visibility or just debugging? It did not
53  // use _(""), so I assume it is meant to use internal strings
54  wxString desc = GetSymbol().Internal() + wxT("\nParameters:");
55  GetSignature();
56  ParamValueMap::iterator iter;
57  ParamValueMap defaults = mSignature->GetDefaults();
58  for (iter = defaults.begin(); iter != defaults.end(); ++iter)
59  {
60  desc += wxT("\n") + iter->first + wxT(": ")
61  + mSignature->GetValidator(iter->first).GetDescription()
62  + wxT(" (default: ")
63  + iter->second.MakeString() + wxT(")");
64  }
65  return desc;
66 }

References desc, CommandSignature::GetDefaults(), Validator::GetDescription(), GetSignature(), GetSymbol(), CommandSignature::GetValidator(), ComponentInterfaceSymbol::Internal(), and mSignature.

Here is the call graph for this function:

◆ GetSignature()

CommandSignature & OldStyleCommandType::GetSignature ( )

Definition at line 40 of file CommandType.cpp.

41 {
42  if (!mSignature)
43  {
46  }
47  return *mSignature;
48 }

References BuildSignature(), Optional< X >::emplace(), and mSignature.

Referenced by Describe(), CommandImplementation::GetSignature(), and CommandImplementation::SetParameter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol OldStyleCommandType::GetSymbol ( )

Implements AudacityCommand.

Definition at line 33 of file CommandType.cpp.

34 {
35  if (mSymbol.empty())
36  mSymbol = BuildName();
37  return mSymbol;
38 }

References BuildName(), ComponentInterfaceSymbol::empty(), and mSymbol.

Referenced by CommandDirectory::AddCommand(), Describe(), and CommandImplementation::GetSymbol().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mSignature

Optional<CommandSignature> OldStyleCommandType::mSignature

Definition at line 46 of file CommandType.h.

Referenced by Describe(), and GetSignature().

◆ mSymbol

ComponentInterfaceSymbol OldStyleCommandType::mSymbol

Definition at line 45 of file CommandType.h.

Referenced by GetSymbol().

The documentation for this class was generated from the following files:
X & emplace(Args &&... args)
Definition: MemoryX.h:193
std::map< wxString, wxVariant > ParamValueMap
Definition: CommandMisc.h:23
Validator & GetValidator(const wxString &paramName)
Definition: CommandSignature.cpp:47
virtual wxString GetDescription() const
Definition: Validators.h:78
const TranslatableString desc
Definition: ExportPCM.cpp:58
CommandSignature & GetSignature()
Definition: CommandType.cpp:40
virtual ComponentInterfaceSymbol BuildName()=0
Optional< CommandSignature > mSignature
Definition: CommandType.h:46
virtual void BuildSignature(CommandSignature &signature)=0
Postcondition: signature is a 'signature' map containing parameter.
ParamValueMap GetDefaults() const
Definition: CommandSignature.cpp:42
ComponentInterfaceSymbol mSymbol
Definition: CommandType.h:45
const wxString & Internal() const
Definition: ComponentInterfaceSymbol.h:55
bool empty() const
Definition: ComponentInterfaceSymbol.h:62
ComponentInterfaceSymbol GetSymbol() override
Definition: CommandType.cpp:33