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

Method DiscoverPluginsAtPath

libraries/lib-vst/VSTEffectsModule.cpp:271–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271unsigned VSTEffectsModule::DiscoverPluginsAtPath(
272 const PluginPath & path, TranslatableString &errMsg,
273 const RegistrationCallback &callback)
274{
275
276 VSTEffectBase effect(path);
277 if(effect.InitializePlugin())
278 {
279 auto effectIDs = effect.GetEffectIDs();
280 if(effectIDs.empty())
281 //Each VST plugin path in Audacity should have id(index) part in it
282 effectIDs.push_back(0);
283
284 for(auto id : effectIDs)
285 {
286 //Subsequent VSTEffect::Load may seem like overhead, but we need
287 //to initialize EffectDefinitionInterface part, which includes
288 //properly formatted plugin path
289 VSTEffectBase subeffect(wxString::Format("%s;%d", path, id));
290 subeffect.Load();
291 if(callback)
292 callback(this, &subeffect);
293 }
294 return effectIDs.size();
295 }
296 errMsg = XO("Could not load the library");
297 return 0;
298}
299
300std::unique_ptr<ComponentInterface>
301VSTEffectsModule::LoadPlugin(const PluginPath & path)

Callers

nothing calls this directly

Calls 7

callbackFunction · 0.85
GetEffectIDsMethod · 0.80
InitializePluginMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45
LoadMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected