MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / slotEnableAudioInput

Method slotEnableAudioInput

Plugins/Player/BackendPlayer.cpp:395–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395void 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
426void CBackendPlayer::slotEnableAudioOutput(bool bEnable)
427{

Callers

nothing calls this directly

Calls 3

GetAudioInputMethod · 0.80
GetAudioInputMutedMethod · 0.80
GetAudioInputVolumeMethod · 0.80

Tested by

no test coverage detected