From 2d0f21fb4a87364b11a5768f8fbb8560129d5fc0 Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 19 Jun 2023 17:42:49 +0100 Subject: [PATCH] VST3 Host: Tidy up input/output loops --- .../format_types/juce_VST3PluginFormat.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index 701eae8eb1..2229ff468e 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -2761,9 +2761,8 @@ public: // not much we can do to check the layout while the audio processor is running // Let's at least check if it is a VST3 compatible layout - for (int dir = 0; dir < 2; ++dir) + for (const auto isInput : { true, false }) { - bool isInput = (dir == 0); auto n = getBusCount (isInput); for (int i = 0; i < n; ++i) @@ -2776,9 +2775,8 @@ public: bool syncBusLayouts (const BusesLayout& layouts) const { - for (int dir = 0; dir < 2; ++dir) + for (const auto isInput : { true, false }) { - bool isInput = (dir == 0); auto n = getBusCount (isInput); const Vst::BusDirection vstDir = (isInput ? Vst::kInput : Vst::kOutput); @@ -3437,9 +3435,8 @@ private: VSTComSmartPtr processor; processor.loadFrom (component.get()); - for (int dirIdx = 0; dirIdx < 2; ++dirIdx) + for (const auto isInput : { true, false }) { - const bool isInput = (dirIdx == 0); const Vst::BusDirection dir = (isInput ? Vst::kInput : Vst::kOutput); const int numBuses = component->getBusCount (Vst::kAudio, dir);