From 3af553e34f4cbdaafdf6bab0e0e08666d3406beb Mon Sep 17 00:00:00 2001 From: hogliux Date: Mon, 14 Sep 2015 13:00:53 +0100 Subject: [PATCH] Do not report AU layout if the AudioUnit is only mono or stereo --- .../AU/juce_AU_Wrapper.mm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm index d5dddea694..f23523fda6 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm @@ -509,6 +509,10 @@ public: AudioChannelLayout *outLayoutPtr, Boolean &outWritable) { + // fallback to old code if this plug-in does not have multi channel IO + if (! hasMultiChannelConfiguration()) + return 0; + if (element == 0 && (scope == kAudioUnitScope_Output || scope == kAudioUnitScope_Input)) { outWritable = false; @@ -1404,6 +1408,21 @@ private: SetAFactoryPresetAsCurrent (currentPreset); } + //============================================================================== + bool hasMultiChannelConfiguration () noexcept + { + for (int i = 0; i < numChannelConfigs; ++i) + { + #if !JucePlugin_IsSynth + if (channelConfigs[i][0] > 2) + return true; + #endif + if (channelConfigs[i][1] > 2) + return true; + } + return false; + } + JUCE_DECLARE_NON_COPYABLE (JuceAU) };