From 12ea5e9579b17e2f32de16cc3486c480f1cf30d0 Mon Sep 17 00:00:00 2001 From: dreamer <1185977+dromer@users.noreply.github.com> Date: Fri, 25 Feb 2022 21:34:44 +0100 Subject: [PATCH] adding Path Set modules (#178) --- .gitmodules | 3 +++ README.md | 1 + docs/LICENSES.md | 2 ++ plugins/Makefile | 12 ++++++++++++ plugins/PathSet | 1 + plugins/plugins.cpp | 19 +++++++++++++++++++ src/custom/dep.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 79 insertions(+) create mode 160000 plugins/PathSet diff --git a/.gitmodules b/.gitmodules index 0bf4182..50e5980 100644 --- a/.gitmodules +++ b/.gitmodules @@ -166,3 +166,6 @@ [submodule "plugins/kocmoc"] path = plugins/kocmoc url = https://github.com/janne808/kocmoc-rack-modules.git +[submodule "plugins/PathSet"] + path = plugins/PathSet + url = https://github.com/patheros/PathSetModules.git diff --git a/README.md b/README.md index 6bbd6d5..5c5af56 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,7 @@ At the moment the following 3rd-party modules are provided: - Mog - mscHack - Orbits +- Path Set - Prism - rackwindows - repelzen diff --git a/docs/LICENSES.md b/docs/LICENSES.md index dce148d..82582ab 100644 --- a/docs/LICENSES.md +++ b/docs/LICENSES.md @@ -53,6 +53,7 @@ Bellow follows a list of all code licenses used in Cardinal and linked submodule | Mog | CC0-1.0 | | | mscHack | BSD-3-Clause | | | Orbits | GPL-3.0-or-later | | +| Path Set | GPL-3.0-or-later | | | Prism | BSD-3-Clause | | | Rackwindows | MIT | | | repelzen | GPL-3.0-or-later | | @@ -156,6 +157,7 @@ Below is a list of artwork licenses from plugins | mscHack/* | BSD-3-Clause | No artwork specific license provided, see [mschack#108](https://github.com/mschack/VCV-Rack-Plugins/issues/108) | | Orbits/* | CC-BY-NC-ND-4.0 | | | Orbits/fonts/ShareTechMono-Regular.ttf | OFL-1.1-RFN | | +| PathSet/* | GPL-3.0-or-later | No artwork specific license provided | | Prism/* | CC-BY-SA-4.0 | | | Prism/RobotoCondensed-Regular.ttf | Apache-2.0 | | | Rackwindows/* | MIT | [Same license as source code](https://github.com/n0jo/rackwindows/issues/15) | diff --git a/plugins/Makefile b/plugins/Makefile index 07fe70f..1a91ce4 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -666,6 +666,11 @@ MSCHACK_CUSTOM_PER_FILE = MAIN_SYNC_CLOCK FILTER_STRUCT FILTER_PARAM_STRUCT OSC_ PLUGIN_FILES += $(wildcard Orbits/src/*.cpp) +# -------------------------------------------------------------- +# Path Set + +PLUGIN_FILES += $(wildcard PathSet/src/*.cpp) + # -------------------------------------------------------------- # Prism @@ -1524,6 +1529,13 @@ $(BUILD_DIR)/Orbits/%.cpp.o: Orbits/%.cpp $(foreach m,$(ORBITS_CUSTOM),$(call custom_module_names,$(m),Orbits)) \ -DpluginInstance=pluginInstance__Orbits +$(BUILD_DIR)/PathSet/%.cpp.o: PathSet/%.cpp + -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" + @echo "Compiling $<" + $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ \ + $(foreach m,$(PATHSET_CUSTOM),$(call custom_module_names,$(m),PathSet)) \ + -DpluginInstance=pluginInstance__PathSet + $(BUILD_DIR)/Prism/%.cpp.o: Prism/%.cpp -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" @echo "Compiling $<" diff --git a/plugins/PathSet b/plugins/PathSet new file mode 160000 index 0000000..d03e8b4 --- /dev/null +++ b/plugins/PathSet @@ -0,0 +1 @@ +Subproject commit d03e8b486deba4740bc7f15ae95a08d823a7d00a diff --git a/plugins/plugins.cpp b/plugins/plugins.cpp index 375af88..5b00562 100644 --- a/plugins/plugins.cpp +++ b/plugins/plugins.cpp @@ -562,6 +562,9 @@ extern Model* modelMaude_221; // Orbits #include "Orbits/src/plugin.hpp" +// Path Set +# include "PathSet/src/plugin.hpp" + // Prism # include "Prism/src/plugin.hpp" @@ -678,6 +681,7 @@ Plugin* pluginInstance__MockbaModular; Plugin* pluginInstance__Mog; extern Plugin* pluginInstance__mscHack; Plugin* pluginInstance__Orbits; +Plugin* pluginInstance__PathSet; Plugin* pluginInstance__Prism; Plugin* pluginInstance__rackwindows; Plugin* pluginInstance__repelzen; @@ -2068,6 +2072,20 @@ static void initStatic__Orbits() } } +static void initStatic__PathSet() +{ + Plugin* const p = new Plugin; + pluginInstance__PathSet = p; + + const StaticPluginLoader spl(p, "PathSet"); + if (spl.ok()) + { + p->addModel(modelShiftyMod); + p->addModel(modelIceTray); + p->addModel(modelAstroVibe); + } +} + static void initStatic__Prism() { Plugin* const p = new Plugin; @@ -2317,6 +2335,7 @@ void initStaticPlugins() initStatic__Mog(); initStatic__mscHack(); initStatic__Orbits(); + initStatic__PathSet(); initStatic__Prism(); initStatic__rackwindows(); initStatic__repelzen(); diff --git a/src/custom/dep.cpp b/src/custom/dep.cpp index b074398..899cf42 100644 --- a/src/custom/dep.cpp +++ b/src/custom/dep.cpp @@ -252,6 +252,10 @@ static const struct { { "/kocmoc/res/SKF.svg", {}, -1 }, { "/kocmoc/res/SVF.svg", {}, -1 }, { "/kocmoc/res/TRG.svg", {}, -1 }, + // GPL-3.0-or-later + { "/PathSet/res/AstroVibe.svg", {}, -1 }, + { "/PathSet/res/IceTray.svg", {}, -1 }, + { "/PathSet/res/ShiftyMod.svg", {}, -1 }, }; static inline bool invertPaint(NSVGpaint& paint, const char* const svgFileToInvert = nullptr) @@ -338,6 +342,43 @@ static inline bool invertPaint(NSVGpaint& paint, const char* const svgFileToInve } } + // Special case for Path Set colors + if (svgFileToInvert != nullptr && std::strncmp(svgFileToInvert, "/PathSet/", 9) == 0) + { + switch (paint.color) + { + // do nothing + case 0xffdf7a1a: + case 0xffe3b080: + case 0xffe941e2: + case 0xffef73ea: + case 0xfff49ff0: + case 0xff698efb: + case 0xff787878: + case 0xfff5c99f: + case 0xffde944f: + case 0xffe1a265: + case 0xffe5cbb3: + case 0xffe6d2c0: + case 0xffffffff: + return false; + // set other colors + case 0xffe4cbb3: + paint.color = 0xffe3b080; + return false; + case 0xfff8dcc2: + paint.color = 0xffde944f; + return false; + case 0xffe5d9cd: + paint.color = 0xfff8dcc2; + return false; + // should be just the logo, but also changes the output outlines + case 0xff000000: + paint.color = 0xffffffff; + return true; + } + } + switch (paint.color) { // scopes or other special things (do nothing)