mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-16 00:34:19 +00:00
Better CoreAudio handling of devices with combined in/out channels.
This commit is contained in:
parent
7906c75f4d
commit
a052b648ec
1 changed files with 13 additions and 4 deletions
|
|
@ -1831,13 +1831,22 @@ public:
|
|||
if (deviceName.isEmpty())
|
||||
deviceName = inputDeviceName;
|
||||
|
||||
AudioDeviceID inputDeviceID = inputIds [inputIndex];
|
||||
AudioDeviceID outputDeviceID = outputIds [outputIndex];
|
||||
|
||||
if (inputDeviceID == 0 && inputDeviceID == 0)
|
||||
return nullptr;
|
||||
|
||||
if (inputDeviceID == outputDeviceID)
|
||||
return new CoreAudioIODevice (outputDeviceName, inputDeviceID, inputIndex, outputDeviceID, outputIndex);
|
||||
|
||||
ScopedPointer<CoreAudioIODevice> in, out;
|
||||
|
||||
if (inputIndex >= 0)
|
||||
in = new CoreAudioIODevice (outputDeviceName, inputIds [inputIndex], inputIndex, 0, -1);
|
||||
if (inputDeviceID != 0)
|
||||
in = new CoreAudioIODevice (outputDeviceName, inputDeviceID, inputIndex, 0, -1);
|
||||
|
||||
if (outputIndex >= 0)
|
||||
out = new CoreAudioIODevice (inputDeviceName, 0, -1, outputIds [outputIndex], outputIndex);
|
||||
if (outputDeviceID != 0)
|
||||
out = new CoreAudioIODevice (inputDeviceName, 0, -1, outputDeviceID, outputIndex);
|
||||
|
||||
if (in == nullptr) return out.release();
|
||||
if (out == nullptr) return in.release();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue