Browse Source

Do plugin init/destroy ourselves, clean whitespace

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.02
falkTX 3 years ago
parent
commit
e56bbe28a4
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 481 additions and 288 deletions
  1. +117
    -0
      plugins/Core.json
  2. +353
    -281
      plugins/plugins.cpp
  3. +11
    -7
      src/CardinalPlugin.cpp

+ 117
- 0
plugins/Core.json View File

@@ -0,0 +1,117 @@
{
"slug": "Core",
"name": "Core",
"version": "2.0.0",
"license": "GPL-3.0-or-later",
"author": "VCV",
"brand": "VCV",
"authorEmail": "support@vcvrack.com",
"authorUrl": "https://vcvrack.com/",
"pluginUrl": "",
"manualUrl": "https://vcvrack.com/manual/Core",
"sourceUrl": "https://github.com/VCVRack/Rack",
"donateUrl": "",
"changelogUrl": "https://github.com/VCVRack/Rack/blob/v2/CHANGELOG.md",
"description": "Necessary modules built into VCV Rack",
"modules": [
{
"slug": "AudioInterface2",
"name": "Audio-2",
"description": "Sends audio and CV to/from an audio device",
"manualUrl": "https://vcvrack.com/manual/Core#Audio",
"tags": [
"External"
]
},
{
"slug": "MIDIToCVInterface",
"name": "MIDI-CV",
"description": "Converts MIDI from an external device to CV and gates",
"manualUrl": "https://vcvrack.com/manual/Core#MIDI-CV",
"tags": [
"External",
"MIDI",
"Polyphonic"
]
},
{
"slug": "MIDICCToCVInterface",
"name": "MIDI-CC",
"description": "Converts MIDI CC from an external device to CV",
"manualUrl": "https://vcvrack.com/manual/Core#MIDI-CC",
"tags": [
"External",
"MIDI"
]
},
{
"slug": "MIDITriggerToCVInterface",
"name": "MIDI-Gate",
"description": "Converts MIDI notes from an external device to gates",
"manualUrl": "https://vcvrack.com/manual/Core#MIDI-Gate",
"tags": [
"External",
"MIDI"
]
},
{
"slug": "MIDI-Map",
"name": "MIDI-Map",
"description": "Controls parameters (knobs, sliders, switches) directly with MIDI CC",
"manualUrl": "https://vcvrack.com/manual/Core#MIDI-Map",
"tags": [
"External",
"MIDI"
]
},
{
"slug": "CV-MIDI",
"name": "CV-MIDI",
"description": "Converts CV to MIDI and sends to an external device",
"manualUrl": "https://vcvrack.com/manual/Core#CV-MIDI",
"tags": [
"External",
"MIDI",
"Polyphonic"
]
},
{
"slug": "CV-CC",
"name": "CV-CC",
"description": "Converts CV to MIDI CC and sends to an external device",
"manualUrl": "https://vcvrack.com/manual/Core#CV-CC",
"tags": [
"External",
"MIDI"
]
},
{
"slug": "CV-Gate",
"name": "CV-Gate",
"description": "Converts gates to MIDI notes and sends to an external device",
"manualUrl": "https://vcvrack.com/manual/Core#CV-Gate",
"tags": [
"External",
"MIDI"
]
},
{
"slug": "Blank",
"name": "Blank",
"description": "A resizable blank panel",
"manualUrl": "https://vcvrack.com/manual/Core#Blank",
"tags": [
"Blank"
]
},
{
"slug": "Notes",
"name": "Notes",
"description": "Write text for patch notes or artist attribution",
"manualUrl": "https://vcvrack.com/manual/Core#Notes",
"tags": [
"Blank"
]
}
]
}

+ 353
- 281
plugins/plugins.cpp View File

@@ -168,258 +168,322 @@ Plugin* pluginInstance__GrandeModular;
Plugin* pluginInstance__ZetaCarinaeModules;

