From b4103bd5a37e5da1429d723fb5c5d7e28385ff23 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 20 Mar 2016 09:51:17 +0100 Subject: Add getInputProperties/getOutputProperties VST methods. --- pluginvst.cc | 34 ++++++++++++++++++++++++++++++++++ pluginvst.h | 2 ++ 2 files changed, 36 insertions(+) diff --git a/pluginvst.cc b/pluginvst.cc index 33eb1b8..7de518e 100644 --- a/pluginvst.cc +++ b/pluginvst.cc @@ -169,6 +169,40 @@ void PluginVST::resume() onActiveChange(active); } +bool PluginVST::getInputProperties(VstInt32 index, VstPinProperties* props) +{ + if(index < (VstInt32)getNumberOfAudioInputs()) + { + vst_strncpy(props->label, "Channel ", 63); + char temp[11] = {0}; + int2string(index + 1, temp, 10); + vst_strncat(props->label, temp, 63); + + props->flags = kVstPinIsActive; + + return true; + } + + return false; +} + +bool PluginVST::getOutputProperties(VstInt32 index, VstPinProperties* props) +{ + if(index < (VstInt32)getNumberOfAudioOutputs()) + { + vst_strncpy(props->label, "Channel ", 63); + char temp[11] = {0}; + int2string(index + 1, temp, 10); + vst_strncat(props->label, temp, 63); + + props->flags = kVstPinIsActive; + + return true; + } + + return false; +} + void PluginVST::setSampleRate(float sampleRate) { // Called when the sample rate changes (always in a suspend state). diff --git a/pluginvst.h b/pluginvst.h index d4bd1a5..2ae746a 100644 --- a/pluginvst.h +++ b/pluginvst.h @@ -171,6 +171,8 @@ public: void close() override; void suspend() override; void resume() override; + bool getInputProperties(VstInt32 index, VstPinProperties* props) override; + bool getOutputProperties(VstInt32 index, VstPinProperties* props) override; // Callbacks: void setSampleRate(float sampleRate) override; -- cgit v1.2.3