mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 14:30:35 +02:00
Merge pull request #4228 from ctrlaltdavid/20279
CR for Job #20279 - Tools > Audio device selection doesn't work on Windows
This commit is contained in:
commit
8311d1a00a
1 changed files with 1 additions and 11 deletions
|
@ -139,23 +139,13 @@ void Audio::audioMixerKilled() {
|
||||||
|
|
||||||
QAudioDeviceInfo getNamedAudioDeviceForMode(QAudio::Mode mode, const QString& deviceName) {
|
QAudioDeviceInfo getNamedAudioDeviceForMode(QAudio::Mode mode, const QString& deviceName) {
|
||||||
QAudioDeviceInfo result;
|
QAudioDeviceInfo result;
|
||||||
// Temporarily enable audio device selection in Windows again to test how it behaves now
|
|
||||||
//#ifdef WIN32
|
|
||||||
#if FALSE
|
|
||||||
// NOTE
|
|
||||||
// this is a workaround for a windows only QtBug https://bugreports.qt-project.org/browse/QTBUG-16117
|
|
||||||
// static QAudioDeviceInfo objects get deallocated when QList<QAudioDevieInfo> objects go out of scope
|
|
||||||
result = (mode == QAudio::AudioInput) ?
|
|
||||||
QAudioDeviceInfo::defaultInputDevice() :
|
|
||||||
QAudioDeviceInfo::defaultOutputDevice();
|
|
||||||
#else
|
|
||||||
foreach(QAudioDeviceInfo audioDevice, QAudioDeviceInfo::availableDevices(mode)) {
|
foreach(QAudioDeviceInfo audioDevice, QAudioDeviceInfo::availableDevices(mode)) {
|
||||||
if (audioDevice.deviceName().trimmed() == deviceName.trimmed()) {
|
if (audioDevice.deviceName().trimmed() == deviceName.trimmed()) {
|
||||||
result = audioDevice;
|
result = audioDevice;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue