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

CoreAudioIODevice: Fix handling channel configurations with disabled lower bits

Prior to this commit it was not possible to deactivate the first few
channels of an audio device. If say channel 5 was active in the
requested configuration then all channels up to 5 would be active as
well regardless of the provided activation pattern.
This commit is contained in:
attila 2022-11-22 16:42:26 +01:00
parent b33dde8134
commit 5162793245

View file

@ -836,7 +836,12 @@ public:
latency (getLatencyFromDevice (isInput, parent)),
bitDepth (getBitDepthFromDevice (isInput, parent)),
chanNames (getChannelNames (isInput, parent)),
activeChans (BigInteger().setRange (0, jmin (activeRequested.getHighestBit() + 1, chanNames.size()), true)),
activeChans ([&activeRequested, clearFrom = chanNames.size()]
{
auto result = activeRequested;
result.setRange (clearFrom, result.getHighestBit() + 1 - clearFrom, false);
return result;
}()),
channelInfo (getChannelInfos (isInput, parent, activeChans)),
channels (static_cast<int> (channelInfo.size()))
{}