Keep desktop stream mute controls synchronized with publication

This commit is contained in:
evgeny committed 2026-10-16 01:48:39 +02:00
1 parent b4cab28520
commit ac564b0a67
3 files changed
+17 -3

No files matched your search

+4 -2
View File
@@ -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