Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libobs/UI: Master mixer & input monitoring #1469

Closed
wants to merge 7 commits into from
Closed
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
49 changes: 0 additions & 49 deletions UI/adv-audio-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *, obs_source_t *source_)
volume = new QDoubleSpinBox();
forceMono = new QCheckBox();
balance = new BalanceSlider();
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
monitoringType = new QComboBox();
#endif
syncOffset = new QSpinBox();
mixer1 = new QCheckBox();
mixer2 = new QCheckBox();
Expand Down Expand Up @@ -114,19 +111,6 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *, obs_source_t *source_)
syncOffset->setMaximum(20000);
syncOffset->setValue(int(cur_sync / NSEC_PER_MSEC));

int idx;
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
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);
int mt = (int)obs_source_get_monitoring_type(source);
idx = monitoringType->findData(mt);
monitoringType->setCurrentIndex(idx);
#endif

mixer1->setText("1");
mixer1->setChecked(mixers & (1 << 0));
mixer2->setText("2");
Expand Down Expand Up @@ -166,10 +150,6 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *, obs_source_t *source_)
SLOT(ResetBalance()));
QWidget::connect(syncOffset, SIGNAL(valueChanged(int)), this,
SLOT(syncOffsetChanged(int)));
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
QWidget::connect(monitoringType, SIGNAL(currentIndexChanged(int)), this,
SLOT(monitoringTypeChanged(int)));
#endif
QWidget::connect(mixer1, SIGNAL(clicked(bool)), this,
SLOT(mixer1Changed(bool)));
QWidget::connect(mixer2, SIGNAL(clicked(bool)), this,
Expand All @@ -193,9 +173,6 @@ OBSAdvAudioCtrl::~OBSAdvAudioCtrl()
forceMonoContainer->deleteLater();
balanceContainer->deleteLater();
syncOffset->deleteLater();
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
monitoringType->deleteLater();
#endif
mixerContainer->deleteLater();
}

Expand All @@ -209,9 +186,6 @@ void OBSAdvAudioCtrl::ShowAudioControl(QGridLayout *layout)
layout->addWidget(forceMonoContainer, lastRow, idx++);
layout->addWidget(balanceContainer, lastRow, idx++);
layout->addWidget(syncOffset, lastRow, idx++);
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
layout->addWidget(monitoringType, lastRow, idx++);
#endif
layout->addWidget(mixerContainer, lastRow, idx++);
layout->layout()->setAlignment(mixerContainer,
Qt::AlignHCenter | Qt::AlignVCenter);
Expand Down Expand Up @@ -344,29 +318,6 @@ void OBSAdvAudioCtrl::syncOffsetChanged(int milliseconds)
NSEC_PER_MSEC);
}

void OBSAdvAudioCtrl::monitoringTypeChanged(int index)
{
int mt = monitoringType->itemData(index).toInt();
obs_source_set_monitoring_type(source, (obs_monitoring_type)mt);

const char *type = nullptr;

switch (mt) {
case OBS_MONITORING_TYPE_NONE:
type = "none";
break;
case OBS_MONITORING_TYPE_MONITOR_ONLY:
type = "monitor only";
break;
case OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT:
type = "monitor and output";
break;
}

blog(LOG_INFO, "User changed audio monitoring for source '%s' to: %s",
obs_source_get_name(source), type);
}

