From ad3c5dae30b548134635873ee05e021d18da2e5e Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 22 Jul 2022 07:08:19 +0100 Subject: [PATCH] Fix build after last changes Signed-off-by: falkTX --- distrho/src/DistrhoPluginInternal.hpp | 56 ++++++++++++++------------- distrho/src/DistrhoPluginVST3.cpp | 12 +++--- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/distrho/src/DistrhoPluginInternal.hpp b/distrho/src/DistrhoPluginInternal.hpp index 932019fe..94868aee 100644 --- a/distrho/src/DistrhoPluginInternal.hpp +++ b/distrho/src/DistrhoPluginInternal.hpp @@ -523,6 +523,36 @@ public: { return getAudioPort(input, index).hints; } + + uint32_t getAudioPortCountWithGroupId(const bool input, const uint32_t groupId) const noexcept + { + DISTRHO_SAFE_ASSERT_RETURN(fData != nullptr, 0); + + uint32_t numPorts = 0; + + if (input) + { + #if DISTRHO_PLUGIN_NUM_INPUTS > 0 + for (uint32_t i=0; iaudioPorts[i].groupId == groupId) + ++numPorts; + } + #endif + } + else + { + #if DISTRHO_PLUGIN_NUM_OUTPUTS > 0 + for (uint32_t i=0; iaudioPorts[i + DISTRHO_PLUGIN_NUM_INPUTS].groupId == groupId) + ++numPorts; + } + #endif + } + + return numPorts; + } #endif uint32_t getParameterCount() const noexcept @@ -674,32 +704,6 @@ public: return fData->portGroupCount; } - uint32_t getPortCountWithGroupId(const bool input, const uint32_t groupId) const noexcept - { - DISTRHO_SAFE_ASSERT_RETURN(fData != nullptr, 0); - - uint32_t numPorts = 0; - - if (input) - { - for (uint32_t i=0; i<(input ? DISTRHO_PLUGIN_NUM_INPUTS : DISTRHO_PLUGIN_NUM_OUTPUTS); ++i) - { - if (fData->audioPorts[i].groupId == groupId) - ++numPorts; - } - } - else - { - for (uint32_t i=0; i<(input ? DISTRHO_PLUGIN_NUM_INPUTS : DISTRHO_PLUGIN_NUM_OUTPUTS); ++i) - { - if (fData->audioPorts[i + DISTRHO_PLUGIN_NUM_INPUTS].groupId == groupId) - ++numPorts; - } - } - - return numPorts; - } - const PortGroupWithId& getPortGroupById(const uint32_t groupId) const noexcept { DISTRHO_SAFE_ASSERT_RETURN(fData != nullptr && fData->portGroupCount != 0, sFallbackPortGroup); diff --git a/distrho/src/DistrhoPluginVST3.cpp b/distrho/src/DistrhoPluginVST3.cpp index 2ad54c22..a73f860c 100644 --- a/distrho/src/DistrhoPluginVST3.cpp +++ b/distrho/src/DistrhoPluginVST3.cpp @@ -872,7 +872,7 @@ public: #if DISTRHO_PLUGIN_NUM_INPUTS > 0 if (busId < inputBuses.numGroups) { - numChannels = fPlugin.getPortCountWithGroupId(true, busId); + numChannels = fPlugin.getAudioPortCountWithGroupId(true, busId); busType = V3_AUX; flags = 0; @@ -972,7 +972,7 @@ public: #if DISTRHO_PLUGIN_NUM_OUTPUTS > 0 if (busId < outputBuses.numGroups) { - numChannels = fPlugin.getPortCountWithGroupId(false, busId); + numChannels = fPlugin.getAudioPortCountWithGroupId(false, busId); busType = V3_AUX; flags = 0; @@ -1499,7 +1499,7 @@ public: default: if (busId < inputBuses.numGroups) { - const uint32_t numPortsInBus = fPlugin.getPortCountWithGroupId(true, busId); + const uint32_t numPortsInBus = fPlugin.getAudioPortCountWithGroupId(true, busId); arr = 0x0; for (uint32_t j=0; j