MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / SetVST

Method SetVST

Source/VSTPlugin.cpp:415–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413}
414
415void 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
453void VSTPlugin::LoadVST(juce::PluginDescription desc)
454{

Callers 1

SpawnModuleOnTheFlyMethod · 0.80

Calls 5

ofLogClass · 0.85
ofToDataPathFunction · 0.85
SetStringMethod · 0.80
openMethod · 0.80
saveMethod · 0.80

Tested by

no test coverage detected