Audacity  2.3.1
CommandType.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity - A Digital Audio Editor
4  Copyright 1999-2009 Audacity Team
5  License: wxwidgets
6 
7  Dan Horgan
8 
9 ******************************************************************//*******************************************************************/
19 
20 #include "../Audacity.h"
21 #include "CommandType.h"
22 #include "CommandMisc.h"
23 #include "CommandSignature.h"
24 #include <wx/string.h>
25 
27  : mSymbol{}, mSignature{}
28 { }
29 
31 {
32 }
33 
35 {
36  if (mSymbol.empty())
37  mSymbol = BuildName();
38  return mSymbol;
39 }
40 
42 {
43  if (!mSignature)
44  {
47  }
48  return *mSignature;
49 }
50 
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 }
IdentInterfaceSymbol mSymbol
Definition: CommandType.h:47
std::map< wxString, wxVariant > ParamValueMap
Definition: CommandMisc.h:23
const wxChar * desc
Definition: ExportPCM.cpp:58
Contains declarations for CommandType class.
virtual ~OldStyleCommandType()
Definition: CommandType.cpp:30
virtual void BuildSignature(CommandSignature &signature)=0
Postcondition: signature is a 'signature' map containing parameter.
ParamValueMap GetDefaults() const
virtual IdentInterfaceSymbol BuildName()=0
virtual wxString GetDescription() const
Definition: Validators.h:74
Maybe< CommandSignature > mSignature
Definition: CommandType.h:48
CommandSignature & GetSignature()
Definition: CommandType.cpp:41
IdentInterfaceSymbol pairs a persistent string identifier used internally with an optional...
const wxString & Internal() const
Validator & GetValidator(const wxString &paramName)
bool empty() const
Class that maps parameter names to default values and validators.
Declaration of CommandSignature class.
void create(Args &&...args)
Definition: MemoryX.h:247
IdentInterfaceSymbol GetSymbol() override
Definition: CommandType.cpp:34