| 269 | } |
| 270 | |
| 271 | unsigned 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 | |
| 300 | std::unique_ptr<ComponentInterface> |
| 301 | VSTEffectsModule::LoadPlugin(const PluginPath & path) |
nothing calls this directly
no test coverage detected