diff --git a/modules/juce_audio_basics/native/juce_CoreAudioLayouts_mac.h b/modules/juce_audio_basics/native/juce_CoreAudioLayouts_mac.h index 44ebd4d93c..1375a0b1ef 100644 --- a/modules/juce_audio_basics/native/juce_CoreAudioLayouts_mac.h +++ b/modules/juce_audio_basics/native/juce_CoreAudioLayouts_mac.h @@ -106,7 +106,12 @@ struct CoreAudioLayouts List { kAudioChannelLayoutTag_MPEG_5_1_D, { centre, left, right, leftSurround, rightSurround, LFE } }, List { kAudioChannelLayoutTag_MPEG_7_1_B, { centre, leftCentre, rightCentre, left, right, leftSurround, rightSurround, LFE } }, List { kAudioChannelLayoutTag_Emagic_Default_7_1, { left, right, leftSurround, rightSurround, centre, LFE, leftCentre, rightCentre } }, + + // Suppressing clang-analyzer-optin.core.EnumCastOutOfRange + #ifndef __clang_analyzer__ List { kAudioChannelLayoutTag_SMPTE_DTV, { left, right, centre, LFE, leftSurround, rightSurround, discreteChannel0 /* leftMatrixTotal */, (ChannelType) (discreteChannel0 + 1) /* rightMatrixTotal */} }, + #endif + List { kAudioChannelLayoutTag_ITU_2_2, { left, right, leftSurround, rightSurround } }, List { kAudioChannelLayoutTag_DVD_4, { left, right, LFE } }, List { kAudioChannelLayoutTag_DVD_5, { left, right, LFE, centreSurround } }, @@ -227,10 +232,13 @@ public: for (UInt32 i = 0; i < layout.mNumberChannelDescriptions; ++i) channels.addIfNotAlreadyThere (getChannelTypeFromAudioChannelLabel (layout.mChannelDescriptions[i].mChannelLabel)); + // Suppressing clang-analyzer-optin.core.EnumCastOutOfRange + #ifndef __clang_analyzer__ // different speaker mappings may point to the same JUCE speaker so fill up // this array with discrete channels for (int j = 0; channels.size() < static_cast (layout.mNumberChannelDescriptions); ++j) channels.addIfNotAlreadyThere (static_cast (AudioChannelSet::discreteChannel0 + j)); + #endif return channels; } @@ -273,8 +281,11 @@ public: return AudioChannelSet::ambisonic (ambisonicOrder).getChannelTypes(); } + // Suppressing clang-analyzer-optin.core.EnumCastOutOfRange + #ifndef __clang_analyzer__ for (UInt32 i = 0; i < numChannels; ++i) speakers.add (static_cast (AudioChannelSet::discreteChannel0 + i)); + #endif return speakers; } diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_1.mm b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_1.mm index c1ed41aa97..10aa30b6a5 100644 --- a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_1.mm +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_1.mm @@ -869,9 +869,14 @@ public: if (const AudioProcessor::Bus* bus = juceFilter->getBus (isInput, busNr)) { AudioChannelSet discreteRangeSet; + + // Suppressing clang-analyzer-optin.core.EnumCastOutOfRange + #ifndef __clang_analyzer__ const int n = bus->getDefaultLayout().size(); + for (int i = 0; i < n; ++i) discreteRangeSet.addChannel ((AudioChannelSet::ChannelType) (256 + i)); + #endif // if the audioprocessor supports this it cannot // really be interested in the bus layouts