Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
b3a40515
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,发现更多精彩内容 >>
提交
b3a40515
编写于
3月 22, 2018
作者:
S
Shaolin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UI: Move more fixed values to multiview update
上级
59215585
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
20 deletion
+14
-20
UI/window-projector.cpp
UI/window-projector.cpp
+12
-19
UI/window-projector.hpp
UI/window-projector.hpp
+2
-1
未找到文件。
UI/window-projector.cpp
浏览文件 @
b3a40515
...
...
@@ -290,14 +290,10 @@ void OBSProjector::OBSRenderMultiview(void *data, uint32_t cx, uint32_t cy)
OBSBasic
*
main
=
(
OBSBasic
*
)
obs_frontend_get_main_window
();
uint32_t
targetCX
,
targetCY
;
int
x
,
y
;
float
targetCXF
,
targetCYF
,
scale
;
float
scale
;
struct
obs_video_info
ovi
;
obs_get_video_info
(
&
ovi
);
targetCX
=
ovi
.
base_width
;
targetCY
=
ovi
.
base_height
;
targetCXF
=
float
(
targetCX
);
targetCYF
=
float
(
targetCY
);
targetCX
=
(
uint32_t
)
window
->
fw
;
targetCY
=
(
uint32_t
)
window
->
fh
;
GetScaleAndCenterPos
(
targetCX
,
targetCY
,
cx
,
cy
,
x
,
y
,
scale
);
...
...
@@ -444,11 +440,11 @@ void OBSProjector::OBSRenderMultiview(void *data, uint32_t cx, uint32_t cy)
};
// Define the whole usable region for the multiview
startRegion
(
x
,
y
,
targetCX
*
scale
,
targetCY
*
scale
,
0.0
f
,
targetCXF
,
0.0
f
,
targetCYF
);
startRegion
(
x
,
y
,
targetCX
*
scale
,
targetCY
*
scale
,
0.0
f
,
window
->
fw
,
0.0
f
,
window
->
fh
);
// Change the background color to highlight all sources
drawBox
(
targetCXF
,
targetCYF
,
outerColor
);
drawBox
(
window
->
fw
,
window
->
fh
,
outerColor
);
/* ----------------------------- */
/* draw sources */
...
...
@@ -661,12 +657,8 @@ void OBSProjector::OBSSourceRemoved(void *data, calldata_t *params)
UNUSED_PARAMETER
(
params
);
}
static
int
getSourceByPosition
(
int
x
,
int
y
)
static
int
getSourceByPosition
(
int
x
,
int
y
,
float
ratio
)
{
struct
obs_video_info
ovi
;
obs_get_video_info
(
&
ovi
);
float
ratio
=
float
(
ovi
.
base_width
)
/
float
(
ovi
.
base_height
);
QWidget
*
rec
=
QApplication
::
activeWindow
();
int
cx
=
rec
->
width
();
int
cy
=
rec
->
height
();
...
...
@@ -774,7 +766,7 @@ void OBSProjector::mouseDoubleClickEvent(QMouseEvent *event)
return
;
if
(
event
->
button
()
==
Qt
::
LeftButton
)
{
int
pos
=
getSourceByPosition
(
event
->
x
(),
event
->
y
());
int
pos
=
getSourceByPosition
(
event
->
x
(),
event
->
y
()
,
ratio
);
if
(
pos
<
0
)
return
;
OBSSource
src
=
OBSGetStrongRef
(
multiviewScenes
[
pos
]);
...
...
@@ -800,7 +792,7 @@ void OBSProjector::mousePressEvent(QMouseEvent *event)
return
;
if
(
event
->
button
()
==
Qt
::
LeftButton
)
{
int
pos
=
getSourceByPosition
(
event
->
x
(),
event
->
y
());
int
pos
=
getSourceByPosition
(
event
->
x
(),
event
->
y
()
,
ratio
);
if
(
pos
<
0
)
return
;
OBSSource
src
=
OBSGetStrongRef
(
multiviewScenes
[
pos
]);
...
...
@@ -830,8 +822,9 @@ void OBSProjector::UpdateMultiview()
uint32_t
w
=
ovi
.
base_width
;
uint32_t
h
=
ovi
.
base_height
;
float
fw
=
float
(
w
);
float
fh
=
float
(
h
);
fw
=
float
(
w
);
fh
=
float
(
h
);
ratio
=
fw
/
fh
;
halfCX
=
fw
/
2
;
halfCY
=
fh
/
2
;
hiCX
=
halfCX
-
thicknessx2
;
...
...
UI/window-projector.hpp
浏览文件 @
b3a40515
...
...
@@ -48,11 +48,12 @@ private:
gs_vertbuffer_t
*
rightLine
=
nullptr
;
gs_effect_t
*
solid
=
nullptr
;
gs_eparam_t
*
color
=
nullptr
;
// Multiview position helpers
float
thickness
=
4
;
float
offset
,
thicknessx2
=
thickness
*
2
,
halfCX
,
halfCY
,
sourceX
,
sourceY
,
labelX
,
labelY
,
quarterCX
,
quarterCY
,
hiCX
,
hiCY
,
qiX
,
qiY
,
qiCX
,
qiCY
,
hiScaleX
,
hiScaleY
,
qiScaleX
,
qiScaleY
;
qiScaleY
,
fw
,
fh
,
ratio
;
float
lineLength
=
0.1
f
;
// Rec. ITU-R BT.1848-1 / EBU R 95
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录