Remove PluginManager::GetTranslatedVendor()...

... Instead, use the IdentInterfaceSymbol for vendor reported by the effect
This commit is contained in:
Paul Licameli 2018-03-29 16:26:23 -04:00
parent 0394660e9e
commit 11d217076a
10 changed files with 29 additions and 23 deletions

View File

@ -187,8 +187,9 @@ static bool SortEffectsByName(const PluginDescriptor *a, const PluginDescriptor
static bool SortEffectsByPublisher(const PluginDescriptor *a, const PluginDescriptor *b)
{
wxString akey = a->GetTranslatedVendor();
wxString bkey = b->GetTranslatedVendor();
auto &em = EffectManager::Get();
auto akey = em.GetVendorName(a->GetID());
auto bkey = em.GetVendorName(b->GetID());
if (akey.IsEmpty())
{
@ -210,8 +211,9 @@ static bool SortEffectsByPublisher(const PluginDescriptor *a, const PluginDescri
static bool SortEffectsByPublisherAndName(const PluginDescriptor *a, const PluginDescriptor *b)
{
wxString akey = a->GetTranslatedVendor();
wxString bkey = b->GetTranslatedVendor();
auto &em = EffectManager::Get();
auto akey = em.GetVendorName(a->GetID());
auto bkey = em.GetVendorName(b->GetID());
if (a->IsEffectDefault())
{
@ -1844,7 +1846,7 @@ void AudacityProject::AddEffectMenuItems(CommandManager *c,
if (groupBy == wxT("groupby:publisher"))
{
current = plug->GetTranslatedVendor();
current = EffectManager::Get().GetVendorName(plug->GetID());
if (current.IsEmpty())
{
current = _("Unknown");
@ -1913,7 +1915,7 @@ void AudacityProject::AddEffectMenuItems(CommandManager *c,
wxString group = wxEmptyString;
if (groupBy == wxT("sortby:publisher:name"))
{
group = plug->GetTranslatedVendor();
group = EffectManager::Get().GetVendorName(plug->GetID());
}
else if (groupBy == wxT("sortby:type:name"))
{

View File

@ -1161,16 +1161,11 @@ wxString PluginDescriptor::GetUntranslatedVersion() const
return mVersion;
}
wxString PluginDescriptor::GetUntranslatedVendor() const
wxString PluginDescriptor::GetVendor() const
{
return mVendor;
}
wxString PluginDescriptor::GetTranslatedVendor() const
{
return wxGetTranslation(mVendor);
}
bool PluginDescriptor::IsEnabled() const
{
return mEnabled;
@ -2048,7 +2043,7 @@ void PluginManager::LoadGroup(wxFileConfig *pRegistry, PluginType type)
{
continue;
}
plug.SetVendor(strVal);
plug.SetVendor( strVal );
#if 0
// This was done before version 2.2.2, but the value was not really used
@ -2245,7 +2240,7 @@ void PluginManager::SaveGroup(wxFileConfig *pRegistry, PluginType type)
pRegistry->Write(KEY_NAME, plug.GetSymbol().Msgid());
pRegistry->Write(KEY_VERSION, plug.GetUntranslatedVersion());
pRegistry->Write(KEY_VENDOR, plug.GetUntranslatedVendor());
pRegistry->Write(KEY_VENDOR, plug.GetVendor());
// Write a blank -- see comments in LoadGroup:
pRegistry->Write(KEY_DESCRIPTION, wxString{});
pRegistry->Write(KEY_PROVIDERID, plug.GetProviderID());
@ -2941,7 +2936,7 @@ wxString PluginManager::SettingsPath(const PluginID & ID, bool shared)
wxT("_") +
plug.GetEffectFamilyId() + // is empty for non-Effects
wxT("_") +
plug.GetUntranslatedVendor() +
plug.GetVendor() +
wxT("_") +
(shared ? wxT("") : plug.GetSymbol().Internal());

View File

@ -65,8 +65,8 @@ public:
wxString GetUntranslatedVersion() const;
// There is no translated version
wxString GetUntranslatedVendor() const;
wxString GetTranslatedVendor() const;
wxString GetVendor() const;
bool IsEnabled() const;
bool IsValid() const;

View File

@ -160,6 +160,14 @@ wxString EffectManager::GetEffectFamilyName(const PluginID & ID)
return {};
}
wxString EffectManager::GetVendorName(const PluginID & ID)
{
auto effect = GetEffect(ID);
if (effect)
return effect->GetVendor().Translation();
return {};
}
wxString EffectManager::GetCommandIdentifier(const PluginID & ID)
{
wxString name = PluginManager::Get().GetSymbol(ID).Internal();

View File

@ -81,6 +81,7 @@ public:
bool shouldPrompt = true);
wxString GetEffectFamilyName(const PluginID & ID);
wxString GetVendorName(const PluginID & ID);
/** Run a command given the plugin ID */
// Returns true on success.

View File

@ -243,7 +243,7 @@ public:
IdentInterfaceSymbol GetVendor() override
{
return mVendor;
return { mVendor };
}
wxString GetVersion() override
@ -1210,7 +1210,7 @@ wxString VSTEffect::GetName()
IdentInterfaceSymbol VSTEffect::GetVendor()
{
return mVendor;
return { mVendor };
}
wxString VSTEffect::GetVersion()

View File

@ -897,7 +897,7 @@ wxString AudioUnitEffect::GetName()
IdentInterfaceSymbol AudioUnitEffect::GetVendor()
{
return mVendor;
return { mVendor };
}
wxString AudioUnitEffect::GetVersion()

View File

@ -638,7 +638,7 @@ wxString LadspaEffect::GetName()
IdentInterfaceSymbol LadspaEffect::GetVendor()
{
return LAT1CTOWX(mData->Maker);
return { LAT1CTOWX(mData->Maker) };
}
wxString LadspaEffect::GetVersion()

View File

@ -349,7 +349,7 @@ IdentInterfaceSymbol LV2Effect::GetVendor()
vendor = XO("n/a");
}
return vendor;
return { vendor };
}
wxString LV2Effect::GetVersion()

View File

@ -108,7 +108,7 @@ wxString VampEffect::GetName()
IdentInterfaceSymbol VampEffect::GetVendor()
{
return wxString::FromUTF8(mPlugin->getMaker().c_str());
return { wxString::FromUTF8(mPlugin->getMaker().c_str()) };
}
wxString VampEffect::GetVersion()