namespace rack {

// core plugins
namespace core {
extern Model* modelAudioInterface2;
extern Model* modelMIDI_CV;
extern Model* modelMIDI_CC;
extern Model* modelMIDI_Gate;
extern Model* modelMIDI_Map;
extern Model* modelCV_MIDI;
extern Model* modelCV_CC;
extern Model* modelCV_Gate;
extern Model* modelBlank;
extern Model* modelNotes;
}

// regular plugins
namespace plugin {

struct StaticPluginLoader {
Plugin* const plugin;
FILE* file;
json_t* rootJ;

StaticPluginLoader(Plugin* const p, const char* const name)
: plugin(p),
file(nullptr),
rootJ(nullptr)
{
p->path = system::join(CARDINAL_PLUGINS_DIR, name);

const std::string manifestFilename = system::join(p->path, "plugin.json");

if ((file = std::fopen(manifestFilename.c_str(), "r")) == nullptr)
{
d_stderr2("Manifest file %s does not exist", manifestFilename.c_str());
return;
}

json_error_t error;
if ((rootJ = json_loadf(file, 0, &error)) == nullptr)
{
d_stderr2("JSON parsing error at %s %d:%d %s", manifestFilename.c_str(), error.line, error.column, error.text);
return;
}

// force ABI, we use static plugins so this doesnt matter as long as it builds
json_t* const version = json_string((APP_VERSION_MAJOR + ".0").c_str());
json_object_set(rootJ, "version", version);
json_decref(version);
}

~StaticPluginLoader()
{
if (rootJ != nullptr)
{
plugin->fromJson(rootJ);
json_decref(rootJ);
plugins.push_back(plugin);
}

if (file != nullptr)
std::fclose(file);
}

bool ok() const noexcept
{
return rootJ != nullptr;
}
Plugin* const plugin;
FILE* file;
json_t* rootJ;

// core
StaticPluginLoader(Plugin* const p)
: plugin(p),
file(nullptr),
rootJ(nullptr)
{
p->path = system::join(CARDINAL_PLUGINS_DIR, "Core.json");

if ((file = std::fopen(p->path.c_str(), "r")) == nullptr)
{
d_stderr2("Manifest file %s does not exist", p->path.c_str());
return;
}

json_error_t error;
if ((rootJ = json_loadf(file, 0, &error)) == nullptr)
{
d_stderr2("JSON parsing error at %s %d:%d %s", p->path.c_str(), error.line, error.column, error.text);
return;
}

// force ABI, we use static plugins so this doesnt matter as long as it builds
json_t* const version = json_string((APP_VERSION_MAJOR + ".0").c_str());
json_object_set(rootJ, "version", version);
json_decref(version);
}

// regular plugins
StaticPluginLoader(Plugin* const p, const char* const name)
: plugin(p),
file(nullptr),
rootJ(nullptr)
{
p->path = system::join(CARDINAL_PLUGINS_DIR, name);

const std::string manifestFilename = system::join(p->path, "plugin.json");

if ((file = std::fopen(manifestFilename.c_str(), "r")) == nullptr)
{
d_stderr2("Manifest file %s does not exist", manifestFilename.c_str());
return;
}

json_error_t error;
if ((rootJ = json_loadf(file, 0, &error)) == nullptr)
{
d_stderr2("JSON parsing error at %s %d:%d %s", manifestFilename.c_str(), error.line, error.column, error.text);
return;
}

// force ABI, we use static plugins so this doesnt matter as long as it builds
json_t* const version = json_string((APP_VERSION_MAJOR + ".0").c_str());
json_object_set(rootJ, "version", version);
json_decref(version);
}

~StaticPluginLoader()
{
if (rootJ != nullptr)
{
plugin->fromJson(rootJ);
json_decref(rootJ);
plugins.push_back(plugin);
}

if (file != nullptr)
std::fclose(file);
}

bool ok() const noexcept
{
return rootJ != nullptr;
}
};

static void initStatic__Core()
{
Plugin* const p = new Plugin;

const StaticPluginLoader spl(p);
if (spl.ok())
{
p->addModel(rack::core::modelAudioInterface2);
p->addModel(rack::core::modelMIDI_CV);
p->addModel(rack::core::modelMIDI_CC);
p->addModel(rack::core::modelMIDI_Gate);
p->addModel(rack::core::modelMIDI_Map);
p->addModel(rack::core::modelCV_MIDI);
p->addModel(rack::core::modelCV_CC);
p->addModel(rack::core::modelCV_Gate);
p->addModel(rack::core::modelBlank);
p->addModel(rack::core::modelNotes);
}
}

static void initStatic__AnimatedCircuits()
{
Plugin* p = new Plugin;
Plugin* const p = new Plugin;
pluginInstance__AnimatedCircuits = p;

const StaticPluginLoader spl(p, "AnimatedCircuits");
if (spl.ok())
{
p->addModel(model_AC_Folding);
}
const StaticPluginLoader spl(p, "AnimatedCircuits");
if (spl.ok())
{
p->addModel(model_AC_Folding);
}
}

static void initStatic__AudibleInstruments()
{
Plugin* p = new Plugin;
Plugin* const p = new Plugin;
pluginInstance__AudibleInstruments = p;

const StaticPluginLoader spl(p, "AudibleInstruments");
if (spl.ok())
{
p->addModel(modelBraids);
p->addModel(modelPlaits);
p->addModel(modelElements);
p->addModel(modelTides);
p->addModel(modelTides2);
p->addModel(modelClouds);
p->addModel(modelWarps);
p->addModel(modelRings);
p->addModel(modelLinks);
p->addModel(modelKinks);
p->addModel(modelShades);
p->addModel(modelBranches);
p->addModel(modelBlinds);
p->addModel(modelVeils);
p->addModel(modelFrames);
p->addModel(modelMarbles);
p->addModel(modelStages);
p->addModel(modelRipples);
p->addModel(modelShelves);
p->addModel(modelStreams);
}
const StaticPluginLoader spl(p, "AudibleInstruments");
if (spl.ok())
{
p->addModel(modelBraids);
p->addModel(modelPlaits);
p->addModel(modelElements);
p->addModel(modelTides);
p->addModel(modelTides2);
p->addModel(modelClouds);
p->addModel(modelWarps);
p->addModel(modelRings);
p->addModel(modelLinks);
p->addModel(modelKinks);
p->addModel(modelShades);
p->addModel(modelBranches);
p->addModel(modelBlinds);
p->addModel(modelVeils);
p->addModel(modelFrames);
p->addModel(modelMarbles);
p->addModel(modelStages);
p->addModel(modelRipples);
p->addModel(modelShelves);
p->addModel(modelStreams);
}
}

static void initStatic__Befaco()
{
Plugin* p = new Plugin;
Plugin* const p = new Plugin;
pluginInstance__Befaco = p;

const StaticPluginLoader spl(p, "Befaco");
if (spl.ok())
{
p->addModel(modelEvenVCO);
p->addModel(modelRampage);
p->addModel(modelABC);
p->addModel(modelSpringReverb);
p->addModel(modelMixer);
p->addModel(modelSlewLimiter);
p->addModel(modelDualAtenuverter);
}
const StaticPluginLoader spl(p, "Befaco");
if (spl.ok())
{
p->addModel(modelEvenVCO);
p->addModel(modelRampage);
p->addModel(modelABC);
p->addModel(modelSpringReverb);
p->addModel(modelMixer);
p->addModel(modelSlewLimiter);
p->addModel(modelDualAtenuverter);
}
}

static void initStatic__BogaudioModules()
{
Plugin* p = new Plugin;
Plugin* const p = new Plugin;
pluginInstance__BogaudioModules = p;

const StaticPluginLoader spl(p, "BogaudioModules");
if (spl.ok())
{
const StaticPluginLoader spl(p, "BogaudioModules");
if (spl.ok())
{
#define modelADSR modelBogaudioADSR
#define modelLFO modelBogaudioLFO
#define modelNoise modelBogaudioNoise
#define modelVCA modelBogaudioVCA
#define modelVCF modelBogaudioVCF
#define modelVCO modelBogaudioVCO
p->addModel(modelVCO);
p->addModel(modelLVCO);
p->addModel(modelSine);
p->addModel(modelPulse);
p->addModel(modelXCO);
p->addModel(modelAdditator);
p->addModel(modelFMOp);
p->addModel(modelChirp);
p->addModel(modelLFO);
p->addModel(modelLLFO);
p->addModel(modelFourFO);
p->addModel(modelEightFO);
p->addModel(modelVCF);
p->addModel(modelLVCF);
p->addModel(modelFFB);
p->addModel(modelEQ);
p->addModel(modelEQS);
p->addModel(modelLPG);
p->addModel(modelLLPG);
p->addModel(modelMegaGate);
p->addModel(modelPEQ);
p->addModel(modelPEQ6);
p->addModel(modelPEQ6XF);
p->addModel(modelPEQ14);
p->addModel(modelPEQ14XF);
p->addModel(modelDADSRH);
p->addModel(modelDADSRHPlus);
p->addModel(modelShaper);
p->addModel(modelShaperPlus);
p->addModel(modelAD);
p->addModel(modelASR);
p->addModel(modelADSR);
p->addModel(modelVish);
p->addModel(modelFollow);
p->addModel(modelDGate);
p->addModel(modelRGate);
p->addModel(modelEdge);
p->addModel(modelNoise);
p->addModel(modelSampleHold);
p->addModel(modelWalk2);
p->addModel(modelWalk);
p->addModel(modelMix8);
p->addModel(modelMix8x);
p->addModel(modelMix4);
p->addModel(modelMix4x);
p->addModel(modelMix2);
p->addModel(modelMix1);
p->addModel(modelVCM);
p->addModel(modelMute8);
p->addModel(modelPan);
p->addModel(modelXFade);
p->addModel(modelVCA);
p->addModel(modelVCAmp);
p->addModel(modelVelo);
p->addModel(modelUMix);
p->addModel(modelMumix);
p->addModel(modelMatrix81);
p->addModel(modelMatrix18);
p->addModel(modelMatrix44);
p->addModel(modelMatrix44Cvm);
p->addModel(modelMatrix88);
p->addModel(modelMatrix88Cv);
p->addModel(modelMatrix88M);
p->addModel(modelSwitch81);
p->addModel(modelSwitch18);
p->addModel(modelSwitch44);
p->addModel(modelSwitch88);
p->addModel(modelSwitch1616);
p->addModel(modelAMRM);
p->addModel(modelPressor);
p->addModel(modelClpr);
p->addModel(modelLmtr);
p->addModel(modelNsgt);
p->addModel(modelCmpDist);
p->addModel(modelOneEight);
p->addModel(modelEightOne);
p->addModel(modelAddrSeq);
p->addModel(modelAddrSeqX);
p->addModel(modelPgmr);
p->addModel(modelPgmrX);
p->addModel(modelVU);
p->addModel(modelAnalyzer);
p->addModel(modelAnalyzerXL);
p->addModel(modelRanalyzer);
p->addModel(modelDetune);
p->addModel(modelStack);
p->addModel(modelReftone);
p->addModel(modelMono);
p->addModel(modelArp);
p->addModel(modelAssign);
p->addModel(modelUnison);
p->addModel(modelPolyCon8);
p->addModel(modelPolyCon16);
p->addModel(modelPolyOff8);
p->addModel(modelPolyOff16);
p->addModel(modelPolyMult);
p->addModel(modelBool);
p->addModel(modelCmp);
p->addModel(modelCVD);
p->addModel(modelFlipFlop);
p->addModel(modelInv);
p->addModel(modelManual);
p->addModel(modelFourMan);
p->addModel(modelMult);
p->addModel(modelOffset);
p->addModel(modelSlew);
p->addModel(modelSums);
p->addModel(modelSwitch);
p->addModel(modelLgsw);
p->addModel(modelBlank3);
p->addModel(modelBlank6);
p->addModel(modelVCO);
p->addModel(modelLVCO);
p->addModel(modelSine);
p->addModel(modelPulse);
p->addModel(modelXCO);
p->addModel(modelAdditator);
p->addModel(modelFMOp);
p->addModel(modelChirp);
p->addModel(modelLFO);
p->addModel(modelLLFO);
p->addModel(modelFourFO);
p->addModel(modelEightFO);
p->addModel(modelVCF);
p->addModel(modelLVCF);
p->addModel(modelFFB);
p->addModel(modelEQ);
p->addModel(modelEQS);
p->addModel(modelLPG);
p->addModel(modelLLPG);
p->addModel(modelMegaGate);
p->addModel(modelPEQ);
p->addModel(modelPEQ6);
p->addModel(modelPEQ6XF);
p->addModel(modelPEQ14);
p->addModel(modelPEQ14XF);
p->addModel(modelDADSRH);
p->addModel(modelDADSRHPlus);
p->addModel(modelShaper);
p->addModel(modelShaperPlus);
p->addModel(modelAD);
p->addModel(modelASR);
p->addModel(modelADSR);
p->addModel(modelVish);
p->addModel(modelFollow);
p->addModel(modelDGate);
p->addModel(modelRGate);
p->addModel(modelEdge);
p->addModel(modelNoise);
p->addModel(modelSampleHold);
p->addModel(modelWalk2);
p->addModel(modelWalk);
p->addModel(modelMix8);
p->addModel(modelMix8x);
p->addModel(modelMix4);
p->addModel(modelMix4x);
p->addModel(modelMix2);
p->addModel(modelMix1);
p->addModel(modelVCM);
p->addModel(modelMute8);
p->addModel(modelPan);
p->addModel(modelXFade);
p->addModel(modelVCA);
p->addModel(modelVCAmp);
p->addModel(modelVelo);
p->addModel(modelUMix);
p->addModel(modelMumix);
p->addModel(modelMatrix81);
p->addModel(modelMatrix18);
p->addModel(modelMatrix44);
p->addModel(modelMatrix44Cvm);
p->addModel(modelMatrix88);
p->addModel(modelMatrix88Cv);
p->addModel(modelMatrix88M);
p->addModel(modelSwitch81);
p->addModel(modelSwitch18);
p->addModel(modelSwitch44);
p->addModel(modelSwitch88);
p->addModel(modelSwitch1616);
p->addModel(modelAMRM);
p->addModel(modelPressor);
p->addModel(modelClpr);
p->addModel(modelLmtr);
p->addModel(modelNsgt);
p->addModel(modelCmpDist);
p->addModel(modelOneEight);
p->addModel(modelEightOne);
p->addModel(modelAddrSeq);
p->addModel(modelAddrSeqX);
p->addModel(modelPgmr);
p->addModel(modelPgmrX);
p->addModel(modelVU);
p->addModel(modelAnalyzer);
p->addModel(modelAnalyzerXL);
p->addModel(modelRanalyzer);
p->addModel(modelDetune);
p->addModel(modelStack);
p->addModel(modelReftone);
p->addModel(modelMono);
p->addModel(modelArp);
p->addModel(modelAssign);
p->addModel(modelUnison);
p->addModel(modelPolyCon8);
p->addModel(modelPolyCon16);
p->addModel(modelPolyOff8);
p->addModel(modelPolyOff16);
p->addModel(modelPolyMult);
p->addModel(modelBool);
p->addModel(modelCmp);
p->addModel(modelCVD);
p->addModel(modelFlipFlop);
p->addModel(modelInv);
p->addModel(modelManual);
p->addModel(modelFourMan);
p->addModel(modelMult);
p->addModel(modelOffset);
p->addModel(modelSlew);
p->addModel(modelSums);
p->addModel(modelSwitch);
p->addModel(modelLgsw);
p->addModel(modelBlank3);
p->addModel(modelBlank6);
#ifdef EXPERIMENTAL
p->addModel(modelLag);
p->addModel(modelPEQ14XR);
p->addModel(modelPEQ14XV);
p->addModel(modelLag);
p->addModel(modelPEQ14XR);
p->addModel(modelPEQ14XV);
#endif
#ifdef TEST
p->addModel(modelTest);
p->addModel(modelTest2);
p->addModel(modelTestExpanderBase);
p->addModel(modelTestExpanderExtension);
p->addModel(modelTestGl);
p->addModel(modelTestVCF);
p->addModel(modelTest);
p->addModel(modelTest2);
p->addModel(modelTestExpanderBase);
p->addModel(modelTestExpanderExtension);
p->addModel(modelTestGl);
p->addModel(modelTestVCF);
#endif
#undef modelADSR
#undef modelLFO
@@ -427,69 +491,69 @@ static void initStatic__BogaudioModules()
#undef modelVCA
#undef modelVCF
#undef modelVCO
}
}
}

static void initStatic__Fundamental()
{
Plugin* p = new Plugin;
Plugin* const p = new Plugin;
pluginInstance__Fundamental = p;

const StaticPluginLoader spl(p, "Fundamental");
if (spl.ok())
{
p->addModel(modelVCO);
p->addModel(modelVCO2);
p->addModel(modelVCF);
p->addModel(modelVCA_1);
p->addModel(modelVCA);
p->addModel(modelLFO);
p->addModel(modelLFO2);
p->addModel(modelDelay);
p->addModel(modelADSR);
p->addModel(modelVCMixer);
p->addModel(model_8vert);
p->addModel(modelUnity);
p->addModel(modelMutes);
p->addModel(modelPulses);
p->addModel(modelScope);
p->addModel(modelSEQ3);
p->addModel(modelSequentialSwitch1);
p->addModel(modelSequentialSwitch2);
p->addModel(modelOctave);
p->addModel(modelQuantizer);
p->addModel(modelSplit);
p->addModel(modelMerge);
p->addModel(modelSum);
p->addModel(modelViz);
p->addModel(modelMidSide);
p->addModel(modelNoise);
p->addModel(modelRandom);
}
const StaticPluginLoader spl(p, "Fundamental");
if (spl.ok())
{
p->addModel(modelVCO);
p->addModel(modelVCO2);
p->addModel(modelVCF);
p->addModel(modelVCA_1);
p->addModel(modelVCA);
p->addModel(modelLFO);
p->addModel(modelLFO2);
p->addModel(modelDelay);
p->addModel(modelADSR);
p->addModel(modelVCMixer);
p->addModel(model_8vert);
p->addModel(modelUnity);
p->addModel(modelMutes);
p->addModel(modelPulses);
p->addModel(modelScope);
p->addModel(modelSEQ3);
p->addModel(modelSequentialSwitch1);
p->addModel(modelSequentialSwitch2);
p->addModel(modelOctave);
p->addModel(modelQuantizer);
p->addModel(modelSplit);
p->addModel(modelMerge);
p->addModel(modelSum);
p->addModel(modelViz);
p->addModel(modelMidSide);
p->addModel(modelNoise);
p->addModel(modelRandom);
}
}

static void initStatic__GrandeModular()
{
Plugin* p = new Plugin;
Plugin* const p = new Plugin;
pluginInstance__GrandeModular = p;

const StaticPluginLoader spl(p, "GrandeModular");
if (spl.ok())
{
p->addModel(modelClip);
p->addModel(modelMergeSplit4);
p->addModel(modelMicrotonalChords);
p->addModel(modelMicrotonalNotes);
p->addModel(modelNoteMT);
p->addModel(modelPolyMergeResplit);
p->addModel(modelQuant);
p->addModel(modelQuantIntervals);
p->addModel(modelQuantMT);
p->addModel(modelSampleDelays);
p->addModel(modelScale);
p->addModel(modelTails);
p->addModel(modelVarSampleDelays);
}
const StaticPluginLoader spl(p, "GrandeModular");
if (spl.ok())
{
p->addModel(modelClip);
p->addModel(modelMergeSplit4);
p->addModel(modelMicrotonalChords);
p->addModel(modelMicrotonalNotes);
p->addModel(modelNoteMT);
p->addModel(modelPolyMergeResplit);
p->addModel(modelQuant);
p->addModel(modelQuantIntervals);
p->addModel(modelQuantMT);
p->addModel(modelSampleDelays);
p->addModel(modelScale);
p->addModel(modelTails);
p->addModel(modelVarSampleDelays);
}
}

static void initStatic__ZetaCarinaeModules()
@@ -497,30 +561,38 @@ static void initStatic__ZetaCarinaeModules()
Plugin* p = new Plugin;
pluginInstance__ZetaCarinaeModules = p;

const StaticPluginLoader spl(p, "ZetaCarinaeModules");
if (spl.ok())
{
p->addModel(modelBrownianBridge);
p->addModel(modelOrnsteinUhlenbeck);
p->addModel(modelIOU);
p->addModel(modelWarbler);
p->addModel(modelRosenchance);
p->addModel(modelGuildensTurn);
p->addModel(modelRosslerRustler);
p->addModel(modelFirefly);
}
const StaticPluginLoader spl(p, "ZetaCarinaeModules");
if (spl.ok())
{
p->addModel(modelBrownianBridge);
p->addModel(modelOrnsteinUhlenbeck);
p->addModel(modelIOU);
p->addModel(modelWarbler);
p->addModel(modelRosenchance);
p->addModel(modelGuildensTurn);
p->addModel(modelRosslerRustler);
p->addModel(modelFirefly);
}
}

void initStaticPlugins()
{
initStatic__Core();
initStatic__AnimatedCircuits();
initStatic__AudibleInstruments();
initStatic__Befaco();
initStatic__BogaudioModules();
initStatic__BogaudioModules();
initStatic__Fundamental();
initStatic__GrandeModular();
initStatic__GrandeModular();
initStatic__ZetaCarinaeModules();
}

void destroyStaticPlugins()
{
for (Plugin* p : plugins)
delete p;
plugins.clear();
}

}
}

