1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

VST3 Client: Fix warning when PreferredChannelConfigurations are set

This commit is contained in:
attila 2022-06-29 16:46:48 +02:00 committed by Attila Szarvas
parent 27924e4996
commit 6ea3788a3b

View file

@ -3130,14 +3130,20 @@ public:
const auto countChannels = [] (auto& range)
{
return std::accumulate (range.begin(), range.end(), (short) 0, [] (auto acc, auto set)
return std::accumulate (range.begin(), range.end(), 0, [] (auto acc, auto set)
{
return acc + set.size();
});
};
const ChannelPair requested { countChannels (desiredLayout.inputBuses),
countChannels (desiredLayout.outputBuses) };
const auto toShort = [] (int x)
{
jassert (0 <= x && x <= std::numeric_limits<short>::max());
return (short) x;
};
const ChannelPair requested { toShort (countChannels (desiredLayout.inputBuses)),
toShort (countChannels (desiredLayout.outputBuses)) };
const ChannelPair configs[] = { JucePlugin_PreferredChannelConfigurations };
return std::find (std::begin (configs), std::end (configs), requested) != std::end (configs);
#else