Audacity  2.3.1
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:
AudacityCommand ComponentInterface BatchEvalCommandType

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 (std::unique_ptr< CommandOutputTargets > &&target)=0
- Public Member Functions inherited from AudacityCommand
 AudacityCommand ()
virtual ~AudacityCommand ()
wxString GetPath () override
ComponentInterfaceSymbol GetVendor () override
wxString GetVersion () override
virtual wxString GetDescription () override
virtual wxString ManualPage ()
virtual bool IsBatchProcessing ()
virtual void SetBatchProcessing (bool start)
virtual bool Apply (const CommandContext &WXUNUSED(context))
virtual bool Apply ()
bool ShowInterface (wxWindow *parent, bool forceModal=false)
virtual void SetHostUI (EffectUIHostInterface *WXUNUSED(host))
bool PopulateUI (wxWindow *parent)
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 wxString &message, long style=DefaultMessageBoxStyle, const wxString &titleStr=wxString{})
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 ()
const wxString & GetTranslatedName ()
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))

Private Attributes

ComponentInterfaceSymbol mSymbol
Maybe< CommandSignaturemSignature

Additional Inherited Members

- Public Types inherited from AudacityCommand
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
- 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 44 of file CommandType.h.

Constructor & Destructor Documentation

OldStyleCommandType::OldStyleCommandType ( )

Definition at line 26 of file CommandType.cpp.

27  : mSymbol{}, mSignature{}
28 { }
Maybe< CommandSignature > mSignature
Definition: CommandType.h:48
ComponentInterfaceSymbol mSymbol
Definition: CommandType.h:47
OldStyleCommandType::~OldStyleCommandType ( )

Definition at line 30 of file CommandType.cpp.

31 {
32 }

Member Function Documentation

virtual ComponentInterfaceSymbol OldStyleCommandType::BuildName ( )
pure virtual

Implemented in BatchEvalCommandType.

Referenced by GetSymbol().

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

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

Implemented in BatchEvalCommandType.

Referenced by GetSignature().

virtual OldStyleCommandPointer OldStyleCommandType::Create ( std::unique_ptr< CommandOutputTargets > &&  target)
pure virtual

Implemented in BatchEvalCommandType.

Referenced by CommandBuilder::BuildCommand().

wxString OldStyleCommandType::Describe ( )

Definition at line 51 of file CommandType.cpp.

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

52 {
53  // PRL: Is this intended for end-user visibility or just debugging? It did not
54  // use _(""), so I assume it is meant to use internal strings
55  wxString desc = GetSymbol().Internal() + wxT("\nParameters:");
56  GetSignature();
57  ParamValueMap::iterator iter;
58  ParamValueMap defaults = mSignature->GetDefaults();
59  for (iter = defaults.begin(); iter != defaults.end(); ++iter)
60  {
61  desc += wxT("\n") + iter->first + wxT(": ")
62  + mSignature->GetValidator(iter->first).GetDescription()
63  + wxT(" (default: ")
64  + iter->second.MakeString() + wxT(")");
65  }
66  return desc;
67 }
std::map< wxString, wxVariant > ParamValueMap
Definition: CommandMisc.h:23
const wxChar * desc
Definition: ExportPCM.cpp:58
const wxString & Internal() const
ComponentInterfaceSymbol GetSymbol() override
Definition: CommandType.cpp:34
ParamValueMap GetDefaults() const
virtual wxString GetDescription() const
Definition: Validators.h:74
Maybe< CommandSignature > mSignature
Definition: CommandType.h:48
CommandSignature & GetSignature()
Definition: CommandType.cpp:41
Validator & GetValidator(const wxString &paramName)
CommandSignature & OldStyleCommandType::GetSignature ( )

Definition at line 41 of file CommandType.cpp.

References BuildSignature(), Maybe< X >::create(), and mSignature.

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

42 {
43  if (!mSignature)
44  {
47  }
48  return *mSignature;
49 }
virtual void BuildSignature(CommandSignature &signature)=0
Postcondition: signature is a 'signature' map containing parameter.
Maybe< CommandSignature > mSignature
Definition: CommandType.h:48
void create(Args &&...args)
Definition: MemoryX.h:256
ComponentInterfaceSymbol OldStyleCommandType::GetSymbol ( )

Implements AudacityCommand.

Definition at line 34 of file CommandType.cpp.

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

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

35 {
36  if (mSymbol.empty())
37  mSymbol = BuildName();
38  return mSymbol;
39 }
virtual ComponentInterfaceSymbol BuildName()=0
ComponentInterfaceSymbol mSymbol
Definition: CommandType.h:47

Member Data Documentation

Maybe<CommandSignature> OldStyleCommandType::mSignature

Definition at line 48 of file CommandType.h.

Referenced by Describe(), and GetSignature().

ComponentInterfaceSymbol OldStyleCommandType::mSymbol

Definition at line 47 of file CommandType.h.

Referenced by GetSymbol().

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