diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp index 88a2f66f8e..570763f107 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -2825,11 +2825,29 @@ public: info.channelCount = bus->getLastEnabledLayout().size(); toString128 (info.name, bus->getName()); - #if JucePlugin_IsSynth - info.busType = (dir == Vst::kInput && index > 0 ? Vst::kAux : Vst::kMain); - #else - info.busType = (index == 0 ? Vst::kMain : Vst::kAux); - #endif + info.busType = [&] + { + const auto isFirstBus = (index == 0); + + if (dir == Vst::kInput) + { + if (isFirstBus) + { + if (auto* extensions = dynamic_cast (pluginInstance)) + return extensions->getPluginHasMainInput() ? Vst::kMain : Vst::kAux; + + return Vst::kMain; + } + + return Vst::kAux; + } + + #if JucePlugin_IsSynth + return Vst::kMain; + #else + return isFirstBus ? Vst::kMain : Vst::kAux; + #endif + }(); #ifdef JucePlugin_PreferredChannelConfigurations info.flags = Vst::BusInfo::kDefaultActive; diff --git a/modules/juce_audio_processors/utilities/juce_VST3ClientExtensions.h b/modules/juce_audio_processors/utilities/juce_VST3ClientExtensions.h index 32afeeb2d6..ffbf0056dc 100644 --- a/modules/juce_audio_processors/utilities/juce_VST3ClientExtensions.h +++ b/modules/juce_audio_processors/utilities/juce_VST3ClientExtensions.h @@ -82,6 +82,14 @@ struct VST3ClientExtensions called - this function may not be called at all! */ virtual void setIHostApplication (Steinberg::FUnknown*) {} + + /** This function will be called to check whether the first input bus + should be designated as "kMain" or "kAux". Return true if the + first bus should be kMain, or false if the bus should be kAux. + + All other input buses will always be designated kAux. + */ + virtual bool getPluginHasMainInput() const { return true; } }; } // namespace juce