Audacity  2.2.2
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 CommandDefinitionInterface IdentInterface ParamsInterface BatchEvalCommandType

Public Member Functions

 OldStyleCommandType ()
 
virtual ~OldStyleCommandType ()
 
IdentInterfaceSymbol GetSymbol () override
 
CommandSignatureGetSignature ()
 
wxString Describe ()
 
virtual IdentInterfaceSymbol 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
 
IdentInterfaceSymbol 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 CommandDefinitionInterface
virtual ~CommandDefinitionInterface ()
 
- Public Member Functions inherited from IdentInterface
virtual ~IdentInterface ()
 
const wxString & GetTranslatedName ()
 
- Public Member Functions inherited from ParamsInterface
virtual ~ParamsInterface ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 

Private Attributes

IdentInterfaceSymbol mSymbol
 
Maybe< CommandSignaturemSignature
 

Additional Inherited Members

- Public Types inherited from AudacityCommand
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Protected Attributes inherited from AudacityCommand
ProgressDialogmProgress
 
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 { }
IdentInterfaceSymbol mSymbol
Definition: CommandType.h:47
Maybe< CommandSignature > mSignature
Definition: CommandType.h:48
OldStyleCommandType::~OldStyleCommandType ( )
virtual

Definition at line 30 of file CommandType.cpp.

31 {
32 }

Member Function Documentation

virtual IdentInterfaceSymbol 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(), IdentInterfaceSymbol::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
ParamValueMap GetDefaults() const
virtual wxString GetDescription() const
Definition: Validators.h:74
Maybe< CommandSignature > mSignature
Definition: CommandType.h:48
CommandSignature & GetSignature()
Definition: CommandType.cpp:41
const wxString & Internal() const
Validator & GetValidator(const wxString &paramName)
IdentInterfaceSymbol GetSymbol() override
Definition: CommandType.cpp:34
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:251
IdentInterfaceSymbol OldStyleCommandType::GetSymbol ( )
overridevirtual

Implements AudacityCommand.

Definition at line 34 of file CommandType.cpp.

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

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

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

Member Data Documentation

Maybe<CommandSignature> OldStyleCommandType::mSignature
private

Definition at line 48 of file CommandType.h.

Referenced by Describe(), and GetSignature().

IdentInterfaceSymbol OldStyleCommandType::mSymbol
private

Definition at line 47 of file CommandType.h.

Referenced by GetSymbol().


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