You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

681 lines
21KB

  1. /*
  2. * DISTRHO Cardinal Plugin
  3. * Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 3 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the LICENSE file.
  16. */
  17. #include "rack.hpp"
  18. #include "plugin.hpp"
  19. #include "DistrhoUtils.hpp"
  20. // Cardinal (built-in)
  21. #include "Cardinal/src/plugin.hpp"
  22. // Fundamental
  23. #include "Fundamental/src/plugin.hpp"
  24. // Aria
  25. extern Model* modelSpleet;
  26. extern Model* modelSwerge;
  27. // AudibleInstruments
  28. #include "AudibleInstruments/src/plugin.hpp"
  29. // BogaudioModules - integrate theme/skin support
  30. #include <mutex>
  31. #include <string>
  32. #include <unordered_map>
  33. #include <unordered_set>
  34. #include <vector>
  35. #define private public
  36. #include "BogaudioModules/src/skins.hpp"
  37. #undef private
  38. // BogaudioModules
  39. extern Model* modelAD;
  40. extern Model* modelBogaudioLFO;
  41. extern Model* modelBogaudioNoise;
  42. extern Model* modelBogaudioVCA;
  43. extern Model* modelBogaudioVCF;
  44. extern Model* modelBogaudioVCO;
  45. extern Model* modelOffset;
  46. extern Model* modelSampleHold;
  47. extern Model* modelSwitch;
  48. extern Model* modelSwitch18;
  49. extern Model* modelUnison;
  50. // MockbaModular
  51. #include "MockbaModular/src/plugin.hpp"
  52. #include "MockbaModular/src/MockbaModular.hpp"
  53. #undef min
  54. #define saveBack ignoreMockbaModular1
  55. #define loadBack ignoreMockbaModular2
  56. #include "MockbaModular/src/MockbaModular.cpp"
  57. #undef saveBack
  58. #undef loadBack
  59. std::string loadBack(int) { return "res/Empty_gray.svg"; }
  60. // surgext
  61. #include "surgext/src/SurgeXT.h"
  62. void surgext_rack_initialize();
  63. void surgext_rack_update_theme();
  64. // ValleyAudio
  65. #include "ValleyAudio/src/Valley.hpp"
  66. // known terminal modules
  67. std::vector<Model*> hostTerminalModels;
  68. // plugin instances
  69. Plugin* pluginInstance__Cardinal;
  70. Plugin* pluginInstance__Fundamental;
  71. Plugin* pluginInstance__Aria;
  72. Plugin* pluginInstance__AudibleInstruments;
  73. Plugin* pluginInstance__BogaudioModules;
  74. Plugin* pluginInstance__MockbaModular;
  75. Plugin* pluginInstance__surgext;
  76. Plugin* pluginInstance__ValleyAudio;
  77. namespace rack {
  78. namespace asset {
  79. std::string pluginManifest(const std::string& dirname);
  80. std::string pluginPath(const std::string& dirname);
  81. }
  82. namespace plugin {
  83. struct StaticPluginLoader {
  84. Plugin* const plugin;
  85. FILE* file;
  86. json_t* rootJ;
  87. StaticPluginLoader(Plugin* const p, const char* const name)
  88. : plugin(p),
  89. file(nullptr),
  90. rootJ(nullptr)
  91. {
  92. #ifdef DEBUG
  93. DEBUG("Loading plugin module %s", name);
  94. #endif
  95. p->path = asset::pluginPath(name);
  96. const std::string manifestFilename = asset::pluginManifest(name);
  97. if ((file = std::fopen(manifestFilename.c_str(), "r")) == nullptr)
  98. {
  99. d_stderr2("Manifest file %s does not exist", manifestFilename.c_str());
  100. return;
  101. }
  102. json_error_t error;
  103. if ((rootJ = json_loadf(file, 0, &error)) == nullptr)
  104. {
  105. d_stderr2("JSON parsing error at %s %d:%d %s", manifestFilename.c_str(), error.line, error.column, error.text);
  106. return;
  107. }
  108. // force ABI, we use static plugins so this doesnt matter as long as it builds
  109. json_t* const version = json_string((APP_VERSION_MAJOR + ".0").c_str());
  110. json_object_set(rootJ, "version", version);
  111. json_decref(version);
  112. // Load manifest
  113. p->fromJson(rootJ);
  114. // Reject plugin if slug already exists
  115. if (Plugin* const existingPlugin = getPlugin(p->slug))
  116. throw Exception("Plugin %s is already loaded, not attempting to load it again", p->slug.c_str());
  117. }
  118. ~StaticPluginLoader()
  119. {
  120. if (rootJ != nullptr)
  121. {
  122. // Load modules manifest
  123. json_t* const modulesJ = json_object_get(rootJ, "modules");
  124. plugin->modulesFromJson(modulesJ);
  125. json_decref(rootJ);
  126. plugins.push_back(plugin);
  127. }
  128. if (file != nullptr)
  129. std::fclose(file);
  130. }
  131. bool ok() const noexcept
  132. {
  133. return rootJ != nullptr;
  134. }
  135. void removeModule(const char* const slugToRemove) const noexcept
  136. {
  137. json_t* const modules = json_object_get(rootJ, "modules");
  138. DISTRHO_SAFE_ASSERT_RETURN(modules != nullptr,);
  139. size_t i;
  140. json_t* v;
  141. json_array_foreach(modules, i, v)
  142. {
  143. if (json_t* const slug = json_object_get(v, "slug"))
  144. {
  145. if (const char* const value = json_string_value(slug))
  146. {
  147. if (std::strcmp(value, slugToRemove) == 0)
  148. {
  149. json_array_remove(modules, i);
  150. break;
  151. }
  152. }
  153. }
  154. }
  155. }
  156. };
  157. static void initStatic__Cardinal()
  158. {
  159. Plugin* const p = new Plugin;
  160. pluginInstance__Cardinal = p;
  161. const StaticPluginLoader spl(p, "Cardinal");
  162. if (spl.ok())
  163. {
  164. p->addModel(modelHostAudio2);
  165. p->addModel(modelHostCV);
  166. p->addModel(modelHostMIDI);
  167. p->addModel(modelHostMIDICC);
  168. p->addModel(modelHostMIDIGate);
  169. p->addModel(modelHostMIDIMap);
  170. p->addModel(modelHostParameters);
  171. p->addModel(modelHostParametersMap);
  172. p->addModel(modelHostTime);
  173. p->addModel(modelTextEditor);
  174. /* TODO
  175. #ifdef HAVE_FFTW3F
  176. p->addModel(modelAudioToCVPitch);
  177. #else
  178. */
  179. spl.removeModule("AudioToCVPitch");
  180. /*
  181. #endif
  182. */
  183. spl.removeModule("AIDA-X");
  184. spl.removeModule("AudioFile");
  185. spl.removeModule("Blank");
  186. spl.removeModule("Carla");
  187. spl.removeModule("ExpanderInputMIDI");
  188. spl.removeModule("ExpanderOutputMIDI");
  189. spl.removeModule("HostAudio8");
  190. spl.removeModule("Ildaeil");
  191. spl.removeModule("MPV");
  192. spl.removeModule("SassyScope");
  193. spl.removeModule("glBars");
  194. hostTerminalModels = {
  195. modelHostAudio2,
  196. modelHostCV,
  197. modelHostMIDI,
  198. modelHostMIDICC,
  199. modelHostMIDIGate,
  200. modelHostMIDIMap,
  201. modelHostParameters,
  202. modelHostParametersMap,
  203. modelHostTime,
  204. };
  205. }
  206. }
  207. static void initStatic__Fundamental()
  208. {
  209. Plugin* const p = new Plugin;
  210. pluginInstance__Fundamental = p;
  211. const StaticPluginLoader spl(p, "Fundamental");
  212. if (spl.ok())
  213. {
  214. p->addModel(modelADSR);
  215. p->addModel(modelLFO);
  216. p->addModel(modelMerge);
  217. p->addModel(modelMidSide);
  218. p->addModel(modelNoise);
  219. p->addModel(modelQuantizer);
  220. p->addModel(modelRandom);
  221. p->addModel(modelScope);
  222. p->addModel(modelSplit);
  223. p->addModel(modelSum);
  224. p->addModel(modelVCA_1);
  225. p->addModel(modelVCF);
  226. p->addModel(modelVCMixer);
  227. p->addModel(modelVCO);
  228. spl.removeModule("8vert");
  229. spl.removeModule("Delay");
  230. spl.removeModule("LFO2");
  231. spl.removeModule("Mixer");
  232. spl.removeModule("Mutes");
  233. spl.removeModule("Octave");
  234. spl.removeModule("Pulses");
  235. spl.removeModule("SEQ3");
  236. spl.removeModule("SequentialSwitch1");
  237. spl.removeModule("SequentialSwitch2");
  238. spl.removeModule("VCA");
  239. spl.removeModule("VCO2");
  240. }
  241. }
  242. static void initStatic__Aria()
  243. {
  244. Plugin* const p = new Plugin;
  245. pluginInstance__Aria = p;
  246. const StaticPluginLoader spl(p, "AriaModules");
  247. if (spl.ok())
  248. {
  249. p->addModel(modelSpleet);
  250. p->addModel(modelSwerge);
  251. spl.removeModule("Aleister");
  252. spl.removeModule("Arcane");
  253. spl.removeModule("Atout");
  254. spl.removeModule("Blank");
  255. spl.removeModule("Darius");
  256. spl.removeModule("Grabby");
  257. spl.removeModule("Pokies4");
  258. spl.removeModule("Psychopump");
  259. spl.removeModule("Q");
  260. spl.removeModule("Qqqq");
  261. spl.removeModule("Quack");
  262. spl.removeModule("Quale");
  263. spl.removeModule("Rotatoes4");
  264. spl.removeModule("Smerge");
  265. spl.removeModule("Solomon16");
  266. spl.removeModule("Solomon4");
  267. spl.removeModule("Solomon8");
  268. spl.removeModule("Splirge");
  269. spl.removeModule("Splort");
  270. spl.removeModule("Undular");
  271. }
  272. }
  273. static void initStatic__AudibleInstruments()
  274. {
  275. Plugin* const p = new Plugin;
  276. pluginInstance__AudibleInstruments = p;
  277. const StaticPluginLoader spl(p, "AudibleInstruments");
  278. if (spl.ok())
  279. {
  280. p->addModel(modelPlaits);
  281. spl.removeModule("Blinds");
  282. spl.removeModule("Braids");
  283. spl.removeModule("Branches");
  284. spl.removeModule("Clouds");
  285. spl.removeModule("Elements");
  286. spl.removeModule("Frames");
  287. spl.removeModule("Kinks");
  288. spl.removeModule("Links");
  289. spl.removeModule("Marbles");
  290. spl.removeModule("Rings");
  291. spl.removeModule("Ripples");
  292. spl.removeModule("Shades");
  293. spl.removeModule("Shelves");
  294. spl.removeModule("Stages");
  295. spl.removeModule("Streams");
  296. spl.removeModule("Tides");
  297. spl.removeModule("Tides2");
  298. spl.removeModule("Veils");
  299. spl.removeModule("Warps");
  300. }
  301. }
  302. static void initStatic__BogaudioModules()
  303. {
  304. Plugin* const p = new Plugin;
  305. pluginInstance__BogaudioModules = p;
  306. const StaticPluginLoader spl(p, "BogaudioModules");
  307. if (spl.ok())
  308. {
  309. // Make sure to use match Cardinal theme
  310. Skins& skins(Skins::skins());
  311. skins._default = settings::preferDarkPanels ? "dark" : "light";
  312. p->addModel(modelAD);
  313. p->addModel(modelBogaudioLFO);
  314. p->addModel(modelBogaudioNoise);
  315. p->addModel(modelBogaudioVCA);
  316. p->addModel(modelBogaudioVCF);
  317. p->addModel(modelBogaudioVCO);
  318. p->addModel(modelOffset);
  319. p->addModel(modelSampleHold);
  320. p->addModel(modelSwitch);
  321. p->addModel(modelSwitch18);
  322. p->addModel(modelUnison);
  323. // cat plugins/BogaudioModules/plugin.json | jq -r .modules[].slug - | sort
  324. spl.removeModule("Bogaudio-Additator");
  325. spl.removeModule("Bogaudio-AddrSeq");
  326. spl.removeModule("Bogaudio-AddrSeqX");
  327. spl.removeModule("Bogaudio-ADSR");
  328. spl.removeModule("Bogaudio-AMRM");
  329. spl.removeModule("Bogaudio-Analyzer");
  330. spl.removeModule("Bogaudio-AnalyzerXL");
  331. spl.removeModule("Bogaudio-Arp");
  332. spl.removeModule("Bogaudio-ASR");
  333. spl.removeModule("Bogaudio-Assign");
  334. spl.removeModule("Bogaudio-Blank3");
  335. spl.removeModule("Bogaudio-Blank6");
  336. spl.removeModule("Bogaudio-Bool");
  337. spl.removeModule("Bogaudio-Chirp");
  338. spl.removeModule("Bogaudio-Clpr");
  339. spl.removeModule("Bogaudio-Cmp");
  340. spl.removeModule("Bogaudio-CmpDist");
  341. spl.removeModule("Bogaudio-CVD");
  342. spl.removeModule("Bogaudio-DADSRH");
  343. spl.removeModule("Bogaudio-DADSRHPlus");
  344. spl.removeModule("Bogaudio-Detune");
  345. spl.removeModule("Bogaudio-DGate");
  346. spl.removeModule("Bogaudio-Edge");
  347. spl.removeModule("Bogaudio-EightFO");
  348. spl.removeModule("Bogaudio-EightOne");
  349. spl.removeModule("Bogaudio-EQ");
  350. spl.removeModule("Bogaudio-EQS");
  351. spl.removeModule("Bogaudio-FFB");
  352. spl.removeModule("Bogaudio-FlipFlop");
  353. spl.removeModule("Bogaudio-FMOp");
  354. spl.removeModule("Bogaudio-Follow");
  355. spl.removeModule("Bogaudio-FourFO");
  356. spl.removeModule("Bogaudio-FourMan");
  357. spl.removeModule("Bogaudio-Inv");
  358. spl.removeModule("Bogaudio-Lgsw");
  359. spl.removeModule("Bogaudio-LLFO");
  360. spl.removeModule("Bogaudio-LLPG");
  361. spl.removeModule("Bogaudio-Lmtr");
  362. spl.removeModule("Bogaudio-LPG");
  363. spl.removeModule("Bogaudio-LVCF");
  364. spl.removeModule("Bogaudio-LVCO");
  365. spl.removeModule("Bogaudio-Manual");
  366. spl.removeModule("Bogaudio-Matrix18");
  367. spl.removeModule("Bogaudio-Matrix44");
  368. spl.removeModule("Bogaudio-Matrix44Cvm");
  369. spl.removeModule("Bogaudio-Matrix81");
  370. spl.removeModule("Bogaudio-Matrix88");
  371. spl.removeModule("Bogaudio-Matrix88Cv");
  372. spl.removeModule("Bogaudio-Matrix88M");
  373. spl.removeModule("Bogaudio-MegaGate");
  374. spl.removeModule("Bogaudio-Mix1");
  375. spl.removeModule("Bogaudio-Mix2");
  376. spl.removeModule("Bogaudio-Mix4");
  377. spl.removeModule("Bogaudio-Mix4x");
  378. spl.removeModule("Bogaudio-Mix8");
  379. spl.removeModule("Bogaudio-Mix8x");
  380. spl.removeModule("Bogaudio-Mono");
  381. spl.removeModule("Bogaudio-Mult");
  382. spl.removeModule("Bogaudio-Mumix");
  383. spl.removeModule("Bogaudio-Mute8");
  384. spl.removeModule("Bogaudio-Nsgt");
  385. spl.removeModule("Bogaudio-OneEight");
  386. spl.removeModule("Bogaudio-Pan");
  387. spl.removeModule("Bogaudio-PEQ");
  388. spl.removeModule("Bogaudio-PEQ14");
  389. spl.removeModule("Bogaudio-PEQ14XF");
  390. spl.removeModule("Bogaudio-PEQ6");
  391. spl.removeModule("Bogaudio-PEQ6XF");
  392. spl.removeModule("Bogaudio-Pgmr");
  393. spl.removeModule("Bogaudio-PgmrX");
  394. spl.removeModule("Bogaudio-PolyCon");
  395. spl.removeModule("Bogaudio-PolyCon8");
  396. spl.removeModule("Bogaudio-PolyMult");
  397. spl.removeModule("Bogaudio-PolyOff16");
  398. spl.removeModule("Bogaudio-PolyOff8");
  399. spl.removeModule("Bogaudio-Pressor");
  400. spl.removeModule("Bogaudio-Pulse");
  401. spl.removeModule("Bogaudio-Ranalyzer");
  402. spl.removeModule("Bogaudio-Reftone");
  403. spl.removeModule("Bogaudio-RGate");
  404. spl.removeModule("Bogaudio-Shaper");
  405. spl.removeModule("Bogaudio-ShaperPlus");
  406. spl.removeModule("Bogaudio-Sine");
  407. spl.removeModule("Bogaudio-Slew");
  408. spl.removeModule("Bogaudio-Stack");
  409. spl.removeModule("Bogaudio-Sums");
  410. spl.removeModule("Bogaudio-Switch1616");
  411. spl.removeModule("Bogaudio-Switch44");
  412. spl.removeModule("Bogaudio-Switch81");
  413. spl.removeModule("Bogaudio-Switch88");
  414. spl.removeModule("Bogaudio-UMix");
  415. spl.removeModule("Bogaudio-VCAmp");
  416. spl.removeModule("Bogaudio-VCM");
  417. spl.removeModule("Bogaudio-Velo");
  418. spl.removeModule("Bogaudio-Vish");
  419. spl.removeModule("Bogaudio-VU");
  420. spl.removeModule("Bogaudio-Walk");
  421. spl.removeModule("Bogaudio-Walk2");
  422. spl.removeModule("Bogaudio-XCO");
  423. spl.removeModule("Bogaudio-XFade");
  424. }
  425. }
  426. static void initStatic__MockbaModular()
  427. {
  428. Plugin* const p = new Plugin;
  429. pluginInstance__MockbaModular = p;
  430. const StaticPluginLoader spl(p, "MockbaModular");
  431. if (spl.ok())
  432. {
  433. p->addModel(modelCZOsc);
  434. p->addModel(modelFiltah);
  435. p->addModel(modelMaugOsc);
  436. p->addModel(modelMixah);
  437. p->addModel(modelPannah);
  438. p->addModel(modelReVoltah);
  439. p->addModel(modelShapah);
  440. spl.removeModule("Blank");
  441. spl.removeModule("Comparator");
  442. spl.removeModule("Countah");
  443. spl.removeModule("CZDblSine");
  444. spl.removeModule("CZPulse");
  445. spl.removeModule("CZReso1");
  446. spl.removeModule("CZReso2");
  447. spl.removeModule("CZReso3");
  448. spl.removeModule("CZSaw");
  449. spl.removeModule("CZSawPulse");
  450. spl.removeModule("CZSquare");
  451. spl.removeModule("Dividah");
  452. spl.removeModule("DualBUFFER");
  453. spl.removeModule("DualNOT");
  454. spl.removeModule("DualOR");
  455. spl.removeModule("DualNOR");
  456. spl.removeModule("DualAND");
  457. spl.removeModule("DualNAND");
  458. spl.removeModule("DualXOR");
  459. spl.removeModule("DualXNOR");
  460. spl.removeModule("Feidah");
  461. spl.removeModule("FeidahS");
  462. spl.removeModule("Holdah");
  463. spl.removeModule("MaugSaw");
  464. spl.removeModule("MaugSaw2");
  465. spl.removeModule("MaugShark");
  466. spl.removeModule("MaugSquare");
  467. spl.removeModule("MaugSquare2");
  468. spl.removeModule("MaugSquare3");
  469. spl.removeModule("MaugTriangle");
  470. spl.removeModule("Mixah3");
  471. spl.removeModule("PSelectah");
  472. spl.removeModule("Selectah");
  473. spl.removeModule("UDPClockMaster");
  474. spl.removeModule("UDPClockSlave");
  475. }
  476. }
  477. static void initStatic__surgext()
  478. {
  479. Plugin* const p = new Plugin;
  480. pluginInstance__surgext = p;
  481. const StaticPluginLoader spl(p, "surgext");
  482. if (spl.ok())
  483. {
  484. p->addModel(modelVCOModern);
  485. p->addModel(modelVCOSine);
  486. /*
  487. p->addModel(modelVCOAlias);
  488. p->addModel(modelVCOClassic);
  489. p->addModel(modelVCOFM2);
  490. p->addModel(modelVCOFM3);
  491. p->addModel(modelVCOSHNoise);
  492. p->addModel(modelVCOString);
  493. p->addModel(modelVCOTwist);
  494. p->addModel(modelVCOWavetable);
  495. p->addModel(modelVCOWindow);
  496. */
  497. spl.removeModule("SurgeXTOSCAlias");
  498. spl.removeModule("SurgeXTOSCClassic");
  499. spl.removeModule("SurgeXTOSCFM2");
  500. spl.removeModule("SurgeXTOSCFM3");
  501. spl.removeModule("SurgeXTOSCSHNoise");
  502. spl.removeModule("SurgeXTOSCString");
  503. spl.removeModule("SurgeXTOSCTwist");
  504. spl.removeModule("SurgeXTOSCWavetable");
  505. spl.removeModule("SurgeXTOSCWindow");
  506. // Add the ported ones
  507. p->addModel(modelSurgeLFO);
  508. p->addModel(modelSurgeMixer);
  509. p->addModel(modelSurgeMixerSlider);
  510. p->addModel(modelSurgeModMatrix);
  511. p->addModel(modelSurgeWaveshaper);
  512. /*
  513. p->addModel(modelSurgeDelay);
  514. p->addModel(modelSurgeDelayLineByFreq);
  515. p->addModel(modelSurgeDelayLineByFreqExpanded);
  516. p->addModel(modelSurgeDigitalRingMods);
  517. p->addModel(modelSurgeVCF);
  518. */
  519. spl.removeModule("SurgeXTDelay");
  520. spl.removeModule("SurgeXTDelayLineByFreq");
  521. spl.removeModule("SurgeXTDelayLineByFreqExpanded");
  522. spl.removeModule("SurgeXTDigitalRingMod");
  523. spl.removeModule("SurgeXTVCF");
  524. p->addModel(modelFXNimbus);
  525. spl.removeModule("SurgeXTFXBonsai");
  526. spl.removeModule("SurgeXTFXChorus");
  527. spl.removeModule("SurgeXTFXChow");
  528. spl.removeModule("SurgeXTFXCombulator");
  529. spl.removeModule("SurgeXTDigitalRingMod");
  530. spl.removeModule("SurgeXTFXDistortion");
  531. spl.removeModule("SurgeXTFXExciter");
  532. spl.removeModule("SurgeXTFXEnsemble");
  533. spl.removeModule("SurgeXTFXFlanger");
  534. spl.removeModule("SurgeXTFXFrequencyShifter");
  535. spl.removeModule("SurgeXTFXNeuron");
  536. spl.removeModule("SurgeXTFXPhaser");
  537. spl.removeModule("SurgeXTFXResonator");
  538. spl.removeModule("SurgeXTFXReverb");
  539. spl.removeModule("SurgeXTFXReverb2");
  540. spl.removeModule("SurgeXTFXRingMod");
  541. spl.removeModule("SurgeXTFXRotarySpeaker");
  542. spl.removeModule("SurgeXTFXSpringReverb");
  543. spl.removeModule("SurgeXTFXTreeMonster");
  544. spl.removeModule("SurgeXTFXVocoder");
  545. /*
  546. p->addModel(modelEGxVCA);
  547. p->addModel(modelQuadAD);
  548. p->addModel(modelQuadLFO);
  549. p->addModel(modelUnisonHelper);
  550. p->addModel(modelUnisonHelperCVExpander);
  551. */
  552. spl.removeModule("SurgeXTEGxVCA");
  553. spl.removeModule("SurgeXTQuadAD");
  554. spl.removeModule("SurgeXTQuadLFO");
  555. spl.removeModule("SurgeXTUnisonHelper");
  556. spl.removeModule("SurgeXTUnisonHelperCVExpander");
  557. surgext_rack_initialize();
  558. }
  559. }
  560. /*
  561. static void initStatic__ValleyAudio()
  562. {
  563. Plugin* const p = new Plugin;
  564. pluginInstance__ValleyAudio = p;
  565. const StaticPluginLoader spl(p, "ValleyAudio");
  566. if (spl.ok())
  567. {
  568. p->addModel(modelDexter);
  569. p->addModel(modelInterzone);
  570. spl.removeModule("Amalgam");
  571. spl.removeModule("Feline");
  572. spl.removeModule("Plateau");
  573. spl.removeModule("Terrorform");
  574. spl.removeModule("Topograph");
  575. spl.removeModule("uGraph");
  576. }
  577. }
  578. */
  579. void initStaticPlugins()
  580. {
  581. initStatic__Cardinal();
  582. initStatic__Fundamental();
  583. initStatic__Aria();
  584. initStatic__AudibleInstruments();
  585. initStatic__BogaudioModules();
  586. initStatic__MockbaModular();
  587. initStatic__surgext();
  588. /*
  589. initStatic__ValleyAudio();
  590. */
  591. }
  592. void destroyStaticPlugins()
  593. {
  594. for (Plugin* p : plugins)
  595. delete p;
  596. plugins.clear();
  597. }
  598. void updateStaticPluginsDarkMode()
  599. {
  600. const bool darkMode = settings::preferDarkPanels;
  601. // bogaudio
  602. {
  603. Skins& skins(Skins::skins());
  604. skins._default = darkMode ? "dark" : "light";
  605. std::lock_guard<std::mutex> lock(skins._defaultSkinListenersLock);
  606. for (auto listener : skins._defaultSkinListeners) {
  607. listener->defaultSkinChanged(skins._default);
  608. }
  609. }
  610. // surgext
  611. {
  612. surgext_rack_update_theme();
  613. }
  614. }
  615. }
  616. }