|
|
|
@@ -1207,12 +1207,10 @@ class CoreAudioIODevice : public AudioIODevice, |
|
|
|
public:
|
|
|
|
CoreAudioIODevice (CoreAudioIODeviceType* dt,
|
|
|
|
const String& deviceName,
|
|
|
|
AudioDeviceID inputDeviceId, int inputIndex_,
|
|
|
|
AudioDeviceID outputDeviceId, int outputIndex_)
|
|
|
|
AudioDeviceID inputDeviceId,
|
|
|
|
AudioDeviceID outputDeviceId)
|
|
|
|
: AudioIODevice (deviceName, "CoreAudio"),
|
|
|
|
deviceType (dt),
|
|
|
|
inputIndex (inputIndex_),
|
|
|
|
outputIndex (outputIndex_)
|
|
|
|
deviceType (dt)
|
|
|
|
{
|
|
|
|
internal = [this, &inputDeviceId, &outputDeviceId]
|
|
|
|
{
|
|
|
|
@@ -1260,7 +1258,7 @@ public: |
|
|
|
int getCurrentBufferSizeSamples() override { return internal->getBufferSize(); }
|
|
|
|
int getXRunCount() const noexcept override { return internal->xruns; }
|
|
|
|
|
|
|
|
int getIndexOfDevice (bool asInput) const { return asInput ? inputIndex : outputIndex; }
|
|
|
|
int getIndexOfDevice (bool asInput) const { return deviceType->getDeviceNames (asInput).indexOf (getName()); }
|
|
|
|
|
|
|
|
int getDefaultBufferSize() override
|
|
|
|
{
|
|
|
|
@@ -1389,7 +1387,6 @@ public: |
|
|
|
bool shouldRestartDevice() const noexcept { return restartDevice; }
|
|
|
|
|
|
|
|
WeakReference<CoreAudioIODeviceType> deviceType;
|
|
|
|
int inputIndex, outputIndex;
|
|
|
|
bool hadDiscontinuity;
|
|
|
|
|
|
|
|
private:
|
|
|
|
@@ -2265,12 +2262,12 @@ public: |
|
|
|
: outputDeviceName;
|
|
|
|
|
|
|
|
if (inputDeviceID == outputDeviceID)
|
|
|
|
return std::make_unique<CoreAudioIODevice> (this, combinedName, inputDeviceID, inputIndex, outputDeviceID, outputIndex).release();
|
|
|
|
return std::make_unique<CoreAudioIODevice> (this, combinedName, inputDeviceID, outputDeviceID).release();
|
|
|
|
|
|
|
|
auto in = inputDeviceID != 0 ? std::make_unique<CoreAudioIODevice> (this, inputDeviceName, inputDeviceID, inputIndex, 0, -1)
|
|
|
|
auto in = inputDeviceID != 0 ? std::make_unique<CoreAudioIODevice> (this, inputDeviceName, inputDeviceID, 0)
|
|
|
|
: nullptr;
|
|
|
|
|
|
|
|
auto out = outputDeviceID != 0 ? std::make_unique<CoreAudioIODevice> (this, outputDeviceName, 0, -1, outputDeviceID, outputIndex)
|
|
|
|
auto out = outputDeviceID != 0 ? std::make_unique<CoreAudioIODevice> (this, outputDeviceName, 0, outputDeviceID)
|
|
|
|
: nullptr;
|
|
|
|
|
|
|
|
if (in == nullptr) return out.release();
|
|
|
|
|