|
|
@@ -124,12 +124,12 @@ struct OboeAudioIODeviceBufferHelpers<float> |
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <typename Type> |
|
|
|
static String getOboeString (const Type& value) |
|
|
|
{ |
|
|
|
return String (oboe::convertToText (value)); |
|
|
|
} |
|
|
|
|
|
|
|
template <typename Type>
|
|
|
|
static String getOboeString (const Type& value)
|
|
|
|
{
|
|
|
|
return String (oboe::convertToText (value));
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
class OboeAudioIODevice : public AudioIODevice
|
|
|
@@ -466,7 +466,7 @@ private: |
|
|
|
auto startResult = stream->requestStart();
|
|
|
|
JUCE_OBOE_LOG ("Requested Oboe stream start with result: " + getOboeString (startResult));
|
|
|
|
|
|
|
|
startResult = stream->waitForStateChange (expectedState, &nextState, timeoutNanos); |
|
|
|
startResult = stream->waitForStateChange (expectedState, &nextState, timeoutNanos);
|
|
|
|
|
|
|
|
JUCE_OBOE_LOG ("Starting Oboe stream with result: " + getOboeString (startResult);
|
|
|
|
+ "\nUses AAudio = " + String ((int) stream->usesAAudio())
|
|
|
@@ -494,17 +494,17 @@ private: |
|
|
|
|
|
|
|
int getXRunCount() const
|
|
|
|
{
|
|
|
|
if (stream != nullptr) |
|
|
|
if (stream != nullptr)
|
|
|
|
{
|
|
|
|
auto count = stream->getXRunCount(); |
|
|
|
|
|
|
|
auto count = stream->getXRunCount();
|
|
|
|
|
|
|
|
if (count)
|
|
|
|
return count.value(); |
|
|
|
|
|
|
|
JUCE_OBOE_LOG ("Failed to get Xrun count: " + getOboeString (count.error())); |
|
|
|
} |
|
|
|
return count.value();
|
|
|
|
|
|
|
|
return 0; |
|
|
|
JUCE_OBOE_LOG ("Failed to get Xrun count: " + getOboeString (count.error()));
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
@@ -1148,7 +1148,7 @@ public: |
|
|
|
|
|
|
|
int getIndexOfDevice (AudioIODevice* device, bool asInput) const override
|
|
|
|
{
|
|
|
|
if (auto oboeDevice = static_cast<OboeAudioIODevice*> (device)) |
|
|
|
if (auto oboeDevice = static_cast<OboeAudioIODevice*> (device))
|
|
|
|
{
|
|
|
|
auto oboeDeviceId = asInput ? oboeDevice->inputDeviceId
|
|
|
|
: oboeDevice->outputDeviceId;
|
|
|
@@ -1157,7 +1157,7 @@ public: |
|
|
|
|
|
|
|
for (int i = 0; i < devices.size(); ++i)
|
|
|
|
if (devices.getReference (i).id == oboeDeviceId)
|
|
|
|
return i; |
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
@@ -1471,14 +1471,14 @@ public: |
|
|
|
{
|
|
|
|
JUCE_OBOE_LOG ("OboeRealtimeThread: Oboe stream onErrorBeforeClose(): " + getOboeString (error));
|
|
|
|
ignoreUnused (error);
|
|
|
|
jassertfalse; // Should never get here! |
|
|
|
jassertfalse; // Should never get here!
|
|
|
|
}
|
|
|
|
|
|
|
|
void onErrorAfterClose (oboe::AudioStream*, oboe::Result error) override
|
|
|
|
{
|
|
|
|
JUCE_OBOE_LOG ("OboeRealtimeThread: Oboe stream onErrorAfterClose(): " + getOboeString (error));
|
|
|
|
ignoreUnused (error);
|
|
|
|
jassertfalse; // Should never get here! |
|
|
|
jassertfalse; // Should never get here!
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
@@ -1502,7 +1502,7 @@ pthread_t juce_createRealtimeAudioThread (void* (*entry) (void*), void* userPtr) |
|
|
|
return {};
|
|
|
|
|
|
|
|
auto threadID = thread->startThread (entry, userPtr);
|
|
|
|
thread.release(); // the thread will de-allocate itself |
|
|
|
thread.release(); // the thread will de-allocate itself
|
|
|
|
return threadID;
|
|
|
|
}
|
|
|
|
|
|
|
|