1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-02 03:20:06 +00:00

Do not report AU layout if the AudioUnit is only mono or stereo

This commit is contained in:
hogliux 2015-09-14 13:00:53 +01:00
parent 7e268231ab
commit 3af553e34f

View file

@ -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)
};