MCPcopy Create free account
hub / github.com/audacity/audacity / CheckPluginUpdates

Method CheckPluginUpdates

libraries/lib-module-manager/PluginManager.cpp:1238–1278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1236}
1237
1238std::map<wxString, std::vector<wxString>> PluginManager::CheckPluginUpdates()
1239{
1240 wxArrayString pathIndex;
1241 for (auto &pair : mRegisteredPlugins) {
1242 auto &plug = pair.second;
1243
1244 // Bypass 2.1.0 placeholders...remove this after a few releases past 2.1.0
1245 if (plug.GetPluginType() != PluginTypeNone)
1246 pathIndex.push_back(plug.GetPath().BeforeFirst(wxT(';')));
1247 }
1248
1249 // Scan for NEW ones.
1250 //
1251 // Because we use the plugins "path" as returned by the providers, we can actually
1252 // have multiple providers report the same path since, at this point, they only
1253 // know that the path might possibly be one supported by the provider.
1254 //
1255 // When the user enables the plugin, each provider that reported it will be asked
1256 // to register the plugin.
1257
1258 auto& moduleManager = ModuleManager::Get();
1259 std::map<wxString, std::vector<wxString>> newPaths;
1260 for(auto& [id, provider] : moduleManager.Providers())
1261 {
1262 const auto paths = provider->FindModulePaths(*this);
1263 for(const auto& path : paths)
1264 {
1265 const auto modulePath = path.BeforeFirst(';');
1266 if (!make_iterator_range(pathIndex).contains(modulePath) ||
1267 make_iterator_range(mEffectPluginsCleared).any_of([&modulePath](const PluginDescriptor& plug) {
1268 return plug.GetPath().BeforeFirst(wxT(';')) == modulePath;
1269 })
1270 )
1271 {
1272 newPaths[modulePath].push_back(id);
1273 }
1274 }
1275 }
1276
1277 return newPaths;
1278}
1279
1280PluginID PluginManager::GetID(const PluginProvider *provider)
1281{

Callers 2

InitPart2Method · 0.80
OnRescanMethod · 0.80

Calls 8

GetFunction · 0.85
make_iterator_rangeFunction · 0.85
GetPluginTypeMethod · 0.80
containsMethod · 0.80
any_ofMethod · 0.80
push_backMethod · 0.45
GetPathMethod · 0.45
FindModulePathsMethod · 0.45

Tested by

no test coverage detected