diff --git a/distrho/DistrhoUI.hpp b/distrho/DistrhoUI.hpp index e802f663..df042753 100644 --- a/distrho/DistrhoUI.hpp +++ b/distrho/DistrhoUI.hpp @@ -20,6 +20,16 @@ #include "extra/LeakDetector.hpp" #include "src/DistrhoPluginChecks.h" +#ifdef DGL_CAIRO +# include "Cairo.hpp" +#endif +#ifdef DGL_OPENGL +# include "OpenGL.hpp" +#endif +#ifdef DGL_VULKAN +# include "Vulkan.hpp" +#endif + #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI # include "../dgl/Base.hpp" # include "extra/ExternalWindow.hpp" @@ -38,13 +48,6 @@ typedef DGL_NAMESPACE::NanoTopLevelWidget UIWidget; typedef DGL_NAMESPACE::TopLevelWidget UIWidget; #endif -#ifdef DGL_CAIRO -# include "Cairo.hpp" -#endif -#ifdef DGL_OPENGL -# include "OpenGL.hpp" -#endif - START_NAMESPACE_DISTRHO /* ------------------------------------------------------------------------------------------------------------ diff --git a/examples/CairoUI/CairoExamplePlugin.cpp b/examples/CairoUI/CairoExamplePlugin.cpp index b6df8799..161399e5 100644 --- a/examples/CairoUI/CairoExamplePlugin.cpp +++ b/examples/CairoUI/CairoExamplePlugin.cpp @@ -77,7 +77,13 @@ public: void run(const float** inputs, float** outputs, uint32_t frames) { - memcpy(outputs[0], inputs[0], frames * sizeof(float)); + /** + This plugin does nothing, it just demonstrates cairo UI usage. + So here we directly copy inputs over outputs, leaving the audio untouched. + We need to be careful in case the host re-uses the same buffer for both inputs and outputs. + */ + if (outputs[0] != inputs[0]) + std::memcpy(outputs[0], inputs[0], sizeof(float)*frames); } }; diff --git a/examples/ExternalUI/ExternalExamplePlugin.cpp b/examples/ExternalUI/ExternalExamplePlugin.cpp index dbecdcc6..92b1b12e 100644 --- a/examples/ExternalUI/ExternalExamplePlugin.cpp +++ b/examples/ExternalUI/ExternalExamplePlugin.cpp @@ -157,7 +157,7 @@ protected: /** This plugin does nothing, it just demonstrates information usage. So here we directly copy inputs over outputs, leaving the audio untouched. - We need to be careful in case the host re-uses the same buffer for both ins and outs. + We need to be careful in case the host re-uses the same buffer for both inputs and outputs. */ if (outputs[0] != inputs[0]) std::memcpy(outputs[0], inputs[0], sizeof(float)*frames); diff --git a/examples/FileHandling/FileHandlingPlugin.cpp b/examples/FileHandling/FileHandlingPlugin.cpp index 074e5ec4..db134ce3 100644 --- a/examples/FileHandling/FileHandlingPlugin.cpp +++ b/examples/FileHandling/FileHandlingPlugin.cpp @@ -227,7 +227,7 @@ protected: /** This plugin doesn't do audio, it just demonstrates file handling usage. So here we directly copy inputs over outputs, leaving the audio untouched. - We need to be careful in case the host re-uses the same buffer for both ins and outs. + We need to be careful in case the host re-uses the same buffer for both inputs and outputs. */ if (outputs[0] != inputs[0]) std::memcpy(outputs[0], inputs[0], sizeof(float)*frames); diff --git a/examples/Info/InfoExamplePlugin.cpp b/examples/Info/InfoExamplePlugin.cpp index bd4829ea..15c4f41e 100644 --- a/examples/Info/InfoExamplePlugin.cpp +++ b/examples/Info/InfoExamplePlugin.cpp @@ -208,7 +208,7 @@ protected: /** This plugin does nothing, it just demonstrates information usage. So here we directly copy inputs over outputs, leaving the audio untouched. - We need to be careful in case the host re-uses the same buffer for both ins and outs. + We need to be careful in case the host re-uses the same buffer for both inputs and outputs. */ if (outputs[0] != inputs[0]) std::memcpy(outputs[0], inputs[0], sizeof(float)*frames); diff --git a/examples/Parameters/ExamplePluginParameters.cpp b/examples/Parameters/ExamplePluginParameters.cpp index ea6ec6d1..3d995ed8 100644 --- a/examples/Parameters/ExamplePluginParameters.cpp +++ b/examples/Parameters/ExamplePluginParameters.cpp @@ -251,7 +251,7 @@ The plugin will be treated as an effect, but it will not change the host audio." /** This plugin does nothing, it just demonstrates parameter usage. So here we directly copy inputs over outputs, leaving the audio untouched. - We need to be careful in case the host re-uses the same buffer for both ins and outs. + We need to be careful in case the host re-uses the same buffer for both inputs and outputs. */ if (outputs[0] != inputs[0]) std::memcpy(outputs[0], inputs[0], sizeof(float)*frames); diff --git a/examples/States/ExamplePluginStates.cpp b/examples/States/ExamplePluginStates.cpp index b9f9ee57..66cba49d 100644 --- a/examples/States/ExamplePluginStates.cpp +++ b/examples/States/ExamplePluginStates.cpp @@ -279,7 +279,7 @@ The plugin will be treated as an effect, but it will not change the host audio." /** This plugin does nothing, it just demonstrates state usage. So here we directly copy inputs over outputs, leaving the audio untouched. - We need to be careful in case the host re-uses the same buffer for both ins and outs. + We need to be careful in case the host re-uses the same buffer for both inputs and outputs. */ if (outputs[0] != inputs[0]) std::memcpy(outputs[0], inputs[0], sizeof(float)*frames);