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.

664 lines
20KB

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