From 1ba43b195fe0e2f52f7e57ce8741e09755838cf7 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 4 Dec 2022 20:38:19 +0000 Subject: [PATCH] Add surgext Signed-off-by: falkTX --- .gitignore | 1 + .gitmodules | 3 + Makefile | 2 +- README.md | 1 + deps/Makefile | 54 +++++++++++++ docs/LICENSES.md | 4 + jucewrapper/CMakeLists.txt | 54 +++++++++++++ plugins/Makefile | 97 ++++++++++++++++++++++- plugins/plugins.cpp | 71 ++++++++++++++++- plugins/surgext | 1 + plugins/surgext-helper/surgext-helper.cpp | 31 ++++++++ src/Makefile.cardinal.mk | 55 +++++++++++++ 12 files changed, 371 insertions(+), 3 deletions(-) create mode 160000 plugins/surgext create mode 100644 plugins/surgext-helper/surgext-helper.cpp diff --git a/.gitignore b/.gitignore index 4b7839a..8f76e40 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ compile_commands.json /bin/ /build/ +/deps/surge-build/ /documentation.pdf /jucewrapper/build/ /jucewrapper/JUCE/ diff --git a/.gitmodules b/.gitmodules index 9544b04..93da739 100644 --- a/.gitmodules +++ b/.gitmodules @@ -224,3 +224,6 @@ [submodule "plugins/stoermelder-packone"] path = plugins/stoermelder-packone url = https://github.com/stoermelder/vcvrack-packone.git +[submodule "plugins/surgext"] + path = plugins/surgext + url = https://github.com/surge-synthesizer/surge-rack.git diff --git a/Makefile b/Makefile index 286e1e7..adb2999 100644 --- a/Makefile +++ b/Makefile @@ -193,7 +193,7 @@ endif deps: ifeq ($(SYSDEPS),true) - $(MAKE) quickjs -C deps + $(MAKE) quickjs surge -C deps else $(MAKE) all -C deps endif diff --git a/README.md b/README.md index acc8c84..9e30ce0 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,7 @@ At the moment the following 3rd-party modules are provided: - Sonus Modular - stocaudio - Stoermelder Pack-One +- Surge XT - unless_modules - Valley - Voxglitch diff --git a/deps/Makefile b/deps/Makefile index 286eb9f..70970fe 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -308,9 +308,61 @@ $(DEP_PATH)/lib/libquickjs.a: install -m644 $(CURDIR)/QuickJS/libquickjs.a $@ install -m644 $(CURDIR)/QuickJS/quickjs.h $(DEP_PATH)/include/quickjs.h +# -------------------------------------------------------------- +# SurgeXT target + +SURGE_DEP_PATH = $(abspath surge-build) +SURGE_SRC_PATH = $(abspath ../plugins/surgext/surge) +SURGE_NAMES = HysteresisProcessing Patch SolverType Tunings Wavetable clouds ghc plaits stmlib + +SURGE_CXX_FLAGS = $(filter-out -fsingle-precision-constant,$(filter-out -std=gnu++11,$(BUILD_CXX_FLAGS))) +SURGE_CXX_FLAGS += $(foreach n,$(SURGE_NAMES),-D$(n)=surgext$(n)) + +# fix JUCE build https://github.com/juce-framework/JUCE/issues/374 +ifeq ($(CPU_I386),true) +SURGE_CXX_FLAGS += -D__sigemptyset=sigemptyset +endif + +# unwanted in this build +SURGE_CXX_FLAGS += -DJUCE_DSP_ENABLE_SNAP_TO_ZERO=0 + +# possibly use fftw? +# ifeq ($(shell $(PKG_CONFIG) --exists fftw3 fftw3f && echo true),true) +# SURGE_CXX_FLAGS += -DJUCE_DSP_USE_STATIC_FFTW=1 +# endif + +# JUCE_USE_CURL +SURGE_ENV = env \ + AR=$(AR) \ + CC=$(CC) \ + CXX=$(CXX) \ + CFLAGS='$(BUILD_C_FLAGS) -w' \ + CXXFLAGS='$(SURGE_CXX_FLAGS) -w' \ + LDFLAGS='$(LINK_FLAGS)' + +SURGE_LIB = $(SURGE_DEP_PATH)/src/common/libsurge-common.a + +$(SURGE_LIB): $(SURGE_DEP_PATH)/Makefile + $(DEP_MAKE) -C $(SURGE_DEP_PATH) surge-common + +$(SURGE_DEP_PATH)/Makefile: $(SURGE_SRC_PATH)/CMakeLists.txt + mkdir -p $(SURGE_DEP_PATH) + cd $(SURGE_DEP_PATH) && \ + $(SURGE_ENV) $(CMAKE) \ + -DSURGE_COMPILE_BLOCK_SIZE=8 \ + -DSURGE_SKIP_AIRWINDOWS=TRUE \ + -DSURGE_SKIP_JUCE_FOR_RACK=TRUE \ + -DSURGE_SKIP_LUA=TRUE \ + -DSURGE_SKIP_ODDSOUND_MTS=TRUE \ + $(SURGE_SRC_PATH) + # -------------------------------------------------------------- # Build targets +ifneq ($(NOPLUGINS),true) +TARGETS += $(SURGE_LIB) +endif + TARGETS += $(DEP_PATH)/lib/libjansson.a TARGETS += $(DEP_PATH)/lib/libquickjs.a TARGETS += $(DEP_PATH)/lib/libsamplerate.a @@ -340,6 +392,7 @@ clean: rm -rf $(DEP_PATH)/libsamplerate-0.1.9 rm -rf $(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3 rm -rf $(DEP_PATH)/zstd-1.4.5 + rm -rf $(SURGE_DEP_PATH) download: \ $(DEP_PATH)/jansson-2.12 \ @@ -349,5 +402,6 @@ download: \ $(DEP_PATH)/zstd-1.4.5/.stamp-patched quickjs: $(DEP_PATH)/lib/libquickjs.a +surge: $(SURGE_LIB) # -------------------------------------------------------------- diff --git a/docs/LICENSES.md b/docs/LICENSES.md index 825879e..f191378 100644 --- a/docs/LICENSES.md +++ b/docs/LICENSES.md @@ -76,6 +76,7 @@ Bellow follows a list of all code licenses used in Cardinal and linked submodule | Sonus Modular | GPL-3.0-or-later | | | stocaudio | GPL-3.0-or-later | | | Stoermelder Pack-One | GPL-3.0-or-later | | +| Surge XT | GPL-3.0-or-later | | | unless_modules | GPL-3.0-or-later | | | Valley | GPL-3.0-or-later | | | Voxglitch | GPL-3.0-or-later | | @@ -215,6 +216,9 @@ Below is a list of artwork licenses from plugins | stocaudio/* | GPL-3.0-or-later | No artwork specific license provided | | stoermelder-packone/* | GPL-3.0-or-later | No artwork specific license provided | | stoermelder-packone/fonts/RedkostComic.otf | OFL-1.1-RFN | | +| surgext/* | GPL-3.0-or-later | | +| surgext/xt/* | CC-BY-NC-SA-4.0 | | +| surgext/xt/fonts/quicksand/* | OFL-1.1-RFN | | | unless_modules/* | CC-BY-NC-ND-4.0 | | | unless_modules/font/CuteFont-Regular.ttf| OFL-1.1 | | | unless_modules/font/Terminus.ttf | GPL-2.0-or-later | [Starting from v4.32, font license is OFL-1.1](https://files.ax86.net/terminus-ttf/#license) | diff --git a/jucewrapper/CMakeLists.txt b/jucewrapper/CMakeLists.txt index d47ce34..6b34c82 100644 --- a/jucewrapper/CMakeLists.txt +++ b/jucewrapper/CMakeLists.txt @@ -89,6 +89,30 @@ set_property(TARGET libspeexdsp PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR add_library(libzstd STATIC IMPORTED) set_property(TARGET libzstd PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../src/Rack/dep/lib/libzstd.a") +set(SURGE_DEP_PATH "${PROJECT_SOURCE_DIR}/../deps/surge-build") + +add_library(surgedep01 STATIC IMPORTED) +add_library(surgedep02 STATIC IMPORTED) +add_library(surgedep03 STATIC IMPORTED) +add_library(surgedep04 STATIC IMPORTED) +add_library(surgedep05 STATIC IMPORTED) +add_library(surgedep06 STATIC IMPORTED) +add_library(surgedep07 STATIC IMPORTED) +add_library(surgedep08 STATIC IMPORTED) +add_library(surgedep09 STATIC IMPORTED) +add_library(surgedep10 STATIC IMPORTED) + +set_property(TARGET surgedep01 PROPERTY IMPORTED_LOCATION "${SURGE_DEP_PATH}/src/common/libsurge-common.a") +set_property(TARGET surgedep02 PROPERTY IMPORTED_LOCATION "${SURGE_DEP_PATH}/src/common/libjuce_dsp_rack_sub.a") +set_property(TARGET surgedep03 PROPERTY IMPORTED_LOCATION "${SURGE_DEP_PATH}/libs/airwindows/libairwindows.a") +set_property(TARGET surgedep04 PROPERTY IMPORTED_LOCATION "${SURGE_DEP_PATH}/libs/eurorack/libeurorack.a") +set_property(TARGET surgedep05 PROPERTY IMPORTED_LOCATION "${SURGE_DEP_PATH}/libs/fmt/libfmt.a") +set_property(TARGET surgedep06 PROPERTY IMPORTED_LOCATION "${SURGE_DEP_PATH}/libs/sqlite-3.23.3/libsqlite.a") +set_property(TARGET surgedep07 PROPERTY IMPORTED_LOCATION "${SURGE_DEP_PATH}/libs/sst/sst-plugininfra/libsst-plugininfra.a") +set_property(TARGET surgedep08 PROPERTY IMPORTED_LOCATION "${SURGE_DEP_PATH}/libs/sst/sst-plugininfra/libs/filesystem/libfilesystem.a") +set_property(TARGET surgedep09 PROPERTY IMPORTED_LOCATION "${SURGE_DEP_PATH}/libs/sst/sst-plugininfra/libs/strnatcmp/libstrnatcmp.a") +set_property(TARGET surgedep10 PROPERTY IMPORTED_LOCATION "${SURGE_DEP_PATH}/libs/sst/sst-plugininfra/libs/tinyxml/libtinyxml.a") + # dependencies find_package(PkgConfig REQUIRED) @@ -181,6 +205,16 @@ target_link_libraries(Cardinal ysfx zita_resampler dgl + surgedep01 + surgedep02 + surgedep03 + surgedep04 + surgedep05 + surgedep06 + surgedep07 + surgedep08 + surgedep09 + surgedep10 libaubio libarchive libjansson @@ -274,6 +308,16 @@ target_link_libraries(CardinalFX ysfx zita_resampler dgl + surgedep01 + surgedep02 + surgedep03 + surgedep04 + surgedep05 + surgedep06 + surgedep07 + surgedep08 + surgedep09 + surgedep10 libaubio libarchive libjansson @@ -366,6 +410,16 @@ target_link_libraries(CardinalSynth ysfx zita_resampler dgl + surgedep01 + surgedep02 + surgedep03 + surgedep04 + surgedep05 + surgedep06 + surgedep07 + surgedep08 + surgedep09 + surgedep10 libaubio libarchive libjansson diff --git a/plugins/Makefile b/plugins/Makefile index ffcd9c2..c453208 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -919,6 +919,63 @@ PLUGIN_FILES += $(filter-out $(STOERMELDER_PACKONE_IGNORED:%=stoermelder-packone STOERMELDER_PACKONE_CUSTOM = LongPressButton STOERMELDER_PACKONE_CUSTOM_PER_FILE = InputLedDisplay IntermixEnvModule +# -------------------------------------------------------------- +# surgext + +PLUGIN_FILES += $(filter-out surgext/src/SurgeXT.cpp,$(wildcard surgext/src/*.cpp)) +PLUGIN_FILES += surgext-helper/surgext-helper.cpp + +# modules/types which are present in other plugins +SURGEXT_CUSTOM = HysteresisProcessing Patch SolverType Tunings Wavetable ghc clouds plaits stmlib + +SURGEXT_FLAGS = $(filter-out -fsingle-precision-constant,$(filter-out -std=gnu++11,$(BUILD_CXX_FLAGS))) +SURGEXT_FLAGS += -std=gnu++17 +SURGEXT_FLAGS += -DTIXML_USE_STL=1 +SURGEXT_FLAGS += -Isurgext/surge/src/common \ + -Isurgext/surge/src/common/dsp \ + -Isurgext/surge/src/common/dsp/filters \ + -Isurgext/surge/src/common/dsp/vembertech \ + -Isurgext/surge/src/common/dsp/utilities \ + -Isurgext/surge/src/common/dsp/oscillators \ + -Isurgext/surge/src/common/dsp/modulators \ + -Isurgext/surge/src/surge-testrunner \ + -Isurgext/surge/libs/sst/sst-filters/include \ + -Isurgext/surge/libs/sst/sst-cpputils/include \ + -Isurgext/surge/libs/sst/sst-waveshapers/include \ + -Isurgext/surge/libs/sst/sst-plugininfra/include \ + -Isurgext/surge/libs/sst/sst-plugininfra/libs/tinyxml/include \ + -Isurgext/surge/libs/sst/sst-plugininfra/libs/filesystem \ + -Isurgext/surge/libs/fmt/include \ + -Isurgext/surge/libs/LuaJitLib/LuaJIT/src \ + -Isurgext/surge/libs/strnatcmp \ + -Isurgext/surge/src/headless \ + -Isurgext/surge/libs/tuning-library/include \ + -I../deps/surge-build/libs/sst/sst-plugininfra/libs/filesystem/include \ + -include limits \ + -DSURGE_COMPILE_BLOCK_SIZE=8 + +ifneq ($(DEBUG),true) +SURGEXT_FLAGS += -DRELEASE=1 +endif + +ifeq ($(MACOS),true) +SURGEXT_FLAGS += -Wno-undefined-bool-conversion -Wno-unused-variable -Wno-reorder -Wno-char-subscripts -Wno-sign-compare -Wno-ignored-qualifiers -Wno-c++17-extensions -Wno-unused-private-field +SURGEXT_FLAGS += -DMAC +else ifeq ($(WINDOWS),true) +SURGEXT_FLAGS += -Wno-suggest-override -Wno-sign-compare -Wno-ignored-qualifiers -Wno-unused-variable -Wno-char-subscripts -Wno-reorder -Wno-int-in-bool-context +SURGEXT_FLAGS += -DWINDOWS +SURGEXT_FLAGS += -DSKIP_MINGW_FORMAT +else +SURGEXT_FLAGS += -Wno-unused-value -Wno-suggest-override -Wno-implicit-fallthrough -Wno-ignored-qualifiers +SURGEXT_FLAGS += -Wno-nonnull-compare -Wno-sign-compare -Wno-char-subscripts -Wno-unused-variable -Wno-unused-but-set-variable -Wno-reorder -Wno-multichar +SURGEXT_FLAGS += -DLINUX +SURGEXT_FLAGS += -Isurge/src/linux +endif + +SURGEXT_FLAGS += -DSURGE_RACK_BASE_VERSION=XT1-0-1 +SURGEXT_FLAGS += -DSURGE_RACK_PLUG_VERSION=Cardinal +SURGEXT_FLAGS += -DSURGE_RACK_SURGE_VERSION=Cardinal + # -------------------------------------------------------------- # unless_modules @@ -1197,6 +1254,7 @@ all: $(TARGET) clean: rm -f $(TARGET) rm -rf $(BUILD_DIR) + rm -rf surgext/build # -------------------------------------------------------------- @@ -1223,6 +1281,8 @@ RESOURCE_FILES = \ $(wildcard */res/*.svg) \ $(wildcard */res/*/*.svg) \ $(wildcard */res/*/*/*.svg) \ + $(wildcard */res/*/*/*/*.svg) \ + $(wildcard */res/*/*/*/*/*.svg) \ $(wildcard */res/*.otf) \ $(wildcard */res/*/*.otf) \ $(wildcard */res/*/*/*.otf) \ @@ -1247,10 +1307,21 @@ RESOURCE_FILES += Meander/res RESOURCE_FILES += Mog/res RESOURCE_FILES += nonlinearcircuits/res RESOURCE_FILES += ParableInstruments/res/Neil.png +RESOURCE_FILES += surgext/build/surge-data/configuration.xml +RESOURCE_FILES += surgext/build/surge-data/fx_presets +RESOURCE_FILES += surgext/build/surge-data/wavetables +RESOURCE_FILES += surgext/build/surge-data/windows.wt +RESOURCE_FILES += surgext/patches +RESOURCE_FILES += $(wildcard surgext/res/xt/fonts/quicksand/*.ttf) RESOURCE_FILES += $(wildcard unless_modules/art/*.art) RESOURCE_FILES += $(wildcard unless_modules/art/svg/*/*.svg) RESOURCE_FILES += $(wildcard unless_modules/font/*.ttf) # RESOURCE_FILES += $(wildcard unless_modules/manual/*) + +JACK_RESOURCES = $(CURDIR)/surgext/build/surge-data/configuration.xml +JACK_RESOURCES += $(CURDIR)/surgext/build/surge-data/fx_presets +JACK_RESOURCES += $(CURDIR)/surgext/build/surge-data/wavetables +JACK_RESOURCES += $(CURDIR)/surgext/build/surge-data/windows.wt endif RESOURCE_FILES += Cardinal/res/Miku/Miku.png @@ -1305,7 +1376,7 @@ VST3_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalSynth.vst3/Contents/Resource endif -resources: $(LV2_RESOURCES) $(VST2_RESOURCES) $(VST3_RESOURCES) $(CLAP_RESOURCES) +resources: $(JACK_RESOURCES) $(LV2_RESOURCES) $(VST2_RESOURCES) $(VST3_RESOURCES) $(CLAP_RESOURCES) ../bin/Cardinal.lv2/resources/%: % -@mkdir -p "$(shell dirname $@)" @@ -1427,6 +1498,23 @@ else $(SILENT)ln -sf $(abspath $<) $@ endif +%/surgext/build/surge-data/configuration.xml: surgext/surge/resources/surge-shared/configuration.xml + -@mkdir -p "$(shell dirname $@)" + $(SILENT)ln -sf $(abspath $<) $@ + +%/surgext/build/surge-data/fx_presets: + -@mkdir -p "$@" + cp -R surgext/surge/resources/data/fx_presets/* $@/ + cp -R surgext/res/surge_extra_data/fx_presets/* $@/ + +%/surgext/build/surge-data/wavetables: surgext/surge/resources/data/wavetables + -@mkdir -p "$(shell dirname $@)" + $(SILENT)ln -sf $(abspath $<) $@ + +%/surgext/build/surge-data/windows.wt: surgext/surge/resources/surge-shared/windows.wt + -@mkdir -p "$(shell dirname $@)" + $(SILENT)ln -sf $(abspath $<) $@ + # -------------------------------------------------------------- # Build commands @@ -2048,6 +2136,13 @@ $(BUILD_DIR)/stocaudio/%.cpp.o: stocaudio/%.cpp $(foreach m,$(STOCAUDIO_CUSTOM),$(call custom_module_names,$(m),stocaudio)) \ -DpluginInstance=pluginInstance__stocaudio +$(BUILD_DIR)/surgext%.cpp.o: surgext%.cpp + -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" + @echo "Compiling $<" + $(SILENT)$(CXX) $< $(SURGEXT_FLAGS) -c -o $@ \ + $(foreach m,$(SURGEXT_CUSTOM),$(call custom_module_names,$(m),surgext)) \ + -DpluginInstance=pluginInstance__surgext + $(BUILD_DIR)/unless_modules/%.cpp.o: unless_modules/%.cpp -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" @echo "Compiling $<" diff --git a/plugins/plugins.cpp b/plugins/plugins.cpp index 0658e7a..2fcef45 100644 --- a/plugins/plugins.cpp +++ b/plugins/plugins.cpp @@ -736,6 +736,11 @@ StoermelderSettings pluginSettings; void StoermelderSettings::saveToJson() {} void StoermelderSettings::readFromJson() {} +// surgext +#include "surgext/src/SurgeXT.h" +void surgext_rack_initialize(); +void surgext_rack_update_theme(); + // unless_modules #include "unless_modules/src/unless.hpp" @@ -848,6 +853,7 @@ Plugin* pluginInstance__repelzen; Plugin* pluginInstance__sonusmodular; Plugin* pluginInstance__stocaudio; extern Plugin* pluginInstance__stoermelder_p1; +Plugin* pluginInstance__surgext; Plugin* pluginInstance__unless_modules; Plugin* pluginInstance__ValleyAudio; Plugin* pluginInstance__Voxglitch; @@ -2840,6 +2846,64 @@ static void initStatic__stoermelder_p1() } } +static void initStatic__surgext() +{ + Plugin* const p = new Plugin; + pluginInstance__surgext = p; + + const StaticPluginLoader spl(p, "surgext"); + if (spl.ok()) + { + p->addModel(modelVCOClassic); + p->addModel(modelVCOModern); + p->addModel(modelVCOWavetable); + p->addModel(modelVCOWindow); + p->addModel(modelVCOSine); + p->addModel(modelVCOFM2); + p->addModel(modelVCOFM3); + p->addModel(modelVCOSHNoise); + p->addModel(modelVCOAlias); + p->addModel(modelVCOString); + p->addModel(modelVCOTwist); + + // Add the ported ones + p->addModel(modelSurgeVCF); + p->addModel(modelSurgeDelay); + p->addModel(modelSurgeDelayLineByFreq); + p->addModel(modelSurgeWaveshaper); + p->addModel(modelSurgeLFO); + p->addModel(modelSurgeMixer); + p->addModel(modelSurgeModMatrix); + + p->addModel(modelFXReverb); + p->addModel(modelFXPhaser); + p->addModel(modelFXRotarySpeaker); + p->addModel(modelFXDistortion); + p->addModel(modelFXFrequencyShifter); + p->addModel(modelFXChorus); + p->addModel(modelFXVocoder); + p->addModel(modelFXReverb2); + p->addModel(modelFXFlanger); + p->addModel(modelFXRingMod); + p->addModel(modelFXNeuron); + p->addModel(modelFXResonator); + p->addModel(modelFXChow); + p->addModel(modelFXExciter); + p->addModel(modelFXEnsemble); + p->addModel(modelFXCombulator); + p->addModel(modelFXSpringReverb); + p->addModel(modelFXTreeMonster); + + /* v2.1 modules + p->addModel(modelEGxVCA); + p->addModel(modelQuadAD); + p->addModel(modelQuadLFO); + */ + + surgext_rack_initialize(); + } +} + static void initStatic__unless_modules() { Plugin* const p = new Plugin; @@ -3038,7 +3102,8 @@ void initStaticPlugins() initStatic__repelzen(); initStatic__sonusmodular(); initStatic__stocaudio(); - initStatic__stoermelder_p1(), + initStatic__stoermelder_p1(); + initStatic__surgext(); initStatic__unless_modules(); initStatic__ValleyAudio(); initStatic__Voxglitch(); @@ -3077,6 +3142,10 @@ void updateStaticPluginsDarkMode() { gtg_default_theme = darkMode ? 1 : 0; } + // surgext + { + surgext_rack_update_theme(); + } #endif } diff --git a/plugins/surgext b/plugins/surgext new file mode 160000 index 0000000..1475b73 --- /dev/null +++ b/plugins/surgext @@ -0,0 +1 @@ +Subproject commit 1475b73ba29189ac6e294bf6d27a39443b584fa6 diff --git a/plugins/surgext-helper/surgext-helper.cpp b/plugins/surgext-helper/surgext-helper.cpp new file mode 100644 index 0000000..1b7c527 --- /dev/null +++ b/plugins/surgext-helper/surgext-helper.cpp @@ -0,0 +1,31 @@ +/* + * DISTRHO Cardinal Plugin + * Copyright (C) 2021-2022 Filipe Coelho + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 3 of + * the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * For a full copy of the GNU General Public License see the LICENSE file. + */ + +#include "../surgext/src/XTStyle.h" + +using namespace sst::surgext_rack::style; + +void surgext_rack_initialize() +{ + XTStyle::initialize(); +} + +void surgext_rack_update_theme() +{ + XTStyle::setGlobalStyle(rack::settings::darkMode ? XTStyle::Style::DARK : XTStyle::Style::LIGHT); + XTStyle::notifyStyleListeners(); +} diff --git a/src/Makefile.cardinal.mk b/src/Makefile.cardinal.mk index 0a08ff9..8ef7ba5 100644 --- a/src/Makefile.cardinal.mk +++ b/src/Makefile.cardinal.mk @@ -130,6 +130,29 @@ endif RACK_EXTRA_LIBS += $(DEP_LIB_PATH)/libzstd.a endif +# -------------------------------------------------------------- +# surgext libraries + +ifneq ($(NOPLUGINS),true) +SURGE_DEP_PATH = $(abspath ../../deps/surge-build) +RACK_EXTRA_LIBS += $(SURGE_DEP_PATH)/src/common/libsurge-common.a +RACK_EXTRA_LIBS += $(SURGE_DEP_PATH)/src/common/libjuce_dsp_rack_sub.a +RACK_EXTRA_LIBS += $(SURGE_DEP_PATH)/libs/airwindows/libairwindows.a +RACK_EXTRA_LIBS += $(SURGE_DEP_PATH)/libs/eurorack/libeurorack.a +ifeq ($(DEBUG),true) +RACK_EXTRA_LIBS += $(SURGE_DEP_PATH)/libs/fmt/libfmtd.a +else +RACK_EXTRA_LIBS += $(SURGE_DEP_PATH)/libs/fmt/libfmt.a +endif +RACK_EXTRA_LIBS += $(SURGE_DEP_PATH)/libs/sqlite-3.23.3/libsqlite.a +RACK_EXTRA_LIBS += $(SURGE_DEP_PATH)/libs/sst/sst-plugininfra/libsst-plugininfra.a +ifneq ($(WINDOWS),true) +RACK_EXTRA_LIBS += $(SURGE_DEP_PATH)/libs/sst/sst-plugininfra/libs/filesystem/libfilesystem.a +endif +RACK_EXTRA_LIBS += $(SURGE_DEP_PATH)/libs/sst/sst-plugininfra/libs/strnatcmp/libstrnatcmp.a +RACK_EXTRA_LIBS += $(SURGE_DEP_PATH)/libs/sst/sst-plugininfra/libs/tinyxml/libtinyxml.a +endif + # -------------------------------------------------------------- # FIXME @@ -148,6 +171,12 @@ EXTRA_LIBS += ../../deps/aubio/libaubio.a EXTRA_LIBS += $(shell $(PKG_CONFIG) --libs fftw3f) endif +ifneq ($(NOPLUGINS),true) +ifeq ($(MACOS),true) +EXTRA_LIBS += -framework Accelerate +endif +endif + # -------------------------------------------------------------- # Setup resources @@ -283,6 +312,32 @@ LINK_FLAGS += --preload-file=./jsfx LINK_FLAGS += --preload-file=./lv2 endif LINK_FLAGS += --preload-file=../../bin/CardinalNative.lv2/resources@/resources +ifneq ($(NOPLUGINS),true) +SYMLINKED_DIRS_RESOURCES = +# find . -type l | grep -v svg | grep -v ttf | grep -v art | grep -v json | grep -v png | grep -v otf | sort +SYMLINKED_DIRS_RESOURCES += BaconPlugs/res/midi/chopin +SYMLINKED_DIRS_RESOURCES += BaconPlugs/res/midi/debussy +SYMLINKED_DIRS_RESOURCES += BaconPlugs/res/midi/goldberg +SYMLINKED_DIRS_RESOURCES += cf/playeroscs +SYMLINKED_DIRS_RESOURCES += DrumKit/res/samples +SYMLINKED_DIRS_RESOURCES += Fundamental/presets +SYMLINKED_DIRS_RESOURCES += GrandeModular/presets +SYMLINKED_DIRS_RESOURCES += LyraeModules/presets +SYMLINKED_DIRS_RESOURCES += Meander/res +SYMLINKED_DIRS_RESOURCES += MindMeldModular/presets +SYMLINKED_DIRS_RESOURCES += MindMeldModular/res/ShapeMaster/CommunityPresets +SYMLINKED_DIRS_RESOURCES += MindMeldModular/res/ShapeMaster/CommunityShapes +SYMLINKED_DIRS_RESOURCES += MindMeldModular/res/ShapeMaster/MindMeldPresets +SYMLINKED_DIRS_RESOURCES += MindMeldModular/res/ShapeMaster/MindMeldShapes +SYMLINKED_DIRS_RESOURCES += Mog/res +SYMLINKED_DIRS_RESOURCES += nonlinearcircuits/res +SYMLINKED_DIRS_RESOURCES += Orbits/presets +SYMLINKED_DIRS_RESOURCES += stoermelder-packone/presets +SYMLINKED_DIRS_RESOURCES += surgext/build/surge-data/wavetables +SYMLINKED_DIRS_RESOURCES += surgext/patches +SYMLINKED_DIRS_RESOURCES += surgext/presets +LINK_FLAGS += $(foreach d,$(SYMLINKED_DIRS_RESOURCES),--preload-file=../../bin/CardinalNative.lv2/resources/$(d)@/resources/$(d)) +endif LINK_FLAGS += -sALLOW_MEMORY_GROWTH LINK_FLAGS += -sINITIAL_MEMORY=64Mb LINK_FLAGS += -sLZ4=1