|
|
|
|
@ -12,6 +12,7 @@
|
|
|
|
|
#include <QButtonGroup> |
|
|
|
|
#include <QPainter> |
|
|
|
|
#include <QScrollArea> |
|
|
|
|
#include <QSignalBlocker> |
|
|
|
|
#ifdef HAVE_STREAM_CAPTURE |
|
|
|
|
#include <QVideoWidget> |
|
|
|
|
#include <QVideoSink> |
|
|
|
|
@ -74,7 +75,7 @@ StreamPublishWindow::StreamPublishWindow(StreamPublishEngine* engine, uint64_t g
|
|
|
|
|
for (const auto& device : SoundManager::enumerateCaptureDevices()) m_microphone->addItem(device.name, device.id); |
|
|
|
|
form->addRow(text("Microphone"), m_microphone); |
|
|
|
|
m_inputChannels = new QLabel(settings); form->addRow(text("Audio input"), m_inputChannels); |
|
|
|
|
m_mute = new QCheckBox(text("Mute microphone"), settings); form->addRow(m_mute); |
|
|
|
|
m_mute = new QCheckBox(text("Mute stream audio"), settings); form->addRow(m_mute); |
|
|
|
|
connect(m_mute, &QCheckBox::toggled, engine, &StreamPublishEngine::setMuted); |
|
|
|
|
m_status = new QLabel(this); m_status->setWordWrap(true); layout->addWidget(m_status); |
|
|
|
|
m_stats = new QLabel(this); m_stats->setWordWrap(true); m_stats->setMinimumHeight(46); layout->addWidget(m_stats); |
|
|
|
|
@ -140,7 +141,8 @@ void StreamPublishWindow::synchronize() {
|
|
|
|
|
m_start->setText(active ? text("Stop stream") : text("Start stream")); |
|
|
|
|
m_start->setEnabled((active && m_engine->running()) || (!active && StreamPublishEngine::supported() && m_source->count() && m_codec->count())); |
|
|
|
|
for (auto* box : {m_source, m_mode, m_codec, m_bitrate}) box->setEnabled(!active || m_engine->running()); |
|
|
|
|
m_audio->setEnabled(!active); m_microphone->setEnabled(!active); m_mute->setEnabled(active && m_engine->config().audio); |
|
|
|
|
m_audio->setEnabled(!active); m_microphone->setEnabled(!active); m_mute->setEnabled(m_engine->running() && m_engine->config().audio); |
|
|
|
|
{ QSignalBlocker blocked(m_mute); m_mute->setChecked(m_engine->muted()); } |
|
|
|
|
if (active) { |
|
|
|
|
auto config = m_engine->config(); |
|
|
|
|
for (int i = 0; i < m_sources.size(); i++) if (m_sources[i].kind == config.source.kind |
|
|
|
|
|