1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-07 12:12:23 +01:00

Use type aliases PluginPath, PluginPaths...

... for wxString and vector thereof, when holding plugin paths (which may or
may not be interpreted as file paths, depending on the module); to be replaced
later with different types
This commit is contained in:
Paul Licameli
2019-02-27 19:58:02 -05:00
parent 06b3b42794
commit dcd211affa
34 changed files with 179 additions and 169 deletions

View File

@@ -419,7 +419,7 @@ void ModuleManager::InitializeBuiltins()
}
}
ModuleInterface *ModuleManager::LoadModule(const wxString & path)
ModuleInterface *ModuleManager::LoadModule(const PluginPath & path)
{
auto lib = std::make_unique<wxDynamicLibrary>();
@@ -490,12 +490,12 @@ void ModuleManager::RegisterModule(ModuleInterface *inModule)
PluginManager::Get().RegisterPlugin(inModule);
}
void ModuleManager::FindAllPlugins(PluginIDs & providers, wxArrayString & paths)
void ModuleManager::FindAllPlugins(PluginIDs & providers, PluginPaths & paths)
{
PluginManager & pm = PluginManager::Get();
wxArrayString modIDs;
wxArrayString modPaths;
PluginPaths modPaths;
const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeModule);
while (plug)
{
@@ -523,8 +523,8 @@ void ModuleManager::FindAllPlugins(PluginIDs & providers, wxArrayString & paths)
}
}
wxArrayString ModuleManager::FindPluginsForProvider(const PluginID & providerID,
const wxString & path)
PluginPaths ModuleManager::FindPluginsForProvider(const PluginID & providerID,
const PluginPath & path)
{
// Instantiate if it hasn't already been done
if (mDynModules.find(providerID) == mDynModules.end())
@@ -532,14 +532,14 @@ wxArrayString ModuleManager::FindPluginsForProvider(const PluginID & providerID,
// If it couldn't be created, just give up and return an empty list
if (!CreateProviderInstance(providerID, path))
{
return wxArrayString();
return {};
}
}
return mDynModules[providerID]->FindPluginPaths(PluginManager::Get());
}
bool ModuleManager::RegisterEffectPlugin(const PluginID & providerID, const wxString & path, wxString &errMsg)
bool ModuleManager::RegisterEffectPlugin(const PluginID & providerID, const PluginPath & path, wxString &errMsg)
{
errMsg.clear();
if (mDynModules.find(providerID) == mDynModules.end())
@@ -553,7 +553,7 @@ bool ModuleManager::RegisterEffectPlugin(const PluginID & providerID, const wxSt
}
ComponentInterface *ModuleManager::CreateProviderInstance(const PluginID & providerID,
const wxString & path)
const PluginPath & path)
{
if (path.empty() && mDynModules.find(providerID) != mDynModules.end())
{
@@ -564,7 +564,7 @@ ComponentInterface *ModuleManager::CreateProviderInstance(const PluginID & provi
}
ComponentInterface *ModuleManager::CreateInstance(const PluginID & providerID,
const wxString & path)
const PluginPath & path)
{
if (mDynModules.find(providerID) == mDynModules.end())
{
@@ -586,7 +586,7 @@ void ModuleManager::DeleteInstance(const PluginID & providerID,
}
bool ModuleManager::IsProviderValid(const PluginID & WXUNUSED(providerID),
const wxString & path)
const PluginPath & path)
{
// Builtin modules do not have a path
if (path.empty())
@@ -604,7 +604,7 @@ bool ModuleManager::IsProviderValid(const PluginID & WXUNUSED(providerID),
}
bool ModuleManager::IsPluginValid(const PluginID & providerID,
const wxString & path,
const PluginPath & path,
bool bFast)
{
if (mDynModules.find(providerID) == mDynModules.end())