ソースを参照

UI: Add option to toggle multiview draw safe area

Shaolin 7 年 前
コミット
b8966802ef

+ 1 - 0
UI/data/locale/en-US.ini

@@ -574,6 +574,7 @@ Basic.Settings.General.StudioPortraitLayout="Enable portrait/vertical layout"
 Basic.Settings.General.Multiview="Multiview"
 Basic.Settings.General.Multiview.MouseSwitch="Click to switch between scenes"
 Basic.Settings.General.Multiview.DrawSourceNames="Show scene names"
+Basic.Settings.General.Multiview.DrawSafeAreas="Draw safe areas (EBU R 95)"
 Basic.Settings.General.MultiviewLayout="Multiview Layout"
 Basic.Settings.General.MultiviewLayout.Horizontal.Top="Horizontal, Top (8 Scenes)"
 Basic.Settings.General.MultiviewLayout.Horizontal.Bottom="Horizontal, Bottom (8 Scenes)"

+ 11 - 1
UI/forms/OBSBasicSettings.ui

@@ -637,9 +637,19 @@
                     </widget>
                    </item>
                    <item row="2" column="1">
+                    <widget class="QCheckBox" name="multiviewDrawAreas">
+                     <property name="text">
+                      <string>Basic.Settings.General.Multiview.DrawSafeAreas</string>
+                     </property>
+                     <property name="checked">
+                      <bool>true</bool>
+                     </property>
+                    </widget>
+                   </item>
+                   <item row="3" column="1">
                     <widget class="QComboBox" name="multiviewLayout"/>
                    </item>
-                   <item row="2" column="0">
+                   <item row="3" column="0">
                     <widget class="QLabel" name="label_64">
                      <property name="text">
                       <string>Basic.Settings.General.MultiviewLayout</string>

+ 3 - 0
UI/obs-app.cpp

@@ -427,6 +427,9 @@ bool OBSApp::InitGlobalConfigDefaults()
 	config_set_default_bool(globalConfig, "BasicWindow",
 			"MultiviewDrawNames", true);
 
+	config_set_default_bool(globalConfig, "BasicWindow",
+			"MultiviewDrawAreas", true);
+
 #ifdef _WIN32
 	config_set_default_bool(globalConfig, "Audio", "DisableAudioDucking",
 			true);

+ 10 - 0
UI/window-basic-settings.cpp

@@ -320,6 +320,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
 	HookWidget(ui->studioPortraitLayout, CHECK_CHANGED,  GENERAL_CHANGED);
 	HookWidget(ui->multiviewMouseSwitch, CHECK_CHANGED,  GENERAL_CHANGED);
 	HookWidget(ui->multiviewDrawNames,   CHECK_CHANGED,  GENERAL_CHANGED);
+	HookWidget(ui->multiviewDrawAreas,   CHECK_CHANGED,  GENERAL_CHANGED);
 	HookWidget(ui->multiviewLayout,      COMBO_CHANGED,  GENERAL_CHANGED);
 	HookWidget(ui->outputMode,           COMBO_CHANGED,  OUTPUTS_CHANGED);
 	HookWidget(ui->streamType,           COMBO_CHANGED,  STREAM1_CHANGED);
@@ -1110,6 +1111,10 @@ void OBSBasicSettings::LoadGeneralSettings()
 			"BasicWindow", "MultiviewDrawNames");
 	ui->multiviewDrawNames->setChecked(multiviewDrawNames);
 
+	bool multiviewDrawAreas = config_get_bool(GetGlobalConfig(),
+			"BasicWindow", "MultiviewDrawAreas");
+	ui->multiviewDrawAreas->setChecked(multiviewDrawAreas);
+
 	ui->multiviewLayout->addItem(QTStr(
 			"Basic.Settings.General.MultiviewLayout.Horizontal.Top"),
 			static_cast<int>(MultiviewLayout::HORIZONTAL_TOP_8_SCENES));
@@ -2724,6 +2729,11 @@ void OBSBasicSettings::SaveGeneralSettings()
 				"MultiviewDrawNames",
 				ui->multiviewDrawNames->isChecked());
 
+	if (WidgetChanged(ui->multiviewDrawAreas))
+		config_set_bool(GetGlobalConfig(), "BasicWindow",
+				"MultiviewDrawAreas",
+				ui->multiviewDrawAreas->isChecked());
+
 	if (WidgetChanged(ui->multiviewLayout)) {
 		config_set_int(GetGlobalConfig(), "BasicWindow",
 				"MultiviewLayout",

+ 12 - 6
UI/window-projector.cpp

@@ -550,12 +550,18 @@ void OBSProjector::OBSRenderMultiview(void *data, uint32_t cx, uint32_t cy)
 		obs_source_video_render(previewSrc);
 	else
 		obs_render_main_texture();
-	renderVB(window->actionSafeMargin, targetCX, targetCY, outerColor);
-	renderVB(window->graphicsSafeMargin, targetCX, targetCY, outerColor);
-	renderVB(window->fourByThreeSafeMargin, targetCX, targetCY, outerColor);
-	renderVB(window->leftLine, targetCX, targetCY, outerColor);
-	renderVB(window->topLine, targetCX, targetCY, outerColor);
-	renderVB(window->rightLine, targetCX, targetCY, outerColor);
+	if (config_get_bool(GetGlobalConfig(), "BasicWindow",
+			"MultiviewDrawAreas")) {
+		renderVB(window->actionSafeMargin, targetCX, targetCY,
+				outerColor);
+		renderVB(window->graphicsSafeMargin, targetCX, targetCY,
+				outerColor);
+		renderVB(window->fourByThreeSafeMargin, targetCX, targetCY,
+				outerColor);
+		renderVB(window->leftLine, targetCX, targetCY, outerColor);
+		renderVB(window->topLine, targetCX, targetCY, outerColor);
+		renderVB(window->rightLine, targetCX, targetCY, outerColor);
+	}
 	endRegion();
 	gs_matrix_pop();