Signed-off-by: falkTX <falktx@falktx.com>tags/23.02
| @@ -311,9 +311,11 @@ endif | |||||
| PLUGIN_FILES += $(filter-out Fundamental/src/plugin.cpp,$(wildcard Fundamental/src/*.cpp)) | PLUGIN_FILES += $(filter-out Fundamental/src/plugin.cpp,$(wildcard Fundamental/src/*.cpp)) | ||||
| PLUGIN_FILES += Fundamental/src/dr_wav.c | PLUGIN_FILES += Fundamental/src/dr_wav.c | ||||
| MINIPLUGIN_FILES += Fundamental/src/ADSR.cpp | |||||
| MINIPLUGIN_FILES += Fundamental/src/LFO.cpp | MINIPLUGIN_FILES += Fundamental/src/LFO.cpp | ||||
| MINIPLUGIN_FILES += Fundamental/src/Noise.cpp | |||||
| MINIPLUGIN_FILES += Fundamental/src/Random.cpp | |||||
| MINIPLUGIN_FILES += Fundamental/src/VCF.cpp | MINIPLUGIN_FILES += Fundamental/src/VCF.cpp | ||||
| MINIPLUGIN_FILES += Fundamental/src/VCMixer.cpp | |||||
| MINIPLUGIN_FILES += Fundamental/src/VCO.cpp | MINIPLUGIN_FILES += Fundamental/src/VCO.cpp | ||||
| # modules/types which are present in other plugins | # modules/types which are present in other plugins | ||||
| @@ -524,6 +526,16 @@ PLUGIN_FILES += AudibleInstruments/eurorack/streams/svf.cc | |||||
| PLUGIN_FILES += AudibleInstruments/eurorack/streams/vactrol.cc | PLUGIN_FILES += AudibleInstruments/eurorack/streams/vactrol.cc | ||||
| PLUGIN_FILES += AudibleInstruments/eurorack/streams/compressor.cc | PLUGIN_FILES += AudibleInstruments/eurorack/streams/compressor.cc | ||||
| MINIPLUGIN_FILES += AudibleInstruments/src/Plaits.cpp | |||||
| MINIPLUGIN_FILES += $(wildcard AudibleInstruments/eurorack/plaits/dsp/*.cc) | |||||
| MINIPLUGIN_FILES += $(wildcard AudibleInstruments/eurorack/plaits/dsp/engine/*.cc) | |||||
| MINIPLUGIN_FILES += $(wildcard AudibleInstruments/eurorack/plaits/dsp/speech/*.cc) | |||||
| MINIPLUGIN_FILES += $(wildcard AudibleInstruments/eurorack/plaits/dsp/physical_modelling/*.cc) | |||||
| MINIPLUGIN_FILES += AudibleInstruments/eurorack/plaits/resources.cc | |||||
| MINIPLUGIN_FILES += AudibleInstruments/eurorack/stmlib/dsp/atan.cc | |||||
| MINIPLUGIN_FILES += AudibleInstruments/eurorack/stmlib/dsp/units.cc | |||||
| MINIPLUGIN_FILES += AudibleInstruments/eurorack/stmlib/utils/random.cc | |||||
| # -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
| # Autinn | # Autinn | ||||
| @@ -575,6 +587,29 @@ PLUGIN_FILES += $(filter-out BogaudioModules/src/bogaudio.cpp,$(wildcard Bogaudi | |||||
| PLUGIN_FILES += $(wildcard BogaudioModules/src/dsp/*.cpp) | PLUGIN_FILES += $(wildcard BogaudioModules/src/dsp/*.cpp) | ||||
| PLUGIN_FILES += $(wildcard BogaudioModules/src/dsp/filters/*.cpp) | PLUGIN_FILES += $(wildcard BogaudioModules/src/dsp/filters/*.cpp) | ||||
| MINIPLUGIN_FILES += BogaudioModules/src/LFO.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/Noise.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/VCA.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/VCF.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/VCO.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/lfo_base.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/menu.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/module.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/param_quantities.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/poly_channels.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/skins.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/utils.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/vco_base.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/widgets.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/dsp/analyzer.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/dsp/math.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/dsp/noise.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/dsp/oscillator.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/dsp/signal.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/dsp/table.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/dsp/filters/multimode.cpp | |||||
| MINIPLUGIN_FILES += BogaudioModules/src/dsp/filters/resample.cpp | |||||
| # modules/types which are present in other plugins | # modules/types which are present in other plugins | ||||
| BOGAUDIO_CUSTOM = ADSR BlueNoiseGenerator LFO Noise VCA VCO VCF | BOGAUDIO_CUSTOM = ADSR BlueNoiseGenerator LFO Noise VCA VCO VCF | ||||
| BOGAUDIO_CUSTOM_PER_FILE = ARQuantity AttackMenuItem ReleaseMenuItem | BOGAUDIO_CUSTOM_PER_FILE = ARQuantity AttackMenuItem ReleaseMenuItem | ||||
| @@ -1384,8 +1419,10 @@ endif | |||||
| RESOURCE_FILES += Cardinal/res/Miku/Miku.png | RESOURCE_FILES += Cardinal/res/Miku/Miku.png | ||||
| MINIPLUGIN_LIST = Cardinal Fundamental | |||||
| MINIRESOURCE_FILES = $(wildcard Cardinal/res/*.svg) | |||||
| MINIPLUGIN_LIST = AudibleInstruments BogaudioModules Cardinal Fundamental | |||||
| MINIRESOURCE_FILES = $(wildcard AudibleInstruments/res/*.svg) | |||||
| MINIRESOURCE_FILES += $(wildcard BogaudioModules/res/*.svg) | |||||
| MINIRESOURCE_FILES += $(wildcard Cardinal/res/*.svg) | |||||
| MINIRESOURCE_FILES += $(wildcard Fundamental/res/*.svg) | MINIRESOURCE_FILES += $(wildcard Fundamental/res/*.svg) | ||||
| MINIRESOURCE_FILES += $(wildcard Fundamental/res/components/*.svg) | MINIRESOURCE_FILES += $(wildcard Fundamental/res/components/*.svg) | ||||
| MINIRESOURCE_FILES += Fundamental/presets | MINIRESOURCE_FILES += Fundamental/presets | ||||
| @@ -26,12 +26,34 @@ | |||||
| // Fundamental | // Fundamental | ||||
| #include "Fundamental/src/plugin.hpp" | #include "Fundamental/src/plugin.hpp" | ||||
| // AudibleInstruments | |||||
| #include "AudibleInstruments/src/plugin.hpp" | |||||
| // BogaudioModules - integrate theme/skin support | |||||
| #include <mutex> | |||||
| #include <string> | |||||
| #include <unordered_map> | |||||
| #include <unordered_set> | |||||
| #include <vector> | |||||
| #define private public | |||||
| #include "BogaudioModules/src/skins.hpp" | |||||
| #undef private | |||||
| // BogaudioModules | |||||
| extern Model* modelBogaudioLFO; | |||||
| extern Model* modelBogaudioNoise; | |||||
| extern Model* modelBogaudioVCA; | |||||
| extern Model* modelBogaudioVCF; | |||||
| extern Model* modelBogaudioVCO; | |||||
| // known terminal modules | // known terminal modules | ||||
| std::vector<Model*> hostTerminalModels; | std::vector<Model*> hostTerminalModels; | ||||
| // plugin instances | // plugin instances | ||||
| Plugin* pluginInstance__Cardinal; | Plugin* pluginInstance__Cardinal; | ||||
| Plugin* pluginInstance__Fundamental; | Plugin* pluginInstance__Fundamental; | ||||
| Plugin* pluginInstance__AudibleInstruments; | |||||
| Plugin* pluginInstance__BogaudioModules; | |||||
| namespace rack { | namespace rack { | ||||
| @@ -187,32 +209,192 @@ static void initStatic__Fundamental() | |||||
| const StaticPluginLoader spl(p, "Fundamental"); | const StaticPluginLoader spl(p, "Fundamental"); | ||||
| if (spl.ok()) | if (spl.ok()) | ||||
| { | { | ||||
| p->addModel(modelADSR); | |||||
| p->addModel(modelLFO); | p->addModel(modelLFO); | ||||
| p->addModel(modelNoise); | |||||
| p->addModel(modelRandom); | |||||
| p->addModel(modelVCF); | p->addModel(modelVCF); | ||||
| p->addModel(modelVCO); | |||||
| spl.removeModule("VCO2"); | |||||
| spl.removeModule("VCA-1"); | |||||
| spl.removeModule("VCA"); | |||||
| spl.removeModule("LFO2"); | |||||
| p->addModel(modelVCMixer); | |||||
| spl.removeModule("8vert"); | |||||
| spl.removeModule("ADSR"); | |||||
| spl.removeModule("Delay"); | spl.removeModule("Delay"); | ||||
| spl.removeModule("LFO2"); | |||||
| spl.removeModule("Merge"); | |||||
| spl.removeModule("MidSide"); | |||||
| spl.removeModule("Mixer"); | spl.removeModule("Mixer"); | ||||
| spl.removeModule("VCMixer"); | |||||
| spl.removeModule("8vert"); | |||||
| spl.removeModule("Mutes"); | spl.removeModule("Mutes"); | ||||
| spl.removeModule("Octave"); | |||||
| spl.removeModule("Pulses"); | spl.removeModule("Pulses"); | ||||
| spl.removeModule("Scope"); | |||||
| spl.removeModule("Quantizer"); | |||||
| spl.removeModule("SEQ3"); | spl.removeModule("SEQ3"); | ||||
| spl.removeModule("Scope"); | |||||
| spl.removeModule("SequentialSwitch1"); | spl.removeModule("SequentialSwitch1"); | ||||
| spl.removeModule("SequentialSwitch2"); | spl.removeModule("SequentialSwitch2"); | ||||
| spl.removeModule("Octave"); | |||||
| spl.removeModule("Quantizer"); | |||||
| spl.removeModule("Split"); | spl.removeModule("Split"); | ||||
| spl.removeModule("Merge"); | |||||
| spl.removeModule("Sum"); | spl.removeModule("Sum"); | ||||
| spl.removeModule("MidSide"); | |||||
| spl.removeModule("Noise"); | |||||
| spl.removeModule("Random"); | |||||
| spl.removeModule("VCA"); | |||||
| spl.removeModule("VCA-1"); | |||||
| spl.removeModule("VCO"); | |||||
| spl.removeModule("VCO2"); | |||||
| } | |||||
| } | |||||
| static void initStatic__AudibleInstruments() | |||||
| { | |||||
| Plugin* const p = new Plugin; | |||||
| pluginInstance__AudibleInstruments = p; | |||||
| const StaticPluginLoader spl(p, "AudibleInstruments"); | |||||
| if (spl.ok()) | |||||
| { | |||||
| p->addModel(modelPlaits); | |||||
| spl.removeModule("Blinds"); | |||||
| spl.removeModule("Braids"); | |||||
| spl.removeModule("Branches"); | |||||
| spl.removeModule("Clouds"); | |||||
| spl.removeModule("Elements"); | |||||
| spl.removeModule("Frames"); | |||||
| spl.removeModule("Kinks"); | |||||
| spl.removeModule("Links"); | |||||
| spl.removeModule("Marbles"); | |||||
| spl.removeModule("Rings"); | |||||
| spl.removeModule("Ripples"); | |||||
| spl.removeModule("Shades"); | |||||
| spl.removeModule("Shelves"); | |||||
| spl.removeModule("Stages"); | |||||
| spl.removeModule("Streams"); | |||||
| spl.removeModule("Tides"); | |||||
| spl.removeModule("Tides2"); | |||||
| spl.removeModule("Veils"); | |||||
| spl.removeModule("Warps"); | |||||
| } | |||||
| } | |||||
| static void initStatic__BogaudioModules() | |||||
| { | |||||
| Plugin* const p = new Plugin; | |||||
| pluginInstance__BogaudioModules = p; | |||||
| const StaticPluginLoader spl(p, "BogaudioModules"); | |||||
| if (spl.ok()) | |||||
| { | |||||
| // Make sure to use match Cardinal theme | |||||
| Skins& skins(Skins::skins()); | |||||
| skins._default = settings::darkMode ? "dark" : "light"; | |||||
| p->addModel(modelBogaudioLFO); | |||||
| p->addModel(modelBogaudioNoise); | |||||
| p->addModel(modelBogaudioVCA); | |||||
| p->addModel(modelBogaudioVCF); | |||||
| p->addModel(modelBogaudioVCO); | |||||
| // cat plugins/BogaudioModules/plugin.json | jq -r .modules[].slug - | sort | |||||
| spl.removeModule("Bogaudio-AD"); | |||||
| spl.removeModule("Bogaudio-Additator"); | |||||
| spl.removeModule("Bogaudio-AddrSeq"); | |||||
| spl.removeModule("Bogaudio-AddrSeqX"); | |||||
| spl.removeModule("Bogaudio-ADSR"); | |||||
| spl.removeModule("Bogaudio-AMRM"); | |||||
| spl.removeModule("Bogaudio-Analyzer"); | |||||
| spl.removeModule("Bogaudio-AnalyzerXL"); | |||||
| spl.removeModule("Bogaudio-Arp"); | |||||
| spl.removeModule("Bogaudio-ASR"); | |||||
| spl.removeModule("Bogaudio-Assign"); | |||||
| spl.removeModule("Bogaudio-Blank3"); | |||||
| spl.removeModule("Bogaudio-Blank6"); | |||||
| spl.removeModule("Bogaudio-Bool"); | |||||
| spl.removeModule("Bogaudio-Chirp"); | |||||
| spl.removeModule("Bogaudio-Clpr"); | |||||
| spl.removeModule("Bogaudio-Cmp"); | |||||
| spl.removeModule("Bogaudio-CmpDist"); | |||||
| spl.removeModule("Bogaudio-CVD"); | |||||
| spl.removeModule("Bogaudio-DADSRH"); | |||||
| spl.removeModule("Bogaudio-DADSRHPlus"); | |||||
| spl.removeModule("Bogaudio-Detune"); | |||||
| spl.removeModule("Bogaudio-DGate"); | |||||
| spl.removeModule("Bogaudio-Edge"); | |||||
| spl.removeModule("Bogaudio-EightFO"); | |||||
| spl.removeModule("Bogaudio-EightOne"); | |||||
| spl.removeModule("Bogaudio-EQ"); | |||||
| spl.removeModule("Bogaudio-EQS"); | |||||
| spl.removeModule("Bogaudio-FFB"); | |||||
| spl.removeModule("Bogaudio-FlipFlop"); | |||||
| spl.removeModule("Bogaudio-FMOp"); | |||||
| spl.removeModule("Bogaudio-Follow"); | |||||
| spl.removeModule("Bogaudio-FourFO"); | |||||
| spl.removeModule("Bogaudio-FourMan"); | |||||
| spl.removeModule("Bogaudio-Inv"); | |||||
| spl.removeModule("Bogaudio-Lgsw"); | |||||
| spl.removeModule("Bogaudio-LLFO"); | |||||
| spl.removeModule("Bogaudio-LLPG"); | |||||
| spl.removeModule("Bogaudio-Lmtr"); | |||||
| spl.removeModule("Bogaudio-LPG"); | |||||
| spl.removeModule("Bogaudio-LVCF"); | |||||
| spl.removeModule("Bogaudio-LVCO"); | |||||
| spl.removeModule("Bogaudio-Manual"); | |||||
| spl.removeModule("Bogaudio-Matrix18"); | |||||
| spl.removeModule("Bogaudio-Matrix44"); | |||||
| spl.removeModule("Bogaudio-Matrix44Cvm"); | |||||
| spl.removeModule("Bogaudio-Matrix81"); | |||||
| spl.removeModule("Bogaudio-Matrix88"); | |||||
| spl.removeModule("Bogaudio-Matrix88Cv"); | |||||
| spl.removeModule("Bogaudio-Matrix88M"); | |||||
| spl.removeModule("Bogaudio-MegaGate"); | |||||
| spl.removeModule("Bogaudio-Mix1"); | |||||
| spl.removeModule("Bogaudio-Mix2"); | |||||
| spl.removeModule("Bogaudio-Mix4"); | |||||
| spl.removeModule("Bogaudio-Mix4x"); | |||||
| spl.removeModule("Bogaudio-Mix8"); | |||||
| spl.removeModule("Bogaudio-Mix8x"); | |||||
| spl.removeModule("Bogaudio-Mono"); | |||||
| spl.removeModule("Bogaudio-Mult"); | |||||
| spl.removeModule("Bogaudio-Mumix"); | |||||
| spl.removeModule("Bogaudio-Mute8"); | |||||
| spl.removeModule("Bogaudio-Nsgt"); | |||||
| spl.removeModule("Bogaudio-Offset"); | |||||
| spl.removeModule("Bogaudio-OneEight"); | |||||
| spl.removeModule("Bogaudio-Pan"); | |||||
| spl.removeModule("Bogaudio-PEQ"); | |||||
| spl.removeModule("Bogaudio-PEQ14"); | |||||
| spl.removeModule("Bogaudio-PEQ14XF"); | |||||
| spl.removeModule("Bogaudio-PEQ6"); | |||||
| spl.removeModule("Bogaudio-PEQ6XF"); | |||||
| spl.removeModule("Bogaudio-Pgmr"); | |||||
| spl.removeModule("Bogaudio-PgmrX"); | |||||
| spl.removeModule("Bogaudio-PolyCon"); | |||||
| spl.removeModule("Bogaudio-PolyCon8"); | |||||
| spl.removeModule("Bogaudio-PolyMult"); | |||||
| spl.removeModule("Bogaudio-PolyOff16"); | |||||
| spl.removeModule("Bogaudio-PolyOff8"); | |||||
| spl.removeModule("Bogaudio-Pressor"); | |||||
| spl.removeModule("Bogaudio-Pulse"); | |||||
| spl.removeModule("Bogaudio-Ranalyzer"); | |||||
| spl.removeModule("Bogaudio-Reftone"); | |||||
| spl.removeModule("Bogaudio-RGate"); | |||||
| spl.removeModule("Bogaudio-SampleHold"); | |||||
| spl.removeModule("Bogaudio-Shaper"); | |||||
| spl.removeModule("Bogaudio-ShaperPlus"); | |||||
| spl.removeModule("Bogaudio-Sine"); | |||||
| spl.removeModule("Bogaudio-Slew"); | |||||
| spl.removeModule("Bogaudio-Stack"); | |||||
| spl.removeModule("Bogaudio-Sums"); | |||||
| spl.removeModule("Bogaudio-Switch"); | |||||
| spl.removeModule("Bogaudio-Switch1616"); | |||||
| spl.removeModule("Bogaudio-Switch18"); | |||||
| spl.removeModule("Bogaudio-Switch44"); | |||||
| spl.removeModule("Bogaudio-Switch81"); | |||||
| spl.removeModule("Bogaudio-Switch88"); | |||||
| spl.removeModule("Bogaudio-UMix"); | |||||
| spl.removeModule("Bogaudio-Unison"); | |||||
| spl.removeModule("Bogaudio-VCAmp"); | |||||
| spl.removeModule("Bogaudio-VCM"); | |||||
| spl.removeModule("Bogaudio-Velo"); | |||||
| spl.removeModule("Bogaudio-Vish"); | |||||
| spl.removeModule("Bogaudio-VU"); | |||||
| spl.removeModule("Bogaudio-Walk"); | |||||
| spl.removeModule("Bogaudio-Walk2"); | |||||
| spl.removeModule("Bogaudio-XCO"); | |||||
| spl.removeModule("Bogaudio-XFade"); | |||||
| } | } | ||||
| } | } | ||||
| @@ -220,6 +402,8 @@ void initStaticPlugins() | |||||
| { | { | ||||
| initStatic__Cardinal(); | initStatic__Cardinal(); | ||||
| initStatic__Fundamental(); | initStatic__Fundamental(); | ||||
| initStatic__AudibleInstruments(); | |||||
| initStatic__BogaudioModules(); | |||||
| } | } | ||||
| void destroyStaticPlugins() | void destroyStaticPlugins() | ||||
| @@ -231,7 +415,17 @@ void destroyStaticPlugins() | |||||
| void updateStaticPluginsDarkMode() | void updateStaticPluginsDarkMode() | ||||
| { | { | ||||
| d_stdout("TODO"); | |||||
| const bool darkMode = settings::darkMode; | |||||
| // bogaudio | |||||
| { | |||||
| Skins& skins(Skins::skins()); | |||||
| skins._default = darkMode ? "dark" : "light"; | |||||
| std::lock_guard<std::mutex> lock(skins._defaultSkinListenersLock); | |||||
| for (auto listener : skins._defaultSkinListeners) { | |||||
| listener->defaultSkinChanged(skins._default); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -156,7 +156,7 @@ extern Model* modelChord; | |||||
| // Bidoo | // Bidoo | ||||
| #include "Bidoo/src/plugin.hpp" | #include "Bidoo/src/plugin.hpp" | ||||
| // BogaudioModules - force dark skin as default | |||||
| // BogaudioModules - integrate theme/skin support | |||||
| #include <mutex> | #include <mutex> | ||||
| #include <string> | #include <string> | ||||
| #include <unordered_map> | #include <unordered_map> | ||||
| @@ -0,0 +1 @@ | |||||
| ../override/MenuBar.cpp | |||||
| @@ -0,0 +1 @@ | |||||
| ../override/MenuBar.cpp | |||||
| @@ -0,0 +1 @@ | |||||
| ../override/MenuBar.cpp | |||||
| @@ -0,0 +1 @@ | |||||
| ../override/MenuBar.cpp | |||||
| @@ -76,13 +76,21 @@ bool connectToRemote() | |||||
| RemoteDetails* remoteDetails = ui->remoteDetails; | RemoteDetails* remoteDetails = ui->remoteDetails; | ||||
| #ifdef HAVE_LIBLO | |||||
| #if CARDINAL_VARIANT_MINI | |||||
| if (remoteDetails == nullptr) | |||||
| { | |||||
| ui->remoteDetails = remoteDetails = new RemoteDetails; | |||||
| remoteDetails->handle = ui; | |||||
| remoteDetails->connected = true; | |||||
| remoteDetails->autoDeploy = true; | |||||
| } | |||||
| #elif defined(HAVE_LIBLO) | |||||
| if (remoteDetails == nullptr) | if (remoteDetails == nullptr) | ||||
| { | { | ||||
| const lo_server oscServer = lo_server_new_with_proto(nullptr, LO_UDP, nullptr); | const lo_server oscServer = lo_server_new_with_proto(nullptr, LO_UDP, nullptr); | ||||
| DISTRHO_SAFE_ASSERT_RETURN(oscServer != nullptr, false); | DISTRHO_SAFE_ASSERT_RETURN(oscServer != nullptr, false); | ||||
| remoteDetails = new RemoteDetails; | |||||
| ui->remoteDetails = remoteDetails = new RemoteDetails; | |||||
| remoteDetails->handle = oscServer; | remoteDetails->handle = oscServer; | ||||
| remoteDetails->connected = false; | remoteDetails->connected = false; | ||||
| remoteDetails->autoDeploy = false; | remoteDetails->autoDeploy = false; | ||||
| @@ -106,13 +114,14 @@ void disconnectFromRemote(RemoteDetails* const remote) | |||||
| { | { | ||||
| #ifdef HAVE_LIBLO | #ifdef HAVE_LIBLO | ||||
| lo_server_free(static_cast<lo_server>(remote->handle)); | lo_server_free(static_cast<lo_server>(remote->handle)); | ||||
| delete remote; | |||||
| #endif | #endif | ||||
| delete remote; | |||||
| } | } | ||||
| } | } | ||||
| void idleRemote(RemoteDetails* const remote) | void idleRemote(RemoteDetails* const remote) | ||||
| { | { | ||||
| DISTRHO_SAFE_ASSERT_RETURN(remote != nullptr,); | |||||
| #ifdef HAVE_LIBLO | #ifdef HAVE_LIBLO | ||||
| while (lo_server_recv_noblock(static_cast<lo_server>(remote->handle), 0) != 0) {} | while (lo_server_recv_noblock(static_cast<lo_server>(remote->handle), 0) != 0) {} | ||||
| #endif | #endif | ||||
| @@ -120,15 +129,26 @@ void idleRemote(RemoteDetails* const remote) | |||||
| void deployToRemote(RemoteDetails* const remote) | void deployToRemote(RemoteDetails* const remote) | ||||
| { | { | ||||
| #ifdef HAVE_LIBLO | |||||
| CardinalPluginContext* const context = static_cast<CardinalPluginContext*>(APP); | |||||
| DISTRHO_SAFE_ASSERT_RETURN(context != nullptr,); | |||||
| context->engine->prepareSave(); | |||||
| context->patch->saveAutosave(); | |||||
| context->patch->cleanAutosave(); | |||||
| std::vector<uint8_t> data(rack::system::archiveDirectory(context->patch->autosavePath, 1)); | |||||
| DISTRHO_SAFE_ASSERT_RETURN(data.size() >= 4,); | |||||
| #if CARDINAL_VARIANT_MINI | |||||
| if (char* const patch = String::asBase64(data.data(), data.size()).getAndReleaseBuffer()) | |||||
| { | |||||
| static_cast<CardinalBaseUI*>(remote->handle)->setState("patch", patch); | |||||
| std::free(patch); | |||||
| } | |||||
| #elif defined(HAVE_LIBLO) | |||||
| const lo_address addr = lo_address_new_with_proto(LO_UDP, REMOTE_HOST, REMOTE_HOST_PORT); | const lo_address addr = lo_address_new_with_proto(LO_UDP, REMOTE_HOST, REMOTE_HOST_PORT); | ||||
| DISTRHO_SAFE_ASSERT_RETURN(addr != nullptr,); | DISTRHO_SAFE_ASSERT_RETURN(addr != nullptr,); | ||||
| APP->engine->prepareSave(); | |||||
| APP->patch->saveAutosave(); | |||||
| APP->patch->cleanAutosave(); | |||||
| std::vector<uint8_t> data(rack::system::archiveDirectory(APP->patch->autosavePath, 1)); | |||||
| if (const lo_blob blob = lo_blob_new(data.size(), data.data())) | if (const lo_blob blob = lo_blob_new(data.size(), data.data())) | ||||
| { | { | ||||
| lo_send(addr, "/load", "b", blob); | lo_send(addr, "/load", "b", blob); | ||||
| @@ -139,7 +159,7 @@ void deployToRemote(RemoteDetails* const remote) | |||||
| #endif | #endif | ||||
| } | } | ||||
| void sendScreenshotToRemote(RemoteDetails* const remote, const char* const screenshot) | |||||
| void sendScreenshotToRemote(RemoteDetails*, const char* const screenshot) | |||||
| { | { | ||||
| #ifdef HAVE_LIBLO | #ifdef HAVE_LIBLO | ||||
| const lo_address addr = lo_address_new_with_proto(LO_UDP, REMOTE_HOST, REMOTE_HOST_PORT); | const lo_address addr = lo_address_new_with_proto(LO_UDP, REMOTE_HOST, REMOTE_HOST_PORT); | ||||
| @@ -0,0 +1 @@ | |||||
| ../override/MenuBar.cpp | |||||
| @@ -0,0 +1 @@ | |||||
| ../override/MenuBar.cpp | |||||
| @@ -62,9 +62,6 @@ | |||||
| #endif | #endif | ||||
| namespace rack { | namespace rack { | ||||
| namespace app { | |||||
| widget::Widget* createMenuBar(bool isStandalone); | |||||
| } | |||||
| namespace engine { | namespace engine { | ||||
| void Engine_setAboutToClose(Engine*); | void Engine_setAboutToClose(Engine*); | ||||
| } | } | ||||
| @@ -87,7 +84,7 @@ bool Plugin::writeMidiEvent(const MidiEvent&) noexcept { return false; } | |||||
| // -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
| #ifdef DISTRHO_OS_WASM | |||||
| #if defined(DISTRHO_OS_WASM) && ! CARDINAL_VARIANT_MINI | |||||
| struct WasmWelcomeDialog : rack::widget::OpaqueWidget | struct WasmWelcomeDialog : rack::widget::OpaqueWidget | ||||
| { | { | ||||
| static const constexpr float margin = 10; | static const constexpr float margin = 10; | ||||
| @@ -346,7 +343,10 @@ public: | |||||
| { | { | ||||
| rack::contextSet(context); | rack::contextSet(context); | ||||
| #if ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS | |||||
| #if CARDINAL_VARIANT_MINI | |||||
| DISTRHO_SAFE_ASSERT_RETURN(remoteUtils::connectToRemote(),); | |||||
| DISTRHO_SAFE_ASSERT_RETURN(remoteDetails != nullptr,); | |||||
| // create unique temporary path for this instance | // create unique temporary path for this instance | ||||
| try { | try { | ||||
| char uidBuf[24]; | char uidBuf[24]; | ||||
| @@ -369,7 +369,7 @@ public: | |||||
| const float sampleRate = getSampleRate(); | const float sampleRate = getSampleRate(); | ||||
| rack::settings::sampleRate = sampleRate; | rack::settings::sampleRate = sampleRate; | ||||
| context->bufferSize = 128; | |||||
| context->bufferSize = 1; | |||||
| context->sampleRate = sampleRate; | context->sampleRate = sampleRate; | ||||
| context->engine = new rack::engine::Engine; | context->engine = new rack::engine::Engine; | ||||
| @@ -403,15 +403,6 @@ public: | |||||
| rack::window::WindowSetPluginUI(context->window, this); | rack::window::WindowSetPluginUI(context->window, this); | ||||
| if (rack::widget::Widget* const menuBar = context->scene->menuBar) | |||||
| { | |||||
| context->scene->removeChild(menuBar); | |||||
| delete menuBar; | |||||
| } | |||||
| context->scene->menuBar = rack::app::createMenuBar(getApp().isStandalone()); | |||||
| context->scene->addChildBelow(context->scene->menuBar, context->scene->rackScroll); | |||||
| // hide "Browse VCV Library" button | // hide "Browse VCV Library" button | ||||
| rack::widget::Widget* const browser = context->scene->browser->children.back(); | rack::widget::Widget* const browser = context->scene->browser->children.back(); | ||||
| rack::widget::Widget* const headerLayout = browser->children.front(); | rack::widget::Widget* const headerLayout = browser->children.front(); | ||||
| @@ -444,7 +435,7 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| #ifdef DISTRHO_OS_WASM | |||||
| #if defined(DISTRHO_OS_WASM) && ! CARDINAL_VARIANT_MINI | |||||
| if (rack::patchStorageSlug != nullptr) | if (rack::patchStorageSlug != nullptr) | ||||
| { | { | ||||
| psDialog = new WasmRemotePatchLoadingDialog(true); | psDialog = new WasmRemotePatchLoadingDialog(true); | ||||
| @@ -477,26 +468,18 @@ public: | |||||
| context->nativeWindowId = 0; | context->nativeWindowId = 0; | ||||
| if (rack::widget::Widget* const menuBar = context->scene->menuBar) | |||||
| { | |||||
| context->scene->removeChild(menuBar); | |||||
| delete menuBar; | |||||
| } | |||||
| context->scene->menuBar = rack::app::createMenuBar(); | |||||
| context->scene->addChildBelow(context->scene->menuBar, context->scene->rackScroll); | |||||
| rack::window::WindowSetPluginUI(context->window, nullptr); | rack::window::WindowSetPluginUI(context->window, nullptr); | ||||
| #if ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS | |||||
| context->tlw = nullptr; | |||||
| context->ui = nullptr; | |||||
| #if CARDINAL_VARIANT_MINI | |||||
| { | { | ||||
| const ScopedContext sc(this); | const ScopedContext sc(this); | ||||
| context->patch->clear(); | context->patch->clear(); | ||||
| // do a little dance to prevent context scene deletion from saving to temp dir | // do a little dance to prevent context scene deletion from saving to temp dir | ||||
| #ifndef HEADLESS | |||||
| const ScopedValueSetter<bool> svs(rack::settings::headless, true); | const ScopedValueSetter<bool> svs(rack::settings::headless, true); | ||||
| #endif | |||||
| Engine_setAboutToClose(context->engine); | Engine_setAboutToClose(context->engine); | ||||
| delete context; | delete context; | ||||
| } | } | ||||
| @@ -620,6 +603,10 @@ public: | |||||
| filebrowserhandle = nullptr; | filebrowserhandle = nullptr; | ||||
| } | } | ||||
| #if CARDINAL_VARIANT_MINI | |||||
| context->engine->stepBlock(1); | |||||
| #endif | |||||
| if (windowParameters.rateLimit != 0 && ++rateLimitStep % (windowParameters.rateLimit * 2)) | if (windowParameters.rateLimit != 0 && ++rateLimitStep % (windowParameters.rateLimit * 2)) | ||||
| return; | return; | ||||
| @@ -804,7 +791,7 @@ protected: | |||||
| void stateChanged(const char* const key, const char* const value) override | void stateChanged(const char* const key, const char* const value) override | ||||
| { | { | ||||
| #if ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS | |||||
| #if CARDINAL_VARIANT_MINI | |||||
| if (std::strcmp(key, "patch") == 0) | if (std::strcmp(key, "patch") == 0) | ||||
| { | { | ||||
| if (fAutosavePath.empty()) | if (fAutosavePath.empty()) | ||||
| @@ -952,9 +939,9 @@ protected: | |||||
| #endif | #endif | ||||
| rack::math::Vec scrollDelta = rack::math::Vec(ev.delta.getX(), ev.delta.getY()); | rack::math::Vec scrollDelta = rack::math::Vec(ev.delta.getX(), ev.delta.getY()); | ||||
| #ifndef DISTRHO_OS_MAC | |||||
| #ifndef DISTRHO_OS_MAC | |||||
| scrollDelta = scrollDelta.mult(50.0); | scrollDelta = scrollDelta.mult(50.0); | ||||
| #endif | |||||
| #endif | |||||
| const int mods = glfwMods(ev.mod); | const int mods = glfwMods(ev.mod); | ||||
| const ScopedContext sc(this, mods); | const ScopedContext sc(this, mods); | ||||
| @@ -165,7 +165,6 @@ RACK_FILES += override/context.cpp | |||||
| RACK_FILES += override/minblep.cpp | RACK_FILES += override/minblep.cpp | ||||
| RACK_FILES += override/plugin.cpp | RACK_FILES += override/plugin.cpp | ||||
| RACK_FILES += override/Engine.cpp | RACK_FILES += override/Engine.cpp | ||||
| RACK_FILES += override/MenuBar.cpp | |||||
| RACK_FILES += override/Model.cpp | RACK_FILES += override/Model.cpp | ||||
| RACK_FILES += override/ModuleWidget.cpp | RACK_FILES += override/ModuleWidget.cpp | ||||
| RACK_FILES += override/OpenGlWidget.cpp | RACK_FILES += override/OpenGlWidget.cpp | ||||
| @@ -108,6 +108,7 @@ FILES_DSP += RemoteWindow.cpp | |||||
| else | else | ||||
| FILES_UI = CardinalUI.cpp | FILES_UI = CardinalUI.cpp | ||||
| FILES_UI += glfw.cpp | FILES_UI += glfw.cpp | ||||
| FILES_UI += MenuBar.cpp | |||||
| FILES_UI += Window.cpp | FILES_UI += Window.cpp | ||||
| endif | endif | ||||
| @@ -255,6 +256,7 @@ FILES_UI += CardinalCommon-UI.cpp | |||||
| FILES_UI += CardinalRemote.cpp | FILES_UI += CardinalRemote.cpp | ||||
| FILES_UI += common.cpp | FILES_UI += common.cpp | ||||
| FILES_UI += glfw.cpp | FILES_UI += glfw.cpp | ||||
| FILES_UI += MenuBar.cpp | |||||
| FILES_UI += Window.cpp | FILES_UI += Window.cpp | ||||
| EXTRA_UI_DEPENDENCIES = $(subst -headless,,$(EXTRA_DSP_DEPENDENCIES)) | EXTRA_UI_DEPENDENCIES = $(subst -headless,,$(EXTRA_DSP_DEPENDENCIES)) | ||||
| EXTRA_UI_LIBS += $(subst -headless,,$(EXTRA_DSP_LIBS)) | EXTRA_UI_LIBS += $(subst -headless,,$(EXTRA_DSP_LIBS)) | ||||
| @@ -182,13 +182,10 @@ public: | |||||
| ~CardinalBaseUI() override | ~CardinalBaseUI() override | ||||
| { | { | ||||
| disconnectFromRemote(remoteDetails); | |||||
| remoteUtils::disconnectFromRemote(remoteDetails); | |||||
| if (filebrowserhandle != nullptr) | if (filebrowserhandle != nullptr) | ||||
| fileBrowserClose(filebrowserhandle); | fileBrowserClose(filebrowserhandle); | ||||
| context->tlw = nullptr; | |||||
| context->ui = nullptr; | |||||
| } | } | ||||
| }; | }; | ||||
| #endif | #endif | ||||
| @@ -209,10 +209,15 @@ static void Engine_stepFrame(Engine* that) { | |||||
| float smoothValue = internal->smoothValue; | float smoothValue = internal->smoothValue; | ||||
| Param* smoothParam = &smoothModule->params[smoothParamId]; | Param* smoothParam = &smoothModule->params[smoothParamId]; | ||||
| float value = smoothParam->value; | float value = smoothParam->value; | ||||
| // Use decay rate of roughly 1 graphics frame | |||||
| const float smoothLambda = 60.f; | |||||
| float newValue = value + (smoothValue - value) * smoothLambda * internal->sampleTime; | |||||
| if (value == newValue) { | |||||
| float newValue; | |||||
| if (internal->blockFrames != 1) { | |||||
| // Use decay rate of roughly 1 graphics frame | |||||
| const float smoothLambda = 60.f; | |||||
| newValue = value + (smoothValue - value) * smoothLambda * internal->sampleTime; | |||||
| } else { | |||||
| newValue = value; | |||||
| } | |||||
| if (d_isEqual(value, newValue)) { | |||||
| // Snap to actual smooth value if the value doesn't change enough (due to the granularity of floats) | // Snap to actual smooth value if the value doesn't change enough (due to the granularity of floats) | ||||
| smoothParam->setValue(smoothValue); | smoothParam->setValue(smoothValue); | ||||
| internal->smoothModule = NULL; | internal->smoothModule = NULL; | ||||
| @@ -53,6 +53,7 @@ | |||||
| #include "../CardinalCommon.hpp" | #include "../CardinalCommon.hpp" | ||||
| #include "../CardinalRemote.hpp" | #include "../CardinalRemote.hpp" | ||||
| #include "DistrhoPlugin.hpp" | |||||
| #include "DistrhoStandaloneUtils.hpp" | #include "DistrhoStandaloneUtils.hpp" | ||||
| #ifdef HAVE_LIBLO | #ifdef HAVE_LIBLO | ||||
| @@ -98,14 +99,14 @@ struct MenuButton : ui::Button { | |||||
| struct FileButton : MenuButton { | struct FileButton : MenuButton { | ||||
| const bool isStandalone; | const bool isStandalone; | ||||
| #if !(defined(DISTRHO_OS_WASM) && defined(STATIC_BUILD)) | |||||
| #if ! CARDINAL_VARIANT_MINI | |||||
| std::vector<std::string> demoPatches; | std::vector<std::string> demoPatches; | ||||
| #endif | #endif | ||||
| FileButton(const bool standalone) | FileButton(const bool standalone) | ||||
| : MenuButton(), isStandalone(standalone) | : MenuButton(), isStandalone(standalone) | ||||
| { | { | ||||
| #if !(defined(DISTRHO_OS_WASM) && defined(STATIC_BUILD)) | |||||
| #if ! CARDINAL_VARIANT_MINI | |||||
| const std::string patchesDir = asset::patchesPath() + DISTRHO_OS_SEP_STR "examples"; | const std::string patchesDir = asset::patchesPath() + DISTRHO_OS_SEP_STR "examples"; | ||||
| if (system::isDirectory(patchesDir)) | if (system::isDirectory(patchesDir)) | ||||
| @@ -167,7 +168,7 @@ struct FileButton : MenuButton { | |||||
| patchUtils::revertDialog(); | patchUtils::revertDialog(); | ||||
| }, APP->patch->path.empty())); | }, APP->patch->path.empty())); | ||||
| #ifdef HAVE_LIBLO | |||||
| // #if defined(HAVE_LIBLO) && ! CARDINAL_VARIANT_MINI | |||||
| menu->addChild(new ui::MenuSeparator); | menu->addChild(new ui::MenuSeparator); | ||||
| remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote(); | remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote(); | ||||
| @@ -186,7 +187,7 @@ struct FileButton : MenuButton { | |||||
| remoteUtils::connectToRemote(); | remoteUtils::connectToRemote(); | ||||
| })); | })); | ||||
| } | } | ||||
| #endif | |||||
| // #endif | |||||
| #ifndef DISTRHO_OS_WASM | #ifndef DISTRHO_OS_WASM | ||||
| menu->addChild(new ui::MenuSeparator); | menu->addChild(new ui::MenuSeparator); | ||||
| @@ -201,7 +202,7 @@ struct FileButton : MenuButton { | |||||
| })); | })); | ||||
| #endif | #endif | ||||
| #if !(defined(DISTRHO_OS_WASM) && defined(STATIC_BUILD)) | |||||
| #if ! CARDINAL_VARIANT_MINI | |||||
| if (!demoPatches.empty()) | if (!demoPatches.empty()) | ||||
| { | { | ||||
| menu->addChild(new ui::MenuSeparator); | menu->addChild(new ui::MenuSeparator); | ||||
| @@ -50,6 +50,9 @@ namespace rack { | |||||
| namespace app { | namespace app { | ||||
| widget::Widget* createMenuBar(bool isStandalone); | |||||
| struct ResizeHandle : widget::OpaqueWidget { | struct ResizeHandle : widget::OpaqueWidget { | ||||
| math::Vec size; | math::Vec size; | ||||
| @@ -131,7 +134,7 @@ Scene::Scene() { | |||||
| rack = rackScroll->rackWidget; | rack = rackScroll->rackWidget; | ||||
| menuBar = createMenuBar(); | |||||
| menuBar = createMenuBar(isStandalone()); | |||||
| addChild(menuBar); | addChild(menuBar); | ||||
| browser = browserCreate(); | browser = browserCreate(); | ||||
| @@ -209,7 +212,7 @@ void Scene::step() { | |||||
| if (remoteDetails->autoDeploy) { | if (remoteDetails->autoDeploy) { | ||||
| const int actionIndex = APP->history->actionIndex; | const int actionIndex = APP->history->actionIndex; | ||||
| const double time = system::getTime(); | const double time = system::getTime(); | ||||
| if (internal->historyActionIndex != actionIndex && time - internal->lastSceneChangeTime >= 5.0) { | |||||
| if (internal->historyActionIndex != actionIndex && time - internal->lastSceneChangeTime >= 1.0) { | |||||
| internal->historyActionIndex = actionIndex; | internal->historyActionIndex = actionIndex; | ||||
| internal->lastSceneChangeTime = time; | internal->lastSceneChangeTime = time; | ||||
| remoteUtils::deployToRemote(remoteDetails); | remoteUtils::deployToRemote(remoteDetails); | ||||
| @@ -315,7 +318,8 @@ void Scene::onHoverKey(const HoverKeyEvent& e) { | |||||
| e.consume(this); | e.consume(this); | ||||
| } | } | ||||
| if (e.key == GLFW_KEY_F7 && (e.mods & RACK_MOD_MASK) == 0) { | if (e.key == GLFW_KEY_F7 && (e.mods & RACK_MOD_MASK) == 0) { | ||||
| remoteUtils::deployToRemote(remoteUtils::getRemote()); | |||||
| if (remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote()) | |||||
| remoteUtils::deployToRemote(remoteDetails); | |||||
| window::generateScreenshot(); | window::generateScreenshot(); | ||||
| e.consume(this); | e.consume(this); | ||||
| } | } | ||||