Type aliases for some uses of ComponentInterfaceSymbol...

... to be replaced later with distinct types

Also changing FamilyId => Family in function names

Also NumericFormatId => NumericFormatSymbol
This commit is contained in:
Paul Licameli 2019-02-28 13:16:09 -05:00
parent cc92c7605e
commit dfeb7e18aa
71 changed files with 231 additions and 226 deletions

View File

@ -119,7 +119,7 @@ public:
// So config compatibility will break if it is changed across Audacity versions
virtual ComponentInterfaceSymbol GetSymbol() = 0;
virtual ComponentInterfaceSymbol GetVendor() = 0;
virtual VendorSymbol GetVendor() = 0;
virtual wxString GetVersion() = 0;

View File

@ -164,7 +164,7 @@ public:
using ObsoleteMap = std::pair< wxString, size_t >;
bool ReadEnum(const wxString & key, int *pi,
const ComponentInterfaceSymbol choices[], size_t nChoices,
const EnumValueSymbol choices[], size_t nChoices,
const ObsoleteMap obsoletes[] = nullptr,
size_t nObsoletes = 0) const
{
@ -174,7 +174,7 @@ public:
return false;
}
*pi = std::find( choices, choices + nChoices,
ComponentInterfaceSymbol{ s, {} } ) - choices;
EnumValueSymbol{ s, {} } ) - choices;
if (*pi == (int)nChoices)
*pi = -1;
if (*pi < 0 && obsoletes) {
@ -189,7 +189,7 @@ public:
}
bool ReadEnum(const wxString & key, int *pi, int defVal,
const ComponentInterfaceSymbol choices[], size_t nChoices,
const EnumValueSymbol choices[], size_t nChoices,
const ObsoleteMap obsoletes[] = nullptr,
size_t nObsoletes = 0) const
{
@ -201,7 +201,7 @@ public:
}
bool WriteEnum(const wxString & key, int value,
const ComponentInterfaceSymbol choices[], size_t nChoices)
const EnumValueSymbol choices[], size_t nChoices)
{
if (value < 0 || value >= (int)nChoices)
{
@ -248,7 +248,7 @@ public:
}
bool ReadAndVerify(const wxString & key, int *val, int defVal,
const ComponentInterfaceSymbol choices[], size_t nChoices,
const EnumValueSymbol choices[], size_t nChoices,
const ObsoleteMap obsoletes[] = nullptr,
size_t nObsoletes = 0) const
{

View File

@ -59,8 +59,6 @@ typedef enum EffectType : int
EffectTypeTool,
} EffectType;
using NumericFormatId = ComponentInterfaceSymbol;
/*************************************************************************************//**
@ -80,7 +78,7 @@ public:
// Classification determines which menu it appears in.
virtual EffectType GetClassification() { return GetType();};
virtual ComponentInterfaceSymbol GetFamilyId() = 0;
virtual EffectFamilySymbol GetFamily() = 0;
// These should move to the "EffectClientInterface" class once all
// effects have been converted.
@ -120,7 +118,7 @@ public:
virtual double GetDefaultDuration() = 0;
virtual double GetDuration() = 0;
virtual NumericFormatId GetDurationFormat() = 0;
virtual NumericFormatSymbol GetDurationFormat() = 0;
virtual void SetDuration(double seconds) = 0;
virtual bool Apply() = 0;

View File

@ -245,6 +245,19 @@ typedef enum
ChannelNameBottomFrontRight,
} ChannelName, *ChannelNames;
// ----------------------------------------------------------------------------
// some frequently needed forward declarations
// ----------------------------------------------------------------------------
class ComponentInterfaceSymbol;
using EnumValueSymbol = ComponentInterfaceSymbol;
using NumericFormatSymbol = EnumValueSymbol;
using VendorSymbol = ComponentInterfaceSymbol;
using EffectFamilySymbol = ComponentInterfaceSymbol;
// LLL FIXME: Until a complete API is devised, we have to use
// AUDACITY_DLL_API when defining API classes. This
// it ugly, but a part of the game. Remove it when

View File

@ -301,10 +301,10 @@ wxString Internat::StripAccelerators(const wxString &s)
}
wxArrayString LocalizedStrings(
const ComponentInterfaceSymbol strings[], size_t nStrings)
const EnumValueSymbol strings[], size_t nStrings)
{
return transform_range<wxArrayString>(
strings, strings + nStrings,
std::mem_fn( &ComponentInterfaceSymbol::Translation )
std::mem_fn( &EnumValueSymbol::Translation )
);
}

View File

@ -20,6 +20,7 @@
#ifndef IN_RC
#include "Audacity.h"
#include "audacity/Types.h"
class wxString;
@ -181,7 +182,7 @@ private:
class ComponentInterfaceSymbol;
wxArrayString LocalizedStrings(
const ComponentInterfaceSymbol strings[], size_t nStrings);
const EnumValueSymbol strings[], size_t nStrings);
// This object pairs an internal string, maybe empty, with a translated string.
// Any internal string may be written to configuration or other files and,

View File

@ -98,8 +98,8 @@ LabelDialog::LabelDialog(wxWindow *parent,
int index,
ViewInfo &viewinfo,
double rate,
const NumericFormatId & format,
const NumericFormatId &freqFormat)
const NumericFormatSymbol & format,
const NumericFormatSymbol &freqFormat)
: wxDialogWrapper(parent,
wxID_ANY,
_("Edit Labels"),

View File

@ -48,8 +48,8 @@ class LabelDialog final : public wxDialogWrapper
ViewInfo &viewinfo,
double rate,
const NumericFormatId & format,
const NumericFormatId &freqFormat);
const NumericFormatSymbol & format,
const NumericFormatSymbol &freqFormat);
~LabelDialog();
bool Show(bool show = true) override;
@ -106,7 +106,7 @@ class LabelDialog final : public wxDialogWrapper
ViewInfo *mViewInfo;
wxArrayString mTrackNames;
double mRate;
NumericFormatId mFormat, mFreqFormat;
NumericFormatSymbol mFormat, mFreqFormat;
int mInitialRow;

View File

@ -1228,7 +1228,7 @@ void PluginDescriptor::SetValid(bool valid)
// Effects
wxString PluginDescriptor::GetEffectFamilyId() const
wxString PluginDescriptor::GetEffectFamily() const
{
return mEffectFamily;
}
@ -1263,7 +1263,7 @@ bool PluginDescriptor::IsEffectAutomatable() const
return mEffectAutomatable;
}
void PluginDescriptor::SetEffectFamilyId(const wxString & family)
void PluginDescriptor::SetEffectFamily(const wxString & family)
{
mEffectFamily = family;
}
@ -1445,7 +1445,7 @@ const PluginID & PluginManager::RegisterPlugin(ModuleInterface *provider, Effect
plug.SetProviderID(PluginManager::GetID(provider));
plug.SetEffectType(effect->GetClassification());
plug.SetEffectFamilyId(effect->GetFamilyId().Internal());
plug.SetEffectFamily(effect->GetFamily().Internal());
plug.SetEffectInteractive(effect->IsInteractive());
plug.SetEffectDefault(effect->IsDefault());
plug.SetEffectRealtime(effect->SupportsRealtime());
@ -2146,7 +2146,7 @@ void PluginManager::LoadGroup(wxFileConfig *pRegistry, PluginType type)
{
continue;
}
plug.SetEffectFamilyId(strVal);
plug.SetEffectFamily(strVal);
// Is it a default (above the line) effect and bypass group if not found
if (!pRegistry->Read(KEY_EFFECTDEFAULT, &boolVal))
@ -2316,7 +2316,7 @@ void PluginManager::SaveGroup(wxFileConfig *pRegistry, PluginType type)
stype = KEY_EFFECTTYPE_HIDDEN;
pRegistry->Write(KEY_EFFECTTYPE, stype);
pRegistry->Write(KEY_EFFECTFAMILY, plug.GetEffectFamilyId());
pRegistry->Write(KEY_EFFECTFAMILY, plug.GetEffectFamily());
pRegistry->Write(KEY_EFFECTDEFAULT, plug.IsEffectDefault());
pRegistry->Write(KEY_EFFECTINTERACTIVE, plug.IsEffectInteractive());
pRegistry->Write(KEY_EFFECTREALTIME, plug.IsEffectRealtime());
@ -2455,7 +2455,7 @@ const PluginID & PluginManager::RegisterPlugin(EffectDefinitionInterface *effect
PluginDescriptor & plug = CreatePlugin(GetID(effect), effect, type);
plug.SetEffectType(effect->GetType());
plug.SetEffectFamilyId(effect->GetFamilyId().Internal());
plug.SetEffectFamily(effect->GetFamily().Internal());
plug.SetEffectInteractive(effect->IsInteractive());
plug.SetEffectDefault(effect->IsDefault());
plug.SetEffectRealtime(effect->SupportsRealtime());
@ -2517,7 +2517,7 @@ const PluginDescriptor *PluginManager::GetFirstPlugin(int type)
bool familyEnabled = true;
if( (plugType & PluginTypeEffect) != 0)
// This preference may be written by EffectsPrefs
gPrefs->Read(plug.GetEffectFamilyId() + wxT("/Enable"), &familyEnabled, true);
gPrefs->Read(plug.GetEffectFamily() + wxT("/Enable"), &familyEnabled, true);
if (familyEnabled)
return &mPluginsIter->second;
}
@ -2537,7 +2537,7 @@ const PluginDescriptor *PluginManager::GetNextPlugin(int type)
bool familyEnabled = true;
if( (plugType & PluginTypeEffect) != 0)
// This preference may be written by EffectsPrefs
gPrefs->Read(plug.GetEffectFamilyId() + wxT("/Enable"), &familyEnabled, true);
gPrefs->Read(plug.GetEffectFamily() + wxT("/Enable"), &familyEnabled, true);
if (familyEnabled)
return &mPluginsIter->second;
}
@ -2556,7 +2556,7 @@ const PluginDescriptor *PluginManager::GetFirstPluginForEffectType(EffectType ty
bool familyEnabled;
// This preference may be written by EffectsPrefs
gPrefs->Read(plug.GetEffectFamilyId() + wxT("/Enable"), &familyEnabled, true);
gPrefs->Read(plug.GetEffectFamily() + wxT("/Enable"), &familyEnabled, true);
if (plug.IsValid() && plug.IsEnabled() && plug.GetEffectType() == type && familyEnabled)
{
if (plug.IsInstantiated() && em.IsHidden(plug.GetID()))
@ -2580,7 +2580,7 @@ const PluginDescriptor *PluginManager::GetNextPluginForEffectType(EffectType typ
PluginDescriptor & plug = mPluginsIter->second;
bool familyEnabled;
// This preference may be written by EffectsPrefs
gPrefs->Read(plug.GetEffectFamilyId() + wxT("/Enable"), &familyEnabled, true);
gPrefs->Read(plug.GetEffectFamily() + wxT("/Enable"), &familyEnabled, true);
if (plug.IsValid() && plug.IsEnabled() && plug.GetEffectType() == type && familyEnabled)
{
if (plug.IsInstantiated() && em.IsHidden(plug.GetID()))
@ -2673,7 +2673,7 @@ PluginID PluginManager::GetID(EffectDefinitionInterface *effect)
{
return wxString::Format(wxT("%s_%s_%s_%s_%s"),
GetPluginTypeString(PluginTypeEffect),
effect->GetFamilyId().Internal(),
effect->GetFamily().Internal(),
effect->GetVendor().Internal(),
effect->GetSymbol().Internal(),
effect->GetPath());
@ -2980,7 +2980,7 @@ wxString PluginManager::SettingsPath(const PluginID & ID, bool shared)
wxString id = GetPluginTypeString(plug.GetPluginType()) +
wxT("_") +
plug.GetEffectFamilyId() + // is empty for non-Effects
plug.GetEffectFamily() + // is empty for non-Effects
wxT("_") +
plug.GetVendor() +
wxT("_") +

View File

@ -90,7 +90,7 @@ public:
// (Use Effect::GetFamilyName instead)
// This string persists in configuration files
// So config compatibility will break if it is changed across Audacity versions
wxString GetEffectFamilyId() const;
wxString GetEffectFamily() const;
EffectType GetEffectType() const;
bool IsEffectDefault() const;
@ -100,7 +100,7 @@ public:
bool IsEffectAutomatable() const;
// "family" should be an untranslated string wrapped in wxT()
void SetEffectFamilyId(const wxString & family);
void SetEffectFamily(const wxString & family);
void SetEffectType(EffectType type);
void SetEffectDefault(bool dflt);
void SetEffectInteractive(bool interactive);

View File

@ -1652,12 +1652,12 @@ void AudacityProject::AS_SetSnapTo(int snap)
RedrawProject();
}
const NumericFormatId & AudacityProject::AS_GetSelectionFormat()
const NumericFormatSymbol & AudacityProject::AS_GetSelectionFormat()
{
return GetSelectionFormat();
}
void AudacityProject::AS_SetSelectionFormat(const NumericFormatId & format)
void AudacityProject::AS_SetSelectionFormat(const NumericFormatSymbol & format)
{
mSelectionFormat = format;
@ -1675,12 +1675,12 @@ double AudacityProject::SSBL_GetRate() const
mTracks->Any<const WaveTrack>().max( &WaveTrack::GetRate ) );
}
const NumericFormatId & AudacityProject::SSBL_GetFrequencySelectionFormatName()
const NumericFormatSymbol & AudacityProject::SSBL_GetFrequencySelectionFormatName()
{
return GetFrequencySelectionFormatName();
}
void AudacityProject::SSBL_SetFrequencySelectionFormatName(const NumericFormatId & formatName)
void AudacityProject::SSBL_SetFrequencySelectionFormatName(const NumericFormatSymbol & formatName)
{
mFrequencySelectionFormatName = formatName;
@ -1689,12 +1689,12 @@ void AudacityProject::SSBL_SetFrequencySelectionFormatName(const NumericFormatId
gPrefs->Flush();
}
const NumericFormatId & AudacityProject::SSBL_GetBandwidthSelectionFormatName()
const NumericFormatSymbol & AudacityProject::SSBL_GetBandwidthSelectionFormatName()
{
return GetBandwidthSelectionFormatName();
}
void AudacityProject::SSBL_SetBandwidthSelectionFormatName(const NumericFormatId & formatName)
void AudacityProject::SSBL_SetBandwidthSelectionFormatName(const NumericFormatSymbol & formatName)
{
mBandwidthSelectionFormatName = formatName;
@ -1721,12 +1721,12 @@ void AudacityProject::SSBL_ModifySpectralSelection(double &bottom, double &top,
#endif
}
const NumericFormatId & AudacityProject::GetFrequencySelectionFormatName() const
const NumericFormatSymbol & AudacityProject::GetFrequencySelectionFormatName() const
{
return mFrequencySelectionFormatName;
}
void AudacityProject::SetFrequencySelectionFormatName(const NumericFormatId & formatName)
void AudacityProject::SetFrequencySelectionFormatName(const NumericFormatSymbol & formatName)
{
SSBL_SetFrequencySelectionFormatName(formatName);
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
@ -1736,12 +1736,12 @@ void AudacityProject::SetFrequencySelectionFormatName(const NumericFormatId & fo
#endif
}
const NumericFormatId & AudacityProject::GetBandwidthSelectionFormatName() const
const NumericFormatSymbol & AudacityProject::GetBandwidthSelectionFormatName() const
{
return mBandwidthSelectionFormatName;
}
void AudacityProject::SetBandwidthSelectionFormatName(const NumericFormatId & formatName)
void AudacityProject::SetBandwidthSelectionFormatName(const NumericFormatSymbol & formatName)
{
SSBL_SetBandwidthSelectionFormatName(formatName);
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
@ -1751,7 +1751,7 @@ void AudacityProject::SetBandwidthSelectionFormatName(const NumericFormatId & fo
#endif
}
void AudacityProject::SetSelectionFormat(const NumericFormatId & format)
void AudacityProject::SetSelectionFormat(const NumericFormatSymbol & format)
{
AS_SetSelectionFormat(format);
if (GetSelectionBar()) {
@ -1759,7 +1759,7 @@ void AudacityProject::SetSelectionFormat(const NumericFormatId & format)
}
}
const NumericFormatId & AudacityProject::GetSelectionFormat() const
const NumericFormatSymbol & AudacityProject::GetSelectionFormat() const
{
return mSelectionFormat;
}

View File

@ -432,16 +432,16 @@ public:
// Selection Format
void SetSelectionFormat(const NumericFormatId & format);
const NumericFormatId & GetSelectionFormat() const;
void SetSelectionFormat(const NumericFormatSymbol & format);
const NumericFormatSymbol & GetSelectionFormat() const;
// Spectral Selection Formats
void SetFrequencySelectionFormatName(const NumericFormatId & format);
const NumericFormatId & GetFrequencySelectionFormatName() const;
void SetFrequencySelectionFormatName(const NumericFormatSymbol & format);
const NumericFormatSymbol & GetFrequencySelectionFormatName() const;
void SetBandwidthSelectionFormatName(const NumericFormatId & format);
const NumericFormatId & GetBandwidthSelectionFormatName() const;
void SetBandwidthSelectionFormatName(const NumericFormatSymbol & format);
const NumericFormatSymbol & GetBandwidthSelectionFormatName() const;
// Scrollbars
@ -524,19 +524,19 @@ public:
void AS_SetRate(double rate) override;
int AS_GetSnapTo() override;
void AS_SetSnapTo(int snap) override;
const NumericFormatId & AS_GetSelectionFormat() override;
void AS_SetSelectionFormat(const NumericFormatId & format) override;
const NumericFormatSymbol & AS_GetSelectionFormat() override;
void AS_SetSelectionFormat(const NumericFormatSymbol & format) override;
void AS_ModifySelection(double &start, double &end, bool done) override;
// SpectralSelectionBarListener callback methods
double SSBL_GetRate() const override;
const NumericFormatId & SSBL_GetFrequencySelectionFormatName() override;
void SSBL_SetFrequencySelectionFormatName(const NumericFormatId & formatName) override;
const NumericFormatSymbol & SSBL_GetFrequencySelectionFormatName() override;
void SSBL_SetFrequencySelectionFormatName(const NumericFormatSymbol & formatName) override;
const NumericFormatId & SSBL_GetBandwidthSelectionFormatName() override;
void SSBL_SetBandwidthSelectionFormatName(const NumericFormatId & formatName) override;
const NumericFormatSymbol & SSBL_GetBandwidthSelectionFormatName() override;
void SSBL_SetBandwidthSelectionFormatName(const NumericFormatSymbol & formatName) override;
void SSBL_ModifySpectralSelection(double &bottom, double &top, bool done) override;
@ -609,9 +609,9 @@ public:
std::shared_ptr<TrackList> mTracks;
int mSnapTo;
NumericFormatId mSelectionFormat;
NumericFormatId mFrequencySelectionFormatName;
NumericFormatId mBandwidthSelectionFormatName;
NumericFormatSymbol mSelectionFormat;
NumericFormatSymbol mFrequencySelectionFormatName;
NumericFormatSymbol mBandwidthSelectionFormatName;
std::shared_ptr<TrackList> mLastSavedTracks;

View File

@ -52,7 +52,7 @@ Resample::~Resample()
}
//////////
static const ComponentInterfaceSymbol methodNames[] = {
static const EnumValueSymbol methodNames[] = {
{ wxT("LowQuality"), XO("Low Quality (Fastest)") },
{ wxT("MediumQuality"), XO("Medium Quality") },
{ wxT("HighQuality"), XO("High Quality") },

View File

@ -342,12 +342,12 @@ void ShuttleParams::Define( float & var, const wxChar * key, const float vdef
void ShuttleParams::Define( double & var, const wxChar * key, const float vdefault, const float vmin, const float vmax, const float vscl ){;};
void ShuttleParams::Define( double & var, const wxChar * key, const double vdefault, const double vmin, const double vmax, const double vscl ){;};
void ShuttleParams::Define( wxString &var, const wxChar * key, const wxString vdefault, const wxString vmin, const wxString vmax, const wxString vscl ){;};
void ShuttleParams::DefineEnum( int &var, const wxChar * key, const int vdefault, const ComponentInterfaceSymbol strings[], size_t nStrings ){;};
void ShuttleParams::DefineEnum( int &var, const wxChar * key, const int vdefault, const EnumValueSymbol strings[], size_t nStrings ){;};
/*
void ShuttleParams::DefineEnum( int &var, const wxChar * key, const int vdefault, const ComponentInterfaceSymbol strings[], size_t nStrings )
void ShuttleParams::DefineEnum( int &var, const wxChar * key, const int vdefault, const EnumValueSymbol strings[], size_t nStrings )
{
}
*/
@ -402,7 +402,7 @@ void ShuttleGetAutomation::Define( wxString &var, const wxChar * key, const wxSt
}
void ShuttleGetAutomation::DefineEnum( int &var, const wxChar * key, const int vdefault, const ComponentInterfaceSymbol strings[], size_t nStrings )
void ShuttleGetAutomation::DefineEnum( int &var, const wxChar * key, const int vdefault, const EnumValueSymbol strings[], size_t nStrings )
{
if( !ShouldSet() ) return;
mpEap->Write(key, strings[var].Internal());
@ -512,7 +512,7 @@ void ShuttleSetAutomation::Define( wxString &var, const wxChar * key, const wxSt
}
void ShuttleSetAutomation::DefineEnum( int &var, const wxChar * key, const int vdefault, const ComponentInterfaceSymbol strings[], size_t nStrings )
void ShuttleSetAutomation::DefineEnum( int &var, const wxChar * key, const int vdefault, const EnumValueSymbol strings[], size_t nStrings )
{
CouldGet( key );
if( !bOK )
@ -629,7 +629,7 @@ void ShuttleGetDefinition::Define( wxString &var, const wxChar * key, const wxSt
void ShuttleGetDefinition::DefineEnum( int &var,
const wxChar * key, const int vdefault,
const ComponentInterfaceSymbol strings[], size_t nStrings )
const EnumValueSymbol strings[], size_t nStrings )
{
StartStruct();
AddItem( wxString(key), "key" );

View File

@ -78,7 +78,7 @@ public:
virtual void Define( double & var, const wxChar * key, const double vdefault, const double vmin, const double vmax, const double vscl=1.0f );
virtual void Define( wxString &var, const wxChar * key, const wxString vdefault, const wxString vmin="", const wxString vmax="", const wxString vscl="" );
virtual void DefineEnum( int &var, const wxChar * key, const int vdefault,
const ComponentInterfaceSymbol strings[], size_t nStrings );
const EnumValueSymbol strings[], size_t nStrings );
};
/**************************************************************************//**
@ -96,7 +96,7 @@ public:
void Define( double & var, const wxChar * key, const double vdefault, const double vmin, const double vmax, const double vscl ) override;
void Define( wxString &var, const wxChar * key, const wxString vdefault, const wxString vmin, const wxString vmax, const wxString vscl ) override;
void DefineEnum( int &var, const wxChar * key, const int vdefault,
const ComponentInterfaceSymbol strings[], size_t nStrings ) override;
const EnumValueSymbol strings[], size_t nStrings ) override;
};
/**************************************************************************//**
@ -120,7 +120,7 @@ public:
void Define( double & var, const wxChar * key, const double vdefault, const double vmin, const double vmax, const double vscl ) override;
void Define( wxString &var, const wxChar * key, const wxString vdefault, const wxString vmin, const wxString vmax, const wxString vscl ) override;
void DefineEnum( int &var, const wxChar * key, const int vdefault,
const ComponentInterfaceSymbol strings[], size_t nStrings ) override;
const EnumValueSymbol strings[], size_t nStrings ) override;
};
/**************************************************************************//**
@ -141,7 +141,7 @@ public:
void Define( double & var, const wxChar * key, const double vdefault, const double vmin, const double vmax, const double vscl ) override;
void Define( wxString &var, const wxChar * key, const wxString vdefault, const wxString vmin, const wxString vmax, const wxString vscl ) override;
void DefineEnum( int &var, const wxChar * key, const int vdefault,
const ComponentInterfaceSymbol strings[], size_t nStrings ) override;
const EnumValueSymbol strings[], size_t nStrings ) override;
};
@ -178,7 +178,7 @@ public:
const wxString WXUNUSED(vmin), const wxString WXUNUSED(vmax), const wxString WXUNUSED(vscl) )
override { var = vdefault;};
void DefineEnum( int &var, const wxChar * WXUNUSED(key), const int vdefault,
const ComponentInterfaceSymbol WXUNUSED(strings) [], size_t WXUNUSED( nStrings ) )
const EnumValueSymbol WXUNUSED(strings) [], size_t WXUNUSED( nStrings ) )
override { var = vdefault;};
};

View File

@ -136,7 +136,7 @@ private:
int mSnapTo;
double mRate;
NumericFormatId mFormat;
NumericFormatSymbol mFormat;
};
#endif

View File

@ -30,7 +30,7 @@ END_EVENT_TABLE()
TimeDialog::TimeDialog(wxWindow *parent,
const wxString &title,
const NumericFormatId &format,
const NumericFormatSymbol &format,
double rate,
double time,
const wxString &prompt)
@ -99,7 +99,7 @@ const double TimeDialog::GetTimeValue()
return mTime;
}
void TimeDialog::SetFormatString(const NumericFormatId &formatString)
void TimeDialog::SetFormatString(const NumericFormatSymbol &formatString)
{
mFormat = formatString;
TransferDataToWindow();

View File

@ -27,12 +27,12 @@ class TimeDialog final : public wxDialogWrapper
TimeDialog(wxWindow *parent,
const wxString &title,
const NumericFormatId &format,
const NumericFormatSymbol &format,
double rate,
double time,
const wxString &prompt = _("Duration"));
void SetFormatString(const NumericFormatId &formatString);
void SetFormatString(const NumericFormatSymbol &formatString);
void SetSampleRate(double sampleRate);
void SetTimeValue(double newTime);
const double GetTimeValue();
@ -48,7 +48,7 @@ class TimeDialog final : public wxDialogWrapper
private:
wxString mPrompt;
NumericFormatId mFormat;
NumericFormatSymbol mFormat;
double mRate;
double mTime;

View File

@ -80,7 +80,7 @@ AudacityCommand::~AudacityCommand()
wxString AudacityCommand::GetPath(){ return BUILTIN_GENERIC_COMMAND_PREFIX + GetSymbol().Internal(); }
ComponentInterfaceSymbol AudacityCommand::GetVendor(){ return XO("Audacity");}
VendorSymbol AudacityCommand::GetVendor(){ return XO("Audacity");}
wxString AudacityCommand::GetVersion(){ return AUDACITY_VERSION_STRING;}

View File

@ -64,7 +64,7 @@ class AUDACITY_DLL_API AudacityCommand /* not final */ : public wxEvtHandler,
//These four can be defaulted....
wxString GetPath() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
// virtual wxString GetFamily();

View File

@ -38,7 +38,7 @@ enum kCoordTypes
nCoordTypes
};
static const ComponentInterfaceSymbol kCoordTypeStrings[nCoordTypes] =
static const EnumValueSymbol kCoordTypeStrings[nCoordTypes] =
{
{ XO("Panel") },
{ wxT("App"), XO("Application") },

View File

@ -55,7 +55,7 @@ enum {
nTypes
};
static const ComponentInterfaceSymbol kTypes[nTypes] =
static const EnumValueSymbol kTypes[nTypes] =
{
{ XO("Commands") },
//{ wxT("CommandsPlus"), XO("Commands Plus") },
@ -75,7 +75,7 @@ enum {
nFormats
};
static const ComponentInterfaceSymbol kFormats[nFormats] =
static const EnumValueSymbol kFormats[nFormats] =
{
// These are acceptable dual purpose internal/visible names

View File

@ -27,7 +27,7 @@
#include "CommandContext.h"
const int nTypes =3;
static const ComponentInterfaceSymbol kTypes[nTypes] =
static const EnumValueSymbol kTypes[nTypes] =
{
{ XO("Tracks") },
{ XO("Clips") },

View File

@ -183,7 +183,7 @@ ComponentInterfaceSymbol BuiltinCommandsModule::GetSymbol()
return XO("Builtin Commands");
}
ComponentInterfaceSymbol BuiltinCommandsModule::GetVendor()
VendorSymbol BuiltinCommandsModule::GetVendor()
{
return XO("The Audacity Team");
}

View File

@ -32,7 +32,7 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;

View File

@ -47,7 +47,7 @@ small calculations of rectangles.
#include "CommandManager.h"
static const ComponentInterfaceSymbol
static const EnumValueSymbol
kCaptureWhatStrings[ ScreenshotCommand::nCaptureWhats ] =
{
{ XO("Window") },
@ -85,7 +85,7 @@ kCaptureWhatStrings[ ScreenshotCommand::nCaptureWhats ] =
};
static const ComponentInterfaceSymbol
static const EnumValueSymbol
kBackgroundStrings[ ScreenshotCommand::nBackgrounds ] =
{
// These are acceptable dual purpose internal/visible names

View File

@ -44,7 +44,7 @@ explicitly code all three.
// Relative to project and relative to selection cover MOST options, since you can already
// set a selection to a clip.
const int nRelativeTos =6;
static const ComponentInterfaceSymbol kRelativeTo[nRelativeTos] =
static const EnumValueSymbol kRelativeTo[nRelativeTos] =
{
{ wxT("ProjectStart"), XO("Project Start") },
{ XO("Project") },
@ -167,7 +167,7 @@ bool SelectFrequenciesCommand::Apply(const CommandContext & context){
}
const int nModes =3;
static const ComponentInterfaceSymbol kModes[nModes] =
static const EnumValueSymbol kModes[nModes] =
{
// These are acceptable dual purpose internal/visible names

View File

@ -38,7 +38,7 @@ enum kColours
nColours
};
static const ComponentInterfaceSymbol kColourStrings[nColours] =
static const EnumValueSymbol kColourStrings[nColours] =
{
{ wxT("Color0"), XO("Color 0") },
{ wxT("Color1"), XO("Color 1") },

View File

@ -234,7 +234,7 @@ enum kColours
nColours
};
static const ComponentInterfaceSymbol kColourStrings[nColours] =
static const EnumValueSymbol kColourStrings[nColours] =
{
{ wxT("Color0"), XO("Color 0") },
{ wxT("Color1"), XO("Color 1") },
@ -250,7 +250,7 @@ enum kDisplayTypes
nDisplayTypes
};
static const ComponentInterfaceSymbol kDisplayTypeStrings[nDisplayTypes] =
static const EnumValueSymbol kDisplayTypeStrings[nDisplayTypes] =
{
// These are acceptable dual purpose internal/visible names
{ XO("Waveform") },
@ -264,7 +264,7 @@ enum kScaleTypes
nScaleTypes
};
static const ComponentInterfaceSymbol kScaleTypeStrings[nScaleTypes] =
static const EnumValueSymbol kScaleTypeStrings[nScaleTypes] =
{
// These are acceptable dual purpose internal/visible names
{ XO("Linear") },
@ -280,7 +280,7 @@ enum kZoomTypes
nZoomTypes
};
static const ComponentInterfaceSymbol kZoomTypeStrings[nZoomTypes] =
static const EnumValueSymbol kZoomTypeStrings[nZoomTypes] =
{
{ XO("Reset") },
{ wxT("Times2"), XO("Times 2") },

View File

@ -115,7 +115,7 @@ private:
// private effect parameters
int mToVinyl; // to standard vinyl speed (rpm)
double mToLength; // target length of selection
NumericFormatId mFormat; // time control format
NumericFormatSymbol mFormat; // time control format
DECLARE_EVENT_TABLE()
};

View File

@ -57,7 +57,7 @@ enum kTableType
nTableTypes
};
static const ComponentInterfaceSymbol kTableTypeStrings[nTableTypes] =
static const EnumValueSymbol kTableTypeStrings[nTableTypes] =
{
{ XO("Hard Clipping") },
{ XO("Soft Clipping") },

View File

@ -178,7 +178,7 @@ ComponentInterfaceSymbol Effect::GetSymbol()
return {};
}
ComponentInterfaceSymbol Effect::GetVendor()
VendorSymbol Effect::GetVendor()
{
if (mClient)
{
@ -208,11 +208,11 @@ wxString Effect::GetDescription()
return wxEmptyString;
}
ComponentInterfaceSymbol Effect::GetFamilyId()
EffectFamilySymbol Effect::GetFamily()
{
if (mClient)
{
return mClient->GetFamilyId();
return mClient->GetFamily();
}
// Unusually, the internal and visible strings differ for the built-in
@ -732,12 +732,12 @@ double Effect::GetDuration()
return mDuration;
}
NumericFormatId Effect::GetDurationFormat()
NumericFormatSymbol Effect::GetDurationFormat()
{
return mDurationFormat;
}
NumericFormatId Effect::GetSelectionFormat()
NumericFormatSymbol Effect::GetSelectionFormat()
{
return GetActiveProject()->GetSelectionFormat();
}
@ -2470,7 +2470,7 @@ void Effect::Preview(bool dryOnly)
wxWindow *FocusDialog = wxWindow::FindFocus();
double previewDuration;
bool isNyquist = GetFamilyId() == NYQUISTEFFECTS_FAMILY;
bool isNyquist = GetFamily() == NYQUISTEFFECTS_FAMILY;
bool isGenerator = GetType() == EffectTypeGenerate;
// Mix a few seconds of audio from all of the tracks
@ -3317,7 +3317,7 @@ void EffectUIHost::OnCancel(wxCommandEvent & WXUNUSED(evt))
void EffectUIHost::OnHelp(wxCommandEvent & WXUNUSED(event))
{
if (mEffect && mEffect->GetFamilyId() == NYQUISTEFFECTS_FAMILY && (mEffect->ManualPage().empty())) {
if (mEffect && mEffect->GetFamily() == NYQUISTEFFECTS_FAMILY && (mEffect->ManualPage().empty())) {
// Old ShowHelp required when there is no on-line manual.
// Always use default web browser to allow full-featured HTML pages.
HelpSystem::ShowHelp(FindWindow(wxID_HELP), mEffect->HelpPage(), wxEmptyString, true, true);
@ -3409,7 +3409,7 @@ void EffectUIHost::OnMenu(wxCommandEvent & WXUNUSED(evt))
auto sub = std::make_unique<wxMenu>();
sub->Append(kDummyID, wxString::Format(_("Type: %s"),
::wxGetTranslation( mEffect->GetFamilyId().Translation() )));
::wxGetTranslation( mEffect->GetFamily().Translation() )));
sub->Append(kDummyID, wxString::Format(_("Name: %s"), mEffect->GetTranslatedName()));
sub->Append(kDummyID, wxString::Format(_("Version: %s"), mEffect->GetVersion()));
sub->Append(kDummyID, wxString::Format(_("Vendor: %s"), mEffect->GetVendor().Translation()));

View File

@ -82,14 +82,14 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;
// EffectDefinitionInterface implementation
EffectType GetType() override;
ComponentInterfaceSymbol GetFamilyId() override;
EffectFamilySymbol GetFamily() override;
bool IsInteractive() override;
bool IsDefault() override;
bool IsLegacy() override;
@ -161,8 +161,8 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
double GetDefaultDuration() override;
double GetDuration() override;
NumericFormatId GetDurationFormat() override;
virtual NumericFormatId GetSelectionFormat() /* not override? */; // time format in Selection toolbar
NumericFormatSymbol GetDurationFormat() override;
virtual NumericFormatSymbol GetSelectionFormat() /* not override? */; // time format in Selection toolbar
void SetDuration(double duration) override;
bool Apply() override;
@ -512,7 +512,7 @@ private:
bool mIsSelection;
double mDuration;
NumericFormatId mDurationFormat;
NumericFormatSymbol mDurationFormat;
bool mIsPreview;

View File

@ -156,7 +156,7 @@ wxString EffectManager::GetEffectFamilyName(const PluginID & ID)
{
auto effect = GetEffect(ID);
if (effect)
return effect->GetFamilyId().Translation();
return effect->GetFamily().Translation();
return {};
}

View File

@ -145,7 +145,7 @@ enum kInterpolations
#define EQCURVES_REVISION 0
#define UPDATE_ALL 0 // 0 = merge NEW presets only, 1 = Update all factory presets.
static const ComponentInterfaceSymbol kInterpStrings[nInterpolations] =
static const EnumValueSymbol kInterpStrings[nInterpolations] =
{
// These are acceptable dual purpose internal/visible names

View File

@ -246,7 +246,7 @@ ComponentInterfaceSymbol BuiltinEffectsModule::GetSymbol()
return XO("Builtin Effects");
}
ComponentInterfaceSymbol BuiltinEffectsModule::GetVendor()
VendorSymbol BuiltinEffectsModule::GetVendor()
{
return XO("The Audacity Team");
}

View File

@ -31,7 +31,7 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;

View File

@ -35,7 +35,7 @@ enum kTypes
nTypes
};
static const ComponentInterfaceSymbol kTypeStrings[nTypes] =
static const EnumValueSymbol kTypeStrings[nTypes] =
{
// These are acceptable dual purpose internal/visible names
{ XO("White") },

View File

@ -86,7 +86,7 @@ enum kTypes
nTypes
};
static const ComponentInterfaceSymbol kTypeStrings[nTypes] =
static const EnumValueSymbol kTypeStrings[nTypes] =
{
/*i18n-hint: Butterworth is the name of the person after whom the filter type is named.*/
{ XO("Butterworth") },
@ -103,7 +103,7 @@ enum kSubTypes
nSubTypes
};
static const ComponentInterfaceSymbol kSubTypeStrings[nSubTypes] =
static const EnumValueSymbol kSubTypeStrings[nSubTypes] =
{
// These are acceptable dual purpose internal/visible names
{ XO("Lowpass") },

View File

@ -39,7 +39,7 @@ enum kInterpolations
nInterpolations
};
static const ComponentInterfaceSymbol kInterStrings[nInterpolations] =
static const EnumValueSymbol kInterStrings[nInterpolations] =
{
// These are acceptable dual purpose internal/visible names
{ XO("Linear") },
@ -55,7 +55,7 @@ enum kWaveforms
nWaveforms
};
static const ComponentInterfaceSymbol kWaveStrings[nWaveforms] =
static const EnumValueSymbol kWaveStrings[nWaveforms] =
{
{ XO("Sine") },
{ XO("Square") },

View File

@ -37,10 +37,10 @@
class Enums {
public:
static const size_t NumDbChoices;
static const ComponentInterfaceSymbol DbChoices[];
static const EnumValueSymbol DbChoices[];
};
const ComponentInterfaceSymbol Enums::DbChoices[] = {
const EnumValueSymbol Enums::DbChoices[] = {
// Table of text values, only for reading what was stored in legacy config
// files.
// It was inappropriate to make this a discrete choice control.
@ -74,7 +74,7 @@ enum kActions
nActions
};
static const ComponentInterfaceSymbol kActionStrings[nActions] =
static const EnumValueSymbol kActionStrings[nActions] =
{
{ XO("Truncate Detected Silence") },
{ XO("Compress Excess Silence") }

View File

@ -236,7 +236,7 @@ public:
return mName;
}
ComponentInterfaceSymbol GetVendor() override
VendorSymbol GetVendor() override
{
return { mVendor };
}
@ -251,7 +251,7 @@ public:
return mDescription;
}
ComponentInterfaceSymbol GetFamilyId() override
EffectFamilySymbol GetFamily() override
{
return VSTPLUGINTYPE;
}
@ -331,7 +331,7 @@ ComponentInterfaceSymbol VSTEffectsModule::GetSymbol()
return XO("VST Effects");
}
ComponentInterfaceSymbol VSTEffectsModule::GetVendor()
VendorSymbol VSTEffectsModule::GetVendor()
{
return XO("The Audacity Team");
}
@ -1195,7 +1195,7 @@ ComponentInterfaceSymbol VSTEffect::GetSymbol()
return mName;
}
ComponentInterfaceSymbol VSTEffect::GetVendor()
VendorSymbol VSTEffect::GetVendor()
{
return { mVendor };
}
@ -1253,7 +1253,7 @@ EffectType VSTEffect::GetType()
}
ComponentInterfaceSymbol VSTEffect::GetFamilyId()
EffectFamilySymbol VSTEffect::GetFamily()
{
return VSTPLUGINTYPE;
}

View File

@ -89,14 +89,14 @@ class VSTEffect final : public wxEvtHandler,
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;
// EffectDefinitionInterface implementation
EffectType GetType() override;
ComponentInterfaceSymbol GetFamilyId() override;
EffectFamilySymbol GetFamily() override;
bool IsInteractive() override;
bool IsDefault() override;
bool IsLegacy() override;
@ -394,7 +394,7 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;

View File

@ -117,7 +117,7 @@ ComponentInterfaceSymbol AudioUnitEffectsModule::GetSymbol()
return XO("Audio Unit Effects");
}
ComponentInterfaceSymbol AudioUnitEffectsModule::GetVendor()
VendorSymbol AudioUnitEffectsModule::GetVendor()
{
return XO("The Audacity Team");
}
@ -885,7 +885,7 @@ ComponentInterfaceSymbol AudioUnitEffect::GetSymbol()
return mName;
}
ComponentInterfaceSymbol AudioUnitEffect::GetVendor()
VendorSymbol AudioUnitEffect::GetVendor()
{
return { mVendor };
}
@ -932,7 +932,7 @@ EffectType AudioUnitEffect::GetType()
return EffectTypeProcess;
}
ComponentInterfaceSymbol AudioUnitEffect::GetFamilyId()
EffectFamilySymbol AudioUnitEffect::GetFamily()
{
return AUDIOUNITEFFECTS_FAMILY;
}

View File

@ -54,14 +54,14 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;
// EffectComponentInterface implementation
EffectType GetType() override;
ComponentInterfaceSymbol GetFamilyId() override;
EffectFamilySymbol GetFamily() override;
bool IsInteractive() override;
bool IsDefault() override;
bool IsLegacy() override;
@ -233,7 +233,7 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;

View File

@ -124,7 +124,7 @@ ComponentInterfaceSymbol LadspaEffectsModule::GetSymbol()
return XO("LADSPA Effects");
}
ComponentInterfaceSymbol LadspaEffectsModule::GetVendor()
VendorSymbol LadspaEffectsModule::GetVendor()
{
return XO("The Audacity Team");
}
@ -625,7 +625,7 @@ ComponentInterfaceSymbol LadspaEffect::GetSymbol()
return LAT1CTOWX(mData->Name);
}
ComponentInterfaceSymbol LadspaEffect::GetVendor()
VendorSymbol LadspaEffect::GetVendor()
{
return { LAT1CTOWX(mData->Maker) };
}
@ -664,7 +664,7 @@ EffectType LadspaEffect::GetType()
return EffectTypeProcess;
}
ComponentInterfaceSymbol LadspaEffect::GetFamilyId()
EffectFamilySymbol LadspaEffect::GetFamily()
{
return LADSPAEFFECTS_FAMILY;
}

