UI: Enable audio monitoring on linux if pulse available
Closes jp9000/obs-studio#940
This commit is contained in:
parent
b6042d91ea
commit
1bae6f3c18
@ -32,7 +32,7 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *layout, obs_source_t *source_)
|
||||
volume = new QSpinBox();
|
||||
forceMono = new QCheckBox();
|
||||
panning = new QSlider(Qt::Horizontal);
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
monitoringType = new QComboBox();
|
||||
#endif
|
||||
syncOffset = new QSpinBox();
|
||||
@ -93,7 +93,7 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *layout, obs_source_t *source_)
|
||||
syncOffset->setValue(int(cur_sync / NSEC_PER_MSEC));
|
||||
|
||||
int idx;
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#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"),
|
||||
@ -138,7 +138,7 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *layout, obs_source_t *source_)
|
||||
this, SLOT(panningChanged(int)));
|
||||
QWidget::connect(syncOffset, SIGNAL(valueChanged(int)),
|
||||
this, SLOT(syncOffsetChanged(int)));
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
QWidget::connect(monitoringType, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(monitoringTypeChanged(int)));
|
||||
#endif
|
||||
@ -163,7 +163,7 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *layout, obs_source_t *source_)
|
||||
layout->addWidget(forceMonoContainer, lastRow, idx++);
|
||||
layout->addWidget(panningContainer, lastRow, idx++);
|
||||
layout->addWidget(syncOffset, lastRow, idx++);
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
layout->addWidget(monitoringType, lastRow, idx++);
|
||||
#endif
|
||||
layout->addWidget(mixerContainer, lastRow, idx++);
|
||||
@ -178,7 +178,7 @@ OBSAdvAudioCtrl::~OBSAdvAudioCtrl()
|
||||
forceMonoContainer->deleteLater();
|
||||
panningContainer->deleteLater();
|
||||
syncOffset->deleteLater();
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
monitoringType->deleteLater();
|
||||
#endif
|
||||
mixerContainer->deleteLater();
|
||||
|
@ -42,7 +42,7 @@ OBSBasicAdvAudio::OBSBasicAdvAudio(QWidget *parent)
|
||||
label = new QLabel(QTStr("Basic.AdvAudio.SyncOffset"));
|
||||
label->setAlignment(Qt::AlignHCenter);
|
||||
mainLayout->addWidget(label, 0, idx++);
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
label = new QLabel(QTStr("Basic.AdvAudio.Monitoring"));
|
||||
label->setAlignment(Qt::AlignHCenter);
|
||||
mainLayout->addWidget(label, 0, idx++);
|
||||
|
@ -410,7 +410,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
HookWidget(ui->colorRange, COMBO_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->disableOSXVSync, CHECK_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->resetOSXVSync, CHECK_CHANGED, ADV_CHANGED);
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
HookWidget(ui->monitoringDevice, COMBO_CHANGED, ADV_CHANGED);
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
@ -431,15 +431,11 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
HookWidget(ui->enableNewSocketLoop, CHECK_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->enableLowLatencyMode, CHECK_CHANGED, ADV_CHANGED);
|
||||
|
||||
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||
delete ui->monitoringDevice;
|
||||
delete ui->monitoringDeviceLabel;
|
||||
delete ui->advAudioGroupBox;
|
||||
#if !defined(_WIN32) && !defined(__APPLE__) && !HAVE_PULSEAUDIO
|
||||
delete ui->enableAutoUpdates;
|
||||
ui->monitoringDevice = nullptr;
|
||||
ui->monitoringDeviceLabel = nullptr;
|
||||
ui->advAudioGroupBox = nullptr;
|
||||
delete ui->advAudioGroupBox;
|
||||
ui->enableAutoUpdates = nullptr;
|
||||
ui->advAudioGroupBox = nullptr;
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -485,7 +481,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
delete ui->advancedGeneralGroupBox;
|
||||
delete ui->enableNewSocketLoop;
|
||||
delete ui->enableLowLatencyMode;
|
||||
#ifdef __APPLE__
|
||||
#if defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
delete ui->disableAudioDucking;
|
||||
#endif
|
||||
ui->rendererLabel = nullptr;
|
||||
@ -497,7 +493,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
ui->advancedGeneralGroupBox = nullptr;
|
||||
ui->enableNewSocketLoop = nullptr;
|
||||
ui->enableLowLatencyMode = nullptr;
|
||||
#ifdef __APPLE__
|
||||
#if defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
ui->disableAudioDucking = nullptr;
|
||||
#endif
|
||||
#endif
|
||||
@ -584,7 +580,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
|
||||
FillSimpleRecordingValues();
|
||||
FillSimpleStreamingValues();
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
FillAudioMonitoringDevices();
|
||||
#endif
|
||||
|
||||
@ -2026,7 +2022,7 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
||||
"Video", "ColorSpace");
|
||||
const char *videoColorRange = config_get_string(main->Config(),
|
||||
"Video", "ColorRange");
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
const char *monDevName = config_get_string(main->Config(), "Audio",
|
||||
"MonitoringDeviceName");
|
||||
const char *monDevId = config_get_string(main->Config(), "Audio",
|
||||
@ -2058,7 +2054,7 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
||||
|
||||
LoadRendererList();
|
||||
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
if (!SetComboByValue(ui->monitoringDevice, monDevId))
|
||||
SetInvalidValue(ui->monitoringDevice, monDevName, monDevId);
|
||||
#endif
|
||||
@ -2622,7 +2618,7 @@ void OBSBasicSettings::SaveAdvancedSettings()
|
||||
SaveCombo(ui->colorFormat, "Video", "ColorFormat");
|
||||
SaveCombo(ui->colorSpace, "Video", "ColorSpace");
|
||||
SaveComboData(ui->colorRange, "Video", "ColorRange");
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
SaveCombo(ui->monitoringDevice, "Audio", "MonitoringDeviceName");
|
||||
SaveComboData(ui->monitoringDevice, "Audio", "MonitoringDeviceId");
|
||||
#endif
|
||||
@ -2648,7 +2644,7 @@ void OBSBasicSettings::SaveAdvancedSettings()
|
||||
SaveSpinBox(ui->reconnectMaxRetries, "Output", "MaxRetries");
|
||||
SaveComboData(ui->bindToIP, "Output", "BindIP");
|
||||
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
QString newDevice = ui->monitoringDevice->currentData().toString();
|
||||
|
||||
if (lastMonitoringDevice != newDevice) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user