mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-18 09:00:07 +02:00
... Unnecessary because transitively included. But each .cpp file still includes its own .h file near the top to ensure that it compiles indenendently, even if it is reincluded transitively later.
67 lines
1.7 KiB
C++
67 lines
1.7 KiB
C++
/**********************************************************************
|
|
|
|
Audacity - A Digital Audio Editor
|
|
Copyright 1999-2009 Audacity Team
|
|
License: wxwidgets
|
|
|
|
Dan Horgan
|
|
|
|
******************************************************************//**
|
|
|
|
\file CommandType.cpp
|
|
\brief Contains definitions for CommandType class
|
|
|
|
\class OldStyleCommandType
|
|
\brief Base class for containing data common to all commands of a given type.
|
|
Also acts as a factory.
|
|
|
|
*//*******************************************************************/
|
|
|
|
#include "../Audacity.h"
|
|
#include "CommandType.h"
|
|
|
|
#include <wx/string.h>
|
|
|
|
OldStyleCommandType::OldStyleCommandType()
|
|
: mSymbol{}, mSignature{}
|
|
{ }
|
|
|
|
OldStyleCommandType::~OldStyleCommandType()
|
|
{
|
|
}
|
|
|
|
ComponentInterfaceSymbol OldStyleCommandType::GetSymbol()
|
|
{
|
|
if (mSymbol.empty())
|
|
mSymbol = BuildName();
|
|
return mSymbol;
|
|
}
|
|
|
|
CommandSignature &OldStyleCommandType::GetSignature()
|
|
{
|
|
if (!mSignature)
|
|
{
|
|
mSignature.create();
|
|
BuildSignature(*mSignature);
|
|
}
|
|
return *mSignature;
|
|
}
|
|
|
|
wxString OldStyleCommandType::Describe()
|
|
{
|
|
// PRL: Is this intended for end-user visibility or just debugging? It did not
|
|
// use _(""), so I assume it is meant to use internal strings
|
|
wxString desc = GetSymbol().Internal() + wxT("\nParameters:");
|
|
GetSignature();
|
|
ParamValueMap::iterator iter;
|
|
ParamValueMap defaults = mSignature->GetDefaults();
|
|
for (iter = defaults.begin(); iter != defaults.end(); ++iter)
|
|
{
|
|
desc += wxT("\n") + iter->first + wxT(": ")
|
|
+ mSignature->GetValidator(iter->first).GetDescription()
|
|
+ wxT(" (default: ")
|
|
+ iter->second.MakeString() + wxT(")");
|
|
}
|
|
return desc;
|
|
}
|