Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions frontend/components/OBSAdvAudioCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,9 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *, obs_source_t *source_) : source(
int idx;
if (obs_audio_monitoring_available()) {
monitoringType->addItem(QTStr("Basic.AdvAudio.Monitoring.None"), (int)OBS_MONITORING_TYPE_NONE);
monitoringType->addItem(QTStr("Basic.AdvAudio.Monitoring.MonitorOnly"),
(int)OBS_MONITORING_TYPE_MONITOR_ONLY);
monitoringType->addItem(QTStr("Basic.AdvAudio.Monitoring.Both"),
(int)OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT);
monitoringType->setPlaceholderText(QTStr("Basic.AdvAudio.Monitoring.MonitorOnly"));
int mt = (int)obs_source_get_monitoring_type(source);
idx = monitoringType->findData(mt);
monitoringType->setCurrentIndex(idx);
Expand Down
29 changes: 10 additions & 19 deletions frontend/components/VolumeControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ VolumeControl::~VolumeControl()
}
}

const QIcon &VolumeControl::getUnassignedIcon()
const QIcon &VolumeControl::getWarningIcon()
{
static const QIcon &icon = *new QIcon(":/res/images/unassigned.svg");
return icon;
Expand Down Expand Up @@ -773,6 +773,7 @@ void VolumeControl::processMixerState()
bool showAsMuted = obsMuted || obsMonitoringType == OBS_MONITORING_TYPE_MONITOR_ONLY;
bool showAsMonitored = obsMonitoringType != OBS_MONITORING_TYPE_NONE;
bool showAsUnassigned = !obsMuted && unassigned;
bool showWarningIcon = showAsUnassigned || obsMonitoringType == OBS_MONITORING_TYPE_MONITOR_ONLY;

volumeMeter->setMuted((showAsMuted || showAsUnassigned) && !showAsMonitored);
setUseDisabledColors(showAsMuted || !isActive);
Expand All @@ -787,8 +788,8 @@ void VolumeControl::processMixerState()
: QTStr("Basic.AudioMixer.Monitoring.Enable");
monitorButton->setToolTip(monitorTooltip);

if (showAsUnassigned) {
muteButton->setIcon(getUnassignedIcon());
if (showWarningIcon) {
muteButton->setIcon(getWarningIcon());
} else if (showAsMuted) {
muteButton->setIcon(getMutedIcon());
} else {
Expand All @@ -806,7 +807,7 @@ void VolumeControl::processMixerState()
utils->toggleClass(muteButton, "checked", showAsMuted);
utils->toggleClass(monitorButton, "checked", showAsMonitored);

utils->toggleClass(muteButton, "mute-unassigned", showAsUnassigned);
utils->toggleClass(muteButton, "mute-warning", showWarningIcon);

style()->polish(muteButton);
style()->polish(monitorButton);
Expand All @@ -818,27 +819,17 @@ void VolumeControl::handleMuteButton(bool mute)
{
setMuted(mute);

if (obsMonitoringType != OBS_MONITORING_TYPE_NONE) {
if (mute) {
setMonitoring(OBS_MONITORING_TYPE_MONITOR_ONLY);
} else {
setMonitoring(OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT);
}
if (!mute && obsMonitoringType == OBS_MONITORING_TYPE_MONITOR_ONLY) {
setMonitoring(OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT);
Comment thread
PatTheMav marked this conversation as resolved.
}
}

void VolumeControl::handleMonitorButton(bool enableMonitoring)
{
if (!enableMonitoring) {
setMonitoring(OBS_MONITORING_TYPE_NONE);
return;
}
obs_monitoring_type newType = (enableMonitoring) ? OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT
: OBS_MONITORING_TYPE_NONE;

if (obsMuted) {
setMonitoring(OBS_MONITORING_TYPE_MONITOR_ONLY);
} else {
setMonitoring(OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT);
}
setMonitoring(newType);
}

void VolumeControl::sliderChanged(int vol)
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/VolumeControl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class VolumeControl : public QFrame {

QMenu *contextMenu;

static const QIcon &getUnassignedIcon();
static const QIcon &getWarningIcon();
static const QIcon &getMutedIcon();
static const QIcon &getUnmutedIcon();
static const QIcon &getMonitorOnIcon();
Expand Down
2 changes: 1 addition & 1 deletion frontend/data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ Basic.AdvAudio.SyncOffsetSource="Sync Offset for '%1'"
Basic.AdvAudio.Monitoring="Audio Monitoring"
Basic.AdvAudio.Monitoring.None="Monitor Off"
Basic.AdvAudio.Monitoring.MonitorOnly="Monitor Only (mute output)"
Basic.AdvAudio.Monitoring.Both="Monitor and Output"
Basic.AdvAudio.Monitoring.Both="Monitoring Enabled"
Basic.AdvAudio.MonitoringSource="Audio Monitoring for '%1'"
Basic.AdvAudio.AudioTracks="Tracks"

Expand Down
6 changes: 3 additions & 3 deletions frontend/data/themes/Yami.obt
Original file line number Diff line number Diff line change
Expand Up @@ -1674,14 +1674,14 @@ QSlider::handle:disabled {
border-color: var(--red1);
}

.btn-mute.mute-unassigned {
.btn-mute.mute-warning {
color: var(--yellow1);
background: var(--yellow6);
qproperty-icon: url(theme:Dark/unassigned.svg);
}

.btn-mute.mute-unassigned.hover,
.btn-mute.mute-unassigned:focus {
.btn-mute.mute-warning.hover,
.btn-mute.mute-warning:focus {
border-color: var(--yellow1);
}

Expand Down
Loading