DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit d41b971d77dceadcb76a7736908d0b6a36ff1469
parent 24d413912920d0536a452e3091f4e1445826652b
Author: falkTX <falktx@falktx.com>
Date:   Fri, 22 Jul 2022 22:14:56 +0100

Set audio port group hints for most example plugins, fixing vst3

Signed-off-by: falkTX <falktx@falktx.com>

Diffstat:
Mexamples/CairoUI/CairoExamplePlugin.cpp | 13+++++++++++++
Mexamples/CairoUI/Makefile | 3++-
Mexamples/EmbedExternalUI/EmbedExternalExamplePlugin.cpp | 13+++++++++++++
Mexamples/FileHandling/FileHandlingPlugin.cpp | 13+++++++++++++
Mexamples/FileHandling/Makefile | 3++-
Mexamples/Info/InfoExamplePlugin.cpp | 13+++++++++++++
Mexamples/Latency/LatencyExamplePlugin.cpp | 13+++++++++++++
Mexamples/Metronome/ExamplePluginMetronome.cpp | 13+++++++++++++
Mexamples/Parameters/ExamplePluginParameters.cpp | 13+++++++++++++
Mexamples/SendNote/SendNoteExamplePlugin.cpp | 17+++++++++++++----
Mexamples/States/ExamplePluginStates.cpp | 13+++++++++++++
11 files changed, 121 insertions(+), 6 deletions(-)

