| 3709 | } |
| 3710 | |
| 3711 | void MainWindow::applyAudioDeviceSelection(const QAudioDevice& inputDevice, |
| 3712 | const QAudioDevice& outputDevice, |
| 3713 | bool reinitializePcInput) |
| 3714 | { |
| 3715 | if (!m_audio) |
| 3716 | return; |
| 3717 | |
| 3718 | QPointer<AudioEngine> audio = m_audio; |
| 3719 | const QHostAddress radioAddress = m_radioModel.radioAddress(); |
| 3720 | const bool restartCapture = reinitializePcInput && !radioAddress.isNull(); |
| 3721 | QMetaObject::invokeMethod(m_audio, [audio, |
| 3722 | inputDevice, |
| 3723 | outputDevice, |
| 3724 | restartCapture, |
| 3725 | radioAddress]() { |
| 3726 | if (!audio) |
| 3727 | return; |
| 3728 | audio->setInputDevice(inputDevice); |
| 3729 | audio->setOutputDevice(outputDevice); |
| 3730 | if (restartCapture && !audio->isTxStreaming()) |
| 3731 | audio->startTxStream(radioAddress, 4991); |
| 3732 | }, Qt::QueuedConnection); |
| 3733 | } |
| 3734 | |
| 3735 | void MainWindow::resetMissingAudioDevicesToDefault(bool resetInput, |
| 3736 | bool resetOutput, |
nothing calls this directly
no test coverage detected