From 2aa9142437ac1fa1fbc6f19f03b108df74e758cc Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 24 Jul 2022 18:18:46 +0100 Subject: [PATCH] Tweak template patch locations Signed-off-by: falkTX --- dpf | 2 +- patches/{ => examples}/DRMR_-_BassGrowl.vcv | 0 patches/{ => examples}/DRMR_-_Etherpad.vcv | 0 patches/{ => examples}/DRMR_-_Gabberswing.vcv | 0 patches/{ => examples}/DRMR_-_Interverb.vcv | 0 .../{ => examples}/VT_-_Jupiter_Ascent.vcv | 0 .../falkTX_-_Random-Progress-Pluck-Rev.vcv | 0 .../falkTX_-_Salomonis-MonoRegen.vcv | 0 src/template-fx.vcv => patches/init/fx.vcv | 0 src/template.vcv => patches/init/main.vcv | 0 .../init/synth.vcv | 0 patches/init/wasm.vcv | 268 ++++++++++++++++++ patches/welcome-wasm-mini.vcv | 268 ++++++++++++++++++ .../welcome-wasm.vcv | 0 src/CardinalCommon.hpp | 7 +- src/CardinalFX/DistrhoPluginInfo.h | 16 +- src/CardinalPlugin.cpp | 51 ++-- src/CardinalUI.cpp | 6 +- src/Makefile.cardinal.mk | 17 -- src/override/MenuBar.cpp | 8 +- 20 files changed, 587 insertions(+), 56 deletions(-) rename patches/{ => examples}/DRMR_-_BassGrowl.vcv (100%) rename patches/{ => examples}/DRMR_-_Etherpad.vcv (100%) rename patches/{ => examples}/DRMR_-_Gabberswing.vcv (100%) rename patches/{ => examples}/DRMR_-_Interverb.vcv (100%) rename patches/{ => examples}/VT_-_Jupiter_Ascent.vcv (100%) rename patches/{ => examples}/falkTX_-_Random-Progress-Pluck-Rev.vcv (100%) rename patches/{ => examples}/falkTX_-_Salomonis-MonoRegen.vcv (100%) rename src/template-fx.vcv => patches/init/fx.vcv (100%) rename src/template.vcv => patches/init/main.vcv (100%) rename src/template-synth.vcv => patches/init/synth.vcv (100%) create mode 100644 patches/init/wasm.vcv create mode 100644 patches/welcome-wasm-mini.vcv rename src/template-wasm.vcv => patches/welcome-wasm.vcv (100%) diff --git a/dpf b/dpf index d200db4..d41b971 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit d200db475b74a20e244bbfc2031527666c614eb4 +Subproject commit d41b971d77dceadcb76a7736908d0b6a36ff1469 diff --git a/patches/DRMR_-_BassGrowl.vcv b/patches/examples/DRMR_-_BassGrowl.vcv similarity index 100% rename from patches/DRMR_-_BassGrowl.vcv rename to patches/examples/DRMR_-_BassGrowl.vcv diff --git a/patches/DRMR_-_Etherpad.vcv b/patches/examples/DRMR_-_Etherpad.vcv similarity index 100% rename from patches/DRMR_-_Etherpad.vcv rename to patches/examples/DRMR_-_Etherpad.vcv diff --git a/patches/DRMR_-_Gabberswing.vcv b/patches/examples/DRMR_-_Gabberswing.vcv similarity index 100% rename from patches/DRMR_-_Gabberswing.vcv rename to patches/examples/DRMR_-_Gabberswing.vcv diff --git a/patches/DRMR_-_Interverb.vcv b/patches/examples/DRMR_-_Interverb.vcv similarity index 100% rename from patches/DRMR_-_Interverb.vcv rename to patches/examples/DRMR_-_Interverb.vcv diff --git a/patches/VT_-_Jupiter_Ascent.vcv b/patches/examples/VT_-_Jupiter_Ascent.vcv similarity index 100% rename from patches/VT_-_Jupiter_Ascent.vcv rename to patches/examples/VT_-_Jupiter_Ascent.vcv diff --git a/patches/falkTX_-_Random-Progress-Pluck-Rev.vcv b/patches/examples/falkTX_-_Random-Progress-Pluck-Rev.vcv similarity index 100% rename from patches/falkTX_-_Random-Progress-Pluck-Rev.vcv rename to patches/examples/falkTX_-_Random-Progress-Pluck-Rev.vcv diff --git a/patches/falkTX_-_Salomonis-MonoRegen.vcv b/patches/examples/falkTX_-_Salomonis-MonoRegen.vcv similarity index 100% rename from patches/falkTX_-_Salomonis-MonoRegen.vcv rename to patches/examples/falkTX_-_Salomonis-MonoRegen.vcv diff --git a/src/template-fx.vcv b/patches/init/fx.vcv similarity index 100% rename from src/template-fx.vcv rename to patches/init/fx.vcv diff --git a/src/template.vcv b/patches/init/main.vcv similarity index 100% rename from src/template.vcv rename to patches/init/main.vcv diff --git a/src/template-synth.vcv b/patches/init/synth.vcv similarity index 100% rename from src/template-synth.vcv rename to patches/init/synth.vcv diff --git a/patches/init/wasm.vcv b/patches/init/wasm.vcv new file mode 100644 index 0000000..fe62fa0 --- /dev/null +++ b/patches/init/wasm.vcv @@ -0,0 +1,268 @@ +{ + "version": "2.1.2", + "unsaved": true, + "zoom": 1.0, + "modules": [ + { + "id": 8712245256622475, + "plugin": "Cardinal", + "model": "TextEditor", + "version": "2.0", + "params": [], + "leftModuleId": 799138358763949, + "data": { + "filepath": "", + "lang": "None", + "etext": "Welcome to Cardinal!\n\nThis is the Web/Wasm variant\nIt has 2 audio outputs, enabled by default.\nUse Engine menu to enable input and/or MIDI.\n\nA basic VCO + ADSR + VCA is the default patch\n\n", + "width": 23 + }, + "pos": [ + 49, + 0 + ] + }, + { + "id": 5726895899473528, + "plugin": "Fundamental", + "model": "ADSR", + "version": "2.0", + "params": [ + { + "value": 0.5, + "id": 0 + }, + { + "value": 0.5, + "id": 1 + }, + { + "value": 0.5, + "id": 2 + }, + { + "value": 0.5, + "id": 3 + }, + { + "value": 0.0, + "id": 4 + }, + { + "value": 0.0, + "id": 5 + }, + { + "value": 0.0, + "id": 6 + }, + { + "value": 0.0, + "id": 7 + }, + { + "value": 0.0, + "id": 8 + } + ], + "leftModuleId": 8601159184541723, + "rightModuleId": 4828178296911509, + "pos": [ + 18, + 0 + ] + }, + { + "id": 4828178296911509, + "plugin": "Fundamental", + "model": "VCA-1", + "version": "2.0", + "params": [ + { + "value": 1.0, + "id": 0 + }, + { + "value": 1.0, + "id": 1 + } + ], + "leftModuleId": 5726895899473528, + "rightModuleId": 1, + "pos": [ + 27, + 0 + ] + }, + { + "id": 8601159184541723, + "plugin": "Fundamental", + "model": "VCO", + "version": "2.0", + "params": [ + { + "value": 0.0, + "id": 0 + }, + { + "value": 1.0, + "id": 1 + }, + { + "value": 0.0, + "id": 2 + }, + { + "value": 0.0, + "id": 3 + }, + { + "value": 0.0, + "id": 4 + }, + { + "value": 0.5, + "id": 5 + }, + { + "value": 0.0, + "id": 6 + }, + { + "value": 0.0, + "id": 7 + } + ], + "leftModuleId": 2, + "rightModuleId": 5726895899473528, + "pos": [ + 9, + 0 + ] + }, + { + "id": 1, + "plugin": "Cardinal", + "model": "HostAudio2", + "version": "2.0", + "params": [ + { + "value": 0.79432821273803711, + "id": 0 + } + ], + "leftModuleId": 4828178296911509, + "rightModuleId": 799138358763949, + "data": { + "dcFilter": true + }, + "pos": [ + 30, + 0 + ] + }, + { + "id": 2, + "plugin": "Cardinal", + "model": "HostMIDI", + "version": "2.0", + "params": [], + "rightModuleId": 8601159184541723, + "data": { + "pwRange": 0.0, + "smooth": false, + "channels": 1, + "polyMode": 0, + "lastPitch": 8192, + "lastMod": 0, + "inputChannel": 0, + "outputChannel": 0 + }, + "pos": [ + 0, + 0 + ] + }, + { + "id": 799138358763949, + "plugin": "Cardinal", + "model": "HostMIDIMap", + "version": "2.0", + "params": [], + "leftModuleId": 1, + "rightModuleId": 8712245256622475, + "data": { + "maps": [ + { + "cc": -1, + "moduleId": -1, + "paramId": 0 + } + ], + "smooth": true, + "channel": 0 + }, + "pos": [ + 38, + 0 + ] + } + ], + "cables": [ + { + "id": 5155876120487880, + "outputModuleId": 2, + "outputId": 1, + "inputModuleId": 5726895899473528, + "inputId": 4, + "color": "#ff9352" + }, + { + "id": 781753834216137, + "outputModuleId": 2, + "outputId": 6, + "inputModuleId": 5726895899473528, + "inputId": 5, + "color": "#ffd452" + }, + { + "id": 3464471860196875, + "outputModuleId": 5726895899473528, + "outputId": 0, + "inputModuleId": 4828178296911509, + "inputId": 0, + "color": "#e8ff52" + }, + { + "id": 739552540616113, + "outputModuleId": 4828178296911509, + "outputId": 0, + "inputModuleId": 1, + "inputId": 0, + "color": "#52beff" + }, + { + "id": 6701970185765111, + "outputModuleId": 2, + "outputId": 0, + "inputModuleId": 8601159184541723, + "inputId": 0, + "color": "#ff5252" + }, + { + "id": 6959800657121782, + "outputModuleId": 2, + "outputId": 2, + "inputModuleId": 8601159184541723, + "inputId": 1, + "color": "#52ff7d" + }, + { + "id": 1598271319373837, + "outputModuleId": 8601159184541723, + "outputId": 0, + "inputModuleId": 4828178296911509, + "inputId": 1, + "color": "#a8ff52" + } + ] +} diff --git a/patches/welcome-wasm-mini.vcv b/patches/welcome-wasm-mini.vcv new file mode 100644 index 0000000..fe62fa0 --- /dev/null +++ b/patches/welcome-wasm-mini.vcv @@ -0,0 +1,268 @@ +{ + "version": "2.1.2", + "unsaved": true, + "zoom": 1.0, + "modules": [ + { + "id": 8712245256622475, + "plugin": "Cardinal", + "model": "TextEditor", + "version": "2.0", + "params": [], + "leftModuleId": 799138358763949, + "data": { + "filepath": "", + "lang": "None", + "etext": "Welcome to Cardinal!\n\nThis is the Web/Wasm variant\nIt has 2 audio outputs, enabled by default.\nUse Engine menu to enable input and/or MIDI.\n\nA basic VCO + ADSR + VCA is the default patch\n\n", + "width": 23 + }, + "pos": [ + 49, + 0 + ] + }, + { + "id": 5726895899473528, + "plugin": "Fundamental", + "model": "ADSR", + "version": "2.0", + "params": [ + { + "value": 0.5, + "id": 0 + }, + { + "value": 0.5, + "id": 1 + }, + { + "value": 0.5, + "id": 2 + }, + { + "value": 0.5, + "id": 3 + }, + { + "value": 0.0, + "id": 4 + }, + { + "value": 0.0, + "id": 5 + }, + { + "value": 0.0, + "id": 6 + }, + { + "value": 0.0, + "id": 7 + }, + { + "value": 0.0, + "id": 8 + } + ], + "leftModuleId": 8601159184541723, + "rightModuleId": 4828178296911509, + "pos": [ + 18, + 0 + ] + }, + { + "id": 4828178296911509, + "plugin": "Fundamental", + "model": "VCA-1", + "version": "2.0", + "params": [ + { + "value": 1.0, + "id": 0 + }, + { + "value": 1.0, + "id": 1 + } + ], + "leftModuleId": 5726895899473528, + "rightModuleId": 1, + "pos": [ + 27, + 0 + ] + }, + { + "id": 8601159184541723, + "plugin": "Fundamental", + "model": "VCO", + "version": "2.0", + "params": [ + { + "value": 0.0, + "id": 0 + }, + { + "value": 1.0, + "id": 1 + }, + { + "value": 0.0, + "id": 2 + }, + { + "value": 0.0, + "id": 3 + }, + { + "value": 0.0, + "id": 4 + }, + { + "value": 0.5, + "id": 5 + }, + { + "value": 0.0, + "id": 6 + }, + { + "value": 0.0, + "id": 7 + } + ], + "leftModuleId": 2, + "rightModuleId": 5726895899473528, + "pos": [ + 9, + 0 + ] + }, + { + "id": 1, + "plugin": "Cardinal", + "model": "HostAudio2", + "version": "2.0", + "params": [ + { + "value": 0.79432821273803711, + "id": 0 + } + ], + "leftModuleId": 4828178296911509, + "rightModuleId": 799138358763949, + "data": { + "dcFilter": true + }, + "pos": [ + 30, + 0 + ] + }, + { + "id": 2, + "plugin": "Cardinal", + "model": "HostMIDI", + "version": "2.0", + "params": [], + "rightModuleId": 8601159184541723, + "data": { + "pwRange": 0.0, + "smooth": false, + "channels": 1, + "polyMode": 0, + "lastPitch": 8192, + "lastMod": 0, + "inputChannel": 0, + "outputChannel": 0 + }, + "pos": [ + 0, + 0 + ] + }, + { + "id": 799138358763949, + "plugin": "Cardinal", + "model": "HostMIDIMap", + "version": "2.0", + "params": [], + "leftModuleId": 1, + "rightModuleId": 8712245256622475, + "data": { + "maps": [ + { + "cc": -1, + "moduleId": -1, + "paramId": 0 + } + ], + "smooth": true, + "channel": 0 + }, + "pos": [ + 38, + 0 + ] + } + ], + "cables": [ + { + "id": 5155876120487880, + "outputModuleId": 2, + "outputId": 1, + "inputModuleId": 5726895899473528, + "inputId": 4, + "color": "#ff9352" + }, + { + "id": 781753834216137, + "outputModuleId": 2, + "outputId": 6, + "inputModuleId": 5726895899473528, + "inputId": 5, + "color": "#ffd452" + }, + { + "id": 3464471860196875, + "outputModuleId": 5726895899473528, + "outputId": 0, + "inputModuleId": 4828178296911509, + "inputId": 0, + "color": "#e8ff52" + }, + { + "id": 739552540616113, + "outputModuleId": 4828178296911509, + "outputId": 0, + "inputModuleId": 1, + "inputId": 0, + "color": "#52beff" + }, + { + "id": 6701970185765111, + "outputModuleId": 2, + "outputId": 0, + "inputModuleId": 8601159184541723, + "inputId": 0, + "color": "#ff5252" + }, + { + "id": 6959800657121782, + "outputModuleId": 2, + "outputId": 2, + "inputModuleId": 8601159184541723, + "inputId": 1, + "color": "#52ff7d" + }, + { + "id": 1598271319373837, + "outputModuleId": 8601159184541723, + "outputId": 0, + "inputModuleId": 4828178296911509, + "inputId": 1, + "color": "#a8ff52" + } + ] +} diff --git a/src/template-wasm.vcv b/patches/welcome-wasm.vcv similarity index 100% rename from src/template-wasm.vcv rename to patches/welcome-wasm.vcv diff --git a/src/CardinalCommon.hpp b/src/CardinalCommon.hpp index 6ecc4c5..f1f5f52 100644 --- a/src/CardinalCommon.hpp +++ b/src/CardinalCommon.hpp @@ -26,7 +26,12 @@ #endif #ifdef DISTRHO_OS_WASM -# define CARDINAL_IMPORTED_TEMPLATE_FILENAME "/imported.vcv" +# define CARDINAL_WASM_IMPORTED_TEMPLATE_FILENAME "/imported.vcv" +# ifdef STATIC_BUILD +# define CARDINAL_WASM_WELCOME_TEMPLATE_FILENAME "welcome-wasm.vcv" +# else +# define CARDINAL_WASM_WELCOME_TEMPLATE_FILENAME "welcome-wasm-mini.vcv" +# endif #endif extern const std::string CARDINAL_VERSION; diff --git a/src/CardinalFX/DistrhoPluginInfo.h b/src/CardinalFX/DistrhoPluginInfo.h index 4d8922c..bab1cc0 100644 --- a/src/CardinalFX/DistrhoPluginInfo.h +++ b/src/CardinalFX/DistrhoPluginInfo.h @@ -28,12 +28,18 @@ #define DISTRHO_PLUGIN_BRAND "DISTRHO" #define DISTRHO_PLUGIN_URI "https://distrho.kx.studio/plugins/cardinal#fx" -#ifdef __MOD_DEVICES__ -#define DISTRHO_PLUGIN_NAME "Cardinal Mini" -#define DISTRHO_PLUGIN_LABEL "CardinalMini" +#if defined(DISTRHO_OS_WASM) && defined(STATIC_BUILD) +# define DISTRHO_PLUGIN_NAME "Mini Cardinal" +# define DISTRHO_PLUGIN_LABEL "MiniCardinal" +#elif defined(DISTRHO_OS_WASM) +# define DISTRHO_PLUGIN_NAME "Cardinal" +# define DISTRHO_PLUGIN_LABEL "Cardinal" +#elif defined(__MOD_DEVICES__) +# define DISTRHO_PLUGIN_NAME "Cardinal Mini" +# define DISTRHO_PLUGIN_LABEL "CardinalMini" #else -#define DISTRHO_PLUGIN_NAME "Cardinal FX" -#define DISTRHO_PLUGIN_LABEL "CardinalFX" +# define DISTRHO_PLUGIN_NAME "Cardinal FX" +# define DISTRHO_PLUGIN_LABEL "CardinalFX" #endif #ifdef HEADLESS diff --git a/src/CardinalPlugin.cpp b/src/CardinalPlugin.cpp index aaeecb6..91b10df 100644 --- a/src/CardinalPlugin.cpp +++ b/src/CardinalPlugin.cpp @@ -52,18 +52,14 @@ # include "extra/SharedResourcePointer.hpp" #endif -#if CARDINAL_VARIANT_FX -# define CARDINAL_FACTORY_TEMPLATE_NAME "template-fx.vcv" -#elif CARDINAL_VARIANT_SYNTH -# define CARDINAL_FACTORY_TEMPLATE_NAME "template-synth.vcv" -#else -# define CARDINAL_FACTORY_TEMPLATE_NAME "template.vcv" -#endif - #ifdef DISTRHO_OS_WASM -# define CARDINAL_TEMPLATE_NAME "template-wasm.vcv" +# define CARDINAL_TEMPLATE_NAME "init/wasm.vcv" +#elif CARDINAL_VARIANT_FX +# define CARDINAL_TEMPLATE_NAME "init/fx.vcv" +#elif CARDINAL_VARIANT_SYNTH +# define CARDINAL_TEMPLATE_NAME "init/synth.vcv" #else -# define CARDINAL_TEMPLATE_NAME CARDINAL_FACTORY_TEMPLATE_NAME +# define CARDINAL_TEMPLATE_NAME "init/main.vcv" #endif static const constexpr uint kCardinalStateBaseCount = 3; // patch, screenshot, comment @@ -78,16 +74,19 @@ static const constexpr uint kCardinalStateCount = kCardinalStateBaseCount; #endif namespace rack { +namespace asset { +std::string patchesPath(); +} namespace engine { - void Engine_setAboutToClose(Engine*); +void Engine_setAboutToClose(Engine*); } namespace plugin { - void initStaticPlugins(); - void destroyStaticPlugins(); +void initStaticPlugins(); +void destroyStaticPlugins(); } #ifndef HEADLESS namespace window { - void WindowInit(Window* window, DISTRHO_NAMESPACE::Plugin* plugin); +void WindowInit(Window* window, DISTRHO_NAMESPACE::Plugin* plugin); } #endif } @@ -183,10 +182,8 @@ struct Initializer { if (const char* const resourcePath = getResourcePath(bundlePath)) { - asset::bundlePath = system::join(resourcePath, "PluginManifests"); asset::systemDir = resourcePath; - templatePath = system::join(asset::systemDir, CARDINAL_TEMPLATE_NAME); - factoryTemplatePath = system::join(asset::systemDir, CARDINAL_FACTORY_TEMPLATE_NAME); + asset::bundlePath = system::join(asset::systemDir, "PluginManifests"); } } @@ -196,13 +193,8 @@ struct Initializer // Make system dir point to source code location as fallback asset::systemDir = CARDINAL_PLUGIN_SOURCE_DIR DISTRHO_OS_SEP_STR "Rack"; - if (system::exists(system::join(asset::systemDir, "res"))) - { - templatePath = CARDINAL_PLUGIN_SOURCE_DIR DISTRHO_OS_SEP_STR CARDINAL_TEMPLATE_NAME; - factoryTemplatePath = CARDINAL_PLUGIN_SOURCE_DIR DISTRHO_OS_SEP_STR CARDINAL_FACTORY_TEMPLATE_NAME; - } // If source code dir does not exist use install target prefix as system dir - else + if (!system::exists(system::join(asset::systemDir, "res"))) #endif { #if defined(DISTRHO_OS_WASM) @@ -218,18 +210,19 @@ struct Initializer #endif asset::bundlePath = system::join(asset::systemDir, "PluginManifests"); - templatePath = system::join(asset::systemDir, CARDINAL_TEMPLATE_NAME); - factoryTemplatePath = system::join(asset::systemDir, CARDINAL_FACTORY_TEMPLATE_NAME); } } asset::userDir = asset::systemDir; } + const std::string patchesPath = asset::patchesPath(); #ifdef DISTRHO_OS_WASM - if ((patchStorageSlug = getPatchStorageSlug()) != nullptr) - templatePath = CARDINAL_IMPORTED_TEMPLATE_FILENAME; + templatePath = system::join(patchesPath, CARDINAL_WASM_WELCOME_TEMPLATE_FILENAME); + #else + templatePath = system::join(patchesPath, CARDINAL_TEMPLATE_NAME); #endif + factoryTemplatePath = system::join(patchesPath, CARDINAL_TEMPLATE_NAME); // Log environment INFO("%s %s v%s", APP_NAME.c_str(), APP_EDITION.c_str(), APP_VERSION.c_str()); @@ -608,11 +601,13 @@ public: context->window = new rack::window::Window; #ifdef DISTRHO_OS_WASM - if (rack::patchStorageSlug == nullptr) + if ((rack::patchStorageSlug = getPatchStorageSlug()) == nullptr) #endif { context->patch->loadTemplate(); context->scene->rackScroll->reset(); + // swap to factory template after first load + context->patch->templatePath = context->patch->factoryTemplatePath; } #if defined(HAVE_LIBLO) && defined(HEADLESS) diff --git a/src/CardinalUI.cpp b/src/CardinalUI.cpp index 5414a6d..3b9baef 100644 --- a/src/CardinalUI.cpp +++ b/src/CardinalUI.cpp @@ -253,7 +253,7 @@ static void downloadPatchStorageFailed(const char* const filename) } using namespace rack; - context->patch->templatePath = system::join(asset::systemDir, "template-synth.vcv"); // FIXME + context->patch->templatePath = system::join(asset::systemDir, "init/wasm.vcv"); // FIXME context->patch->loadTemplate(); context->scene->rackScroll->reset(); } @@ -277,7 +277,7 @@ static void downloadPatchStorageSucceeded(const char* const filename) } try { - context->patch->load(CARDINAL_IMPORTED_TEMPLATE_FILENAME); + context->patch->load(CARDINAL_WASM_IMPORTED_TEMPLATE_FILENAME); } catch (rack::Exception& e) { const std::string message = rack::string::f("Could not load patch: %s", e.what()); asyncDialog::create(message.c_str()); @@ -428,7 +428,7 @@ public: void uiIdle() override { - if (counterForFirstIdlePoint >= 0 && ++counterForFirstIdlePoint == 5) + if (counterForFirstIdlePoint >= 0 && ++counterForFirstIdlePoint == 30) { counterForFirstIdlePoint = -1; diff --git a/src/Makefile.cardinal.mk b/src/Makefile.cardinal.mk index efa8b36..66a82c9 100644 --- a/src/Makefile.cardinal.mk +++ b/src/Makefile.cardinal.mk @@ -311,7 +311,6 @@ endif CORE_RESOURCES = patches CORE_RESOURCES += $(subst ../Rack/res/,,$(wildcard ../Rack/res/ComponentLibrary/*.svg ../Rack/res/fonts/*.ttf)) -CORE_RESOURCES += $(subst ../,,$(wildcard ../template*.vcv)) LV2_RESOURCES = $(CORE_RESOURCES:%=$(TARGET_DIR)/$(NAME).lv2/resources/%) VST3_RESOURCES = $(CORE_RESOURCES:%=$(TARGET_DIR)/$(NAME).vst3/Contents/Resources/%) @@ -376,22 +375,6 @@ $(TARGET_DIR)/%/patches: ../../patches -@mkdir -p "$(shell dirname $@)" $(SILENT)ln -sf $(abspath $<) $@ -$(TARGET_DIR)/%/template.vcv: ../template.vcv - -@mkdir -p "$(shell dirname $@)" - $(SILENT)ln -sf $(abspath $<) $@ - -$(TARGET_DIR)/%/template-fx.vcv: ../template-fx.vcv - -@mkdir -p "$(shell dirname $@)" - $(SILENT)ln -sf $(abspath $<) $@ - -$(TARGET_DIR)/%/template-synth.vcv: ../template-synth.vcv - -@mkdir -p "$(shell dirname $@)" - $(SILENT)ln -sf $(abspath $<) $@ - -$(TARGET_DIR)/%/template-wasm.vcv: ../template-wasm.vcv - -@mkdir -p "$(shell dirname $@)" - $(SILENT)ln -sf $(abspath $<) $@ - $(TARGET_DIR)/$(NAME).lv2/resources/%: ../Rack/res/% -@mkdir -p "$(shell dirname $@)" $(SILENT)ln -sf $(abspath $<) $@ diff --git a/src/override/MenuBar.cpp b/src/override/MenuBar.cpp index f49147f..59e4cce 100644 --- a/src/override/MenuBar.cpp +++ b/src/override/MenuBar.cpp @@ -97,12 +97,15 @@ struct MenuButton : ui::Button { struct FileButton : MenuButton { const bool isStandalone; +#if !(defined(DISTRHO_OS_WASM) && defined(STATIC_BUILD)) std::vector demoPatches; +#endif FileButton(const bool standalone) : MenuButton(), isStandalone(standalone) { - const std::string patchesDir = asset::patchesPath(); +#if !(defined(DISTRHO_OS_WASM) && defined(STATIC_BUILD)) + const std::string patchesDir = asset::patchesPath() + DISTRHO_OS_SEP_STR "examples"; if (system::isDirectory(patchesDir)) { @@ -111,6 +114,7 @@ struct FileButton : MenuButton { return string::lowercase(a) < string::lowercase(b); }); } +#endif } void onAction(const ActionEvent& e) override { @@ -195,6 +199,7 @@ struct FileButton : MenuButton { })); #endif +#if !(defined(DISTRHO_OS_WASM) && defined(STATIC_BUILD)) if (!demoPatches.empty()) { menu->addChild(new ui::MenuSeparator); @@ -220,6 +225,7 @@ struct FileButton : MenuButton { })); })); } +#endif #ifndef DISTRHO_OS_WASM if (isStandalone) {