Browse Source

Fix in-place processing in cairoui example; Cleanup

Signed-off-by: falkTX <falktx@falktx.com>
pull/272/head
falkTX 4 years ago
parent
commit
a8af6b7282
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
7 changed files with 22 additions and 13 deletions
  1. +10
    -7
      distrho/DistrhoUI.hpp
  2. +7
    -1
      examples/CairoUI/CairoExamplePlugin.cpp
  3. +1
    -1
      examples/ExternalUI/ExternalExamplePlugin.cpp
  4. +1
    -1
      examples/FileHandling/FileHandlingPlugin.cpp
  5. +1
    -1
      examples/Info/InfoExamplePlugin.cpp
  6. +1
    -1
      examples/Parameters/ExamplePluginParameters.cpp
  7. +1
    -1
      examples/States/ExamplePluginStates.cpp

+ 10
- 7
distrho/DistrhoUI.hpp View File

@@ -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

/* ------------------------------------------------------------------------------------------------------------


+ 7
- 1
examples/CairoUI/CairoExamplePlugin.cpp View File

@@ -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);
}
};



+ 1
- 1
examples/ExternalUI/ExternalExamplePlugin.cpp View File

@@ -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);


+ 1
- 1
examples/FileHandling/FileHandlingPlugin.cpp View File

@@ -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);


+ 1
- 1
examples/Info/InfoExamplePlugin.cpp View File

@@ -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);


+ 1
- 1
examples/Parameters/ExamplePluginParameters.cpp View File

@@ -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);


+ 1
- 1
examples/States/ExamplePluginStates.cpp View File

@@ -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);


Loading…
Cancel
Save