View File

@ -51,14 +51,14 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;
// EffectDefinitionInterface implementation
EffectType GetType() override;
ComponentInterfaceSymbol GetFamilyId() override;
EffectFamilySymbol GetFamily() override;
bool IsInteractive() override;
bool IsDefault() override;
bool IsLegacy() override;
@ -213,7 +213,7 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;

View File

@ -335,7 +335,7 @@ ComponentInterfaceSymbol LV2Effect::GetSymbol()
return LilvString(lilv_plugin_get_name(mPlug), true);
}
ComponentInterfaceSymbol LV2Effect::GetVendor()
VendorSymbol LV2Effect::GetVendor()
{
wxString vendor = LilvString(lilv_plugin_get_author_name(mPlug), true);
@ -381,7 +381,7 @@ EffectType LV2Effect::GetType()
return EffectTypeProcess;
}
ComponentInterfaceSymbol LV2Effect::GetFamilyId()
EffectFamilySymbol LV2Effect::GetFamily()
{
return LV2EFFECTS_FAMILY;
}

View File

@ -111,14 +111,14 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;
// EffectDefinitionInterface implementation
EffectType GetType() override;
ComponentInterfaceSymbol GetFamilyId() override;
EffectFamilySymbol GetFamily() override;
bool IsInteractive() override;
bool IsDefault() override;
bool IsLegacy() override;

