Pārlūkot izejas kodu

UI: Clarify multiview layout names

Shaolin 7 gadi atpakaļ
vecāks
revīzija
a142261edd

+ 4 - 4
UI/data/locale/en-US.ini

@@ -572,10 +572,10 @@ Basic.Settings.General.SaveProjectors="Save projectors on exit"
 Basic.Settings.General.SwitchOnDoubleClick="Transition to scene when double-clicked"
 Basic.Settings.General.StudioPortraitLayout="Enable portrait/vertical layout"
 Basic.Settings.General.MultiviewLayout="Multiview Layout"
-Basic.Settings.General.MultiviewLayout.Horizontal.Top="Horizontal, Top"
-Basic.Settings.General.MultiviewLayout.Horizontal.Bottom="Horizontal, Bottom"
-Basic.Settings.General.MultiviewLayout.Vertical.Left="Vertical, Left"
-Basic.Settings.General.MultiviewLayout.Vertical.Right="Vertical, Right"
+Basic.Settings.General.MultiviewLayout.Horizontal.Top="Horizontal, Top (8 Scenes)"
+Basic.Settings.General.MultiviewLayout.Horizontal.Bottom="Horizontal, Bottom (8 Scenes)"
+Basic.Settings.General.MultiviewLayout.Vertical.Left="Vertical, Left (8 Scenes)"
+Basic.Settings.General.MultiviewLayout.Vertical.Right="Vertical, Right (8 Scenes)"
 
 # basic mode 'stream' settings
 Basic.Settings.Stream="Stream"

+ 8 - 4
UI/obs-app.cpp

@@ -598,25 +598,29 @@ bool OBSApp::UpdatePre22MultiviewLayout(const char *layout)
 
 	if (astrcmpi(layout, "horizontaltop") == 0) {
 		config_set_int(globalConfig, "BasicWindow", "MultiviewLayout",
-			static_cast<int>(MultiviewLayout::HORIZONTAL_TOP));
+			static_cast<int>(
+				MultiviewLayout::HORIZONTAL_TOP_8_SCENES));
 		return true;
 	}
 
 	if (astrcmpi(layout, "horizontalbottom") == 0) {
 		config_set_int(globalConfig, "BasicWindow", "MultiviewLayout",
-			static_cast<int>(MultiviewLayout::HORIZONTAL_BOTTOM));
+			static_cast<int>(
+				MultiviewLayout::HORIZONTAL_BOTTOM_8_SCENES));
 		return true;
 	}
 
 	if (astrcmpi(layout, "verticalleft") == 0) {
 		config_set_int(globalConfig, "BasicWindow", "MultiviewLayout",
-			static_cast<int>(MultiviewLayout::VERTICAL_LEFT));
+			static_cast<int>(
+				MultiviewLayout::VERTICAL_LEFT_8_SCENES));
 		return true;
 	}
 
 	if (astrcmpi(layout, "verticalright") == 0) {
 		config_set_int(globalConfig, "BasicWindow", "MultiviewLayout",
-			static_cast<int>(MultiviewLayout::VERTICAL_RIGHT));
+			static_cast<int>(
+				MultiviewLayout::VERTICAL_RIGHT_8_SCENES));
 		return true;
 	}
 

+ 4 - 4
UI/window-basic-settings.cpp

