mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 16:14:35 +02:00
setting defauld device code for mac to use QT with optional backup to platform code on failure
This commit is contained in:
parent
6860ac9693
commit
397586bd19
1 changed files with 37 additions and 24 deletions
|
@ -516,6 +516,18 @@ QString defaultAudioDeviceName(QAudio::Mode mode) {
|
|||
QString deviceName;
|
||||
|
||||
#ifdef __APPLE__
|
||||
QAudioDeviceInfo device;
|
||||
if (mode == QAudio::AudioInput) {
|
||||
device = QAudioDeviceInfo::defaultInputDevice();
|
||||
} else {
|
||||
device = QAudioDeviceInfo::defaultOutputDevice();
|
||||
}
|
||||
if (!device.isNull()) {
|
||||
if (!device.deviceName().isEmpty()) {
|
||||
deviceName = device.deviceName();
|
||||
}
|
||||
} else {
|
||||
qDebug() << "QT's Default device is null, reverting to platoform code";
|
||||
AudioDeviceID defaultDeviceID = 0;
|
||||
uint32_t propertySize = sizeof(AudioDeviceID);
|
||||
AudioObjectPropertyAddress propertyAddress = {
|
||||
|
@ -547,6 +559,7 @@ QString defaultAudioDeviceName(QAudio::Mode mode) {
|
|||
deviceName = CFStringGetCStringPtr(devName, kCFStringEncodingMacRoman);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
//Check for Windows Vista or higher, IMMDeviceEnumerator doesn't work below that.
|
||||
|
|
Loading…
Reference in a new issue