View File

@ -103,7 +103,7 @@ ComponentInterfaceSymbol LV2EffectsModule::GetSymbol()
return XO("LV2 Effects");
}
ComponentInterfaceSymbol LV2EffectsModule::GetVendor()
VendorSymbol LV2EffectsModule::GetVendor()
{
return XO("The Audacity Team");
}

View File

@ -78,7 +78,7 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;

View File

@ -106,7 +106,7 @@ ComponentInterfaceSymbol NyquistEffectsModule::GetSymbol()
return XO("Nyquist Effects");
}
ComponentInterfaceSymbol NyquistEffectsModule::GetVendor()
VendorSymbol NyquistEffectsModule::GetVendor()
{
return XO("The Audacity Team");
}

View File

@ -28,7 +28,7 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;

View File

@ -206,7 +206,7 @@ ComponentInterfaceSymbol NyquistEffect::GetSymbol()
return mName;
}
ComponentInterfaceSymbol NyquistEffect::GetVendor()
VendorSymbol NyquistEffect::GetVendor()
{
if (mIsPrompt)
{
@ -262,7 +262,7 @@ EffectType NyquistEffect::GetClassification()
return mType;
}
ComponentInterfaceSymbol NyquistEffect::GetFamilyId()
EffectFamilySymbol NyquistEffect::GetFamily()
{
return NYQUISTEFFECTS_FAMILY;
}
@ -1531,9 +1531,9 @@ wxString NyquistEffect::EscapeString(const wxString & inStr)
return str;
}
std::vector<ComponentInterfaceSymbol> NyquistEffect::ParseChoice(const wxString & text)
std::vector<EnumValueSymbol> NyquistEffect::ParseChoice(const wxString & text)
{
std::vector<ComponentInterfaceSymbol> results;
std::vector<EnumValueSymbol> results;
if (text[0] == wxT('(')) {
// New style: expecting a Lisp-like list of strings
Tokenizer tzer;

View File

@ -32,7 +32,7 @@
Audacity, named in honor of the Swedish-American Harry Nyquist (or Nyqvist).
In the translations of this and other strings, you may transliterate the
name into another alphabet. */
#define NYQUISTEFFECTS_FAMILY ( ComponentInterfaceSymbol{ XO("Nyquist") } )
#define NYQUISTEFFECTS_FAMILY ( EffectFamilySymbol{ XO("Nyquist") } )
#define NYQUIST_PROMPT_ID wxT("Nyquist Prompt")
#define NYQUIST_WORKER_ID wxT("Nyquist Worker")
@ -63,7 +63,7 @@ public:
wxString var;
wxString name;
wxString label;
std::vector<ComponentInterfaceSymbol> choices;
std::vector<EnumValueSymbol> choices;
wxString valStr;
wxString lowStr;
wxString highStr;
@ -88,7 +88,7 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;
@ -99,7 +99,7 @@ public:
EffectType GetType() override;
EffectType GetClassification() override;
ComponentInterfaceSymbol GetFamilyId() override;
EffectFamilySymbol GetFamily() override;
bool IsInteractive() override;
bool IsDefault() override;
@ -149,7 +149,7 @@ private:
static wxString NyquistToWxString(const char *nyqString);
wxString EscapeString(const wxString & inStr);
static std::vector<ComponentInterfaceSymbol> ParseChoice(const wxString & text);
static std::vector<EnumValueSymbol> ParseChoice(const wxString & text);
static int StaticGetCallback(float *buffer, int channel,
long start, long len, long totlen,

View File

@ -80,7 +80,7 @@ ComponentInterfaceSymbol VampEffectsModule::GetSymbol()
return XO("Vamp Effects");
}
ComponentInterfaceSymbol VampEffectsModule::GetVendor()
VendorSymbol VampEffectsModule::GetVendor()
{
return XO("The Audacity Team");
}

View File

@ -32,7 +32,7 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;

View File

@ -97,7 +97,7 @@ ComponentInterfaceSymbol VampEffect::GetSymbol()
return mName;
}
ComponentInterfaceSymbol VampEffect::GetVendor()
VendorSymbol VampEffect::GetVendor()
{
return { wxString::FromUTF8(mPlugin->getMaker().c_str()) };
}
@ -121,7 +121,7 @@ EffectType VampEffect::GetType()
return EffectTypeAnalyze;
}
ComponentInterfaceSymbol VampEffect::GetFamilyId()
EffectFamilySymbol VampEffect::GetFamily()
{
return VAMPEFFECTS_FAMILY;
}
@ -166,7 +166,7 @@ bool VampEffect::GetAutomationParameters(CommandParameters & parms)
mParameters[p].quantizeStep == 1.0 &&
!mParameters[p].valueNames.empty())
{
std::vector<ComponentInterfaceSymbol> choices;
std::vector<EnumValueSymbol> choices;
int val = 0;
for (size_t i = 0, choiceCount = mParameters[p].valueNames.size(); i < choiceCount; i++)
@ -213,7 +213,7 @@ bool VampEffect::SetAutomationParameters(CommandParameters & parms)
mParameters[p].quantizeStep == 1.0 &&
!mParameters[p].valueNames.empty())
{
std::vector<ComponentInterfaceSymbol> choices;
std::vector<EnumValueSymbol> choices;
int val;
for (size_t i = 0, choiceCount = mParameters[p].valueNames.size(); i < choiceCount; i++)
@ -259,7 +259,7 @@ bool VampEffect::SetAutomationParameters(CommandParameters & parms)
mParameters[p].quantizeStep == 1.0 &&
!mParameters[p].valueNames.empty())
{
std::vector<ComponentInterfaceSymbol> choices;
std::vector<EnumValueSymbol> choices;
int val = 0;
for (size_t i = 0, choiceCount = mParameters[p].valueNames.size(); i < choiceCount; i++)

View File

@ -48,14 +48,14 @@ public:
wxString GetPath() override;
ComponentInterfaceSymbol GetSymbol() override;
ComponentInterfaceSymbol GetVendor() override;
VendorSymbol GetVendor() override;
wxString GetVersion() override;
wxString GetDescription() override;
// EffectDefinitionInterface implementation
EffectType GetType() override;
ComponentInterfaceSymbol GetFamilyId() override;
EffectFamilySymbol GetFamily() override;
bool IsInteractive() override;
bool IsDefault() override;

View File

@ -56,7 +56,7 @@ static EncodedEnumSetting formatSetting{
};
//////////
static const ComponentInterfaceSymbol choicesDither[] = {
static const EnumValueSymbol choicesDither[] = {
{ XO("None") },
{ XO("Rectangle") },
{ XO("Triangle") },

View File

@ -157,7 +157,7 @@ WaveTrack::SampleDisplay TracksPrefs::SampleViewChoice()
}
//////////
static const ComponentInterfaceSymbol choicesZoom[] = {
static const EnumValueSymbol choicesZoom[] = {
{ wxT("FitToWidth"), XO("Fit to Width") },
{ wxT("ZoomToSelection"), XO("Zoom to Selection") },
{ wxT("ZoomDefault"), XO("Zoom Default") },

View File

@ -145,7 +145,7 @@ auStaticText * SelectionBar::AddTitle( const wxString & Title, wxSizer * pSizer
NumericTextCtrl * SelectionBar::AddTime( const wxString Name, int id, wxSizer * pSizer ){
auto formatName = mListener ? mListener->AS_GetSelectionFormat()
: NumericFormatId{};
: NumericFormatSymbol{};
auto pCtrl = safenew NumericTextCtrl(
this, id, NumericConverter::TIME, formatName, 0.0, mRate);
pCtrl->SetName(Name);
@ -375,7 +375,7 @@ void SelectionBar::RegenerateTooltips()
auto formatName =
mListener
? mListener->AS_GetSelectionFormat()
: NumericFormatId{};
: NumericFormatSymbol{};
mSnapTo->SetToolTip(
wxString::Format(
_("Snap Clicks/Selections to %s"), formatName.Translation() ));
@ -649,7 +649,7 @@ void SelectionBar::SetSnapTo(int snap)
mSnapTo->SetSelection(snap);
}
void SelectionBar::SetSelectionFormat(const NumericFormatId & format)
void SelectionBar::SetSelectionFormat(const NumericFormatSymbol & format)
{
mStartTime->SetFormatString(mStartTime->GetBuiltinFormat(format));

View File

@ -39,8 +39,6 @@ class wxStaticText;
class SelectionBarListener;
class NumericTextCtrl;
using NumericFormatId = ComponentInterfaceSymbol;
class SelectionBar final : public ToolBar {
public:
@ -56,7 +54,7 @@ class SelectionBar final : public ToolBar {
void SetTimes(double start, double end, double audio);
void SetSnapTo(int);
void SetSelectionFormat(const NumericFormatId & format);
void SetSelectionFormat(const NumericFormatSymbol & format);
void SetRate(double rate);
void SetListener(SelectionBarListener *l);
void RegenerateTooltips() override;

View File

@ -11,8 +11,8 @@
#ifndef __AUDACITY_SELECTION_BAR_LISTENER__
#define __AUDACITY_SELECTION_BAR_LISTENER__
class ComponentInterfaceSymbol;
using NumericFormatId = ComponentInterfaceSymbol;
#include "audacity/Types.h"
class SelectedRegion;
class AUDACITY_DLL_API SelectionBarListener /* not final */ {
@ -26,8 +26,8 @@ class AUDACITY_DLL_API SelectionBarListener /* not final */ {
virtual void AS_SetRate(double rate) = 0;
virtual int AS_GetSnapTo() = 0;
virtual void AS_SetSnapTo(int snap) = 0;
virtual const NumericFormatId & AS_GetSelectionFormat() = 0;
virtual void AS_SetSelectionFormat(const NumericFormatId & format) = 0;
virtual const NumericFormatSymbol & AS_GetSelectionFormat() = 0;
virtual void AS_SetSelectionFormat(const NumericFormatSymbol & format) = 0;
virtual void AS_ModifySelection(double &start, double &end, bool done) = 0;
};

View File

@ -132,10 +132,10 @@ void SpectralSelectionBar::Populate()
auto frequencyFormatName = mListener
? mListener->SSBL_GetFrequencySelectionFormatName()
: NumericFormatId{};
: NumericFormatSymbol{};
auto bandwidthFormatName = mListener
? mListener->SSBL_GetBandwidthSelectionFormatName()
: NumericFormatId{};
: NumericFormatSymbol{};
wxFlexGridSizer *mainSizer;
Add((mainSizer = safenew wxFlexGridSizer(1, 1, 1)), 0,wxALIGN_TOP | wxLEFT | wxTOP, 5);
@ -448,7 +448,7 @@ void SpectralSelectionBar::SetFrequencies(double bottom, double top)
ValuesToControls();
}
void SpectralSelectionBar::SetFrequencySelectionFormatName(const NumericFormatId & formatName)
void SpectralSelectionBar::SetFrequencySelectionFormatName(const NumericFormatSymbol & formatName)
{
NumericTextCtrl *frequencyCtrl = (mbCenterAndWidth ? mCenterCtrl : mLowCtrl);
frequencyCtrl->SetFormatName(formatName);
@ -458,7 +458,7 @@ void SpectralSelectionBar::SetFrequencySelectionFormatName(const NumericFormatId
OnUpdate(e);
}
void SpectralSelectionBar::SetBandwidthSelectionFormatName(const NumericFormatId & formatName)
void SpectralSelectionBar::SetBandwidthSelectionFormatName(const NumericFormatSymbol & formatName)
{
if (mbCenterAndWidth) {
mWidthCtrl->SetFormatName(formatName);

View File

@ -42,8 +42,8 @@ public:
void UpdatePrefs() override;
void SetFrequencies(double bottom, double top);
void SetFrequencySelectionFormatName(const NumericFormatId & formatName);
void SetBandwidthSelectionFormatName(const NumericFormatId & formatName);
void SetFrequencySelectionFormatName(const NumericFormatSymbol & formatName);
void SetBandwidthSelectionFormatName(const NumericFormatSymbol & formatName);
void SetListener(SpectralSelectionBarListener *l);
void RegenerateTooltips() override {};

View File

@ -12,9 +12,7 @@
#define __AUDACITY_SPECTRAL_SELECTION_BAR_LISTENER__
#include "../Audacity.h"
class ComponentInterfaceSymbol;
using NumericFormatId = ComponentInterfaceSymbol;
#include "audacity/Types.h"
class AUDACITY_DLL_API SpectralSelectionBarListener /* not final */ {
@ -25,11 +23,11 @@ class AUDACITY_DLL_API SpectralSelectionBarListener /* not final */ {
virtual double SSBL_GetRate() const = 0;
virtual const NumericFormatId & SSBL_GetFrequencySelectionFormatName() = 0;
virtual void SSBL_SetFrequencySelectionFormatName(const NumericFormatId & formatName) = 0;
virtual const NumericFormatSymbol & SSBL_GetFrequencySelectionFormatName() = 0;
virtual void SSBL_SetFrequencySelectionFormatName(const NumericFormatSymbol & formatName) = 0;
virtual const NumericFormatId & SSBL_GetBandwidthSelectionFormatName() = 0;
virtual void SSBL_SetBandwidthSelectionFormatName(const NumericFormatId & formatName) = 0;
virtual const NumericFormatSymbol & SSBL_GetBandwidthSelectionFormatName() = 0;
virtual void SSBL_SetBandwidthSelectionFormatName(const NumericFormatSymbol & formatName) = 0;
virtual void SSBL_ModifySpectralSelection(double &bottom, double &top, bool done) = 0;
};

View File

@ -29,7 +29,7 @@
#include "../Internat.h"
NumericEditor::NumericEditor
(NumericConverter::Type type, const NumericFormatId &format, double rate)
(NumericConverter::Type type, const NumericFormatSymbol &format, double rate)
{
mType = type;
mFormat = format;
@ -131,7 +131,7 @@ wxString NumericEditor::GetValue() const
return wxString::Format(wxT("%g"), GetNumericTextControl()->GetValue());
}
NumericFormatId NumericEditor::GetFormat() const
NumericFormatSymbol NumericEditor::GetFormat() const
{
return mFormat;
}
@ -141,7 +141,7 @@ double NumericEditor::GetRate() const
return mRate;
}
void NumericEditor::SetFormat(const NumericFormatId &format)
void NumericEditor::SetFormat(const NumericFormatSymbol &format)
{
mFormat = format;
}

View File

@ -31,7 +31,6 @@ class GridAx;
#endif
class NumericTextCtrl;
using NumericFormatId = ComponentInterfaceSymbol;
/**********************************************************************//**
@ -47,7 +46,7 @@ class NumericEditor /* not final */ : public wxGridCellEditor
public:
NumericEditor
(NumericConverter::Type type, const NumericFormatId &format, double rate);
(NumericConverter::Type type, const NumericFormatSymbol &format, double rate);
~NumericEditor();
@ -66,9 +65,9 @@ public:
void Reset() override;
NumericFormatId GetFormat() const;
NumericFormatSymbol GetFormat() const;
double GetRate() const;
void SetFormat(const NumericFormatId &format);
void SetFormat(const NumericFormatSymbol &format);
void SetRate(double rate);
wxGridCellEditor *Clone() const override;
@ -79,7 +78,7 @@ public:
private:
NumericFormatId mFormat;
NumericFormatSymbol mFormat;
double mRate;
NumericConverter::Type mType;
double mOld;

View File

@ -198,7 +198,7 @@ different formats.
* to the user */
struct BuiltinFormatString
{
NumericFormatId name;
NumericFormatSymbol name;
wxString formatStr;
friend inline bool operator ==
@ -559,19 +559,19 @@ static const BuiltinFormatString BandwidthConverterFormats_[] = {
// NumericConverter Class
// ----------------------------------------------------------------------------
//
NumericFormatId NumericConverter::DefaultSelectionFormat()
NumericFormatSymbol NumericConverter::DefaultSelectionFormat()
{ return TimeConverterFormats_[4].name; }
NumericFormatId NumericConverter::TimeAndSampleFormat()
NumericFormatSymbol NumericConverter::TimeAndSampleFormat()
{ return TimeConverterFormats_[5].name; }
NumericFormatId NumericConverter::SecondsFormat()
NumericFormatSymbol NumericConverter::SecondsFormat()
{ return TimeConverterFormats_[0].name; }
NumericFormatId NumericConverter::HundredthsFormat()
NumericFormatSymbol NumericConverter::HundredthsFormat()
{ return TimeConverterFormats_[3].name; }
NumericFormatId NumericConverter::HertzFormat()
NumericFormatSymbol NumericConverter::HertzFormat()
{ return FrequencyConverterFormats_[0].name; }
NumericFormatId NumericConverter::LookupFormat( Type type, const wxString& id)
NumericFormatSymbol NumericConverter::LookupFormat( Type type, const wxString& id)
{
if (id.empty()) {
if (type == TIME)
@ -590,7 +590,7 @@ NumericFormatId NumericConverter::LookupFormat( Type type, const wxString& id)
}
NumericConverter::NumericConverter(Type type,
const NumericFormatId & formatName,
const NumericFormatSymbol & formatName,
double value,
double sampleRate)
: mBuiltinFormatStrings( ChooseBuiltinFormatStrings( type ) )
@ -970,7 +970,7 @@ void NumericConverter::ControlsToValue()
mValue = std::max(mMinValue, std::min(mMaxValue, t));
}
void NumericConverter::SetFormatName(const NumericFormatId & formatName)
void NumericConverter::SetFormatName(const NumericFormatSymbol & formatName)
{
SetFormatString(GetBuiltinFormat(formatName));
}
@ -1054,7 +1054,7 @@ int NumericConverter::GetNumBuiltins()
return mNBuiltins;
}
NumericFormatId NumericConverter::GetBuiltinName(const int index)
NumericFormatSymbol NumericConverter::GetBuiltinName(const int index)
{
if (index >= 0 && index < GetNumBuiltins())
return mBuiltinFormatStrings[index].name;
@ -1070,7 +1070,7 @@ wxString NumericConverter::GetBuiltinFormat(const int index)
return {};
}
wxString NumericConverter::GetBuiltinFormat(const NumericFormatId &name)
wxString NumericConverter::GetBuiltinFormat(const NumericFormatSymbol &name)
{
int ndx =
std::find( mBuiltinFormatStrings, mBuiltinFormatStrings + mNBuiltins,
@ -1211,7 +1211,7 @@ IMPLEMENT_CLASS(NumericTextCtrl, wxControl)
NumericTextCtrl::NumericTextCtrl(wxWindow *parent, wxWindowID id,
NumericConverter::Type type,
const NumericFormatId &formatName,
const NumericFormatSymbol &formatName,
double timeValue,
double sampleRate,
const Options &options,
@ -1285,7 +1285,7 @@ void NumericTextCtrl::UpdateAutoFocus()
}
}
void NumericTextCtrl::SetFormatName(const NumericFormatId & formatName)
void NumericTextCtrl::SetFormatName(const NumericFormatSymbol & formatName)
{
SetFormatString(GetBuiltinFormat(formatName));
}

View File

@ -50,8 +50,6 @@ class NumericField;
class DigitInfo;
using NumericFormatId = ComponentInterfaceSymbol;
class NumericConverter /* not final */
{
public:
@ -62,16 +60,16 @@ public:
BANDWIDTH,
};
static NumericFormatId DefaultSelectionFormat();
static NumericFormatId TimeAndSampleFormat();
static NumericFormatId SecondsFormat();
static NumericFormatId HundredthsFormat();
static NumericFormatId HertzFormat();
static NumericFormatSymbol DefaultSelectionFormat();
static NumericFormatSymbol TimeAndSampleFormat();
static NumericFormatSymbol SecondsFormat();
static NumericFormatSymbol HundredthsFormat();
static NumericFormatSymbol HertzFormat();
static NumericFormatId LookupFormat( Type type, const wxString& id);
static NumericFormatSymbol LookupFormat( Type type, const wxString& id);
NumericConverter(Type type,
const NumericFormatId & formatName = {},
const NumericFormatSymbol & formatName = {},
double value = 0.0f,
double sampleRate = 1.0f /* to prevent div by 0 */);
@ -92,7 +90,7 @@ private:
public:
void PrintDebugInfo();
void SetFormatName(const NumericFormatId & formatName);
void SetFormatName(const NumericFormatSymbol & formatName);
void SetFormatString(const wxString & formatString);
void SetSampleRate(double sampleRate);
void SetValue(double newValue);
@ -108,9 +106,9 @@ public:
int GetFormatIndex();
int GetNumBuiltins();
NumericFormatId GetBuiltinName(const int index);
NumericFormatSymbol GetBuiltinName(const int index);
wxString GetBuiltinFormat(const int index);
wxString GetBuiltinFormat(const NumericFormatId & name);
wxString GetBuiltinFormat(const NumericFormatSymbol & name);
// Adjust the value by the number "steps" in the active format.
// Increment if "dir" is 1, decrement if "dir" is -1.
@ -182,7 +180,7 @@ class NumericTextCtrl final : public wxControl, public NumericConverter
NumericTextCtrl(wxWindow *parent, wxWindowID winid,
NumericConverter::Type type,
const NumericFormatId &formatName = {},
const NumericFormatSymbol &formatName = {},
double value = 0.0,
double sampleRate = 44100,
const Options &options = {},
@ -197,7 +195,7 @@ class NumericTextCtrl final : public wxControl, public NumericConverter
void SetSampleRate(double sampleRate);
void SetValue(double newValue);
void SetFormatString(const wxString & formatString);
void SetFormatName(const NumericFormatId & formatName);
void SetFormatName(const NumericFormatSymbol & formatName);
void SetFieldFocus(int /* digit */);