| @@ -0,0 +1 @@ | |||
| ../CardinalPlugin.cpp | |||
| @@ -0,0 +1 @@ | |||
| ../CardinalUI.cpp | |||
| @@ -0,0 +1,8 @@ | |||
| #!/usr/bin/make -f | |||
| # Makefile for DISTRHO Plugins # | |||
| # ---------------------------- # | |||
| # Created by falkTX | |||
| # | |||
| NAME = Cardinal | |||
| include ../Makefile.cardinal.mk | |||
| @@ -0,0 +1 @@ | |||
| ../override/MenuBar.cpp | |||
| @@ -0,0 +1 @@ | |||
| ../override/RemoteNanoVG.cpp | |||
| @@ -0,0 +1 @@ | |||
| ../override/RemoteWindow.cpp | |||
| @@ -0,0 +1 @@ | |||
| ../override/Window.cpp | |||
| @@ -0,0 +1 @@ | |||
| ../override/common.cpp | |||
| @@ -307,7 +307,9 @@ class CardinalPlugin : public CardinalBasePlugin | |||
| { | |||
| SharedResourcePointer<Initializer> fInitializer; | |||
| #if DISTRHO_PLUGIN_NUM_INPUTS != 0 | |||
| float* fAudioBufferIn; | |||
| #endif | |||
| float* fAudioBufferOut; | |||
| std::string fAutosavePath; | |||
| String fWindowSize; | |||
| @@ -326,7 +328,9 @@ public: | |||
| CardinalPlugin() | |||
| : CardinalBasePlugin(kModuleParameters + kWindowParameterCount, 0, 2), | |||
| fInitializer(this), | |||
| #if DISTRHO_PLUGIN_NUM_INPUTS != 0 | |||
| fAudioBufferIn(nullptr), | |||
| #endif | |||
| fAudioBufferOut(nullptr), | |||
| fIsActive(false), | |||
| fCurrentAudioDevice(nullptr), | |||
| @@ -497,7 +501,11 @@ protected: | |||
| const char* getLabel() const override | |||
| { | |||
| #if DISTRHO_PLUGIN_IS_SYNTH | |||
| return "CardinalSynth"; | |||
| #else | |||
| return "Cardinal"; | |||
| #endif | |||
| } | |||
| const char* getDescription() const override | |||
| @@ -529,7 +537,11 @@ protected: | |||
| int64_t getUniqueId() const override | |||
| { | |||
| #if DISTRHO_PLUGIN_IS_SYNTH | |||
| return d_cconst('d', 'C', 'n', 'S'); | |||
| #else | |||
| return d_cconst('d', 'C', 'd', 'n'); | |||
| #endif | |||
| } | |||
| /* -------------------------------------------------------------------------------------------------------- | |||
| @@ -746,9 +758,11 @@ protected: | |||
| void activate() override | |||
| { | |||
| const uint32_t bufferSize = getBufferSize() * DISTRHO_PLUGIN_NUM_OUTPUTS; | |||
| fAudioBufferIn = new float[bufferSize]; | |||
| fAudioBufferOut = new float[bufferSize]; | |||
| #if DISTRHO_PLUGIN_NUM_INPUTS != 0 | |||
| fAudioBufferIn = new float[bufferSize]; | |||
| std::memset(fAudioBufferIn, 0, sizeof(float)*bufferSize); | |||
| #endif | |||
| { | |||
| const MutexLocker cml(fDeviceMutex); | |||
| @@ -767,9 +781,12 @@ protected: | |||
| fCurrentAudioDevice->onStopStream(); | |||
| } | |||
| delete[] fAudioBufferIn; | |||
| delete[] fAudioBufferOut; | |||
| fAudioBufferIn = fAudioBufferOut = nullptr; | |||
| fAudioBufferOut = nullptr; | |||
| #if DISTRHO_PLUGIN_NUM_INPUTS != 0 | |||
| delete[] fAudioBufferIn; | |||
| fAudioBufferIn = nullptr; | |||
| #endif | |||
| } | |||
| void run(const float** const inputs, float** const outputs, const uint32_t frames, | |||
| @@ -784,11 +801,13 @@ protected: | |||
| if (fCurrentAudioDevice != nullptr) | |||
| { | |||
| #if DISTRHO_PLUGIN_NUM_INPUTS != 0 | |||
| for (uint32_t i=0, j=0; i<frames; ++i) | |||
| { | |||
| fAudioBufferIn[j++] = inputs[0][i]; | |||
| fAudioBufferIn[j++] = inputs[1][i]; | |||
| } | |||
| #endif | |||
| } | |||
| else | |||
| { | |||
| @@ -802,8 +821,15 @@ protected: | |||
| dev->handleMessagesFromHost(midiEvents, midiEventCount); | |||
| if (fCurrentAudioDevice != nullptr) | |||
| fCurrentAudioDevice->processBuffer(fAudioBufferIn, DISTRHO_PLUGIN_NUM_INPUTS, | |||
| { | |||
| #if DISTRHO_PLUGIN_NUM_INPUTS == 0 | |||
| const float* const insPtr = nullptr; | |||
| #else | |||
| const float* const insPtr = fAudioBufferIn; | |||
| #endif | |||
| fCurrentAudioDevice->processBuffer(insPtr, DISTRHO_PLUGIN_NUM_INPUTS, | |||
| fAudioBufferOut, DISTRHO_PLUGIN_NUM_OUTPUTS, frames); | |||
| } | |||
| if (fCurrentMidiOutput != nullptr) | |||
| fCurrentMidiOutput->processMessages(); | |||
| @@ -0,0 +1 @@ | |||
| ../CardinalPlugin.cpp | |||
| @@ -0,0 +1 @@ | |||
| ../CardinalUI.cpp | |||
| @@ -0,0 +1,42 @@ | |||
| /* | |||
| * DISTRHO Cardinal Plugin | |||
| * Copyright (C) 2021 Filipe Coelho <falktx@falktx.com> | |||
| * | |||
| * 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. | |||
| */ | |||
| #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | |||
| #define DISTRHO_PLUGIN_INFO_H_INCLUDED | |||
| #define DISTRHO_PLUGIN_BRAND "DISTRHO" | |||
| #define DISTRHO_PLUGIN_NAME "Cardinal" | |||
| #define DISTRHO_PLUGIN_URI "https://distrho.kx.studio/plugins/cardinal#synth" | |||
| #ifdef HEADLESS | |||
| #define DISTRHO_PLUGIN_HAS_UI 0 | |||
| #else | |||
| #define DISTRHO_PLUGIN_HAS_UI 1 | |||
| #define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 1 | |||
| #define DISTRHO_UI_USE_NANOVG 1 | |||
| #define DISTRHO_UI_USER_RESIZABLE 1 | |||
| #endif | |||
| #define DISTRHO_PLUGIN_IS_SYNTH 1 | |||
| #define DISTRHO_PLUGIN_NUM_INPUTS 0 | |||
| #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 | |||
| #define DISTRHO_PLUGIN_WANT_MIDI_INPUT 1 | |||
| #define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT 1 | |||
| #define DISTRHO_PLUGIN_WANT_FULL_STATE 1 | |||
| #define DISTRHO_PLUGIN_WANT_STATE 1 | |||
| #define DISTRHO_PLUGIN_WANT_TIMEPOS 1 | |||
| #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED | |||
| @@ -0,0 +1,8 @@ | |||
| #!/usr/bin/make -f | |||
| # Makefile for DISTRHO Plugins # | |||
| # ---------------------------- # | |||
| # Created by falkTX | |||
| # | |||
| NAME = CardinalSynth | |||
| include ../Makefile.cardinal.mk | |||
| @@ -0,0 +1 @@ | |||
| ../override/MenuBar.cpp | |||
| @@ -0,0 +1 @@ | |||
| ../override/RemoteNanoVG.cpp | |||
| @@ -0,0 +1 @@ | |||
| ../override/RemoteWindow.cpp | |||
| @@ -0,0 +1 @@ | |||
| ../override/Window.cpp | |||
| @@ -0,0 +1 @@ | |||
| ../override/common.cpp | |||
| @@ -11,36 +11,6 @@ PREFIX ?= /usr/local | |||
| DESTDIR ?= | |||
| SYSDEPS ?= false | |||
| # -------------------------------------------------------------- | |||
| # Project name, used for binaries | |||
| NAME = Cardinal | |||
| # -------------------------------------------------------------- | |||
| # Files to build (DPF stuff) | |||
| FILES_DSP = \ | |||
| CardinalPlugin.cpp \ | |||
| override/asset.cpp \ | |||
| override/common.cpp \ | |||
| override/context.cpp \ | |||
| override/dep.cpp \ | |||
| override/library.cpp \ | |||
| override/network.cpp \ | |||
| override/osdialog.cpp | |||
| ifeq ($(HEADLESS),true) | |||
| FILES_DSP += \ | |||
| override/RemoteNanoVG.cpp \ | |||
| override/RemoteWindow.cpp | |||
| else | |||
| FILES_UI = \ | |||
| CardinalUI.cpp \ | |||
| AsyncDialog.cpp \ | |||
| override/MenuBar.cpp \ | |||
| override/Window.cpp | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| # Import base definitions | |||
| @@ -48,61 +18,9 @@ USE_NANOVG_FBO = true | |||
| include ../dpf/Makefile.base.mk | |||
| # -------------------------------------------------------------- | |||
| # Files to build (VCV stuff) | |||
| FILES_DSP += Rack/dep/pffft/pffft.c | |||
| FILES_DSP += Rack/dep/pffft/fftpack.c | |||
| FILES_DSP += Rack/dep/osdialog/osdialog.c | |||
| FILES_DSP += Rack/dep/oui-blendish/blendish.c | |||
| IGNORED_FILES = Rack/src/asset.cpp | |||
| IGNORED_FILES += Rack/src/common.cpp | |||
| IGNORED_FILES += Rack/src/context.cpp | |||
| IGNORED_FILES += Rack/src/dep.cpp | |||
| IGNORED_FILES += Rack/src/discord.cpp | |||
| IGNORED_FILES += Rack/src/gamepad.cpp | |||
| IGNORED_FILES += Rack/src/keyboard.cpp | |||
| IGNORED_FILES += Rack/src/library.cpp | |||
| IGNORED_FILES += Rack/src/network.cpp | |||
| IGNORED_FILES += Rack/src/rtaudio.cpp | |||
| IGNORED_FILES += Rack/src/rtmidi.cpp | |||
| IGNORED_FILES += Rack/src/app/MenuBar.cpp | |||
| IGNORED_FILES += Rack/src/window/Window.cpp | |||
| FILES_DSP += $(wildcard Rack/src/*.c) | |||
| FILES_DSP += $(wildcard Rack/src/*/*.c) | |||
| FILES_DSP += $(filter-out $(IGNORED_FILES),$(wildcard Rack/src/*.cpp)) | |||
| FILES_DSP += $(filter-out $(IGNORED_FILES), $(wildcard Rack/src/*/*.cpp)) | |||
| # -------------------------------------------------------------- | |||
| # Extra libraries to link against | |||
| ifneq ($(SYSDEPS),true) | |||
| EXTRA_LIBS = ../plugins/plugins.a | |||
| EXTRA_LIBS += Rack/dep/lib/libjansson.a | |||
| EXTRA_LIBS += Rack/dep/lib/libsamplerate.a | |||
| EXTRA_LIBS += Rack/dep/lib/libspeexdsp.a | |||
| ifeq ($(WINDOWS),true) | |||
| EXTRA_LIBS += Rack/dep/lib/libarchive_static.a | |||
| else | |||
| EXTRA_LIBS += Rack/dep/lib/libarchive.a | |||
| endif | |||
| EXTRA_LIBS += Rack/dep/lib/libzstd.a | |||
| EXTRA_DEPENDENCIES = $(EXTRA_LIBS) | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| # Do some magic | |||
| # Build setup | |||
| DPF_PATH = ../dpf | |||
| DPF_BUILD_DIR = ../build | |||
| DPF_TARGET_DIR = ../bin | |||
| USE_VST2_BUNDLE = true | |||
| include ../dpf/Makefile.plugins.mk | |||
| # -------------------------------------------------------------- | |||
| # Extra flags for VCV stuff | |||
| BUILD_DIR = ../build/rack | |||
| ifeq ($(MACOS),true) | |||
| BASE_FLAGS += -DARCH_MAC | |||
| @@ -114,6 +32,7 @@ endif | |||
| BASE_FLAGS += -fno-finite-math-only | |||
| BASE_FLAGS += -I../dpf/dgl/src/nanovg | |||
| BASE_FLAGS += -I../dpf/distrho | |||
| BASE_FLAGS += -I../include | |||
| BASE_FLAGS += -I../include/neon-compat | |||
| BASE_FLAGS += -IRack/include | |||
| @@ -149,96 +68,87 @@ endif | |||
| BUILD_C_FLAGS += -std=gnu11 | |||
| # -------------------------------------------------------------- | |||
| # FIXME lots of warnings from VCV side | |||
| BASE_FLAGS += -Wno-unused-parameter | |||
| BASE_FLAGS += -Wno-unused-variable | |||
| # -------------------------------------------------------------- | |||
| # extra linker flags | |||
| # Rack files to build | |||
| LINK_FLAGS += -pthread | |||
| ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true) | |||
| LINK_FLAGS += -ldl | |||
| endif | |||
| RACK_FILES += AsyncDialog.cpp | |||
| RACK_FILES += override/asset.cpp | |||
| RACK_FILES += override/context.cpp | |||
| RACK_FILES += override/dep.cpp | |||
| RACK_FILES += override/library.cpp | |||
| RACK_FILES += override/network.cpp | |||
| RACK_FILES += override/osdialog.cpp | |||
| ifeq ($(MACOS),true) | |||
| LINK_FLAGS += -framework IOKit | |||
| else ifeq ($(WINDOWS),true) | |||
| LINK_FLAGS += -ldbghelp -lshlwapi | |||
| # needed by JW-Modules | |||
| EXTRA_LIBS += -lws2_32 -lwinmm | |||
| endif | |||
| RACK_FILES += Rack/dep/pffft/pffft.c | |||
| RACK_FILES += Rack/dep/pffft/fftpack.c | |||
| RACK_FILES += Rack/dep/osdialog/osdialog.c | |||
| RACK_FILES += Rack/dep/oui-blendish/blendish.c | |||
| ifeq ($(SYSDEPS),true) | |||
| LINK_FLAGS += $(shell pkg-config --libs jansson libarchive samplerate speexdsp) | |||
| endif | |||
| IGNORED_FILES = Rack/src/asset.cpp | |||
| IGNORED_FILES += Rack/src/common.cpp | |||
| IGNORED_FILES += Rack/src/context.cpp | |||
| IGNORED_FILES += Rack/src/dep.cpp | |||
| IGNORED_FILES += Rack/src/discord.cpp | |||
| IGNORED_FILES += Rack/src/gamepad.cpp | |||
| IGNORED_FILES += Rack/src/keyboard.cpp | |||
| IGNORED_FILES += Rack/src/library.cpp | |||
| IGNORED_FILES += Rack/src/network.cpp | |||
| IGNORED_FILES += Rack/src/rtaudio.cpp | |||
| IGNORED_FILES += Rack/src/rtmidi.cpp | |||
| IGNORED_FILES += Rack/src/app/MenuBar.cpp | |||
| IGNORED_FILES += Rack/src/window/Window.cpp | |||
| ifeq ($(WITH_LTO),true) | |||
| LINK_FLAGS += -fno-strict-aliasing -flto -Werror=odr -Werror=lto-type-mismatch | |||
| endif | |||
| RACK_FILES += $(wildcard Rack/src/*.c) | |||
| RACK_FILES += $(wildcard Rack/src/*/*.c) | |||
| RACK_FILES += $(filter-out $(IGNORED_FILES),$(wildcard Rack/src/*.cpp)) | |||
| RACK_FILES += $(filter-out $(IGNORED_FILES), $(wildcard Rack/src/*/*.cpp)) | |||
| # -------------------------------------------------------------- | |||
| # optional liblo | |||
| # FIXME lots of warnings from VCV side | |||
| ifeq ($(HAVE_LIBLO),true) | |||
| BASE_FLAGS += $(LIBLO_FLAGS) | |||
| LINK_FLAGS += $(LIBLO_LIBS) | |||
| endif | |||
| BASE_FLAGS += -Wno-unused-parameter | |||
| BASE_FLAGS += -Wno-unused-variable | |||
| # -------------------------------------------------------------- | |||
| # fallback path to resource files | |||
| ifeq ($(EXE_WRAPPER),wine) | |||
| SOURCE_DIR = Z:$(subst /,\\,$(CURDIR)) | |||
| else | |||
| SOURCE_DIR = $(CURDIR) | |||
| endif | |||
| # Build targets | |||
| ifneq ($(SYSDEPS),true) | |||
| BUILD_CXX_FLAGS += -DCARDINAL_PLUGIN_SOURCE_DIR='"$(SOURCE_DIR)"' | |||
| endif | |||
| TARGET = rack.a | |||
| BUILD_CXX_FLAGS += -DCARDINAL_PLUGIN_PREFIX='"$(PREFIX)"' | |||
| all: $(TARGET) | |||
| $(MAKE) -C Cardinal | |||
| $(MAKE) -C CardinalSynth | |||
| # -------------------------------------------------------------- | |||
| # Enable all possible plugin types | |||
| resources: | |||
| $(MAKE) resources -C Cardinal | |||
| $(MAKE) resources -C CardinalSynth | |||
| all: jack lv2 vst2 vst3 resources | |||
| clean: | |||
| rm -f $(TARGET) | |||
| rm -rf $(BUILD_DIR) | |||
| $(MAKE) clean -C Cardinal | |||
| $(MAKE) clean -C CardinalSynth | |||
| # -------------------------------------------------------------- | |||
| # Build commands | |||
| CORE_RESOURCES = $(subst Rack/res/,,$(wildcard Rack/res/*)) template.vcv | |||
| PLUGIN_RESOURCES += $(CORE_RESOURCES:%=../bin/Cardinal.lv2/resources/%) | |||
| ifeq ($(MACOS),true) | |||
| PLUGIN_RESOURCES += $(CORE_RESOURCES:%=../bin/Cardinal.vst/Contents/Resources/%) | |||
| else | |||
| PLUGIN_RESOURCES += $(CORE_RESOURCES:%=../bin/Cardinal.vst/resources/%) | |||
| endif | |||
| PLUGIN_RESOURCES += $(CORE_RESOURCES:%=../bin/Cardinal.vst3/Contents/Resources/%) | |||
| RACK_OBJS = $(RACK_FILES:%=$(BUILD_DIR)/%.o) | |||
| resources: $(PLUGIN_RESOURCES) | |||
| $(TARGET): $(RACK_OBJS) | |||
| @echo "Creating $@" | |||
| $(SILENT)rm -f $@ | |||
| $(SILENT)$(AR) crs $@ $^ | |||
| ../bin/Cardinal.%/template.vcv: template.vcv | |||
| -@mkdir -p "$(shell dirname $@)" | |||
| ln -sf $(abspath $<) $@ | |||
| $(BUILD_DIR)/%.c.o: %.c | |||
| -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" | |||
| @echo "Compiling $<" | |||
| $(SILENT)$(CC) $< $(BUILD_C_FLAGS) -c -o $@ | |||
| ../bin/Cardinal.lv2/resources/%: Rack/res/% | |||
| -@mkdir -p "$(shell dirname $@)" | |||
| ln -sf $(abspath $<) $@ | |||
| $(BUILD_DIR)/%.cpp.o: %.cpp | |||
| -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" | |||
| @echo "Compiling $<" | |||
| $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |||
| ../bin/Cardinal.vst/resources/%: Rack/res/% | |||
| -@mkdir -p "$(shell dirname $@)" | |||
| ln -sf $(abspath $<) $@ | |||
| ../bin/Cardinal.vst/Contents/Resources/%: Rack/res/% | |||
| -@mkdir -p "$(shell dirname $@)" | |||
| ln -sf $(abspath $<) $@ | |||
| # -------------------------------------------------------------- | |||
| ../bin/Cardinal.vst3/Contents/Resources/%: Rack/res/% | |||
| -@mkdir -p "$(shell dirname $@)" | |||
| ln -sf $(abspath $<) $@ | |||
| -include $(RACK_OBJS:%.o=%.d) | |||
| # -------------------------------------------------------------- | |||
| @@ -0,0 +1,217 @@ | |||
| #!/usr/bin/make -f | |||
| # Makefile for DISTRHO Plugins # | |||
| # ---------------------------- # | |||
| # Created by falkTX | |||
| # | |||
| # Must have NAME defined | |||
| # -------------------------------------------------------------- | |||
| # Build config | |||
| PREFIX ?= /usr/local | |||
| DESTDIR ?= | |||
| SYSDEPS ?= false | |||
| # -------------------------------------------------------------- | |||
| # Files to build (DPF stuff) | |||
| FILES_DSP = CardinalPlugin.cpp | |||
| FILES_DSP += common.cpp | |||
| ifeq ($(HEADLESS),true) | |||
| FILES_DSP += RemoteNanoVG.cpp | |||
| FILES_DSP += RemoteWindow.cpp | |||
| else | |||
| FILES_UI = CardinalUI.cpp | |||
| FILES_UI += MenuBar.cpp | |||
| FILES_UI += Window.cpp | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| # Extra libraries to link against | |||
| EXTRA_LIBS = ../../plugins/plugins.a | |||
| EXTRA_LIBS += ../rack.a | |||
| ifneq ($(SYSDEPS),true) | |||
| EXTRA_LIBS += ../Rack/dep/lib/libjansson.a | |||
| EXTRA_LIBS += ../Rack/dep/lib/libsamplerate.a | |||
| EXTRA_LIBS += ../Rack/dep/lib/libspeexdsp.a | |||
| ifeq ($(WINDOWS),true) | |||
| EXTRA_LIBS += ../Rack/dep/lib/libarchive_static.a | |||
| else | |||
| EXTRA_LIBS += ../Rack/dep/lib/libarchive.a | |||
| endif | |||
| EXTRA_LIBS += ../Rack/dep/lib/libzstd.a | |||
| endif | |||
| EXTRA_DEPENDENCIES = $(EXTRA_LIBS) | |||
| # -------------------------------------------------------------- | |||
| # Do some magic | |||
| USE_NANOVG_FBO = true | |||
| USE_VST2_BUNDLE = true | |||
| include ../../dpf/Makefile.plugins.mk | |||
| # -------------------------------------------------------------- | |||
| # Extra flags for VCV stuff | |||
| ifeq ($(MACOS),true) | |||
| BASE_FLAGS += -DARCH_MAC | |||
| else ifeq ($(WINDOWS),true) | |||
| BASE_FLAGS += -DARCH_WIN | |||
| else | |||
| BASE_FLAGS += -DARCH_LIN | |||
| endif | |||
| BASE_FLAGS += -fno-finite-math-only | |||
| BASE_FLAGS += -I.. | |||
| BASE_FLAGS += -I../../dpf/dgl/src/nanovg | |||
| BASE_FLAGS += -I../../include | |||
| BASE_FLAGS += -I../../include/neon-compat | |||
| BASE_FLAGS += -I../Rack/include | |||
| ifeq ($(SYSDEPS),true) | |||
| BASE_FLAGS += $(shell pkg-config --cflags jansson libarchive samplerate speexdsp) | |||
| else | |||
| BASE_FLAGS += -I../Rack/dep/include | |||
| endif | |||
| BASE_FLAGS += -I../Rack/dep/glfw/include | |||
| BASE_FLAGS += -I../Rack/dep/nanosvg/src | |||
| BASE_FLAGS += -I../Rack/dep/oui-blendish | |||
| BASE_FLAGS += -pthread | |||
| ifeq ($(WINDOWS),true) | |||
| BASE_FLAGS += -D_USE_MATH_DEFINES | |||
| BASE_FLAGS += -DWIN32_LEAN_AND_MEAN | |||
| BASE_FLAGS += -I../../include/mingw-compat | |||
| BASE_FLAGS += -I../../include/mingw-std-threads | |||
| endif | |||
| ifeq ($(HEADLESS),true) | |||
| BASE_FLAGS += -DHEADLESS | |||
| endif | |||
| ifeq ($(WITH_LTO),true) | |||
| BASE_FLAGS += -fno-strict-aliasing -flto | |||
| endif | |||
| BUILD_C_FLAGS += -std=gnu11 | |||
| # -------------------------------------------------------------- | |||
| # FIXME lots of warnings from VCV side | |||
| BASE_FLAGS += -Wno-unused-parameter | |||
| BASE_FLAGS += -Wno-unused-variable | |||
| # -------------------------------------------------------------- | |||
| # extra linker flags | |||
| LINK_FLAGS += -pthread | |||
| ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true) | |||
| LINK_FLAGS += -ldl | |||
| endif | |||
| ifeq ($(MACOS),true) | |||
| LINK_FLAGS += -framework IOKit | |||
| else ifeq ($(WINDOWS),true) | |||
| LINK_FLAGS += -ldbghelp -lshlwapi | |||
| # needed by JW-Modules | |||
| EXTRA_LIBS += -lws2_32 -lwinmm | |||
| endif | |||
| ifeq ($(SYSDEPS),true) | |||
| LINK_FLAGS += $(shell pkg-config --libs jansson libarchive samplerate speexdsp) | |||
| endif | |||
| ifeq ($(WITH_LTO),true) | |||
| LINK_FLAGS += -fno-strict-aliasing -flto -Werror=odr -Werror=lto-type-mismatch | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| # optional liblo | |||
| ifeq ($(HAVE_LIBLO),true) | |||
| BASE_FLAGS += $(LIBLO_FLAGS) | |||
| LINK_FLAGS += $(LIBLO_LIBS) | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| # fallback path to resource files | |||
| ifeq ($(EXE_WRAPPER),wine) | |||
| SOURCE_DIR = Z:$(subst /,\\,$(abspath $(CURDIR)/..)) | |||
| else | |||
| SOURCE_DIR = $(abspath $(CURDIR)/..) | |||
| endif | |||
| ifneq ($(SYSDEPS),true) | |||
| BUILD_CXX_FLAGS += -DCARDINAL_PLUGIN_SOURCE_DIR='"$(SOURCE_DIR)"' | |||
| endif | |||
| BUILD_CXX_FLAGS += -DCARDINAL_PLUGIN_PREFIX='"$(PREFIX)"' | |||
| # -------------------------------------------------------------- | |||
| # Enable all possible plugin types | |||
| all: jack lv2 vst2 vst3 resources | |||
| # -------------------------------------------------------------- | |||
| ifeq ($(NAME),Cardinal) | |||
| CORE_RESOURCES = $(subst ../Rack/res/,,$(wildcard ../Rack/res/*)) ../template.vcv | |||
| PLUGIN_RESOURCES += $(CORE_RESOURCES:%=$(TARGET_DIR)/Cardinal.lv2/resources/%) | |||
| ifeq ($(MACOS),true) | |||
| PLUGIN_RESOURCES += $(CORE_RESOURCES:%=$(TARGET_DIR)/Cardinal.vst/Contents/Resources/%) | |||
| else | |||
| PLUGIN_RESOURCES += $(CORE_RESOURCES:%=$(TARGET_DIR)/Cardinal.vst/resources/%) | |||
| endif | |||
| PLUGIN_RESOURCES += $(CORE_RESOURCES:%=$(TARGET_DIR)/Cardinal.vst3/Contents/Resources/%) | |||
| else | |||
| PLUGIN_RESOURCES += $(TARGET_DIR)/$(NAME).lv2/resources | |||
| ifeq ($(MACOS),true) | |||
| PLUGIN_RESOURCES += $(TARGET_DIR)/$(NAME).vst/Contents/Resources | |||
| else | |||
| PLUGIN_RESOURCES += $(TARGET_DIR)/$(NAME).vst/resources | |||
| endif | |||
| PLUGIN_RESOURCES += $(TARGET_DIR)/$(NAME).vst3/Contents/Resources | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| resources: $(PLUGIN_RESOURCES) | |||
| ifneq ($(NAME),Cardinal) | |||
| $(TARGET_DIR)/$(NAME).%: $(TARGET_DIR)/Cardinal.% | |||
| -@mkdir -p "$(shell dirname $@)" | |||
| ln -sf $(abspath $<) $@ | |||
| endif | |||
| $(TARGET_DIR)/Cardinal.%/template.vcv: ../template.vcv | |||
| -@mkdir -p "$(shell dirname $@)" | |||
| ln -sf $(abspath $<) $@ | |||
| $(TARGET_DIR)/Cardinal.lv2/resources/%: ../Rack/res/% | |||
| -@mkdir -p "$(shell dirname $@)" | |||
| ln -sf $(abspath $<) $@ | |||
| $(TARGET_DIR)/Cardinal.vst/resources/%: ../Rack/res/% | |||
| -@mkdir -p "$(shell dirname $@)" | |||
| ln -sf $(abspath $<) $@ | |||
| $(TARGET_DIR)/Cardinal.vst/Contents/Resources/%: ../Rack/res/% | |||
| -@mkdir -p "$(shell dirname $@)" | |||
| ln -sf $(abspath $<) $@ | |||
| $(TARGET_DIR)/Cardinal.vst3/Contents/Resources/%: ../Rack/res/% | |||
| -@mkdir -p "$(shell dirname $@)" | |||
| ln -sf $(abspath $<) $@ | |||
| # -------------------------------------------------------------- | |||
| @@ -29,8 +29,6 @@ | |||
| #include <queue> | |||
| #include <thread> | |||
| #include <osdialog.h> | |||
| #include <window/Window.hpp> | |||
| #include <asset.hpp> | |||
| #include <widget/Widget.hpp> | |||
| @@ -19,6 +19,10 @@ | |||
| #include <system.hpp> | |||
| #include <plugin/Plugin.hpp> | |||
| #ifdef NDEBUG | |||
| # undef DEBUG | |||
| #endif | |||
| #include <algorithm> | |||
| #include "DistrhoUtils.hpp" | |||
| @@ -28,6 +28,10 @@ | |||
| #include <common.hpp> | |||
| #include <string.hpp> | |||
| #ifdef NDEBUG | |||
| # undef DEBUG | |||
| #endif | |||
| #include "DistrhoPluginUtils.hpp" | |||
| // fopen_u8 | |||
| @@ -6,7 +6,11 @@ | |||
| #include <history.hpp> | |||
| #include <settings.hpp> | |||
| #include "DistrhoPluginUtils.hpp" | |||
| #ifdef NDEBUG | |||
| # undef DEBUG | |||
| #endif | |||
| #include "DistrhoUtils.hpp" | |||
| /** | |||
| * This file is an edited version of VCVRack's context.cpp | |||