mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-27 01:41:06 -04:00
UI: Add 'Advanced' settings section
Currently, this allows the setting of values such as: - Audio buffering time - Color format (still somewhat unsupported) - YUV color space (if a YUV format) = YUV color range (if a YUV format) More color formats will be added in the future, such as RGB and YUV 4:2:2 formats.
This commit is contained in:
@@ -298,6 +298,15 @@ Basic.Settings.Audio.AuxDevice="Mic/Auxiliary Audio Device"
|
||||
Basic.Settings.Audio.AuxDevice2="Mic/Auxiliary Audio Device 2"
|
||||
Basic.Settings.Audio.AuxDevice3="Mic/Auxiliary Audio Device 3"
|
||||
|
||||
# basic mode 'advanced' settings
|
||||
Basic.Settings.Advanced="Advanced"
|
||||
Basic.Settings.Advanced.Audio.BufferingTime="Audio Buffering Time"
|
||||
Basic.Settings.Advanced.Video.ColorFormat="Color Format"
|
||||
Basic.Settings.Advanced.Video.ColorSpace="YUV Color Space"
|
||||
Basic.Settings.Advanced.Video.ColorRange="YUV Color Range"
|
||||
Basic.Settings.Advanced.Video.ColorRange.Partial="Partial"
|
||||
Basic.Settings.Advanced.Video.ColorRange.Full="Full"
|
||||
|
||||
# advanced audio properties
|
||||
Basic.AdvAudio="Advanced Audio Properties"
|
||||
Basic.AdvAudio.Name="Name"
|
||||
|
||||
@@ -87,6 +87,15 @@
|
||||
<normaloff>:/settings/images/settings/video-display-3.png</normaloff>:/settings/images/settings/video-display-3.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Advanced</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="obs.qrc">
|
||||
<normaloff>:/settings/images/settings/advanced.png</normaloff>:/settings/images/settings/advanced.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -2287,6 +2296,206 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="advancedPage">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>609</width>
|
||||
<height>553</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="QWidget" name="widget_11" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_17">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_6">
|
||||
<property name="title">
|
||||
<string>Basic.Settings.Audio</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_17">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_35">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>170</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Advanced.Audio.BufferingTime</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="audioBufferingTime">
|
||||
<property name="minimum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="advancedVideoContainer">
|
||||
<property name="title">
|
||||
<string>Basic.Settings.Video</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_14">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_30">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>170</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Advanced.Video.ColorFormat</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="colorFormat">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">NV12</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">I420</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">RGB</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_34">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Advanced.Video.ColorRange</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="colorRange"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_33">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Advanced.Video.ColorSpace</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="colorSpace">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">709</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">601</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="advancedMsg">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 0, 4);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -11,6 +11,7 @@
|
||||
<file>images/obs.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="settings">
|
||||
<file>images/settings/advanced.png</file>
|
||||
<file>images/settings/network.png</file>
|
||||
<file>images/settings/video-display-3.png</file>
|
||||
<file>images/settings/decibel_audio_player.png</file>
|
||||
|
||||
@@ -121,6 +121,8 @@ void OBSBasicSettings::HookWidget(QWidget *widget, const char *signal,
|
||||
#define VIDEO_RESTART SLOT(VideoChangedRestart())
|
||||
#define VIDEO_RES SLOT(VideoChangedResolution())
|
||||
#define VIDEO_CHANGED SLOT(VideoChanged())
|
||||
#define ADV_CHANGED SLOT(AdvancedChanged())
|
||||
#define ADV_RESTART SLOT(AdvancedChangedRestart())
|
||||
|
||||
OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
: QDialog (parent),
|
||||
@@ -206,12 +208,17 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
HookWidget(ui->fpsInteger, SCROLL_CHANGED, VIDEO_CHANGED);
|
||||
HookWidget(ui->fpsNumerator, SCROLL_CHANGED, VIDEO_CHANGED);
|
||||
HookWidget(ui->fpsDenominator, SCROLL_CHANGED, VIDEO_CHANGED);
|
||||
HookWidget(ui->audioBufferingTime, SCROLL_CHANGED, ADV_RESTART);
|
||||
HookWidget(ui->colorFormat, COMBO_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->colorSpace, COMBO_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->colorRange, COMBO_CHANGED, ADV_CHANGED);
|
||||
|
||||
//Apply button disabled until change.
|
||||
EnableApplyButton(false);
|
||||
|
||||
LoadServiceTypes();
|
||||
LoadEncoderTypes();
|
||||
LoadColorRanges();
|
||||
LoadSettings(false);
|
||||
}
|
||||
|
||||
@@ -301,6 +308,15 @@ void OBSBasicSettings::LoadEncoderTypes()
|
||||
}
|
||||
}
|
||||
|
||||
#define CS_PARTIAL_STR QTStr("Basic.Settings.Advanced.Video.ColorRange.Partial")
|
||||
#define CS_FULL_STR QTStr("Basic.Settings.Advanced.Video.ColorRange.Full")
|
||||
|
||||
void OBSBasicSettings::LoadColorRanges()
|
||||
{
|
||||
ui->colorRange->addItem(CS_PARTIAL_STR, "Partial");
|
||||
ui->colorRange->addItem(CS_FULL_STR, "Full");
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadLanguageList()
|
||||
{
|
||||
const char *currentLang = App()->GetLocale();
|
||||
@@ -917,6 +933,31 @@ void OBSBasicSettings::LoadAudioSettings()
|
||||
loading = false;
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadAdvancedSettings()
|
||||
{
|
||||
uint32_t audioBufferingTime = config_get_uint(main->Config(),
|
||||
"Audio", "BufferingTime");
|
||||
const char *videoColorFormat = config_get_string(main->Config(),
|
||||
"Video", "ColorFormat");
|
||||
const char *videoColorSpace = config_get_string(main->Config(),
|
||||
"Video", "ColorSpace");
|
||||
const char *videoColorRange = config_get_string(main->Config(),
|
||||
"Video", "ColorRange");
|
||||
|
||||
loading = true;
|
||||
|
||||
ui->audioBufferingTime->setValue(audioBufferingTime);
|
||||
SetComboByName(ui->colorFormat, videoColorFormat);
|
||||
SetComboByName(ui->colorSpace, videoColorSpace);
|
||||
SetComboByValue(ui->colorRange, videoColorRange);
|
||||
|
||||
if (video_output_active(obs_get_video())) {
|
||||
ui->advancedVideoContainer->setEnabled(false);
|
||||
}
|
||||
|
||||
loading = false;
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadSettings(bool changedOnly)
|
||||
{
|
||||
if (!changedOnly || generalChanged)
|
||||
@@ -929,6 +970,8 @@ void OBSBasicSettings::LoadSettings(bool changedOnly)
|
||||
LoadAudioSettings();
|
||||
if (!changedOnly || videoChanged)
|
||||
LoadVideoSettings();
|
||||
if (!changedOnly || advancedChanged)
|
||||
LoadAdvancedSettings();
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SaveGeneralSettings()
|
||||
@@ -988,8 +1031,14 @@ void OBSBasicSettings::SaveVideoSettings()
|
||||
SaveSpinBox(ui->fpsNumerator, "Video", "FPSNum");
|
||||
SaveSpinBox(ui->fpsDenominator, "Video", "FPSDen");
|
||||
SaveComboData(ui->downscaleFilter, "Video", "ScaleType");
|
||||
}
|
||||
|
||||
main->ResetVideo();
|
||||
void OBSBasicSettings::SaveAdvancedSettings()
|
||||
{
|
||||
SaveSpinBox(ui->audioBufferingTime, "Audio", "BufferingTime");
|
||||
SaveCombo(ui->colorFormat, "Video", "ColorFormat");
|
||||
SaveCombo(ui->colorSpace, "Video", "ColorSpace");
|
||||
SaveComboData(ui->colorRange, "Video", "ColorRange");
|
||||
}
|
||||
|
||||
static inline const char *OutputModeFromIdx(int idx)
|
||||
@@ -1154,6 +1203,11 @@ void OBSBasicSettings::SaveSettings()
|
||||
SaveAudioSettings();
|
||||
if (videoChanged)
|
||||
SaveVideoSettings();
|
||||
if (advancedChanged)
|
||||
SaveAdvancedSettings();
|
||||
|
||||
if (videoChanged || advancedChanged)
|
||||
main->ResetVideo();
|
||||
|
||||
config_save(main->Config());
|
||||
config_save(GetGlobalConfig());
|
||||
@@ -1413,6 +1467,17 @@ void OBSBasicSettings::VideoChangedRestart()
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasicSettings::AdvancedChangedRestart()
|
||||
{
|
||||
if (!loading) {
|
||||
advancedChanged = true;
|
||||
ui->advancedMsg->setText(
|
||||
QTStr("Basic.Settings.ProgramRestart"));
|
||||
sender()->setProperty("changed", QVariant(true));
|
||||
EnableApplyButton(true);
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasicSettings::VideoChangedResolution()
|
||||
{
|
||||
if (!loading && ValidResolutions(ui.get())) {
|
||||
@@ -1430,3 +1495,12 @@ void OBSBasicSettings::VideoChanged()
|
||||
EnableApplyButton(true);
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasicSettings::AdvancedChanged()
|
||||
{
|
||||
if (!loading) {
|
||||
advancedChanged = true;
|
||||
sender()->setProperty("changed", QVariant(true));
|
||||
EnableApplyButton(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ private:
|
||||
bool outputsChanged = false;
|
||||
bool audioChanged = false;
|
||||
bool videoChanged = false;
|
||||
bool advancedChanged = false;
|
||||
int pageIndex = 0;
|
||||
bool loading = true;
|
||||
|
||||
@@ -63,7 +64,7 @@ private:
|
||||
inline bool Changed() const
|
||||
{
|
||||
return generalChanged || outputsChanged || stream1Changed ||
|
||||
audioChanged || videoChanged;
|
||||
audioChanged || videoChanged || advancedChanged;
|
||||
}
|
||||
|
||||
inline void EnableApplyButton(bool en)
|
||||
@@ -78,6 +79,7 @@ private:
|
||||
outputsChanged = false;
|
||||
audioChanged = false;
|
||||
videoChanged = false;
|
||||
advancedChanged= false;
|
||||
EnableApplyButton(false);
|
||||
}
|
||||
|
||||
@@ -87,12 +89,14 @@ private:
|
||||
|
||||
void LoadServiceTypes();
|
||||
void LoadEncoderTypes();
|
||||
void LoadColorRanges();
|
||||
|
||||
void LoadGeneralSettings();
|
||||
void LoadStream1Settings();
|
||||
void LoadOutputSettings();
|
||||
void LoadAudioSettings();
|
||||
void LoadVideoSettings();
|
||||
void LoadAdvancedSettings();
|
||||
void LoadSettings(bool changedOnly);
|
||||
|
||||
OBSPropertiesView *CreateEncoderPropertyView(const char *encoder,
|
||||
@@ -128,6 +132,7 @@ private:
|
||||
void SaveOutputSettings();
|
||||
void SaveAudioSettings();
|
||||
void SaveVideoSettings();
|
||||
void SaveAdvancedSettings();
|
||||
void SaveSettings();
|
||||
|
||||
private slots:
|
||||
@@ -154,6 +159,8 @@ private slots:
|
||||
void VideoChanged();
|
||||
void VideoChangedResolution();
|
||||
void VideoChangedRestart();
|
||||
void AdvancedChanged();
|
||||
void AdvancedChangedRestart();
|
||||
|
||||
protected:
|
||||
virtual void closeEvent(QCloseEvent *event);
|
||||
|
||||
Reference in New Issue
Block a user