diff --git a/examples/CairoUI/CairoExamplePlugin.cpp b/examples/CairoUI/CairoExamplePlugin.cpp @@ -54,6 +54,19 @@ public: return d_cconst('d', 'C', 'a', 'i'); } + /** + Initialize the audio port @a index.@n + This function will be called once, shortly after the plugin is created. + */ + void initAudioPort(bool input, uint32_t index, AudioPort& port) override + { + // treat meter audio ports as stereo + port.groupId = kPortGroupMono; + + // everything else is as default + Plugin::initAudioPort(input, index, port); + } + void initParameter(uint32_t index, Parameter& parameter) { // unused diff --git a/examples/CairoUI/Makefile b/examples/CairoUI/Makefile @@ -40,7 +40,8 @@ endif # HAVE_LIBLO endif # MACOS_OR_WINDOWS TARGETS += lv2_sep -TARGETS += vst +TARGETS += vst2 +TARGETS += vst3 endif # HAVE_CAIRO diff --git a/examples/EmbedExternalUI/EmbedExternalExamplePlugin.cpp b/examples/EmbedExternalUI/EmbedExternalExamplePlugin.cpp @@ -100,6 +100,19 @@ protected: * Init */ /** + Initialize the audio port @a index.@n + This function will be called once, shortly after the plugin is created. + */ + void initAudioPort(bool input, uint32_t index, AudioPort& port) override + { + // treat meter audio ports as stereo + port.groupId = kPortGroupStereo; + + // everything else is as default + Plugin::initAudioPort(input, index, port); + } + + /** Initialize the parameter @a index. This function will be called once, shortly after the plugin is created. */ diff --git a/examples/FileHandling/FileHandlingPlugin.cpp b/examples/FileHandling/FileHandlingPlugin.cpp @@ -99,6 +99,19 @@ protected: * Init */ /** + Initialize the audio port @a index.@n + This function will be called once, shortly after the plugin is created. + */ + void initAudioPort(bool input, uint32_t index, AudioPort& port) override + { + // treat meter audio ports as stereo + port.groupId = kPortGroupMono; + + // everything else is as default + Plugin::initAudioPort(input, index, port); + } + + /** Initialize the parameter @a index. This function will be called once, shortly after the plugin is created. */ diff --git a/examples/FileHandling/Makefile b/examples/FileHandling/Makefile @@ -34,7 +34,8 @@ else TARGETS += lv2_dsp endif -TARGETS += vst +TARGETS += vst2 +TARGETS += vst3 all: $(TARGETS) diff --git a/examples/Info/InfoExamplePlugin.cpp b/examples/Info/InfoExamplePlugin.cpp @@ -104,6 +104,19 @@ protected: * Init */ /** + Initialize the audio port @a index.@n + This function will be called once, shortly after the plugin is created. + */ + void initAudioPort(bool input, uint32_t index, AudioPort& port) override + { + // treat meter audio ports as stereo + port.groupId = kPortGroupStereo; + + // everything else is as default + Plugin::initAudioPort(input, index, port); + } + + /** Initialize the parameter @a index. This function will be called once, shortly after the plugin is created. */ diff --git a/examples/Latency/LatencyExamplePlugin.cpp b/examples/Latency/LatencyExamplePlugin.cpp @@ -109,6 +109,19 @@ protected: * Init */ /** + Initialize the audio port @a index.@n + This function will be called once, shortly after the plugin is created. + */ + void initAudioPort(bool input, uint32_t index, AudioPort& port) override + { + // treat meter audio ports as stereo + port.groupId = kPortGroupMono; + + // everything else is as default + Plugin::initAudioPort(input, index, port); + } + + /** Initialize the parameter @a index. This function will be called once, shortly after the plugin is created. */ diff --git a/examples/Metronome/ExamplePluginMetronome.cpp b/examples/Metronome/ExamplePluginMetronome.cpp @@ -151,6 +151,19 @@ protected: * Init */ /** + Initialize the audio port @a index.@n + This function will be called once, shortly after the plugin is created. + */ + void initAudioPort(bool input, uint32_t index, AudioPort& port) override + { + // treat meter audio ports as stereo + port.groupId = kPortGroupMono; + + // everything else is as default + Plugin::initAudioPort(input, index, port); + } + + /** Initialize the parameter @a index. This function will be called once, shortly after the plugin is created. */ diff --git a/examples/Parameters/ExamplePluginParameters.cpp b/examples/Parameters/ExamplePluginParameters.cpp @@ -111,6 +111,19 @@ The plugin will be treated as an effect, but it will not change the host audio." }; /** + Initialize the audio port @a index.@n + This function will be called once, shortly after the plugin is created. + */ + void initAudioPort(bool input, uint32_t index, AudioPort& port) override + { + // treat meter audio ports as stereo + port.groupId = kPortGroupStereo; + + // everything else is as default + Plugin::initAudioPort(input, index, port); + } + + /** Initialize the parameter @a index. This function will be called once, shortly after the plugin is created. */ diff --git a/examples/SendNote/SendNoteExamplePlugin.cpp b/examples/SendNote/SendNoteExamplePlugin.cpp @@ -100,11 +100,20 @@ protected: } /* -------------------------------------------------------------------------------------------------------- - * Init and Internal data, unused in this plugin */ + * Init */ - void initParameter(uint32_t, Parameter&) override {} - float getParameterValue(uint32_t) const override { return 0.0f;} - void setParameterValue(uint32_t, float) override {} + /** + Initialize the audio port @a index.@n + This function will be called once, shortly after the plugin is created. + */ + void initAudioPort(bool input, uint32_t index, AudioPort& port) override + { + // treat meter audio ports as stereo + port.groupId = kPortGroupMono; + + // everything else is as default + Plugin::initAudioPort(input, index, port); + } /* -------------------------------------------------------------------------------------------------------- * Audio/MIDI Processing */ diff --git a/examples/States/ExamplePluginStates.cpp b/examples/States/ExamplePluginStates.cpp @@ -105,6 +105,19 @@ The plugin will be treated as an effect, but it will not change the host audio." * Init */ /** + Initialize the audio port @a index.@n + This function will be called once, shortly after the plugin is created. + */ + void initAudioPort(bool input, uint32_t index, AudioPort& port) override + { + // treat meter audio ports as stereo + port.groupId = kPortGroupStereo; + + // everything else is as default + Plugin::initAudioPort(input, index, port); + } + + /** Set the name of the program @a index. This function will be called once, shortly after the plugin is created. */