Eliminate last use of PluginManager by ModuleManager, breaking cycle

This commit is contained in:
Paul Licameli 2020-02-20 07:48:26 -05:00
parent 02b61532fe
commit d5a22dfb15
3 changed files with 3 additions and 19 deletions

View File

@ -31,7 +31,6 @@ i.e. an alternative to the usual interface, for Audacity.
#include "FileNames.h"
#include "MemoryX.h"
#include "PluginManager.h"
#include "audacity/PluginInterface.h"
@ -488,22 +487,6 @@ void ModuleInterfaceDeleter::operator() (ModuleInterface *pInterface) const
}
}
PluginPaths ModuleManager::FindPluginsForProvider(const PluginID & providerID,
const PluginPath & path)
{
// Instantiate if it hasn't already been done
if (mDynModules.find(providerID) == mDynModules.end())
{
// If it couldn't be created, just give up and return an empty list
if (!CreateProviderInstance(providerID, path))
{
return {};
}
}
return mDynModules[providerID]->FindPluginPaths(PluginManager::Get());
}
bool ModuleManager::RegisterEffectPlugin(const PluginID & providerID, const PluginPath & path, TranslatableString &errMsg)
{
errMsg = {};

View File

@ -103,7 +103,6 @@ public:
auto Providers() const
{ return make_iterator_range(mDynModules.cbegin(), mDynModules.cend()); }
PluginPaths FindPluginsForProvider(const PluginID & provider, const PluginPath & path);
bool RegisterEffectPlugin(const PluginID & provider, const PluginPath & path,
TranslatableString &errMsg);

View File

@ -1382,7 +1382,9 @@ void PluginManager::CheckForUpdates(bool bFast)
else
{
// Collect plugin paths
auto paths = mm.FindPluginsForProvider(plugID, plugPath);
PluginPaths paths;
if (auto provider = mm.CreateProviderInstance( plugID, plugPath ) )
paths = provider->FindPluginPaths( *this );
for (size_t i = 0, cnt = paths.size(); i < cnt; i++)
{
wxString path = paths[i].BeforeFirst(wxT(';'));;