| 393 | } |
| 394 | |
| 395 | void CBackendPlayer::slotEnableAudioInput(bool bEnable) |
| 396 | { |
| 397 | if(bEnable && -1 < m_pParameters->GetAudioInput() |
| 398 | && m_pParameters->GetAudioInput() < QMediaDevices::audioInputs().size()) { |
| 399 | m_AudioInput.setDevice(QMediaDevices::audioInputs() |
| 400 | .at(m_pParameters->GetAudioInput())); |
| 401 | m_AudioInput.setMuted(m_pParameters->GetAudioInputMuted()); |
| 402 | m_AudioInput.setVolume(m_pParameters->GetAudioInputVolume()); |
| 403 | m_CaptureSession.setAudioInput(&m_AudioInput); |
| 404 | |
| 405 | bool check = connect(m_pParameters, |
| 406 | &CParameterPlayer::sigAudioInputMuted, |
| 407 | &m_AudioInput, &QAudioInput::setMuted); |
| 408 | Q_ASSERT(check); |
| 409 | check = connect(m_pParameters, &CParameterPlayer::sigAudioInputVolume, |
| 410 | &m_AudioInput, &QAudioInput::setVolume); |
| 411 | Q_ASSERT(check); |
| 412 | check = connect(m_pParameters, &CParameterPlayer::sigAudioInput, |
| 413 | this, [&](int nIndex) { |
| 414 | if(-1 < nIndex |
| 415 | && nIndex < QMediaDevices::audioInputs().size()) |
| 416 | m_AudioInput.setDevice( |
| 417 | QMediaDevices::audioInputs().at(nIndex)); |
| 418 | }); |
| 419 | Q_ASSERT(check); |
| 420 | } else { |
| 421 | qDebug(log) << "m_CaptureSession: disable audio input"; |
| 422 | m_CaptureSession.setAudioInput(nullptr); |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | void CBackendPlayer::slotEnableAudioOutput(bool bEnable) |
| 427 | { |
nothing calls this directly
no test coverage detected