static inline void setMixer(obs_source_t *source, const int mixerIdx,
const bool checked)
{
Expand Down
2 changes: 0 additions & 2 deletions UI/adv-audio-control.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class OBSAdvAudioCtrl : public QObject {
QPointer<QLabel> labelL;
QPointer<QLabel> labelR;
QPointer<QSpinBox> syncOffset;
QPointer<QComboBox> monitoringType;
QPointer<QCheckBox> mixer1;
QPointer<QCheckBox> mixer2;
QPointer<QCheckBox> mixer3;
Expand Down Expand Up @@ -64,7 +63,6 @@ public slots:
void downmixMonoChanged(bool checked);
void balanceChanged(int val);
void syncOffsetChanged(int milliseconds);
void monitoringTypeChanged(int index);
void mixer1Changed(bool checked);
void mixer2Changed(bool checked);
void mixer3Changed(bool checked);
Expand Down
18 changes: 14 additions & 4 deletions UI/data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ StudioMode.Preview="Preview"
StudioMode.Program="Program"
ShowInMultiview="Show in Multiview"
VerticalLayout="Vertical Layout"
VerticalLayoutMaster="Vertical Layout"
ShowMonitoringButton="Show Monitoring Button"
ShowTracksButtons="Show Tracks buttons"
Group="Group"
DoNotShowAgain="Do not show again"
Default="(Default)"
Expand Down Expand Up @@ -384,6 +387,14 @@ VolControl.SliderUnmuted="Volume slider for '%1': %2"
VolControl.SliderMuted="Volume slider for '%1': %2 (currently muted)"
VolControl.Mute="Mute '%1'"
VolControl.Properties="Properties for '%1'"
VolControl.Stream="Stream"
VolControl.Rec="Recording %1"
VolControl.Mon="Monitor"
VolControl.Sends="Sends"
VolControl.Stream.Tooltip="Arm Track %1 for Streaming"
VolControl.Rec.Tooltip="Arm Track %1 for Recording"
VolControl.Mon.Tooltip="Monitor input/output"
VolControl.Sends.Tooltip="Send audio to output Tracks"

# add scene dialog
Basic.Main.AddSceneDlg.Title="Add Scene"
Expand All @@ -410,6 +421,9 @@ RenameProfile.Title="Rename Profile"
Basic.Main.MixerRename.Title="Rename Audio Source"
Basic.Main.MixerRename.Text="Please enter the name of the audio source"

# rename audio track in master mixer
Basic.Main.MasterMixerRename.Title="Rename Audio Track"
Basic.Main.MasterMixerRename.Text="Please enter the new name of the audio track"

# preview window disabled
Basic.Main.PreviewDisabled="Preview is currently disabled"
Expand Down Expand Up @@ -842,10 +856,6 @@ Basic.AdvAudio.Volume="Volume"
Basic.AdvAudio.Mono="Downmix to Mono"
Basic.AdvAudio.Balance="Balance"
Basic.AdvAudio.SyncOffset="Sync Offset (ms)"
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.AudioTracks="Tracks"

# basic mode 'hotkeys' settings
Expand Down
184 changes: 184 additions & 0 deletions UI/data/themes/Acri.qss
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,10 @@ MuteCheckBox {
outline: none;
}

MuteCheckBox[themeID="MacOnly"] {
padding: 0px;
}

MuteCheckBox::indicator:checked {
image: url(./Dark/mute.svg);
}
Expand Down Expand Up @@ -806,6 +810,186 @@ MuteCheckBox::indicator:unchecked:disabled {
image: url(./Dark/settings/audio.svg);
}

/* Master Mixer */
MonCheckBox {
outline: none;
}

MonCheckBox[themeID="MacOnly"] {
padding: 0px;
}

MonCheckBox::indicator:checked {
image: url(./Dark/monON.png);
}

MonCheckBox::indicator:unchecked {
image: url(./Dark/monOFF.png);
}

MonCheckBox::indicator:checked:hover {
image: url(./Dark/monON.png);
}

MonCheckBox::indicator:checked:focus {
image: url(./Dark/monON.png);
}

MonCheckBox::indicator:unchecked:hover {
image: url(./Dark/monOFF.png);
}

MonCheckBox::indicator:unchecked:focus {
image: url(./Dark/monOFF.png);
}

StreamCheckBox {
outline: none;
width: 48px;
height: 16px;
}

StreamCheckBox::indicator:checked {
image: url(:/res/images/streamON.png);
width: 48px;
height: 16px;
}

StreamCheckBox::indicator:checked:hover {
image: url(:/res/images/streamON.png);
width: 48px;
height: 16px;
}

StreamCheckBox::indicator:checked:focus {
image: url(:/res/images/streamON.png);
width: 48px;
height: 16px;
}

StreamCheckBox::indicator:unchecked {
image: url(:/res/images/streamOFF.png);
width: 48px;
height: 16px;
}

StreamCheckBox::indicator:unchecked:hover {
image: url(:/res/images/streamOFF.png);
width: 48px;
height: 16px;
}

StreamCheckBox::indicator:unchecked:focus {
image: url(:/res/images/streamOFF.png);
width: 48px;
height: 16px;
}


RecCheckBox {
outline: none;
}

RecCheckBox[themeID="MacOnly"] {
padding: 0px;
}

RecCheckBox::indicator:checked {
image: url(:/res/images/recON.png);
}

RecCheckBox::indicator:checked:hover {
image: url(:/res/images/recON.png);
}

RecCheckBox::indicator:checked:focus {
image: url(:/res/images/recON.png);;
}

RecCheckBox::indicator:unchecked {
image: url(:/res/images/recOFF.png);
}

RecCheckBox::indicator:unchecked:hover {
image: url(:/res/images/recOFF.png);
}

RecCheckBox::indicator:unchecked:focus {
image: url(:/res/images/recOFF.png);
}

TracksCheckBox#track1 {
outline: none;
}

TracksCheckBox#track1::indicator:checked {
image: url(:/res/images/track1.png);
}

TracksCheckBox#track1::indicator:unchecked {
image: url(:/res/images/track1OFF.png);
}

TracksCheckBox#track2 {
outline: none;
}

TracksCheckBox#track2::indicator:checked {
image: url(:/res/images/track2.png);
}

TracksCheckBox#track2::indicator:unchecked {
image: url(:/res/images/track2OFF.png);
}

TracksCheckBox#track3 {
outline: none;
}

TracksCheckBox#track3::indicator:checked {
image: url(:/res/images/track3.png);
}

TracksCheckBox#track3::indicator:unchecked {
image: url(:/res/images/track3OFF.png);
}

TracksCheckBox#track4 {
outline: none;
}

TracksCheckBox#track4::indicator:checked {
image: url(:/res/images/track4.png);
}

TracksCheckBox#track4::indicator:unchecked {
image: url(:/res/images/track4OFF.png);
}

TracksCheckBox#track5 {
outline: none;
}

TracksCheckBox#track5::indicator:checked {
image: url(:/res/images/track5.png);
}

TracksCheckBox#track5::indicator:unchecked {
image: url(:/res/images/track5OFF.png);
}

TracksCheckBox#track6 {
outline: none;
}

TracksCheckBox#track6::indicator:checked {
image: url(:/res/images/track6.png);
}

TracksCheckBox#track6::indicator:unchecked {
image: url(:/res/images/track6OFF.png);
}

OBSHotkeyLabel[hotkeyPairHover=true] {
color: rgba(27, 96, 166);
}
Expand Down
Loading