UI: Clarify multiview layout names

This commit is contained in:
Shaolin 2018-03-20 21:41:39 -03:00
parent b8a901c870
commit a142261edd
5 changed files with 32 additions and 28 deletions

View file

@ -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"

View file

@ -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;
}

View file

@ -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",

View file

@ -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);

View file

@ -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 {