Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
369d95df
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,发现更多精彩内容 >>
提交
369d95df
编写于
5月 02, 2015
作者:
P
Palana
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UI: Add OBSSourceLabel
上级
b33be9fc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
96 addition
and
0 deletion
+96
-0
obs/CMakeLists.txt
obs/CMakeLists.txt
+2
-0
obs/source-label.cpp
obs/source-label.cpp
+44
-0
obs/source-label.hpp
obs/source-label.hpp
+50
-0
未找到文件。
obs/CMakeLists.txt
浏览文件 @
369d95df
...
...
@@ -118,6 +118,7 @@ set(obs_SOURCES
source-list-widget.cpp
crash-report.cpp
hotkey-edit.cpp
source-label.cpp
qt-wrappers.cpp
)
set
(
obs_HEADERS
...
...
@@ -155,6 +156,7 @@ set(obs_HEADERS
qt-display.hpp
crash-report.hpp
hotkey-edit.hpp
source-label.hpp
qt-wrappers.hpp
)
set
(
obs_UI
...
...
obs/source-label.cpp
0 → 100644
浏览文件 @
369d95df
/******************************************************************************
Copyright (C) 2015 by Ruwen Hahn <palana@stunned.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#include "source-label.hpp"
void
OBSSourceLabel
::
SourceRenamed
(
void
*
data
,
calldata_t
*
params
)
{
auto
&
label
=
*
static_cast
<
OBSSourceLabel
*>
(
data
);
const
char
*
name
=
calldata_string
(
params
,
"new_name"
);
label
.
setText
(
name
);
emit
label
.
Renamed
(
name
);
}
void
OBSSourceLabel
::
SourceRemoved
(
void
*
data
,
calldata_t
*
)
{
auto
&
label
=
*
static_cast
<
OBSSourceLabel
*>
(
data
);
emit
label
.
Removed
();
}
void
OBSSourceLabel
::
SourceDestroyed
(
void
*
data
,
calldata_t
*
)
{
auto
&
label
=
*
static_cast
<
OBSSourceLabel
*>
(
data
);
emit
label
.
Destroyed
();
label
.
destroyedSignal
.
Disconnect
();
label
.
removedSignal
.
Disconnect
();
label
.
renamedSignal
.
Disconnect
();
}
obs/source-label.hpp
0 → 100644
浏览文件 @
369d95df
/******************************************************************************
Copyright (C) 2015 by Ruwen Hahn <palana@stunned.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#include <QLabel>
#include <obs.hpp>
class
OBSSourceLabel
:
public
QLabel
{
Q_OBJECT
;
public:
OBSSignal
renamedSignal
;
OBSSignal
removedSignal
;
OBSSignal
destroyedSignal
;
OBSSourceLabel
(
const
obs_source_t
*
source
,
QWidget
*
parent
=
nullptr
,
Qt
::
WindowFlags
f
=
0
)
:
QLabel
(
obs_source_get_name
(
source
),
parent
,
f
),
renamedSignal
(
obs_source_get_signal_handler
(
source
),
"rename"
,
&
OBSSourceLabel
::
SourceRenamed
,
this
),
removedSignal
(
obs_source_get_signal_handler
(
source
),
"remove"
,
&
OBSSourceLabel
::
SourceRemoved
,
this
),
destroyedSignal
(
obs_source_get_signal_handler
(
source
),
"destroy"
,
&
OBSSourceLabel
::
SourceDestroyed
,
this
)
{}
protected:
static
void
SourceRenamed
(
void
*
data
,
calldata_t
*
params
);
static
void
SourceRemoved
(
void
*
data
,
calldata_t
*
params
);
static
void
SourceDestroyed
(
void
*
data
,
calldata_t
*
params
);
signals:
void
Renamed
(
const
char
*
name
);
void
Removed
();
void
Destroyed
();
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录