| 3733 | } |
| 3734 | |
| 3735 | void MainWindow::resetMissingAudioDevicesToDefault(bool resetInput, |
| 3736 | bool resetOutput, |
| 3737 | bool reinitializePcInput) |
| 3738 | { |
| 3739 | if (!m_audio || (!resetInput && !resetOutput)) |
| 3740 | return; |
| 3741 | |
| 3742 | QPointer<AudioEngine> audio = m_audio; |
| 3743 | const QHostAddress radioAddress = m_radioModel.radioAddress(); |
| 3744 | const bool restartCapture = reinitializePcInput && !radioAddress.isNull(); |
| 3745 | QMetaObject::invokeMethod(m_audio, [audio, |
| 3746 | resetInput, |
| 3747 | resetOutput, |
| 3748 | restartCapture, |
| 3749 | radioAddress]() { |
| 3750 | if (!audio) |
| 3751 | return; |
| 3752 | if (resetInput) |
| 3753 | audio->setInputDevice(QAudioDevice{}); |
| 3754 | if (resetOutput) |
| 3755 | audio->setOutputDevice(QAudioDevice{}); |
| 3756 | if (restartCapture && !audio->isTxStreaming()) |
| 3757 | audio->startTxStream(radioAddress, 4991); |
| 3758 | }, Qt::QueuedConnection); |
| 3759 | } |
| 3760 | |
| 3761 | // ─── UI Construction ────────────────────────────────────────────────────────── |
| 3762 |
nothing calls this directly
no test coverage detected