diff --git a/include/audacity/EffectInterface.h b/include/audacity/EffectInterface.h index c5d09f9bd..382a1359c 100755 --- a/include/audacity/EffectInterface.h +++ b/include/audacity/EffectInterface.h @@ -105,12 +105,7 @@ public: virtual EffectType GetType() = 0; - // This string persists in configuration files - // So config compatibility will break if it is changed across Audacity versions - virtual wxString GetFamilyId() = 0; - - // Returns a user-visible string: - virtual wxString GetFamilyName() = 0; + virtual IdentInterfaceSymbol GetFamilyId() = 0; // These should move to the "EffectClientInterface" class once all // effects have been converted. diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index dfdd75733..afb8cd9bd 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -1443,7 +1443,7 @@ const PluginID & PluginManager::RegisterPlugin(ModuleInterface *provider, Effect plug.SetProviderID(PluginManager::GetID(provider)); plug.SetEffectType(effect->GetType()); - plug.SetEffectFamilyId(effect->GetFamilyId()); + plug.SetEffectFamilyId(effect->GetFamilyId().Internal()); plug.SetEffectInteractive(effect->IsInteractive()); plug.SetEffectDefault(effect->IsDefault()); plug.SetEffectRealtime(effect->SupportsRealtime()); @@ -2414,7 +2414,7 @@ const PluginID & PluginManager::RegisterPlugin(EffectDefinitionInterface *effect PluginDescriptor & plug = CreatePlugin(GetID(effect), effect, type); plug.SetEffectType(effect->GetType()); - plug.SetEffectFamilyId(effect->GetFamilyId()); + plug.SetEffectFamilyId(effect->GetFamilyId().Internal()); plug.SetEffectInteractive(effect->IsInteractive()); plug.SetEffectDefault(effect->IsDefault()); plug.SetEffectRealtime(effect->SupportsRealtime()); @@ -2632,7 +2632,7 @@ PluginID PluginManager::GetID(EffectDefinitionInterface *effect) { return wxString::Format(wxT("%s_%s_%s_%s_%s"), GetPluginTypeString(PluginTypeEffect), - effect->GetFamilyId(), + effect->GetFamilyId().Internal(), effect->GetVendor(), effect->GetName(), effect->GetPath()); diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 43f7156c4..3420df140 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -217,33 +217,16 @@ wxString Effect::GetDescription() return wxEmptyString; } -wxString Effect::GetFamilyId() +IdentInterfaceSymbol Effect::GetFamilyId() { if (mClient) { return mClient->GetFamilyId(); } - // PRL: In 2.2.2 we wanted to change the user-visible name to - // "Built-in" but we did not do it the obvious way by just changing this - // string, because of problems with compatibility of pluginsettings.cfg - // See PluginDescriptor::GetTranslatedEffectFamily and - // EffectUIHost::OnMenu - // See PluginManager::RegisterPlugin and PluginManager::GetID, where the - // return value is also (mis?)used for internal identification purposes, - // NOT as a user-visible string! - // Thereby affecting configuration file contents! - return XO("Audacity"); -} - -wxString Effect::GetFamilyName() -{ - if (mClient) - { - return mClient->GetFamilyName(); - } - - return XO("Built-in"); + // Unusually, the internal and visible strings differ for the built-in + // effect family. + return { wxT("Audacity"), XO("Built-in") }; } bool Effect::IsInteractive() @@ -2516,7 +2499,7 @@ void Effect::Preview(bool dryOnly) wxWindow *FocusDialog = wxWindow::FindFocus(); double previewDuration; - bool isNyquist = GetFamilyId().IsSameAs(NYQUISTEFFECTS_FAMILY); + bool isNyquist = GetFamilyId() == NYQUISTEFFECTS_FAMILY; bool isGenerator = GetType() == EffectTypeGenerate; // Mix a few seconds of audio from all of the tracks @@ -3366,7 +3349,7 @@ void EffectUIHost::OnCancel(wxCommandEvent & WXUNUSED(evt)) void EffectUIHost::OnHelp(wxCommandEvent & WXUNUSED(event)) { - if (mEffect && mEffect->GetFamilyId().IsSameAs(NYQUISTEFFECTS_FAMILY) && (mEffect->ManualPage().IsEmpty())) { + if (mEffect && mEffect->GetFamilyId() == NYQUISTEFFECTS_FAMILY && (mEffect->ManualPage().IsEmpty())) { // 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); @@ -3458,7 +3441,7 @@ void EffectUIHost::OnMenu(wxCommandEvent & WXUNUSED(evt)) auto sub = std::make_unique(); sub->Append(kDummyID, wxString::Format(_("Type: %s"), - ::wxGetTranslation( mEffect->GetFamilyName() ))); + ::wxGetTranslation( mEffect->GetFamilyId().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"), GetCustomTranslation(mEffect->GetVendor()))); diff --git a/src/effects/Effect.h b/src/effects/Effect.h index de5d41e6c..8aad65636 100644 --- a/src/effects/Effect.h +++ b/src/effects/Effect.h @@ -92,8 +92,7 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler, // EffectDefinitionInterface implementation EffectType GetType() override; - wxString GetFamilyId() override; - wxString GetFamilyName() override; + IdentInterfaceSymbol GetFamilyId() override; bool IsInteractive() override; bool IsDefault() override; bool IsLegacy() override; diff --git a/src/effects/EffectManager.cpp b/src/effects/EffectManager.cpp index c73638096..0c3fc6536 100644 --- a/src/effects/EffectManager.cpp +++ b/src/effects/EffectManager.cpp @@ -156,7 +156,7 @@ wxString EffectManager::GetEffectFamilyName(const PluginID & ID) { auto effect = GetEffect(ID); if (effect) - return effect->GetFamilyName(); + return effect->GetFamilyId().Translation(); return {}; } diff --git a/src/effects/VST/VSTEffect.cpp b/src/effects/VST/VSTEffect.cpp index 65bfb6004..5046bcb3e 100644 --- a/src/effects/VST/VSTEffect.cpp +++ b/src/effects/VST/VSTEffect.cpp @@ -256,12 +256,7 @@ public: return mDescription; } - wxString GetFamilyId() override - { - return VSTPLUGINTYPE; - } - - wxString GetFamilyName() override + IdentInterfaceSymbol GetFamilyId() override { return VSTPLUGINTYPE; } @@ -1270,12 +1265,7 @@ EffectType VSTEffect::GetType() } -wxString VSTEffect::GetFamilyId() -{ - return VSTPLUGINTYPE; -} - -wxString VSTEffect::GetFamilyName() +IdentInterfaceSymbol VSTEffect::GetFamilyId() { return VSTPLUGINTYPE; } diff --git a/src/effects/VST/VSTEffect.h b/src/effects/VST/VSTEffect.h index 145ca278a..2da0c1197 100644 --- a/src/effects/VST/VSTEffect.h +++ b/src/effects/VST/VSTEffect.h @@ -95,8 +95,7 @@ class VSTEffect final : public wxEvtHandler, // EffectDefinitionInterface implementation EffectType GetType() override; - wxString GetFamilyId() override; - wxString GetFamilyName() override; + IdentInterfaceSymbol GetFamilyId() override; bool IsInteractive() override; bool IsDefault() override; bool IsLegacy() override; diff --git a/src/effects/audiounits/AudioUnitEffect.cpp b/src/effects/audiounits/AudioUnitEffect.cpp index af2b1a578..69452e24e 100644 --- a/src/effects/audiounits/AudioUnitEffect.cpp +++ b/src/effects/audiounits/AudioUnitEffect.cpp @@ -941,12 +941,7 @@ EffectType AudioUnitEffect::GetType() return EffectTypeProcess; } -wxString AudioUnitEffect::GetFamilyId() -{ - return AUDIOUNITEFFECTS_FAMILY; -} - -wxString AudioUnitEffect::GetFamilyName() +IdentInterfaceSymbol AudioUnitEffect::GetFamilyId() { return AUDIOUNITEFFECTS_FAMILY; } diff --git a/src/effects/audiounits/AudioUnitEffect.h b/src/effects/audiounits/AudioUnitEffect.h index 2e8eb028c..b7789796b 100644 --- a/src/effects/audiounits/AudioUnitEffect.h +++ b/src/effects/audiounits/AudioUnitEffect.h @@ -61,8 +61,7 @@ public: // EffectIdentInterface implementation EffectType GetType() override; - wxString GetFamilyId() override; - wxString GetFamilyName() override; + IdentInterfaceSymbol GetFamilyId() override; bool IsInteractive() override; bool IsDefault() override; bool IsLegacy() override; diff --git a/src/effects/ladspa/LadspaEffect.cpp b/src/effects/ladspa/LadspaEffect.cpp index 8c04d399c..c86b4d5e8 100644 --- a/src/effects/ladspa/LadspaEffect.cpp +++ b/src/effects/ladspa/LadspaEffect.cpp @@ -672,12 +672,7 @@ EffectType LadspaEffect::GetType() return EffectTypeProcess; } -wxString LadspaEffect::GetFamilyId() -{ - return LADSPAEFFECTS_FAMILY; -} - -wxString LadspaEffect::GetFamilyName() +IdentInterfaceSymbol LadspaEffect::GetFamilyId() { return LADSPAEFFECTS_FAMILY; } diff --git a/src/effects/ladspa/LadspaEffect.h b/src/effects/ladspa/LadspaEffect.h index bda2ec346..f1d183a56 100644 --- a/src/effects/ladspa/LadspaEffect.h +++ b/src/effects/ladspa/LadspaEffect.h @@ -56,8 +56,7 @@ public: // EffectDefinitionInterface implementation EffectType GetType() override; - wxString GetFamilyId() override; - wxString GetFamilyName() override; + IdentInterfaceSymbol GetFamilyId() override; bool IsInteractive() override; bool IsDefault() override; bool IsLegacy() override; diff --git a/src/effects/lv2/LV2Effect.cpp b/src/effects/lv2/LV2Effect.cpp index a6d03f22b..a2f7af3b8 100644 --- a/src/effects/lv2/LV2Effect.cpp +++ b/src/effects/lv2/LV2Effect.cpp @@ -386,12 +386,7 @@ EffectType LV2Effect::GetType() return EffectTypeProcess; } -wxString LV2Effect::GetFamilyId() -{ - return LV2EFFECTS_FAMILY; -} - -wxString LV2Effect::GetFamilyName() +IdentInterfaceSymbol LV2Effect::GetFamilyId() { return LV2EFFECTS_FAMILY; } diff --git a/src/effects/lv2/LV2Effect.h b/src/effects/lv2/LV2Effect.h index 7fcd01ccd..47df4811e 100644 --- a/src/effects/lv2/LV2Effect.h +++ b/src/effects/lv2/LV2Effect.h @@ -119,8 +119,7 @@ public: // EffectDefinitionInterface implementation EffectType GetType() override; - wxString GetFamilyId() override; - wxString GetFamilyName() override; + IdentInterfaceSymbol GetFamilyId() override; bool IsInteractive() override; bool IsDefault() override; bool IsLegacy() override; diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 040d04bb8..ea0479682 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -260,12 +260,7 @@ EffectType NyquistEffect::GetType() return mType; } -wxString NyquistEffect::GetFamilyId() -{ - return NYQUISTEFFECTS_FAMILY; -} - -wxString NyquistEffect::GetFamilyName() +IdentInterfaceSymbol NyquistEffect::GetFamilyId() { return NYQUISTEFFECTS_FAMILY; } diff --git a/src/effects/nyquist/Nyquist.h b/src/effects/nyquist/Nyquist.h index 5e1994b82..892f47e0e 100644 --- a/src/effects/nyquist/Nyquist.h +++ b/src/effects/nyquist/Nyquist.h @@ -28,7 +28,7 @@ #include "nyx.h" #define NYQUISTEFFECTS_VERSION wxT("1.0.0.0") -#define NYQUISTEFFECTS_FAMILY wxT("Nyquist") +#define NYQUISTEFFECTS_FAMILY ( IdentInterfaceSymbol{ wxT("Nyquist") } ) #define NYQUIST_PROMPT_ID wxT("Nyquist Prompt") #define NYQUIST_TOOLS_PROMPT_ID wxT("Nyquist Tools Prompt") @@ -92,8 +92,7 @@ public: // EffectDefinitionInterface implementation EffectType GetType() override; - wxString GetFamilyId() override; - wxString GetFamilyName() override; + IdentInterfaceSymbol GetFamilyId() override; bool IsInteractive() override; bool IsDefault() override; diff --git a/src/effects/vamp/VampEffect.cpp b/src/effects/vamp/VampEffect.cpp index 2b3b03b75..d2a965d34 100644 --- a/src/effects/vamp/VampEffect.cpp +++ b/src/effects/vamp/VampEffect.cpp @@ -130,12 +130,7 @@ EffectType VampEffect::GetType() return EffectTypeAnalyze; } -wxString VampEffect::GetFamilyId() -{ - return VAMPEFFECTS_FAMILY; -} - -wxString VampEffect::GetFamilyName() +IdentInterfaceSymbol VampEffect::GetFamilyId() { return VAMPEFFECTS_FAMILY; } diff --git a/src/effects/vamp/VampEffect.h b/src/effects/vamp/VampEffect.h index 7f408d157..c4441c188 100644 --- a/src/effects/vamp/VampEffect.h +++ b/src/effects/vamp/VampEffect.h @@ -54,8 +54,7 @@ public: // EffectDefinitionInterface implementation EffectType GetType() override; - wxString GetFamilyId() override; - wxString GetFamilyName() override; + IdentInterfaceSymbol GetFamilyId() override; bool IsInteractive() override; bool IsDefault() override;