diff --git a/Makefile b/Makefile
index c8c9235..a108278 100644
--- a/Makefile
+++ b/Makefile
@@ -79,18 +79,26 @@ ifneq ($(HAVE_PROJECTM),true)
ln -sf $(CURDIR)/plugins/ProM/projectM/presets/presets_* bin/ProM.lv2/resources/presets/
ifeq ($(MACOS),true)
- # VST2 fonts
+ # CLAP + VST2 fonts
+ install -d bin/ProM.clap/Contents/Resources/fonts
install -d bin/ProM.vst/Contents/Resources/fonts
+ ln -sf $(CURDIR)/plugins/ProM/projectM/fonts/*.ttf bin/ProM.clap/Contents/Resources/fonts/
ln -sf $(CURDIR)/plugins/ProM/projectM/fonts/*.ttf bin/ProM.vst/Contents/Resources/fonts/
- # VST2 presets
+ # CLAP + VST2 presets
+ install -d bin/ProM.clap/Contents/Resources/presets
install -d bin/ProM.vst/Contents/Resources/presets
+ ln -sf $(CURDIR)/plugins/ProM/projectM/presets/presets_* bin/ProM.clap/Contents/Resources/presets/
ln -sf $(CURDIR)/plugins/ProM/projectM/presets/presets_* bin/ProM.vst/Contents/Resources/presets/
else
- # VST2 fonts
+ # CLAP + VST2 fonts
+ install -d bin/ProM.clap/resources/fonts
install -d bin/ProM.vst/resources/fonts
+ ln -sf $(CURDIR)/plugins/ProM/projectM/fonts/*.ttf bin/ProM.clap/resources/fonts/
ln -sf $(CURDIR)/plugins/ProM/projectM/fonts/*.ttf bin/ProM.vst/resources/fonts/
- # VST2 presets
+ # CLAP + VST2 presets
+ install -d bin/ProM.clap/resources/presets
install -d bin/ProM.vst/resources/presets
+ ln -sf $(CURDIR)/plugins/ProM/projectM/presets/presets_* bin/ProM.clap/resources/presets/
ln -sf $(CURDIR)/plugins/ProM/projectM/presets/presets_* bin/ProM.vst/resources/presets/
endif
@@ -160,6 +168,7 @@ install:
install -d $(DESTDIR)$(PREFIX)/lib/lv2/
install -d $(DESTDIR)$(PREFIX)/lib/vst/
install -d $(DESTDIR)$(PREFIX)/lib/vst3/
+ install -d $(DESTDIR)$(PREFIX)/lib/clap/
install -d $(DESTDIR)$(PREFIX)/bin/
install -m 644 bin/*-ladspa.* $(DESTDIR)$(PREFIX)/lib/ladspa/
@@ -176,6 +185,7 @@ ifeq ($(HAVE_OPENGL),true)
cp -rL bin/*.vst $(DESTDIR)$(PREFIX)/lib/vst/
endif # HAVE_OPENGL
cp -rL bin/*.vst3 $(DESTDIR)$(PREFIX)/lib/vst3/
+ cp -rL bin/*.clap $(DESTDIR)$(PREFIX)/lib/clap/
install -m 755 bin/Kars$(APP_EXT) $(DESTDIR)$(PREFIX)/bin/
install -m 755 bin/3BandEQ$(APP_EXT) $(DESTDIR)$(PREFIX)/bin/
diff --git a/dpf/LICENSING.md b/dpf/LICENSING.md
index ad0a4c4..3759580 100644
--- a/dpf/LICENSING.md
+++ b/dpf/LICENSING.md
@@ -2,8 +2,7 @@
Even though DPF is quite liberally licensed, not all plugin formats follow the same ideals.
This is usually due to plugin APIs/headers being tied to a specific license or having commercial restrictions.
-This file describes the licensing that applies to each individual plugin format as a way to make it clear what is possible and compatible.
-Note that if you are making GPLv2+ licensed plugins this does not apply to you, as so far everything is GPLv2+ compatible.
+This file describes the licensing that applies to each individual plugin format as a way to make it clear what is possible and compatible.
Regardless of target format, DPF itself needs to be mentioned in attribution.
See the [LICENSE](LICENSE) file for copyright details.
@@ -14,8 +13,9 @@ See the [LICENSE](LICENSE) file for copyright details.
| LADSPA | LGPLv2.1+ | ??? (*) | 2000-2002 Richard W. E. Furse, Paul Barton-Davis, Stefan Westerfeld |
| DSSI | LGPLv2.1+ | ??? (*) | **DSSI**: 2004, 2009 Chris Cannam, Steve Harris and Sean Bolton;
**ALSA**: 1998-2001 Jaroslav Kysela, Abramo Bagnara, Takashi Iwai |
| LV2 | ISC | Copyright attribution | 2006-2020 Steve Harris, David Robillard;
2000-2002 Richard W.E. Furse, Paul Barton-Davis, Stefan Westerfeld |
-| VST2 | GPLv2+ or commercial | Must be GPLv2+ compatible or alternatively use Steinberg VST2 SDK (no longer available for new plugins) | GPLv2+ compatible license or custom agreement with Steinberg |
+| VST2 | BSD-3 | Copyright attribution | 2020-2022 Michael Fabian 'Xaymar' Dirks |
| VST3 | ISC | Copyright attribution | (none, only DPF files used) |
+| CLAP | MIT | Copyright attribution | 2014-2022 Alexandre Bique |
### LADSPA and DSSI special note
@@ -32,12 +32,9 @@ These formats are very limited and not much used anymore anyway, feel free to sk
### VST2 special note
-By default DPF uses the free reverse-engineered [vestige header](distrho/src/vestige/vestige.h) file.
-This file is GPLv2+ licensed, so that applies to plugins built with it as well.
-You can alternatively build DPF-based VST2 plugins using the official Steinberg VST2 SDK,
-simply set the `VESTIGE_HEADER` compiler macro to `0` during build.
-You will need to provide your own VST2 SDK files then, as DPF does not ship with them.
-Note there are legal issues surrounding releasing new VST2 plugins using the official SDK, as that is no longer supported by Steinberg.
+The DPF's VST2 implementation uses https://github.com/Xaymar/vst2sdk which is a liberally-licensed "clean room" untainted reverse engineered "SDK" for the VST2 interface.
+Previously "vestige" was used, but was problematic due to it being GPLv2 licensed.
+With the Xaymar's work, both open-source and proprietary plugins can be created from the same source, which helps in maintenance on DPF side.
### VST3 special note
diff --git a/dpf/Makefile.base.mk b/dpf/Makefile.base.mk
index 4c56955..eacd699 100644
--- a/dpf/Makefile.base.mk
+++ b/dpf/Makefile.base.mk
@@ -35,7 +35,11 @@ DPF_MAKEFILE_BASE_INCLUDED = true
# ---------------------------------------------------------------------------------------------------------------------
# Auto-detect target compiler if not defined
+ifeq ($(shell echo '\#test' | grep -- '\#test'),\#test)
TARGET_COMPILER = $(shell echo '\#ifdef __clang__\nclang\n\#else\ngcc\n\#endif' | $(CC) -E -P -x c - 2>/dev/null)
+else
+TARGET_COMPILER = $(shell echo '#ifdef __clang__\nclang\n#else\ngcc\n#endif' | $(CC) -E -P -x c - 2>/dev/null)
+endif
ifneq ($(CLANG),true)
ifneq ($(GCC),true)
@@ -119,6 +123,9 @@ ifneq (,$(filter aarch64%,$(TARGET_PROCESSOR)))
CPU_ARM64 = true
CPU_ARM_OR_ARM64 = true
endif
+ifneq (,$(filter riscv64%,$(TARGET_PROCESSOR)))
+CPU_RISCV64 = true
+endif
ifeq ($(CPU_ARM),true)
ifneq ($(CPU_ARM64),true)
@@ -246,8 +253,7 @@ else ifeq ($(WASM),true)
LINK_OPTS += -O3
LINK_OPTS += -Wl,--gc-sections
else
-LINK_OPTS += -Wl,-O1,--gc-sections
-LINK_OPTS += -Wl,--as-needed
+LINK_OPTS += -Wl,-O1,--as-needed,--gc-sections
endif
ifneq ($(SKIP_STRIPPING),true)
@@ -658,6 +664,8 @@ features:
$(call print_available,CPU_ARM_OR_ARM64)
$(call print_available,CPU_I386)
$(call print_available,CPU_I386_OR_X86_64)
+ $(call print_available,CPU_RISCV64)
+ $(call print_available,CPU_X86_64)
@echo === Detected OS
$(call print_available,BSD)
$(call print_available,HAIKU)
@@ -677,6 +685,7 @@ features:
$(call print_available,HAVE_DBUS)
$(call print_available,HAVE_CAIRO)
$(call print_available,HAVE_DGL)
+ $(call print_available,HAVE_JACK)
$(call print_available,HAVE_LIBLO)
$(call print_available,HAVE_OPENGL)
$(call print_available,HAVE_PULSEAUDIO)
@@ -689,6 +698,53 @@ features:
$(call print_available,HAVE_XEXT)
$(call print_available,HAVE_XRANDR)
+# ---------------------------------------------------------------------------------------------------------------------
+# Extra rules for MOD Audio stuff
+
+# NOTE: note path must be absolute
+MOD_WORKDIR ?= $(HOME)/mod-workdir
+MOD_ENVIRONMENT = \
+ AR=${1}/host/usr/bin/${2}-gcc-ar \
+ CC=${1}/host/usr/bin/${2}-gcc \
+ CPP=${1}/host/usr/bin/${2}-cpp \
+ CXX=${1}/host/usr/bin/${2}-g++ \
+ LD=${1}/host/usr/bin/${2}-ld \
+ PKG_CONFIG=${1}/host/usr/bin/pkg-config \
+ STRIP=${1}/host/usr/bin/${2}-strip \
+ CFLAGS="-I${1}/staging/usr/include $(EXTRA_MOD_FLAGS)" \
+ CPPFLAGS= \
+ CXXFLAGS="-I${1}/staging/usr/include $(EXTRA_MOD_FLAGS)" \
+ LDFLAGS="-L${1}/staging/usr/lib $(EXTRA_MOD_FLAGS)" \
+ EXE_WRAPPER="qemu-${3}-static -L ${1}/target" \
+ NOOPT=true
+
+modduo:
+ $(MAKE) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR)/modduo-static,arm-mod-linux-gnueabihf.static,arm)
+
+modduox:
+ $(MAKE) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR)/modduox-static,aarch64-mod-linux-gnueabi.static,aarch64)
+
+moddwarf:
+ $(MAKE) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR)/moddwarf,aarch64-mod-linux-gnu,aarch64)
+
+modpush:
+ tar -C bin -cz $(subst bin/,,$(wildcard bin/*.lv2)) | base64 | curl -F 'package=@-' http://192.168.51.1/sdk/install && echo
+
+ifneq (,$(findstring modduo-,$(MAKECMDGOALS)))
+$(MAKECMDGOALS):
+ $(MAKE) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR)/modduo,arm-mod-linux-gnueabihf,arm) $(subst modduo-,,$(MAKECMDGOALS))
+endif
+
+ifneq (,$(findstring modduox-,$(MAKECMDGOALS)))
+$(MAKECMDGOALS):
+ $(MAKE) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR)/modduox,aarch64-mod-linux-gnueabi,aarch64) $(subst modduox-,,$(MAKECMDGOALS))
+endif
+
+ifneq (,$(findstring moddwarf-,$(MAKECMDGOALS)))
+$(MAKECMDGOALS):
+ $(MAKE) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR)/moddwarf,aarch64-mod-linux-gnu,aarch64) $(subst moddwarf-,,$(MAKECMDGOALS))
+endif
+
# ---------------------------------------------------------------------------------------------------------------------
# Protect against multiple inclusion
diff --git a/dpf/README.md b/dpf/README.md
index 95003a9..998c0af 100644
--- a/dpf/README.md
+++ b/dpf/README.md
@@ -7,7 +7,7 @@ DPF is designed to make development of new plugins an easy and enjoyable task.
The framework facilitates exporting various different plugin formats from the same code-base.
-DPF can build for LADSPA, DSSI, LV2, VST2 and VST3 formats.
+DPF can build for LADSPA, DSSI, LV2, VST2, VST3 and CLAP formats.
All current plugin format implementations are complete.
A JACK/Standalone mode is also available, allowing you to quickly test plugins.
@@ -44,6 +44,7 @@ Online help and discussion about DPF happens in the [kx.studio chat, DPF room](h
- [DISTRHO ProM](https://github.com/DISTRHO/ProM)
- [Dragonfly Reverb](https://michaelwillis.github.io/dragonfly-reverb)
- [Fogpad-port](https://github.com/linuxmao-org/fogpad-port)
+ - [master_me](https://github.com/trummerschlunk/master_me)
- [Ninjas2](https://github.com/rghvdberg/ninjas2)
- [osamc-lv2-workshop](https://github.com/osamc-lv2-workshop/lv2-workshop) (simple plugins code examples)
- [QuadraFuzz](https://github.com/jpcima/quadrafuzz)
diff --git a/dpf/dgl/NanoVG.hpp b/dpf/dgl/NanoVG.hpp
index ebafdb9..a1fab23 100644
--- a/dpf/dgl/NanoVG.hpp
+++ b/dpf/dgl/NanoVG.hpp
@@ -319,10 +319,9 @@ public:
/**
Constructor reusing a NanoVG context, used for subwidgets.
+ Context will not be deleted on class destructor.
*/
- /*
- NanoVG(NanoWidget* groupWidget);
- */
+ explicit NanoVG(NVGcontext* context);
/**
Destructor.
@@ -917,7 +916,17 @@ public:
Constructor for a NanoSubWidget.
@see CreateFlags
*/
- explicit NanoBaseWidget(Widget* parentGroupWidget, int flags = CREATE_ANTIALIAS);
+ explicit NanoBaseWidget(Widget* parentWidget, int flags = CREATE_ANTIALIAS);
+
+ /**
+ Constructor for a NanoSubWidget reusing a parent subwidget nanovg context.
+ */
+ explicit NanoBaseWidget(NanoBaseWidget* parentWidget);
+
+ /**
+ Constructor for a NanoSubWidget reusing a parent top-level-widget nanovg context.
+ */
+ explicit NanoBaseWidget(NanoBaseWidget* parentWidget);
/**
Constructor for a NanoTopLevelWidget.
@@ -954,13 +963,7 @@ private:
Widget display function.
Implemented internally to wrap begin/endFrame() automatically.
*/
- inline void onDisplay() override
- {
- // NOTE maybe should use BaseWidget::getWindow().getScaleFactor() as 3rd arg ?
- NanoVG::beginFrame(BaseWidget::getWidth(), BaseWidget::getHeight());
- onNanoDisplay();
- NanoVG::endFrame();
- }
+ void onDisplay() override;
// these should not be used
void beginFrame(uint,uint) {}
@@ -969,6 +972,12 @@ private:
void cancelFrame() {}
void endFrame() {}
+ /** @internal */
+ const bool fUsingParentContext;
+ void displayChildren();
+ friend class NanoBaseWidget;
+ friend class NanoBaseWidget;
+
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(NanoBaseWidget)
};
diff --git a/dpf/dgl/Window.hpp b/dpf/dgl/Window.hpp
index c32ba0f..9971988 100644
--- a/dpf/dgl/Window.hpp
+++ b/dpf/dgl/Window.hpp
@@ -541,7 +541,7 @@ private:
uint height,
double scaleFactor,
bool resizable,
- bool isVST3,
+ bool usesSizeRequest,
bool doPostInit);
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Window)
diff --git a/dpf/dgl/src/NanoVG.cpp b/dpf/dgl/src/NanoVG.cpp
index f5f0b9f..f3fd71d 100644
--- a/dpf/dgl/src/NanoVG.cpp
+++ b/dpf/dgl/src/NanoVG.cpp
@@ -327,6 +327,14 @@ NanoVG::NanoVG(int flags)
DISTRHO_CUSTOM_SAFE_ASSERT("Failed to create NanoVG context, expect a black screen", fContext != nullptr);
}
+NanoVG::NanoVG(NVGcontext* const context)
+ : fContext(context),
+ fInFrame(false),
+ fIsSubWidget(true)
+{
+ DISTRHO_CUSTOM_SAFE_ASSERT("Failed to create NanoVG context, expect a black screen", fContext != nullptr);
+}
+
NanoVG::~NanoVG()
{
DISTRHO_CUSTOM_SAFE_ASSERT("Destroying NanoVG context with still active frame", ! fInFrame);
@@ -1057,17 +1065,73 @@ bool NanoVG::loadSharedResources()
}
#endif
+// -----------------------------------------------------------------------
+
+template
+void NanoBaseWidget::displayChildren()
+{
+ std::list children(BaseWidget::getChildren());
+
+ for (std::list::iterator it = children.begin(); it != children.end(); ++it)
+ {
+ if (NanoSubWidget* const subwidget = dynamic_cast(*it))
+ {
+ if (subwidget->fUsingParentContext && subwidget->isVisible())
+ subwidget->onDisplay();
+ }
+ }
+}
+
// -----------------------------------------------------------------------
// NanoSubWidget
template <>
-NanoBaseWidget::NanoBaseWidget(Widget* const parent, int flags)
- : SubWidget(parent),
- NanoVG(flags)
+NanoBaseWidget::NanoBaseWidget(Widget* const parentWidget, int flags)
+ : SubWidget(parentWidget),
+ NanoVG(flags),
+ fUsingParentContext(false)
{
setNeedsViewportScaling();
}
+template <>
+NanoBaseWidget::NanoBaseWidget(NanoSubWidget* const parentWidget)
+ : SubWidget(parentWidget),
+ NanoVG(parentWidget->getContext()),
+ fUsingParentContext(true)
+{
+ setSkipDrawing();
+}
+
+template <>
+NanoBaseWidget::NanoBaseWidget(NanoTopLevelWidget* const parentWidget)
+ : SubWidget(parentWidget),
+ NanoVG(parentWidget->getContext()),
+ fUsingParentContext(true)
+{
+ setSkipDrawing();
+}
+
+template <>
+inline void NanoBaseWidget::onDisplay()
+{
+ if (fUsingParentContext)
+ {
+ NanoVG::save();
+ translate(SubWidget::getAbsoluteX(), SubWidget::getAbsoluteY());
+ onNanoDisplay();
+ NanoVG::restore();
+ displayChildren();
+ }
+ else
+ {
+ NanoVG::beginFrame(SubWidget::getWidth(), SubWidget::getHeight());
+ onNanoDisplay();
+ displayChildren();
+ NanoVG::endFrame();
+ }
+}
+
template class NanoBaseWidget;
// -----------------------------------------------------------------------
@@ -1076,7 +1140,17 @@ template class NanoBaseWidget;
template <>
NanoBaseWidget::NanoBaseWidget(Window& windowToMapTo, int flags)
: TopLevelWidget(windowToMapTo),
- NanoVG(flags) {}
+ NanoVG(flags),
+ fUsingParentContext(false) {}
+
+template <>
+inline void NanoBaseWidget::onDisplay()
+{
+ NanoVG::beginFrame(TopLevelWidget::getWidth(), TopLevelWidget::getHeight());
+ onNanoDisplay();
+ displayChildren();
+ NanoVG::endFrame();
+}
template class NanoBaseWidget;
@@ -1086,12 +1160,23 @@ template class NanoBaseWidget;
template <>
NanoBaseWidget::NanoBaseWidget(Application& app, int flags)
: StandaloneWindow(app),
- NanoVG(flags) {}
+ NanoVG(flags),
+ fUsingParentContext(false) {}
template <>
NanoBaseWidget::NanoBaseWidget(Application& app, Window& parentWindow, int flags)
: StandaloneWindow(app, parentWindow),
- NanoVG(flags) {}
+ NanoVG(flags),
+ fUsingParentContext(false) {}
+
+template <>
+inline void NanoBaseWidget::onDisplay()
+{
+ NanoVG::beginFrame(Window::getWidth(), Window::getHeight());
+ onNanoDisplay();
+ displayChildren();
+ NanoVG::endFrame();
+}
template class NanoBaseWidget;
diff --git a/dpf/dgl/src/WindowPrivateData.cpp b/dpf/dgl/src/WindowPrivateData.cpp
index 6b32e0c..2105670 100644
--- a/dpf/dgl/src/WindowPrivateData.cpp
+++ b/dpf/dgl/src/WindowPrivateData.cpp
@@ -184,7 +184,7 @@ Window::PrivateData::PrivateData(Application& a, Window* const s,
Window::PrivateData::PrivateData(Application& a, Window* const s,
const uintptr_t parentWindowHandle,
const uint width, const uint height,
- const double scale, const bool resizable, const bool isVST3)
+ const double scale, const bool resizable, const bool usesSizeRequest_)
: app(a),
appData(a.pData),
self(s),
@@ -193,7 +193,7 @@ Window::PrivateData::PrivateData(Application& a, Window* const s,
isClosed(parentWindowHandle == 0),
isVisible(parentWindowHandle != 0 && view != nullptr),
isEmbed(parentWindowHandle != 0),
- usesSizeRequest(isVST3),
+ usesSizeRequest(usesSizeRequest_),
scaleFactor(scale != 0.0 ? scale : getScaleFactorFromParent(view)),
autoScaling(false),
autoScaleFactor(1.0),
diff --git a/dpf/distrho/DistrhoInfo.hpp b/dpf/distrho/DistrhoInfo.hpp
index d1b8bda..050cbd3 100644
--- a/dpf/distrho/DistrhoInfo.hpp
+++ b/dpf/distrho/DistrhoInfo.hpp
@@ -31,7 +31,7 @@ START_NAMESPACE_DISTRHO
It allows developers to create plugins with custom UIs using a simple C++ API.@n
The framework facilitates exporting various different plugin formats from the same code-base.
- DPF can build for LADSPA, DSSI, LV2, VST2 and VST3 formats.@n
+ DPF can build for LADSPA, DSSI, LV2, VST2, VST3 and CLAP formats.@n
A JACK/Standalone mode is also available, allowing you to quickly test plugins.
@section Macros
@@ -341,11 +341,11 @@ START_NAMESPACE_DISTRHO
switch (index)
{
- case 0;
+ case 0:
parameter.name = "Gain Right";
parameter.symbol = "gainR";
break;
- case 1;
+ case 1:
parameter.name = "Gain Left";
parameter.symbol = "gainL";
break;
@@ -373,12 +373,12 @@ START_NAMESPACE_DISTRHO
{
switch (index)
{
- case 0;
+ case 0:
return fGainL;
- case 1;
+ case 1:
return fGainR;
- default:
- return 0.f;
+ default:
+ return 0.f;
}
}
@@ -389,10 +389,10 @@ START_NAMESPACE_DISTRHO
{
switch (index)
{
- case 0;
+ case 0:
fGainL = value;
break;
- case 1;
+ case 1:
fGainR = value;
break;
}
@@ -475,6 +475,8 @@ START_NAMESPACE_DISTRHO
- @ref DISTRHO_PLUGIN_NUM_INPUTS
- @ref DISTRHO_PLUGIN_NUM_OUTPUTS
- @ref DISTRHO_PLUGIN_URI
+
+ Additionally, @ref DISTRHO_PLUGIN_CLAP_ID is required if building CLAP plugins.
@{
*/
@@ -628,6 +630,8 @@ START_NAMESPACE_DISTRHO
Setting this macro allows to skip a temporary UI from being created in certain VST2 and VST3 hosts.
(which would normally be done for knowing the UI size before host creates a window for it)
+ Value must match 1x scale factor.
+
When this macro is defined, the companion DISTRHO_UI_DEFAULT_HEIGHT macro must be defined as well.
*/
#define DISTRHO_UI_DEFAULT_WIDTH 300
@@ -637,6 +641,8 @@ START_NAMESPACE_DISTRHO
Setting this macro allows to skip a temporary UI from being created in certain VST2 and VST3 hosts.
(which would normally be done for knowing the UI size before host creates a window for it)
+ Value must match 1x scale factor.
+
When this macro is defined, the companion DISTRHO_UI_DEFAULT_WIDTH macro must be defined as well.
*/
#define DISTRHO_UI_DEFAULT_HEIGHT 300
@@ -810,6 +816,12 @@ START_NAMESPACE_DISTRHO
*/
#define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "stereo"
+/**
+ The plugin id when exporting in CLAP format, in reverse URI form.
+ @note This macro is required when building CLAP plugins
+*/
+#define DISTRHO_PLUGIN_CLAP_ID "studio.kx.distrho.effect"
+
/** @} */
/* ------------------------------------------------------------------------------------------------------------
@@ -864,15 +876,6 @@ START_NAMESPACE_DISTRHO
*/
#define DGL_USE_OPENGL3
-/**
- Whether to use the GPLv2+ vestige header instead of the official Steinberg VST2 SDK.@n
- This is a boolean, and enabled (set to 1) by default.@n
- Set this to 0 in order to create non-GPL binaries.
- (but then at your own discretion in regards to Steinberg licensing)@n
- When set to 0, DPF will import the VST2 definitions from `"vst/aeffectx.h"` (not shipped with DPF).
- */
-#define VESTIGE_HEADER 1
-
/** @} */
/* ------------------------------------------------------------------------------------------------------------
diff --git a/dpf/distrho/DistrhoUI.hpp b/dpf/distrho/DistrhoUI.hpp
index 950077b..1b25748 100644
--- a/dpf/distrho/DistrhoUI.hpp
+++ b/dpf/distrho/DistrhoUI.hpp
@@ -51,6 +51,9 @@ typedef DGL_NAMESPACE::TopLevelWidget UIWidget;
#if DISTRHO_UI_FILE_BROWSER
# include "extra/FileBrowserDialog.hpp"
#endif
+#if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
+# include
+#endif
START_NAMESPACE_DISTRHO
diff --git a/dpf/distrho/src/DistrhoPlugin.cpp b/dpf/distrho/src/DistrhoPlugin.cpp
index 03902fe..1128e9f 100644
--- a/dpf/distrho/src/DistrhoPlugin.cpp
+++ b/dpf/distrho/src/DistrhoPlugin.cpp
@@ -125,7 +125,7 @@ const TimePosition& Plugin::getTimePosition() const noexcept
#endif
#if DISTRHO_PLUGIN_WANT_LATENCY
-void Plugin::setLatency(uint32_t frames) noexcept
+void Plugin::setLatency(const uint32_t frames) noexcept
{
pData->latency = frames;
}
diff --git a/dpf/distrho/src/DistrhoPluginCLAP.cpp b/dpf/distrho/src/DistrhoPluginCLAP.cpp
index 64847b7..2226b3f 100644
--- a/dpf/distrho/src/DistrhoPluginCLAP.cpp
+++ b/dpf/distrho/src/DistrhoPluginCLAP.cpp
@@ -17,24 +17,57 @@
#include "DistrhoPluginInternal.hpp"
#include "extra/ScopedPointer.hpp"
+#ifndef DISTRHO_PLUGIN_CLAP_ID
+# error DISTRHO_PLUGIN_CLAP_ID undefined!
+#endif
+
+#if DISTRHO_PLUGIN_HAS_UI && ! defined(HAVE_DGL) && ! DISTRHO_PLUGIN_HAS_EXTERNAL_UI
+# undef DISTRHO_PLUGIN_HAS_UI
+# define DISTRHO_PLUGIN_HAS_UI 0
+#endif
+
#if DISTRHO_PLUGIN_HAS_UI
# include "DistrhoUIInternal.hpp"
-# include "extra/Mutex.hpp"
+# include "../extra/Mutex.hpp"
#endif
+#if DISTRHO_PLUGIN_HAS_UI && DISTRHO_PLUGIN_WANT_MIDI_INPUT
+# include "../extra/RingBuffer.hpp"
+#endif
+
+#include