Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
4b496274
O
Obs Studio
项目概览
小白菜888
/
Obs Studio
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Obs Studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4b496274
编写于
1月 09, 2020
作者:
C
Clayton Groeneveld
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UI: Display aspect ratios in video settings
上级
97b1e350
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
123 addition
and
45 deletion
+123
-45
UI/data/locale/en-US.ini
UI/data/locale/en-US.ini
+1
-0
UI/forms/OBSBasicSettings.ui
UI/forms/OBSBasicSettings.ui
+81
-43
UI/window-basic-settings.cpp
UI/window-basic-settings.cpp
+41
-2
未找到文件。
UI/data/locale/en-US.ini
浏览文件 @
4b496274
...
...
@@ -92,6 +92,7 @@ Calculating="Calculating..."
Fullscreen
=
"Fullscreen"
Windowed
=
"Windowed"
Percent
=
"Percent"
AspectRatio
=
"Aspect Ratio <b>%1:%2</b>"
# warning if program already open
AlreadyRunning.Title
=
"OBS is already running"
...
...
UI/forms/OBSBasicSettings.ui
浏览文件 @
4b496274
...
...
@@ -7,7 +7,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
981
</width>
<height>
7
48
</height>
<height>
7
26
</height>
</rect>
</property>
<property
name=
"sizePolicy"
>
...
...
@@ -28,7 +28,7 @@
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item
alignment=
"Qt::AlignLeft"
>
<item>
<widget
class=
"QListWidget"
name=
"listWidget"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Minimum"
vsizetype=
"Expanding"
>
...
...
@@ -151,8 +151,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
80
3
</width>
<height>
977
</height>
<width>
80
6
</width>
<height>
1254
</height>
</rect>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_19"
>
...
...
@@ -1206,8 +1206,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
601
</width>
<height>
63
1
</height>
<width>
813
</width>
<height>
76
1
</height>
</rect>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_21"
>
...
...
@@ -2345,8 +2345,8 @@
<rect>
<x>
9
</x>
<y>
0
</y>
<width>
2
21
</width>
<height>
2
1
</height>
<width>
2
36
</width>
<height>
2
5
</height>
</rect>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_24"
>
...
...
@@ -3715,8 +3715,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
555
</width>
<height>
469
</height>
<width>
767
</width>
<height>
582
</height>
</rect>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_50"
>
...
...
@@ -4200,22 +4200,42 @@
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"baseResolution"
>
<property
name=
"editable"
>
<bool>
true
</bool>
</property>
<property
name=
"currentText"
>
<string
notr=
"true"
/>
</property>
<property
name=
"duplicatesEnabled"
>
<bool>
false
</bool>
</property>
<property
name=
"frame"
>
<bool>
true
</bool>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_29"
>
<property
name=
"spacing"
>
<number>
6
</number>
</property>
</widget>
<item>
<widget
class=
"QComboBox"
name=
"baseResolution"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"editable"
>
<bool>
true
</bool>
</property>
<property
name=
"currentText"
>
<string
notr=
"true"
/>
</property>
<property
name=
"duplicatesEnabled"
>
<bool>
false
</bool>
</property>
<property
name=
"frame"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"baseAspect"
>
<property
name=
"text"
>
<string>
AspectRatio
</string>
</property>
</widget>
</item>
</layout>
</item>
<item
row=
"
1
"
column=
"0"
>
<item
row=
"
3
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_10"
>
<property
name=
"text"
>
<string>
Basic.Settings.Video.ScaledResolution
</string>
...
...
@@ -4225,17 +4245,7 @@
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"outputResolution"
>
<property
name=
"editable"
>
<bool>
true
</bool>
</property>
<property
name=
"currentText"
>
<string
notr=
"true"
/>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<item
row=
"5"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_11"
>
<property
name=
"text"
>
<string>
Basic.Settings.Video.DownscaleFilter
</string>
...
...
@@ -4245,14 +4255,14 @@
</property>
</widget>
</item>
<item
row=
"
2
"
column=
"1"
>
<item
row=
"
5
"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"downscaleFilter"
>
<property
name=
"enabled"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"
3
"
column=
"0"
>
<item
row=
"
6
"
column=
"0"
>
<widget
class=
"QComboBox"
name=
"fpsType"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
...
...
@@ -4283,7 +4293,7 @@
</item>
</widget>
</item>
<item
row=
"
3
"
column=
"1"
>
<item
row=
"
6
"
column=
"1"
>
<widget
class=
"QStackedWidget"
name=
"fpsTypes"
>
<property
name=
"currentIndex"
>
<number>
1
</number>
...
...
@@ -4454,7 +4464,7 @@
</widget>
</widget>
</item>
<item
row=
"
4
"
column=
"1"
>
<item
row=
"
7
"
column=
"1"
>
<widget
class=
"QLabel"
name=
"videoMsg"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Expanding"
>
...
...
@@ -4473,6 +4483,36 @@
</property>
</widget>
</item>
<item
row=
"3"
column=
"1"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_28"
>
<property
name=
"spacing"
>
<number>
6
</number>
</property>
<item>
<widget
class=
"QComboBox"
name=
"outputResolution"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"editable"
>
<bool>
true
</bool>
</property>
<property
name=
"currentText"
>
<string
notr=
"true"
/>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"scaledAspect"
>
<property
name=
"text"
>
<string>
AspectRatio
</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget
class=
"QScrollArea"
name=
"hotkeyPage"
>
...
...
@@ -4531,8 +4571,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
803
</width>
<height>
781
</height>
<width>
791
</width>
<height>
970
</height>
</rect>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_23"
>
...
...
@@ -5485,8 +5525,6 @@
<tabstop>
peakMeterType
</tabstop>
<tabstop>
monitoringDevice
</tabstop>
<tabstop>
disableAudioDucking
</tabstop>
<tabstop>
baseResolution
</tabstop>
<tabstop>
outputResolution
</tabstop>
<tabstop>
downscaleFilter
</tabstop>
<tabstop>
fpsType
</tabstop>
<tabstop>
fpsCommon
</tabstop>
...
...
UI/window-basic-settings.cpp
浏览文件 @
4b496274
...
...
@@ -760,6 +760,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
UpdateAutomaticReplayBufferCheckboxes
();
on_baseResolution_editTextChanged
(
ui
->
baseResolution
->
currentText
());
App
()
->
DisableHotkeys
();
}
...
...
@@ -1315,10 +1317,13 @@ void OBSBasicSettings::ResetDownscales(uint32_t cx, uint32_t cy)
float
outputAspect
=
float
(
out_cx
)
/
float
(
out_cy
);
bool
closeAspect
=
close_float
(
baseAspect
,
outputAspect
,
0.01
f
);
if
(
closeAspect
)
if
(
closeAspect
)
{
ui
->
outputResolution
->
lineEdit
()
->
setText
(
oldOutputRes
);
else
on_outputResolution_editTextChanged
(
oldOutputRes
);
}
else
{
ui
->
outputResolution
->
lineEdit
()
->
setText
(
bestScale
.
c_str
());
on_outputResolution_editTextChanged
(
bestScale
.
c_str
());
}
ui
->
outputResolution
->
blockSignals
(
false
);
...
...
@@ -3745,6 +3750,25 @@ static bool ValidResolutions(Ui::OBSBasicSettings *ui)
return
true
;
}
static
int
gcd
(
int
a
,
int
b
)
{
return
b
==
0
?
a
:
gcd
(
b
,
a
%
b
);
}
static
std
::
tuple
<
int
,
int
>
aspect_ratio
(
int
cx
,
int
cy
)
{
int
common
=
gcd
(
cx
,
cy
);
int
newCX
=
cx
/
common
;
int
newCY
=
cy
/
common
;
if
(
newCX
==
8
&&
newCY
==
5
)
{
newCX
=
16
;
newCY
=
10
;
}
return
std
::
make_tuple
(
newCX
,
newCY
);
}
void
OBSBasicSettings
::
RecalcOutputResPixels
(
const
char
*
resText
)
{
uint32_t
newCX
;
...
...
@@ -3754,6 +3778,13 @@ void OBSBasicSettings::RecalcOutputResPixels(const char *resText)
if
(
newCX
&&
newCY
)
{
outputCX
=
newCX
;
outputCY
=
newCY
;
std
::
tuple
<
int
,
int
>
aspect
=
aspect_ratio
(
outputCX
,
outputCY
);
ui
->
scaledAspect
->
setText
(
QTStr
(
"AspectRatio"
)
.
arg
(
QString
::
number
(
std
::
get
<
0
>
(
aspect
)),
QString
::
number
(
std
::
get
<
1
>
(
aspect
))));
}
}
...
...
@@ -3785,6 +3816,14 @@ void OBSBasicSettings::on_baseResolution_editTextChanged(const QString &text)
uint32_t
cx
,
cy
;
ConvertResText
(
QT_TO_UTF8
(
baseResolution
),
cx
,
cy
);
std
::
tuple
<
int
,
int
>
aspect
=
aspect_ratio
(
cx
,
cy
);
ui
->
baseAspect
->
setText
(
QTStr
(
"AspectRatio"
)
.
arg
(
QString
::
number
(
std
::
get
<
0
>
(
aspect
)),
QString
::
number
(
std
::
get
<
1
>
(
aspect
))));
ResetDownscales
(
cx
,
cy
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录