@@ -1102,16 +1102,16 @@ void OBSBasicSettings::LoadGeneralSettings()
 
 	ui->multiviewLayout->addItem(QTStr(
 			"Basic.Settings.General.MultiviewLayout.Horizontal.Top"),
-			static_cast<int>(MultiviewLayout::HORIZONTAL_TOP));
+			static_cast<int>(MultiviewLayout::HORIZONTAL_TOP_8_SCENES));
 	ui->multiviewLayout->addItem(QTStr(
 			"Basic.Settings.General.MultiviewLayout.Horizontal.Bottom"),
-			static_cast<int>(MultiviewLayout::HORIZONTAL_BOTTOM));
+			static_cast<int>(MultiviewLayout::HORIZONTAL_BOTTOM_8_SCENES));
 	ui->multiviewLayout->addItem(QTStr(
 			"Basic.Settings.General.MultiviewLayout.Vertical.Left"),
-			static_cast<int>(MultiviewLayout::VERTICAL_LEFT));
+			static_cast<int>(MultiviewLayout::VERTICAL_LEFT_8_SCENES));
 	ui->multiviewLayout->addItem(QTStr(
 			"Basic.Settings.General.MultiviewLayout.Vertical.Right"),
-			static_cast<int>(MultiviewLayout::VERTICAL_RIGHT));
+			static_cast<int>(MultiviewLayout::VERTICAL_RIGHT_8_SCENES));
 
 	ui->multiviewLayout->setCurrentIndex(
 			config_get_int(GetGlobalConfig(), "BasicWindow",

+ 12 - 12
UI/window-projector.cpp

@@ -333,19 +333,19 @@ void OBSProjector::OBSRenderMultiview(void *data, uint32_t cx, uint32_t cy)
 	auto calcBaseSource = [&](size_t i)
 	{
 		switch (multiviewLayout) {
-		case MultiviewLayout::VERTICAL_LEFT:
+		case MultiviewLayout::VERTICAL_LEFT_8_SCENES:
 			sourceX = halfCX;
 			sourceY = (i / 2 ) * quarterCY;
 			if (i % 2 != 0)
 				sourceX = halfCX + quarterCX;
 			break;
-		case MultiviewLayout::VERTICAL_RIGHT:
+		case MultiviewLayout::VERTICAL_RIGHT_8_SCENES:
 			sourceX = 0;
 			sourceY = (i / 2 ) * quarterCY;
 			if (i % 2 != 0)
 				sourceX = quarterCX;
 			break;
-		case MultiviewLayout::HORIZONTAL_BOTTOM:
+		case MultiviewLayout::HORIZONTAL_BOTTOM_8_SCENES:
 			if (i < 4) {
 				sourceX = (float(i) * quarterCX);
 				sourceY = 0;
@@ -354,7 +354,7 @@ void OBSProjector::OBSRenderMultiview(void *data, uint32_t cx, uint32_t cy)
 				sourceY = quarterCY;
 			}
 			break;
-		default: // MultiviewLayout::HORIZONTAL_TOP:
+		default: // MultiviewLayout::HORIZONTAL_TOP_8_SCENES:
 			if (i < 4) {
 				sourceX = (float(i) * quarterCX);
 				sourceY = halfCY;
@@ -368,7 +368,7 @@ void OBSProjector::OBSRenderMultiview(void *data, uint32_t cx, uint32_t cy)
 	auto calcPreviewProgram = [&](bool program)
 	{
 		switch (multiviewLayout) {
-		case MultiviewLayout::VERTICAL_LEFT:
+		case MultiviewLayout::VERTICAL_LEFT_8_SCENES:
 			sourceX = 2.0f;
 			sourceY = halfCY + 2.0f;
 			labelX = offset;
@@ -378,7 +378,7 @@ void OBSProjector::OBSRenderMultiview(void *data, uint32_t cx, uint32_t cy)
 				labelY = halfCY * 0.8f;
 			}
 			break;
-		case MultiviewLayout::VERTICAL_RIGHT:
+		case MultiviewLayout::VERTICAL_RIGHT_8_SCENES:
 			sourceX = halfCX + 2.0f;
 			sourceY = halfCY + 2.0f;
 			labelX = halfCX + offset;
@@ -388,7 +388,7 @@ void OBSProjector::OBSRenderMultiview(void *data, uint32_t cx, uint32_t cy)
 				labelY = halfCY * 0.8f;
 			}
 			break;
-		case MultiviewLayout::HORIZONTAL_BOTTOM:
+		case MultiviewLayout::HORIZONTAL_BOTTOM_8_SCENES:
 			sourceX = 2.0f;
 			sourceY = halfCY + 2.0f;
 			labelX = offset;
@@ -398,7 +398,7 @@ void OBSProjector::OBSRenderMultiview(void *data, uint32_t cx, uint32_t cy)
 				labelX = halfCX + offset;
 			}
 			break;
-		default: // MultiviewLayout::HORIZONTAL_TOP:
+		default: // MultiviewLayout::HORIZONTAL_TOP_8_SCENES:
 			sourceX = 2.0f;
 			sourceY = 2.0f;
 			labelX = offset;
@@ -665,7 +665,7 @@ static int getSourceByPosition(int x, int y)
 	int     pos   = -1;
 
 	switch (multiviewLayout) {
-	case MultiviewLayout::VERTICAL_LEFT:
+	case MultiviewLayout::VERTICAL_LEFT_8_SCENES:
 		if (float(cx) / float(cy) > ratio) {
 			int validX = cy * ratio;
 			maxX = halfX + (validX / 2);
@@ -684,7 +684,7 @@ static int getSourceByPosition(int x, int y)
 		if (x > minX + ((maxX - minX) / 2))
 			pos++;
 		break;
-	case MultiviewLayout::VERTICAL_RIGHT:
+	case MultiviewLayout::VERTICAL_RIGHT_8_SCENES:
 		if (float(cx) / float(cy) > ratio) {
 			int validX = cy * ratio;
 			minX = halfX - (validX / 2);
@@ -703,7 +703,7 @@ static int getSourceByPosition(int x, int y)
 		if (x > minX + ((maxX - minX) / 2))
 			pos++;
 		break;
-	case MultiviewLayout::HORIZONTAL_BOTTOM:
+	case MultiviewLayout::HORIZONTAL_BOTTOM_8_SCENES:
 		if (float(cx) / float(cy) > ratio) {
 			int validX = cy * ratio;
 			minX = halfX - (validX / 2);
@@ -722,7 +722,7 @@ static int getSourceByPosition(int x, int y)
 		if (y > minY + ((maxY - minY) / 2))
 			pos += 4;
 		break;
-	default: // MultiviewLayout::HORIZONTAL_TOP
+	default: // MultiviewLayout::HORIZONTAL_TOP_8_SCENES
 		if (float(cx) / float(cy) > ratio) {
 			int validX = cy * ratio;
 			minX = halfX - (validX / 2);

+ 4 - 4
UI/window-projector.hpp

@@ -14,10 +14,10 @@ enum class ProjectorType {
 class QMouseEvent;
 
 enum class MultiviewLayout : uint8_t {
-	HORIZONTAL_TOP = 0,
-	HORIZONTAL_BOTTOM = 1,
-	VERTICAL_LEFT = 2,
-	VERTICAL_RIGHT = 3
+	HORIZONTAL_TOP_8_SCENES = 0,
+	HORIZONTAL_BOTTOM_8_SCENES = 1,
+	VERTICAL_LEFT_8_SCENES = 2,
+	VERTICAL_RIGHT_8_SCENES = 3
 };
 
 class OBSProjector : public OBSQTDisplay {