Fixed and improved audio device selection.

This commit is contained in:
2017-02-15 22:22:32 +01:00
parent ec04bbcc2d
commit 8da0ab734e
5 changed files with 96 additions and 14 deletions
+18 -6
View File
@@ -192,12 +192,24 @@ namespace advsettings {
}
void AudioTabController::onNewMirrorDevice() {
auto devid = audioManager->getMirrorDevId();
if (devid.empty()) {
m_mirrorDeviceIndex = -1;
emit mirrorDeviceIndexChanged(m_mirrorDeviceIndex);
} else {
findMirrorDeviceIndex(devid);
}
}
void AudioTabController::onDeviceAdded() {
}
void AudioTabController::onDeviceRemoved() {
void AudioTabController::onDeviceStateChanged() {
// I'm too lazy to find out which device has changed, so let's invalidate all device lists
m_playbackDevices = audioManager->getPlaybackDevices();
m_recordingDevices = audioManager->getRecordingDevices();
findPlaybackDeviceIndex(audioManager->getPlaybackDevId(), false);
findMirrorDeviceIndex(audioManager->getMirrorDevId(), false);
findMicDeviceIndex(audioManager->getMicDevId(), false);
emit playbackDeviceListChanged();
emit recordingDeviceListChanged();
}
int AudioTabController::getPlaybackDeviceCount() {
@@ -275,7 +287,7 @@ namespace advsettings {
audioManager->setMirrorDevice(m_playbackDevices[index].first, notify);
}
} else if (notify) {
emit mirrorDeviceIndexChanged(index);
emit mirrorDeviceIndexChanged(m_mirrorDeviceIndex);
}
}
}
@@ -292,7 +304,7 @@ namespace advsettings {
audioManager->setMicDevice(m_recordingDevices[index].first, notify);
}
} else if (notify) {
emit micDeviceIndexChanged(index);
emit micDeviceIndexChanged(m_recordingDeviceIndex);
}
}
}