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

Method LoadPlugin

libraries/lib-vst3/VST3EffectsModule.cpp:264–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264std::unique_ptr<ComponentInterface>
265VST3EffectsModule::LoadPlugin(const PluginPath& pluginPath)
266{
267 try
268 {
269 wxString modulePath;
270 std::string effectUIDString;
271
272 if(!VST3Utils::ParsePluginPath(pluginPath, &modulePath, &effectUIDString))
273 throw std::runtime_error("failed to parse plugin string");
274
275 auto module = GetModule(modulePath);
276 const auto pluginFactory = module->getFactory();
277 for(const auto& classInfo : pluginFactory.classInfos())
278 {
279 if(effectUIDString == classInfo.ID().toString()) {
280 auto result = Factory::Call(module, classInfo);
281 return result;
282 }
283 }
284 throw std::runtime_error("effect UID not found");
285 }
286 catch(std::exception& e)
287 {
288 wxLogError("VST3 Module was not loaded: %s", e.what());
289 }
290 return nullptr;
291}
292
293class VST3PluginValidator final : public PluginProvider::Validator
294{

Callers

nothing calls this directly

Calls 3

CallClass · 0.85
toStringMethod · 0.45
IDMethod · 0.45

Tested by

no test coverage detected