diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29f428d..67c0e33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,7 @@ on: env: DEBIAN_FRONTEND: noninteractive HOMEBREW_NO_AUTO_UPDATE: 1 + LIBGL_ALWAYS_SOFTWARE: "true" jobs: linux-arm64: @@ -26,7 +27,7 @@ jobs: echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-arm64.list echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-arm64.list sudo apt-get update -qq - sudo apt-get install -yqq g++-aarch64-linux-gnu libasound2-dev:arm64 libcairo2-dev:arm64 libgl1-mesa-dev:arm64 liblo-dev:arm64 libpulse-dev:arm64 libx11-dev:arm64 libxcursor-dev:arm64 libxext-dev:arm64 libxrandr-dev:arm64 qemu-user-static xvfb + sudo apt-get install -yqq g++-aarch64-linux-gnu libasound2-dev:arm64 libcairo2-dev:arm64 libgl1-mesa-dev:arm64 liblo-dev:arm64 libpulse-dev:arm64 libx11-dev:arm64 libxcursor-dev:arm64 libxext-dev:arm64 libxrandr-dev:arm64 qemu-user-static # extra for vcv deps sudo apt-get install -yqq libxi-dev:arm64 libxinerama-dev:arm64 - name: Build linux arm64 cross-compiled @@ -35,10 +36,9 @@ jobs: CXX: aarch64-linux-gnu-g++ LDFLAGS: -static-libgcc -static-libstdc++ PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - LIBGL_ALWAYS_SOFTWARE: "true" run: | make features - xvfb-run -a -- make WITH_LTO=true -j $(nproc) + make WITH_LTO=true -j $(nproc) - name: Set sha8 id: slug run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)" @@ -65,7 +65,7 @@ jobs: echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-armhf.list echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-armhf.list sudo apt-get update -qq - sudo apt-get install -yqq g++-arm-linux-gnueabihf libasound2-dev:armhf libcairo2-dev:armhf libgl1-mesa-dev:armhf liblo-dev:armhf libpulse-dev:armhf libx11-dev:armhf libxcursor-dev:armhf libxext-dev:armhf libxrandr-dev:armhf qemu-user-static xvfb + sudo apt-get install -yqq g++-arm-linux-gnueabihf libasound2-dev:armhf libcairo2-dev:armhf libgl1-mesa-dev:armhf liblo-dev:armhf libpulse-dev:armhf libx11-dev:armhf libxcursor-dev:armhf libxext-dev:armhf libxrandr-dev:armhf qemu-user-static # extra for vcv deps sudo apt-get install -yqq libxi-dev:armhf libxinerama-dev:armhf - name: Build linux armhf cross-compiled @@ -74,10 +74,9 @@ jobs: CXX: arm-linux-gnueabihf-g++ LDFLAGS: -static-libgcc -static-libstdc++ PKG_CONFIG_PATH: /usr/lib/arm-linux-gnueabihf/pkgconfig - LIBGL_ALWAYS_SOFTWARE: "true" run: | make features - xvfb-run -a -- make WITH_LTO=true -j $(nproc) + make WITH_LTO=true -j $(nproc) - name: Set sha8 id: slug run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)" @@ -100,7 +99,7 @@ jobs: run: | sudo dpkg --add-architecture i386 sudo apt-get update -qq - sudo apt-get install -yqq g++-i686-linux-gnu libasound2-dev:i386 libcairo2-dev:i386 libgl1-mesa-dev:i386 liblo-dev:i386 libpulse-dev:i386 libx11-dev:i386 libxcursor-dev:i386 libxext-dev:i386 libxrandr-dev:i386 xvfb + sudo apt-get install -yqq g++-i686-linux-gnu libasound2-dev:i386 libcairo2-dev:i386 libgl1-mesa-dev:i386 liblo-dev:i386 libpulse-dev:i386 libx11-dev:i386 libxcursor-dev:i386 libxext-dev:i386 libxrandr-dev:i386 # extra for vcv deps sudo apt-get install -yqq libxi-dev:i386 libxinerama-dev:i386 - name: Build linux x86 @@ -111,10 +110,9 @@ jobs: CXXFLAGS: -m32 LDFLAGS: -m32 -static-libgcc -static-libstdc++ PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig - LIBGL_ALWAYS_SOFTWARE: "true" run: | make features - xvfb-run -a -- make WITH_LTO=true -j $(nproc) + make WITH_LTO=true -j $(nproc) - name: Set sha8 id: slug run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)" @@ -136,16 +134,15 @@ jobs: - name: Set up dependencies run: | sudo apt-get update -qq - sudo apt-get install -yqq libasound2-dev libcairo2-dev libgl1-mesa-dev liblo-dev libpulse-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev xvfb + sudo apt-get install -yqq libasound2-dev libcairo2-dev libgl1-mesa-dev liblo-dev libpulse-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev # extra for vcv deps sudo apt-get install -yqq libxi-dev libxinerama-dev - name: Build linux x86_64 env: LDFLAGS: -static-libgcc -static-libstdc++ - LIBGL_ALWAYS_SOFTWARE: "true" run: | make features - xvfb-run -a -- make WITH_LTO=true -j $(nproc) + make WITH_LTO=true -j $(nproc) - name: Set sha8 id: slug run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)" @@ -167,16 +164,15 @@ jobs: - name: Set up dependencies run: | sudo apt-get update -qq - sudo apt-get install -yqq libasound2-dev libcairo2-dev libgl1-mesa-dev liblo-dev libpulse-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev xvfb + sudo apt-get install -yqq libasound2-dev libcairo2-dev libgl1-mesa-dev liblo-dev libpulse-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev # extra for vcv deps sudo apt-get install -yqq libxi-dev libxinerama-dev - name: Build linux x86_64 (debug) env: LDFLAGS: -static-libgcc -static-libstdc++ - LIBGL_ALWAYS_SOFTWARE: "true" run: | make features - xvfb-run -a -- make DEBUG=true -j $(nproc) + make DEBUG=true -j $(nproc) - name: Set sha8 id: slug run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)" @@ -227,23 +223,19 @@ jobs: run: | sudo dpkg --add-architecture i386 sudo apt-get update -qq - sudo apt-get install -yqq binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 wine-stable:i386 xvfb + sudo apt-get install -yqq binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 wine-stable:i386 - name: Build win32 cross-compiled env: CC: i686-w64-mingw32-gcc CXX: i686-w64-mingw32-g++ EXE_WRAPPER: wine PKG_CONFIG: "false" - LIBGL_ALWAYS_SOFTWARE: "true" WINEARCH: "win32" WINEDEBUG: "-all" WINEDLLOVERRIDES: "mscoree,mshtml=" run: | make features - xvfb-run wineboot -u - echo -e '[HKEY_CURRENT_USER\Software\Wine\WineDbg]\n"ShowCrashDialog"=dword:00000000\n' > nodiag.reg - xvfb-run regedit nodiag.reg - xvfb-run -a -- make WITH_LTO=true -j $(nproc) + make WITH_LTO=true -j $(nproc) - name: Set sha8 id: slug run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)" @@ -265,23 +257,19 @@ jobs: - name: Set up dependencies run: | sudo apt-get update -qq - sudo apt-get install -yqq binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable xvfb + sudo apt-get install -yqq binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable - name: Build win64 cross-compiled env: CC: x86_64-w64-mingw32-gcc CXX: x86_64-w64-mingw32-g++ EXE_WRAPPER: wine PKG_CONFIG: "false" - LIBGL_ALWAYS_SOFTWARE: "true" WINEARCH: "win64" WINEDEBUG: "-all" WINEDLLOVERRIDES: "mscoree,mshtml=" run: | make features - xvfb-run wineboot -u - echo -e '[HKEY_CURRENT_USER\Software\Wine\WineDbg]\n"ShowCrashDialog"=dword:00000000\n' > nodiag.reg - xvfb-run regedit nodiag.reg - xvfb-run -a -- make WITH_LTO=true -j $(nproc) + make WITH_LTO=true -j $(nproc) - name: Set sha8 id: slug run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)" @@ -307,7 +295,7 @@ jobs: sudo dpkg -i kxstudio-repos_10.0.3_all.deb sudo apt-get update -qq # build-deps - sudo apt-get install -yqq libasound2-dev libcairo2-dev libgl1-mesa-dev liblo-dev libpulse-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev xvfb + sudo apt-get install -yqq libasound2-dev libcairo2-dev libgl1-mesa-dev liblo-dev libpulse-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev # extra for vcv deps sudo apt-get install -yqq libxi-dev libxinerama-dev # runtime testing @@ -317,10 +305,9 @@ jobs: CFLAGS: -g CXXFLAGS: -g -DDPF_ABORT_ON_ERROR LDFLAGS: -static-libgcc -static-libstdc++ - LIBGL_ALWAYS_SOFTWARE: "true" run: | make features - xvfb-run -a -- make NOOPT=true SKIP_STRIPPING=true -j $(nproc) + make NOOPT=true SKIP_STRIPPING=true -j $(nproc) - name: Validate LV2 ttl syntax run: | lv2_validate \ @@ -330,23 +317,19 @@ jobs: /usr/lib/lv2/kx-programs.lv2/*.ttl \ ./bin/*.lv2/*.ttl #- name: Validate LV2 metadata and binaries - #env: - #LIBGL_ALWAYS_SOFTWARE: "true" #run: | #export LV2_PATH=/tmp/lv2-path #mkdir ${LV2_PATH} #cp -r bin/*.lv2 \ #/usr/lib/lv2/{atom,buf-size,core,data-access,kx-control-input-port-change-request,kx-programs,instance-access,midi,parameters,port-groups,port-props,options,patch,presets,resize-port,state,time,ui,units,urid,worker}.lv2 \ #${LV2_PATH} - #xvfb-run lv2lint -s lv2_generate_ttl -l ld-linux-x86-64.so.2 -M nopack $(lv2ls) + #lv2lint -s lv2_generate_ttl -l ld-linux-x86-64.so.2 -M nopack $(lv2ls) - name: Test LV2 plugin - env: - LIBGL_ALWAYS_SOFTWARE: "true" run: | export LV2_PATH=/tmp/lv2-path for p in $(lv2ls); do \ env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \ - xvfb-run valgrind \ + valgrind \ --error-exitcode=255 \ --leak-check=no \ --track-origins=yes \ @@ -354,28 +337,24 @@ jobs: /usr/lib/carla/carla-bridge-native lv2 "" ${p} 1>/dev/null; \ done - name: Test VST2 plugin - env: - LIBGL_ALWAYS_SOFTWARE: "true" run: | for p in $(ls bin/ | grep vst.so); do \ env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \ - xvfb-run valgrind \ + valgrind \ --error-exitcode=255 \ --leak-check=no \ --track-origins=yes \ --suppressions=./dpf/utils/valgrind-dpf.supp \ /usr/lib/carla/carla-bridge-native vst2 ./bin/${p} "" 1>/dev/null; \ done - - name: Test VST3 plugin - env: - LIBGL_ALWAYS_SOFTWARE: "true" - run: | - for p in $(ls bin/ | grep vst3); do \ - env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \ - xvfb-run valgrind \ - --error-exitcode=255 \ - --leak-check=no \ - --track-origins=yes \ - --suppressions=./dpf/utils/valgrind-dpf.supp \ - /usr/lib/carla/carla-bridge-native vst3 ./bin/${p} "" 1>/dev/null; \ - done + # - name: Test VST3 plugin + # run: | + # for p in $(ls bin/ | grep vst3); do \ + # env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \ + # valgrind \ + # --error-exitcode=255 \ + # --leak-check=no \ + # --track-origins=yes \ + # --suppressions=./dpf/utils/valgrind-dpf.supp \ + # /usr/lib/carla/carla-bridge-native vst3 ./bin/${p} "" 1>/dev/null; \ + # done diff --git a/dpf b/dpf index 0f31c24..ad05572 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 0f31c24917043d6841fcc16efcb0e4e85bc51a89 +Subproject commit ad055720fc348478717037017edb003072278d6d diff --git a/plugins/DrumKit b/plugins/DrumKit index 58755a3..53205f4 160000 --- a/plugins/DrumKit +++ b/plugins/DrumKit @@ -1 +1 @@ -Subproject commit 58755a32837522a64b6b886b764dbefc9a2b8fd3 +Subproject commit 53205f4f58d84ed02ebdc23d80ef86d90ce2d61b diff --git a/plugins/res/AS b/plugins/res/AS new file mode 120000 index 0000000..5fda03b --- /dev/null +++ b/plugins/res/AS @@ -0,0 +1 @@ +../AS/res \ No newline at end of file diff --git a/plugins/res/AmalgamatedHarmonics b/plugins/res/AmalgamatedHarmonics new file mode 120000 index 0000000..b1f95f5 --- /dev/null +++ b/plugins/res/AmalgamatedHarmonics @@ -0,0 +1 @@ +../AmalgamatedHarmonics/res \ No newline at end of file diff --git a/plugins/res/AnimatedCircuits b/plugins/res/AnimatedCircuits new file mode 120000 index 0000000..58d1e12 --- /dev/null +++ b/plugins/res/AnimatedCircuits @@ -0,0 +1 @@ +../AnimatedCircuits/res \ No newline at end of file diff --git a/plugins/res/AudibleInstruments b/plugins/res/AudibleInstruments new file mode 120000 index 0000000..55a5eaa --- /dev/null +++ b/plugins/res/AudibleInstruments @@ -0,0 +1 @@ +../AudibleInstruments/res \ No newline at end of file diff --git a/plugins/res/Befaco b/plugins/res/Befaco new file mode 120000 index 0000000..dda4da3 --- /dev/null +++ b/plugins/res/Befaco @@ -0,0 +1 @@ +../Befaco/res \ No newline at end of file diff --git a/plugins/res/Bidoo b/plugins/res/Bidoo new file mode 120000 index 0000000..5be434f --- /dev/null +++ b/plugins/res/Bidoo @@ -0,0 +1 @@ +../Bidoo/res \ No newline at end of file diff --git a/plugins/res/BogaudioModules b/plugins/res/BogaudioModules new file mode 120000 index 0000000..bb3ce9b --- /dev/null +++ b/plugins/res/BogaudioModules @@ -0,0 +1 @@ +../BogaudioModules/res \ No newline at end of file diff --git a/plugins/res/Cardinal b/plugins/res/Cardinal new file mode 120000 index 0000000..1f944cf --- /dev/null +++ b/plugins/res/Cardinal @@ -0,0 +1 @@ +../Cardinal/res \ No newline at end of file diff --git a/plugins/res/DrumKit b/plugins/res/DrumKit new file mode 120000 index 0000000..0f28388 --- /dev/null +++ b/plugins/res/DrumKit @@ -0,0 +1 @@ +../DrumKit/res \ No newline at end of file diff --git a/plugins/res/ESeries b/plugins/res/ESeries new file mode 120000 index 0000000..999be60 --- /dev/null +++ b/plugins/res/ESeries @@ -0,0 +1 @@ +../ESeries/res \ No newline at end of file diff --git a/plugins/res/Fundamental b/plugins/res/Fundamental new file mode 120000 index 0000000..31d6e5a --- /dev/null +++ b/plugins/res/Fundamental @@ -0,0 +1 @@ +../Fundamental/res \ No newline at end of file diff --git a/plugins/res/GrandeModular b/plugins/res/GrandeModular new file mode 120000 index 0000000..2883349 --- /dev/null +++ b/plugins/res/GrandeModular @@ -0,0 +1 @@ +../GrandeModular/res \ No newline at end of file diff --git a/plugins/res/ImpromptuModular b/plugins/res/ImpromptuModular new file mode 120000 index 0000000..a276730 --- /dev/null +++ b/plugins/res/ImpromptuModular @@ -0,0 +1 @@ +../ImpromptuModular/res \ No newline at end of file diff --git a/plugins/res/JW-Modules b/plugins/res/JW-Modules new file mode 120000 index 0000000..964f22b --- /dev/null +++ b/plugins/res/JW-Modules @@ -0,0 +1 @@ +../JW-Modules/res \ No newline at end of file diff --git a/plugins/res/MindMeldModular b/plugins/res/MindMeldModular new file mode 120000 index 0000000..59dffe7 --- /dev/null +++ b/plugins/res/MindMeldModular @@ -0,0 +1 @@ +../MindMeldModular/res \ No newline at end of file diff --git a/plugins/res/ValleyAudio b/plugins/res/ValleyAudio new file mode 120000 index 0000000..4381856 --- /dev/null +++ b/plugins/res/ValleyAudio @@ -0,0 +1 @@ +../ValleyAudio/res \ No newline at end of file diff --git a/plugins/res/ZetaCarinaeModules b/plugins/res/ZetaCarinaeModules new file mode 120000 index 0000000..ddd2191 --- /dev/null +++ b/plugins/res/ZetaCarinaeModules @@ -0,0 +1 @@ +../ZetaCarinaeModules/res \ No newline at end of file diff --git a/plugins/res/cf b/plugins/res/cf new file mode 120000 index 0000000..42eb2c0 --- /dev/null +++ b/plugins/res/cf @@ -0,0 +1 @@ +../cf/res \ No newline at end of file diff --git a/plugins/res/rackwindows b/plugins/res/rackwindows new file mode 120000 index 0000000..799200a --- /dev/null +++ b/plugins/res/rackwindows @@ -0,0 +1 @@ +../rackwindows/res \ No newline at end of file diff --git a/src/CardinalPlugin.cpp b/src/CardinalPlugin.cpp index 42da423..01b2780 100644 --- a/src/CardinalPlugin.cpp +++ b/src/CardinalPlugin.cpp @@ -379,7 +379,9 @@ public: context->event = new rack::widget::EventState; context->scene = new rack::app::Scene; context->event->rootWidget = context->scene; - context->window = new rack::window::Window; + + if (! isDummyInstance()) + context->window = new rack::window::Window; context->patch->loadTemplate(); context->scene->rackScroll->reset(); diff --git a/src/Makefile b/src/Makefile index 1dd43ff..3fce996 100644 --- a/src/Makefile +++ b/src/Makefile @@ -68,6 +68,9 @@ BUILD_C_FLAGS += -std=gnu11 BUILD_C_FLAGS += -fno-finite-math-only BUILD_CXX_FLAGS += -fno-finite-math-only +# use our custom function to filter out VCV trademarks +BUILD_CXX_FLAGS += -DnsvgParseFromFile=nsvgParseFromFileCardinal + # -------------------------------------------------------------- # Rack files to build diff --git a/src/Makefile.cardinal.mk b/src/Makefile.cardinal.mk index a42e0dd..1302ec9 100644 --- a/src/Makefile.cardinal.mk +++ b/src/Makefile.cardinal.mk @@ -170,7 +170,7 @@ all: jack lv2 vst2 vst3 resources ifeq ($(NAME),Cardinal) -CORE_RESOURCES = $(subst ../Rack/res/,,$(wildcard ../Rack/res/*)) template.vcv +CORE_RESOURCES = $(filter-out icon.png,$(subst ../Rack/res/,,$(wildcard ../Rack/res/*))) template.vcv PLUGIN_RESOURCES += $(CORE_RESOURCES:%=$(TARGET_DIR)/Cardinal.lv2/resources/%) ifeq ($(MACOS),true) diff --git a/src/override/asset.cpp b/src/override/asset.cpp index 01e2820..2be346c 100644 --- a/src/override/asset.cpp +++ b/src/override/asset.cpp @@ -37,12 +37,8 @@ std::string bundlePath; // points to plugin manifests dir (or empty) // get rid of "res/" prefix static inline std::string& trim(std::string& s) { - if (std::strncmp(s.c_str(), "res" DISTRHO_OS_SEP_STR, 4) == 0) - s = s.substr(4, s.size()-4); -#if DISTRHO_OS_SEP != '/' if (std::strncmp(s.c_str(), "res/", 4) == 0) s = s.substr(4, s.size()-4); -#endif return s; } @@ -59,7 +55,7 @@ std::string system(std::string filename) { // get plugin resource, also trims "res/" as needed std::string plugin(plugin::Plugin* plugin, std::string filename) { DISTRHO_SAFE_ASSERT_RETURN(plugin != nullptr, {}); - return system::join(plugin->path, bundlePath.empty() ? filename : trim(filename)); + return system::join(plugin->path, trim(filename)); } // path to plugin manifest @@ -79,7 +75,7 @@ std::string pluginPath(const std::string& dirname) { { if (dirname == "Core") return systemDir; - return system::join(systemDir, "..", "..", "plugins", dirname); + return system::join(systemDir, "..", "..", "plugins", "res", dirname); } return system::join(systemDir, dirname); } diff --git a/src/override/dep.cpp b/src/override/dep.cpp index 8fd9e03..7438ef0 100644 --- a/src/override/dep.cpp +++ b/src/override/dep.cpp @@ -16,6 +16,7 @@ */ #include +#include // fix blendish build, missing symbol in debug mode #ifdef DEBUG @@ -39,4 +40,219 @@ float FollowerBase::efGainMaxDecibelsDebug = 12.0f; // Compile those nice implementation-in-header little libraries #define NANOSVG_IMPLEMENTATION #define NANOSVG_ALL_COLOR_KEYWORDS +#undef nsvgParseFromFile #include + +// Custom Cardinal filtering +static const struct { + const char* filename; + const char* shapes[4]; +} pathsToFilterOut[] = { + { + "Core/AudioInterface.svg", + {"path39377","path39381","path39383","path39379"} + }, + { + "Core/AudioInterface2.svg", + {"path18733","path18737","path18731","path18735"} + }, + { + "Core/AudioInterface16.svg", + {"path40283","path40287","path40289","path40285"} + }, + { + "Core/CV-CC.svg", + {"path12881","path12885","path12887","path12883"} + }, + { + "Core/CV-Gate.svg", + {"path13127","path13131","path13133","path13129"} + }, + { + "Core/CV-MIDI.svg", + {"path12747","path12751","path12753","path12749"} + }, + { + "Core/MIDI-CC.svg", + {"path9740","path9744","path9746","path9742"} + }, + { + "Core/MIDI-CV.svg", + {"path11803","path11807","path11809","path11805"} + }, + { + "Core/MIDI-Gate.svg", + {"path11634","path11638","path11640","path11636"} + }, + { + "Core/MIDI-Map.svg", + {"path21209","path21213","path21215","path21211"} + }, + { + "Core/Notes.svg", + {"path6935","path6939","path6941","path6937"} + }, + { + "Fundamental/8vert.svg", + {"path69642","path69646","path69640","path69644"} + }, + { + "Fundamental/ADSR.svg", + {"path33693","path33697","path33699","path33695"} + }, + { + "Fundamental/Delay.svg", + {"path25369","path25373","path25375","path25371"} + }, + { + "Fundamental/LFO-1.svg", + {"path35889","path35893","path35895","path35891"} + }, + { + "Fundamental/LFO-2.svg", + {"path36131","path36135","path36137","path36133"} + }, + { + "Fundamental/Merge.svg", + {"path29991","path29995","path29989","path29993"} + }, + { + "Fundamental/MidSide.svg", + {"path44181","path44185","path44179","path44183"} + }, + { + "Fundamental/Mutes.svg", + {"path21613","path21617","path21611","path21615"} + }, + { + "Fundamental/Noise.svg", + {"path105594","path105598","path105592","path105596"} + }, + { + "Fundamental/Octave.svg", + {"path38471","path38475","path38469","path38473"} + }, + { + "Fundamental/Pulses.svg", + {"path46241","path46245","path46239","path46243"} + }, + { + "Fundamental/Quantizer.svg", + {"path38549","path38553","path38547","path38551"} + }, + { + "Fundamental/Random.svg", + {"path89732","path89736","path89730","path89734"} + }, + { + "Fundamental/SEQ3.svg", + {"path35687","path35691","path35693","path35689"} + }, + { + "Fundamental/Scope.svg", + {"path33887","path33891","path33893","path33889"} + }, + /* These 2 do not have logos on them? + { + "Fundamental/SequentialSwitch1.svg", + {"_______","_______","_______","_______"} + }, + { + "Fundamental/SequentialSwitch2.svg", + {"_______","_______","_______","_______"} + }, + */ + { + "Fundamental/Split.svg", + {"path29999","path30003","path29997","path30001"} + }, + { + "Fundamental/Sum.svg", + {"path10913","path10917","path10911","path10915"} + }, + { + "Fundamental/Unity.svg", + {"path21219","path21223","path21217","path21221"} + }, + /* These 2 do not have logos on them? + { + "Fundamental/VCA-1.svg", + {"_______","_______","_______","_______"} + }, + { + "Fundamental/VCA.svg", + {"_______","_______","_______","_______"} + }, + */ + { + "Fundamental/VCF.svg", + {"path25239","path25243","path25245","path25241"} + }, + { + "Fundamental/VCMixer.svg", + {"path125839","path125843","path125845","path125841"} + }, + { + "Fundamental/VCO-1.svg", + {"path33533","path33537","path33539","path33535"} + }, + { + "Fundamental/VCO-2.svg", + {"path37557","path37561","path37563","path37559"} + }, + { + "Fundamental/Viz.svg", + {"path41769","path41773","path41767","path41771"} + }, +}; + +static void removeShape(NSVGimage* const handle, const char* const id) +{ + for (NSVGshape *shape = handle->shapes, *old = nullptr; shape; old = shape, shape = shape->next) + { + if (strcmp(shape->id, id) != 0) + continue; + + if (old != nullptr) + old->next = shape->next; + else + handle->shapes = shape->next; + + nsvg__deletePaths(shape->paths); + free(shape); + break; + } +} + +extern "C" { +NSVGimage* nsvgParseFromFileCardinal(const char* filename, const char* units, float dpi); +} + +NSVGimage* nsvgParseFromFileCardinal(const char* const filename, const char* const units, const float dpi) +{ + if (NSVGimage* const handle = nsvgParseFromFile(filename, units, dpi)) + { + for (size_t i = 0; i < sizeof(pathsToFilterOut)/sizeof(pathsToFilterOut[0]); ++i) + { + const char* const pathToFilterOut = pathsToFilterOut[i].filename; + const size_t filenamelen = std::strlen(filename); + const size_t filterlen = std::strlen(pathToFilterOut); + + if (filenamelen < filterlen) + continue; + + if (std::strncmp(filename + (filenamelen-filterlen), pathToFilterOut, filterlen) == 0) + { + puts("Removing CC-ND deadlock from file..."); + removeShape(handle, pathsToFilterOut[i].shapes[0]); + removeShape(handle, pathsToFilterOut[i].shapes[1]); + removeShape(handle, pathsToFilterOut[i].shapes[2]); + removeShape(handle, pathsToFilterOut[i].shapes[3]); + } + } + + return handle; + } + + return nullptr; +}