| 413 | } |
| 414 | |
| 415 | void VSTPlugin::SetVST(juce::PluginDescription pluginDesc) |
| 416 | { |
| 417 | ofLog() << "loading Plugin: " << pluginDesc.name << "; Format: " << pluginDesc.pluginFormatName << "; ID: " << pluginDesc.uniqueId; |
| 418 | |
| 419 | juce::String pluginId = pluginDesc.createIdentifierString(); |
| 420 | std::string strPluginId = pluginId.toStdString(); |
| 421 | |
| 422 | if (strPluginId != kInvalidPluginId) |
| 423 | mModuleSaveData.SetString("pluginId", strPluginId); |
| 424 | else |
| 425 | mModuleSaveData.SetString("pluginId", "none"); |
| 426 | |
| 427 | //mark VST as used |
| 428 | if (strPluginId != kInvalidPluginId) |
| 429 | { |
| 430 | ofxJSONElement root; |
| 431 | root.open(ofToDataPath("vst/recent_plugins.json")); |
| 432 | |
| 433 | auto time = juce::Time::getCurrentTime(); |
| 434 | root["vsts"][strPluginId] = (double)time.currentTimeMillis(); |
| 435 | |
| 436 | root.save(ofToDataPath("vst/recent_plugins.json"), true); |
| 437 | } |
| 438 | |
| 439 | if (mPlugin != nullptr && dynamic_cast<juce::AudioPluginInstance*>(mPlugin.get())->getPluginDescription().matchesIdentifierString(pluginId)) |
| 440 | return; //this VST is already loaded! we're all set |
| 441 | |
| 442 | if (mPlugin != nullptr && mWindow != nullptr) |
| 443 | { |
| 444 | VSTWindow* window = mWindow.release(); |
| 445 | delete window; |
| 446 | //delete mWindowOverlay; |
| 447 | //mWindowOverlay = nullptr; |
| 448 | } |
| 449 | |
| 450 | LoadVST(pluginDesc); |
| 451 | } |
| 452 | |
| 453 | void VSTPlugin::LoadVST(juce::PluginDescription desc) |
| 454 | { |
no test coverage detected