| @@ -264,6 +264,7 @@ vst2 = $(TARGET_DIR)/$(VST2_FILENAME) | |||
| ifneq ($(VST3_FILENAME),) | |||
| vst3 = $(TARGET_DIR)/$(VST3_FILENAME) | |||
| endif | |||
| clap = $(TARGET_DIR)/$(NAME)-clap$(LIB_EXT) | |||
| shared = $(TARGET_DIR)/$(NAME)$(LIB_EXT) | |||
| static = $(TARGET_DIR)/$(NAME).a | |||
| @@ -298,6 +299,7 @@ SYMBOLS_LV2UI = -Wl,-exported_symbols_list,$(DPF_PATH)/utils/symbols/lv2-ui.exp | |||
| SYMBOLS_LV2 = -Wl,-exported_symbols_list,$(DPF_PATH)/utils/symbols/lv2.exp | |||
| SYMBOLS_VST2 = -Wl,-exported_symbols_list,$(DPF_PATH)/utils/symbols/vst2.exp | |||
| SYMBOLS_VST3 = -Wl,-exported_symbols_list,$(DPF_PATH)/utils/symbols/vst3.exp | |||
| SYMBOLS_CLAP = -Wl,-exported_symbols_list,$(DPF_PATH)/utils/symbols/clap.exp | |||
| SYMBOLS_SHARED = -Wl,-exported_symbols_list,$(DPF_PATH)/utils/symbols/shared.exp | |||
| else ifeq ($(WASM),true) | |||
| SYMBOLS_LADSPA = -sEXPORTED_FUNCTIONS="['ladspa_descriptor']" | |||
| @@ -307,6 +309,7 @@ SYMBOLS_LV2UI = -sEXPORTED_FUNCTIONS="['lv2ui_descriptor']" | |||
| SYMBOLS_LV2 = -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2_generate_ttl','lv2ui_descriptor']" | |||
| SYMBOLS_VST2 = -sEXPORTED_FUNCTIONS="['VSTPluginMain']" | |||
| SYMBOLS_VST3 = -sEXPORTED_FUNCTIONS="['GetPluginFactory','ModuleEntry','ModuleExit']" | |||
| SYMBOLS_CLAP = -sEXPORTED_FUNCTIONS="['']" | |||
| SYMBOLS_SHARED = -sEXPORTED_FUNCTIONS="['createSharedPlugin']" | |||
| else ifeq ($(WINDOWS),true) | |||
| SYMBOLS_LADSPA = $(DPF_PATH)/utils/symbols/ladspa.def | |||
| @@ -316,6 +319,7 @@ SYMBOLS_LV2UI = $(DPF_PATH)/utils/symbols/lv2-ui.def | |||
| SYMBOLS_LV2 = $(DPF_PATH)/utils/symbols/lv2.def | |||
| SYMBOLS_VST2 = $(DPF_PATH)/utils/symbols/vst2.def | |||
| SYMBOLS_VST3 = $(DPF_PATH)/utils/symbols/vst3.def | |||
| SYMBOLS_CLAP = $(DPF_PATH)/utils/symbols/clap.def | |||
| SYMBOLS_SHARED = $(DPF_PATH)/utils/symbols/shared.def | |||
| else ifneq ($(DEBUG),true) | |||
| SYMBOLS_LADSPA = -Wl,--version-script=$(DPF_PATH)/utils/symbols/ladspa.version | |||
| @@ -325,6 +329,7 @@ SYMBOLS_LV2UI = -Wl,--version-script=$(DPF_PATH)/utils/symbols/lv2-ui.version | |||
| SYMBOLS_LV2 = -Wl,--version-script=$(DPF_PATH)/utils/symbols/lv2.version | |||
| SYMBOLS_VST2 = -Wl,--version-script=$(DPF_PATH)/utils/symbols/vst2.version | |||
| SYMBOLS_VST3 = -Wl,--version-script=$(DPF_PATH)/utils/symbols/vst3.version | |||
| SYMBOLS_CLAP = -Wl,--version-script=$(DPF_PATH)/utils/symbols/clap.version | |||
| SYMBOLS_SHARED = -Wl,--version-script=$(DPF_PATH)/utils/symbols/shared.version | |||
| endif | |||
| @@ -521,6 +526,20 @@ endif | |||
| @echo "Creating VST3 plugin for $(NAME)" | |||
| $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(EXTRA_LIBS) $(DGL_LIBS) $(SHARED) $(SYMBOLS_VST3) -o $@ | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # CLAP | |||
| clap: $(clap) $(clapfiles) | |||
| ifeq ($(HAVE_DGL),true) | |||
| $(clap): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_CLAP.cpp.o $(BUILD_DIR)/DistrhoUIMain_CLAP.cpp.o $(DGL_LIB) | |||
| else | |||
| $(clap): $(OBJS_DSP) $(BUILD_DIR)/DistrhoPluginMain_CLAP.cpp.o | |||
| endif | |||
| -@mkdir -p $(shell dirname $@) | |||
| @echo "Creating CLAP plugin for $(NAME)" | |||
| $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(EXTRA_LIBS) $(DGL_LIBS) $(SHARED) $(SYMBOLS_CLAP) -o $@ | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Shared | |||
| @@ -1,6 +1,6 @@ | |||
| /* | |||
| * DISTRHO Plugin Framework (DPF) | |||
| * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||
| * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com> | |||
| * | |||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | |||
| * or without fee is hereby granted, provided that the above copyright notice and this | |||
| @@ -18,6 +18,8 @@ | |||
| #if defined(DISTRHO_PLUGIN_TARGET_CARLA) | |||
| # include "src/DistrhoPluginCarla.cpp" | |||
| #elif defined(DISTRHO_PLUGIN_TARGET_CLAP) | |||
| # include "src/DistrhoPluginStub.cpp" | |||
| #elif defined(DISTRHO_PLUGIN_TARGET_JACK) | |||
| # include "src/DistrhoPluginJACK.cpp" | |||
| #elif (defined(DISTRHO_PLUGIN_TARGET_LADSPA) || defined(DISTRHO_PLUGIN_TARGET_DSSI)) | |||
| @@ -18,6 +18,8 @@ | |||
| #if defined(DISTRHO_PLUGIN_TARGET_CARLA) | |||
| // nothing | |||
| #elif defined(DISTRHO_PLUGIN_TARGET_CLAP) | |||
| # include "src/DistrhoUIStub.cpp" | |||
| #elif defined(DISTRHO_PLUGIN_TARGET_JACK) | |||
| // nothing | |||
| #elif defined(DISTRHO_PLUGIN_TARGET_DSSI) | |||
| @@ -0,0 +1,97 @@ | |||
| /* | |||
| * DISTRHO Plugin Framework (DPF) | |||
| * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com> | |||
| * | |||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | |||
| * or without fee is hereby granted, provided that the above copyright notice and this | |||
| * permission notice appear in all copies. | |||
| * | |||
| * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD | |||
| * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN | |||
| * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL | |||
| * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER | |||
| * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | |||
| * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |||
| */ | |||
| #include "DistrhoPluginInternal.hpp" | |||
| START_NAMESPACE_DISTRHO | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| #if ! DISTRHO_PLUGIN_WANT_MIDI_OUTPUT | |||
| static constexpr const writeMidiFunc writeMidiCallback = nullptr; | |||
| #endif | |||
| #if ! DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | |||
| static constexpr const requestParameterValueChangeFunc requestParameterValueChangeCallback = nullptr; | |||
| #endif | |||
| #if ! DISTRHO_PLUGIN_WANT_STATE | |||
| static const updateStateValueFunc updateStateValueCallback = nullptr; | |||
| #endif | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| /** | |||
| * Stub plugin class, does nothing but serving as example code for other implementations. | |||
| */ | |||
| class PluginStub | |||
| { | |||
| public: | |||
| PluginStub() | |||
| : fPlugin(this, | |||
| writeMidiCallback, | |||
| requestParameterValueChangeCallback, | |||
| updateStateValueCallback) | |||
| { | |||
| } | |||
| // ---------------------------------------------------------------------------------------------------------------- | |||
| private: | |||
| // Plugin | |||
| PluginExporter fPlugin; | |||
| // ---------------------------------------------------------------------------------------------------------------- | |||
| // DPF callbacks | |||
| #if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT | |||
| bool writeMidi(const MidiEvent&) | |||
| { | |||
| return true; | |||
| } | |||
| static bool writeMidiCallback(void* const ptr, const MidiEvent& midiEvent) | |||
| { | |||
| return ((PluginStub*)ptr)->writeMidi(midiEvent); | |||
| } | |||
| #endif | |||
| #if DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | |||
| bool requestParameterValueChange(uint32_t, float) | |||
| { | |||
| return true; | |||
| } | |||
| static bool requestParameterValueChangeCallback(void* const ptr, const uint32_t index, const float value) | |||
| { | |||
| return ((PluginStub*)ptr)->requestParameterValueChange(index, value); | |||
| } | |||
| #endif | |||
| #if DISTRHO_PLUGIN_WANT_STATE | |||
| bool updateState(const char*, const char*) | |||
| { | |||
| return true; | |||
| } | |||
| static bool updateStateValueCallback(void* const ptr, const char* const key, const char* const value) | |||
| { | |||
| return ((PluginStub*)ptr)->updateState(key, value); | |||
| } | |||
| #endif | |||
| }; | |||
| END_NAMESPACE_DISTRHO | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| @@ -0,0 +1,127 @@ | |||
| /* | |||
| * DISTRHO Plugin Framework (DPF) | |||
| * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com> | |||
| * | |||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | |||
| * or without fee is hereby granted, provided that the above copyright notice and this | |||
| * permission notice appear in all copies. | |||
| * | |||
| * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD | |||
| * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN | |||
| * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL | |||
| * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER | |||
| * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | |||
| * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |||
| */ | |||
| #include "DistrhoUIInternal.hpp" | |||
| START_NAMESPACE_DISTRHO | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| #if ! DISTRHO_PLUGIN_WANT_MIDI_INPUT | |||
| static constexpr const sendNoteFunc sendNoteCallback = nullptr; | |||
| #endif | |||
| #if ! DISTRHO_PLUGIN_WANT_STATE | |||
| static constexpr const setStateFunc setStateCallback = nullptr; | |||
| #endif | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| /** | |||
| * Stub UI class, does nothing but serving as example code for other implementations. | |||
| */ | |||
| class UIStub | |||
| { | |||
| public: | |||
| UIStub(const intptr_t winId, | |||
| const double sampleRate, | |||
| const char* const bundlePath, | |||
| void* const dspPtr, | |||
| const float scaleFactor) | |||
| : fUI(this, winId, sampleRate, | |||
| editParameterCallback, | |||
| setParameterCallback, | |||
| setStateCallback, | |||
| sendNoteCallback, | |||
| setSizeCallback, | |||
| fileRequestCallback, | |||
| bundlePath, dspPtr, scaleFactor) | |||
| { | |||
| } | |||
| // ---------------------------------------------------------------------------------------------------------------- | |||
| private: | |||
| // Stub stuff here | |||
| // Plugin UI (after Stub stuff so the UI can call into us during its constructor) | |||
| UIExporter fUI; | |||
| // ---------------------------------------------------------------------------------------------------------------- | |||
| // DPF callbacks | |||
| void editParameter(uint32_t, bool) const | |||
| { | |||
| } | |||
| static void editParameterCallback(void* const ptr, const uint32_t rindex, const bool started) | |||
| { | |||
| ((UIStub*)ptr)->editParameter(rindex, started); | |||
| } | |||
| void setParameterValue(uint32_t, float) | |||
| { | |||
| } | |||
| static void setParameterCallback(void* const ptr, const uint32_t rindex, const float value) | |||
| { | |||
| ((UIStub*)ptr)->setParameterValue(rindex, value); | |||
| } | |||
| void setSize(uint, uint) | |||
| { | |||
| } | |||
| static void setSizeCallback(void* const ptr, const uint width, const uint height) | |||
| { | |||
| ((UIStub*)ptr)->setSize(width, height); | |||
| } | |||
| #if DISTRHO_PLUGIN_WANT_MIDI_INPUT | |||
| void sendNote(const uint8_t channel, const uint8_t note, const uint8_t velocity) | |||
| { | |||
| } | |||
| static void sendNoteCallback(void* const ptr, const uint8_t channel, const uint8_t note, const uint8_t velocity) | |||
| { | |||
| ((UIStub*)ptr)->sendNote(channel, note, velocity); | |||
| } | |||
| #endif | |||
| #if DISTRHO_PLUGIN_WANT_STATE | |||
| void setState(const char*, const char*) | |||
| { | |||
| } | |||
| static void setStateCallback(void* const ptr, const char* key, const char* value) | |||
| { | |||
| ((UIStub*)ptr)->setState(key, value); | |||
| } | |||
| #endif | |||
| bool fileRequest(const char*) | |||
| { | |||
| return true; | |||
| } | |||
| static bool fileRequestCallback(void* const ptr, const char* const key) | |||
| { | |||
| return ((UIStub*)ptr)->fileRequest(key); | |||
| } | |||
| }; | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| END_NAMESPACE_DISTRHO | |||
| @@ -26,27 +26,19 @@ include ../../Makefile.plugins.mk | |||
| # -------------------------------------------------------------- | |||
| # Enable all possible plugin types | |||
| ifeq ($(HAVE_OPENGL),true) | |||
| TARGETS += jack | |||
| endif # HAVE_OPENGL | |||
| ifneq ($(MACOS_OR_WINDOWS),true) | |||
| TARGETS += ladspa | |||
| ifeq ($(HAVE_LIBLO),true) | |||
| ifeq ($(HAVE_OPENGL),true) | |||
| TARGETS += dssi | |||
| endif # HAVE_OPENGL | |||
| endif # HAVE_LIBLO | |||
| endif # MACOS_OR_WINDOWS | |||
| ifeq ($(HAVE_OPENGL),true) | |||
| TARGETS += lv2_sep | |||
| else | |||
| TARGETS += lv2_dsp | |||
| endif | |||
| TARGETS += vst | |||
| TARGETS += vst3 | |||
| TARGETS += clap | |||
| all: $(TARGETS) | |||
| @@ -0,0 +1 @@ | |||
| EXPORTS | |||
| @@ -0,0 +1,4 @@ | |||
| { | |||
| global: __name; | |||
| local: *; | |||
| }; | |||