From 312c49aa7d716443f9d7f1a04fbe9e51db83e202 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 4 Dec 2021 23:53:03 +0000 Subject: [PATCH] Add Glue the Giant, fix build Signed-off-by: falkTX --- .gitmodules | 3 +++ README.md | 1 + doc/LICENSES.md | 1 + plugins/GlueTheGiant | 1 + plugins/Makefile | 23 +++++++++++++++++++++-- plugins/plugins.cpp | 35 ++++++++++++++++++++++++++++++++++- plugins/res/GlueTheGiant | 1 + src/override/asset.cpp | 20 +++++++++++++++++--- 8 files changed, 79 insertions(+), 6 deletions(-) create mode 160000 plugins/GlueTheGiant create mode 120000 plugins/res/GlueTheGiant diff --git a/.gitmodules b/.gitmodules index de806d4..be904bc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -97,3 +97,6 @@ [submodule "plugins/ChowDSP"] path = plugins/ChowDSP url = https://github.com/jatinchowdhury18/ChowDSP-VCV.git +[submodule "plugins/GlueTheGiant"] + path = plugins/GlueTheGiant + url = https://github.com/gluethegiant/gtg-rack.git diff --git a/README.md b/README.md index 2dab4e5..8fbb8ab 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ At the moment the following 3rd-party modules are provided: - E-Series - Fehler Fabrik - Fundamental +- Glue the Giant - Grande - Impromptu - JW-Modules diff --git a/doc/LICENSES.md b/doc/LICENSES.md index 1655ad7..25c9547 100644 --- a/doc/LICENSES.md +++ b/doc/LICENSES.md @@ -29,6 +29,7 @@ Bellow follows a list of all code licenses used in Cardinal and linked submodule | E-Series | GPL-3.0-or-later | | | Fehler Fabrik | GPL-3.0-or-later | | | Fundamental | GPL-3.0-or-later | | +| Glue the Giant | GPL-3.0-or-later | | | Grande | GPL-3.0-or-later | | | Impromptu | GPL-3.0-or-later | | | JW-Modules | BSD-3-Clause | | diff --git a/plugins/GlueTheGiant b/plugins/GlueTheGiant new file mode 160000 index 0000000..54fed7f --- /dev/null +++ b/plugins/GlueTheGiant @@ -0,0 +1 @@ +Subproject commit 54fed7f78bbaac1f1d6275aa737acc39aebc6e72 diff --git a/plugins/Makefile b/plugins/Makefile index 9d4e4da..d363a5a 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -383,7 +383,6 @@ BOGAUDIO_CUSTOM_PER_FILE = ARQuantity AttackMenuItem ReleaseMenuItem # -------------------------------------------------------------- # ChowDSP -PLUGIN_FILES += ChowDSP/src/plugin.cpp PLUGIN_FILES += $(wildcard ChowDSP/src/*/*.cpp) PLUGIN_FILES += $(wildcard ChowDSP/src/*/*/*.cpp) PLUGIN_FILES += $(wildcard ChowDSP/lib/r8lib/*.cpp) @@ -426,6 +425,11 @@ PLUGIN_FILES += Fundamental/src/dr_wav.c # modules/types which are present in other plugins FUNDAMENTAL_CUSTOM = $(DRWAV) +# -------------------------------------------------------------- +# GlueTheGiant + +PLUGIN_FILES += $(filter-out GlueTheGiant/src/plugin.cpp,$(wildcard GlueTheGiant/src/*.cpp)) + # -------------------------------------------------------------- # GrandeModular @@ -921,7 +925,6 @@ $(BUILD_DIR)/ChowDSP/%.cpp.o: ChowDSP/%.cpp $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ \ $(foreach m,$(CHOWDSP_CUSTOM),$(call custom_module_names,$(m),ChowDSP)) \ -DpluginInstance=pluginInstance__ChowDSP \ - -Dinit=init__ChowDSP \ -DUSE_EIGEN \ -IChowDSP/lib \ -IChowDSP/lib/chowdsp_utils/DSP/WDF \ @@ -964,6 +967,22 @@ $(BUILD_DIR)/Fundamental/%.cpp.o: Fundamental/%.cpp $(foreach m,$(FUNDAMENTAL_CUSTOM),$(call custom_module_names,$(m),Fundamental)) \ -DpluginInstance=pluginInstance__Fundamental +$(BUILD_DIR)/GlueTheGiant/%.cpp.o: GlueTheGiant/%.cpp + -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" + @echo "Compiling $<" + $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ \ + $(foreach m,$(GLUETHEGIANT_CUSTOM),$(call custom_module_names,$(m),GlueTheGiant)) \ + -DpluginInstance=pluginInstance__GlueTheGiant + +$(BUILD_DIR)/GlueTheGiant/src/gtgComponents.cpp.o: GlueTheGiant/src/gtgComponents.cpp + -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" + @echo "Compiling $<" + $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ \ + $(foreach m,$(GLUETHEGIANT_CUSTOM),$(call custom_module_names,$(m),GlueTheGiant)) \ + -DpluginInstance=pluginInstance__GlueTheGiant \ + -DloadGtgPluginDefault=ignoredGlueTheGiant1 \ + -DsaveGtgPluginDefault=ignoredGlueTheGiant2 + $(BUILD_DIR)/GrandeModular/%.cpp.o: GrandeModular/%.cpp -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" @echo "Compiling $<" diff --git a/plugins/plugins.cpp b/plugins/plugins.cpp index 657c780..ca400d1 100644 --- a/plugins/plugins.cpp +++ b/plugins/plugins.cpp @@ -226,6 +226,9 @@ extern Model *modelBlank; // ChowDSP #include "ChowDSP/src/plugin.hpp" +#define init initChowDSP +#include "ChowDSP/src/plugin.cpp" +#undef init // DrumKit #include "DrumKit/src/DrumKit.hpp" @@ -240,6 +243,14 @@ void setupSamples(); // Fundamental #include "Fundamental/src/plugin.hpp" +// GlueTheGiant +#include "GlueTheGiant/src/plugin.hpp" +bool audition_mixer = false; +bool audition_depot = false; +int gtg_default_theme = 1; +int loadGtgPluginDefault(const char*, int) { return 1; } +void saveGtgPluginDefault(const char*, int) {} + // GrandeModular #include "GrandeModular/src/plugin.hpp" @@ -384,12 +395,13 @@ Plugin* pluginInstance__Befaco; Plugin* pluginInstance__Bidoo; Plugin* pluginInstance__BogaudioModules; Plugin* pluginInstance__cf; -extern Plugin* pluginInstance__ChowDSP; +Plugin* pluginInstance__ChowDSP; extern Plugin* pluginInstance__DrumKit; Plugin* pluginInstance__ESeries; Plugin* pluginInstance__FehlerFabrik; Plugin* pluginInstance__Fundamental; Plugin* pluginInstance__GrandeModular; +Plugin* pluginInstance__GlueTheGiant; extern Plugin* pluginInstance__ImpromptuModular; Plugin* pluginInstance__JW; extern Plugin* pluginInstance__MindMeld; @@ -1187,6 +1199,26 @@ static void initStatic__Fundamental() } } +static void initStatic__GlueTheGiant() +{ + Plugin* const p = new Plugin; + pluginInstance__GlueTheGiant = p; + + const StaticPluginLoader spl(p, "GlueTheGiant"); + if (spl.ok()) + { + p->addModel(modelGigBus); + p->addModel(modelMiniBus); + p->addModel(modelSchoolBus); + p->addModel(modelMetroCityBus); + p->addModel(modelBusDepot); + p->addModel(modelBusRoute); + p->addModel(modelRoad); + p->addModel(modelEnterBus); + p->addModel(modelExitBus); + } +} + static void initStatic__GrandeModular() { Plugin* const p = new Plugin; @@ -1535,6 +1567,7 @@ void initStaticPlugins() initStatic__ESeries(); initStatic__FehlerFabrik(); initStatic__Fundamental(); + initStatic__GlueTheGiant(); initStatic__GrandeModular(); initStatic__ImpromptuModular(); initStatic__JW(); diff --git a/plugins/res/GlueTheGiant b/plugins/res/GlueTheGiant new file mode 120000 index 0000000..ef4d01f --- /dev/null +++ b/plugins/res/GlueTheGiant @@ -0,0 +1 @@ +../GlueTheGiant/res \ No newline at end of file diff --git a/src/override/asset.cpp b/src/override/asset.cpp index 8c039ec..6ff6457 100644 --- a/src/override/asset.cpp +++ b/src/override/asset.cpp @@ -50,15 +50,29 @@ std::string user(std::string filename) { // get system resource, trimming "res/" prefix if we are loaded as a plugin bundle std::string system(std::string filename) { - if (string::endsWith(filename, "ComponentLibrary/ScrewSilver.svg")) { - filename = filename.substr(0, filename.size()-32) + "ComponentLibrary/ScrewBlack.svg"; - } + if (string::endsWith(filename, "/ComponentLibrary/ScrewSilver.svg")) + filename = filename.substr(0, filename.size()-10) + "Black.svg"; return system::join(systemDir, bundlePath.empty() ? filename : trim(filename)); } // get plugin resource, also trims "res/" as needed std::string plugin(plugin::Plugin* plugin, std::string filename) { DISTRHO_SAFE_ASSERT_RETURN(plugin != nullptr, {}); + if (plugin->slug == "GlueTheGiant") + { + if (filename == "res/BusDepot.svg" + || filename == "res/BusRoute.svg" + || filename == "res/EnterBus.svg" + || filename == "res/ExitBus.svg" + || filename == "res/GigBus.svg" + || filename == "res/MetroCityBus.svg" + || filename == "res/MiniBus.svg" + || filename == "res/Road.svg" + || filename == "res/SchoolBus.svg") + { + filename = filename.substr(0, filename.size()-4) + "_Night.svg"; + } + } return system::join(plugin->path, trim(filename)); }