mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 22:36:39 +02:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
c2b22c0aa2
1 changed files with 8 additions and 3 deletions
|
@ -219,9 +219,14 @@ QAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) {
|
||||||
hr = pPropertyStore->GetValue(PKEY_Device_FriendlyName, &pv);
|
hr = pPropertyStore->GetValue(PKEY_Device_FriendlyName, &pv);
|
||||||
pPropertyStore->Release();
|
pPropertyStore->Release();
|
||||||
pPropertyStore = NULL;
|
pPropertyStore = NULL;
|
||||||
//QAudio devices seems to only take the 31 first characters of the Friendly Device Name.
|
deviceName = QString::fromWCharArray((wchar_t*)pv.pwszVal);
|
||||||
const DWORD QT_WIN_MAX_AUDIO_DEVICENAME_LEN = 31;
|
const DWORD WINDOWS7_MAJOR_VERSION = 6;
|
||||||
deviceName = QString::fromWCharArray((wchar_t*)pv.pwszVal).left(QT_WIN_MAX_AUDIO_DEVICENAME_LEN);
|
const DWORD WINDOWS7_MINOR_VERSION = 1;
|
||||||
|
if (osvi.dwMajorVersion <= WINDOWS7_MAJOR_VERSION && osvi.dwMinorVersion <= WINDOWS7_MINOR_VERSION) {
|
||||||
|
// Windows 7 provides only the 31 first characters of the device name.
|
||||||
|
const DWORD QT_WIN7_MAX_AUDIO_DEVICENAME_LEN = 31;
|
||||||
|
deviceName = deviceName.left(QT_WIN7_MAX_AUDIO_DEVICENAME_LEN);
|
||||||
|
}
|
||||||
qDebug() << (mode == QAudio::AudioOutput ? "output" : "input") << " device:" << deviceName;
|
qDebug() << (mode == QAudio::AudioOutput ? "output" : "input") << " device:" << deviceName;
|
||||||
PropVariantClear(&pv);
|
PropVariantClear(&pv);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue