| 262 | } |
| 263 | |
| 264 | std::unique_ptr<ComponentInterface> |
| 265 | VST3EffectsModule::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 | |
| 293 | class VST3PluginValidator final : public PluginProvider::Validator |
| 294 | { |