+ 11
- 7
src/CardinalPlugin.cpp View File

@@ -18,9 +18,7 @@
#include <asset.hpp>
#include <audio.hpp>
#include <context.hpp>
#include <gamepad.hpp>
#include <library.hpp>
#include <keyboard.hpp>
#include <midi.hpp>
#include <patch.hpp>
#include <plugin.hpp>
@@ -39,11 +37,13 @@
#ifdef NDEBUG
# undef DEBUG
#endif
#include "DistrhoPlugin.hpp"
namespace rack {
namespace plugin {
void initStaticPlugins();
void destroyStaticPlugins();
}
}
@@ -69,6 +69,9 @@ struct Initializer {
settings::autosaveInterval = 0;
settings::discordUpdateActivity = false;
settings::isPlugin = true;
settings::skipLoadOnLaunch = true;
settings::showTipsOnLaunch = true;
settings::threadCount = 1;
system::init();
asset::init();
logger::init();
@@ -117,20 +120,21 @@ struct Initializer {
audio::init(); // does nothing
midi::init(); // does nothing
// rtaudioInit();
plugin::init();
ui::init();
plugin::initStaticPlugins();
ui::init();
}
~Initializer()
{
using namespace rack;
ui::destroy();
ui::destroy(); // does nothing
INFO("Destroying plugins");
plugin::destroyStaticPlugins();
midi::destroy();
audio::destroy();
plugin::destroy();
INFO("Destroying logger");
logger::destroy();
}


Loading…
Cancel
Save