Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
b7755e53
O
obs-studio
项目概览
尘离序散
/
obs-studio
与 Fork 源项目一致
从无法访问的项目Fork
通知
30
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obs-studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
b7755e53
编写于
1月 09, 2018
作者:
J
Jim
提交者:
GitHub
1月 09, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1140 from admshao/volume-meters-minus-sixty
UI: Add the -60 volume control marker
上级
a79992ea
9872e4d5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
16 deletion
+14
-16
UI/volume-control.cpp
UI/volume-control.cpp
+13
-16
UI/volume-control.hpp
UI/volume-control.hpp
+1
-0
未找到文件。
UI/volume-control.cpp
浏览文件 @
b7755e53
...
...
@@ -410,6 +410,9 @@ void VolumeMeter::setInputPeakHoldDuration(qreal v)
VolumeMeter
::
VolumeMeter
(
QWidget
*
parent
,
obs_volmeter_t
*
obs_volmeter
)
:
QWidget
(
parent
),
obs_volmeter
(
obs_volmeter
)
{
// Use a font that can be rendered small.
tickFont
=
QFont
(
"Arial"
);
tickFont
.
setPixelSize
(
7
);
// Default meter color settings, they only show if
// there is no stylesheet, do not remove.
backgroundNominalColor
.
setRgb
(
0x26
,
0x7f
,
0x26
);
// Dark green
...
...
@@ -616,31 +619,25 @@ void VolumeMeter::paintTicks(QPainter &painter, int x, int y,
{
qreal
scale
=
width
/
minimumLevel
;
// Use a font that can be rendered small.
QFont
font
=
QFont
(
"Arial"
);
font
.
setPixelSize
(
7
);
painter
.
setFont
(
font
);
painter
.
setFont
(
tickFont
);
painter
.
setPen
(
majorTickColor
);
// Draw major tick lines and numeric indicators.
for
(
int
i
=
0
;
i
>
minimumLevel
;
i
-=
5
)
{
for
(
int
i
=
0
;
i
>
=
minimumLevel
;
i
-=
5
)
{
int
position
=
x
+
width
-
(
i
*
scale
)
-
1
;
char
str
[
5
];
snprintf
(
str
,
sizeof
(
str
),
"%i"
,
i
);
QString
str
=
QString
::
number
(
i
);
if
(
i
==
0
||
i
==
5
)
{
painter
.
drawText
(
position
-
3
,
height
,
QString
(
str
)
);
if
(
i
==
0
||
i
==
-
5
)
{
painter
.
drawText
(
position
-
3
,
height
,
str
);
}
else
{
painter
.
drawText
(
position
-
5
,
height
,
QString
(
str
)
);
painter
.
drawText
(
position
-
5
,
height
,
str
);
}
painter
.
drawLine
(
position
,
y
,
position
,
y
+
2
);
}
// Draw minor tick lines.
painter
.
setPen
(
minorTickColor
);
for
(
int
i
=
0
;
i
>
minimumLevel
;
i
--
)
{
for
(
int
i
=
0
;
i
>
=
minimumLevel
;
i
--
)
{
int
position
=
x
+
width
-
(
i
*
scale
)
-
1
;
if
(
i
%
5
!=
0
)
{
...
...
@@ -810,7 +807,7 @@ void VolumeMeter::paintEvent(QPaintEvent *event)
bool
idle
=
detectIdle
(
ts
);
// Draw the ticks in a off-screen buffer when the widget changes size.
QSize
tickPaintCacheSize
=
QSize
(
width
-
5
,
9
);
QSize
tickPaintCacheSize
=
QSize
(
width
,
9
);
if
(
tickPaintCache
==
NULL
||
tickPaintCache
->
size
()
!=
tickPaintCacheSize
)
{
delete
tickPaintCache
;
...
...
@@ -820,14 +817,14 @@ void VolumeMeter::paintEvent(QPaintEvent *event)
tickPaintCache
->
fill
(
clearColor
);
QPainter
tickPainter
(
tickPaintCache
);
paintTicks
(
tickPainter
,
0
,
0
,
tickPaintCacheSize
.
width
()
,
paintTicks
(
tickPainter
,
6
,
0
,
tickPaintCacheSize
.
width
()
-
6
,
tickPaintCacheSize
.
height
());
tickPainter
.
end
();
}
// Actual painting of the widget starts here.
QPainter
painter
(
this
);
painter
.
drawPixmap
(
5
,
height
-
9
,
*
tickPaintCache
);
painter
.
drawPixmap
(
0
,
height
-
9
,
*
tickPaintCache
);
for
(
int
channelNr
=
0
;
channelNr
<
displayNrAudioChannels
;
channelNr
++
)
{
...
...
UI/volume-control.hpp
浏览文件 @
b7755e53
...
...
@@ -115,6 +115,7 @@ private:
float
displayInputPeakHold
[
MAX_AUDIO_CHANNELS
];
uint64_t
displayInputPeakHoldLastUpdateTime
[
MAX_AUDIO_CHANNELS
];
QFont
tickFont
;
QColor
backgroundNominalColor
;
QColor
backgroundWarningColor
;
QColor
backgroundErrorColor
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录