Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
2933b897
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,发现更多精彩内容 >>
未验证
提交
2933b897
编写于
5月 15, 2017
作者:
R
Richard Stanway
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UI: Add support for showing output error messages
上级
8bd76237
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
10 deletion
+25
-10
UI/window-basic-main-outputs.cpp
UI/window-basic-main-outputs.cpp
+4
-1
UI/window-basic-main.cpp
UI/window-basic-main.cpp
+20
-8
UI/window-basic-main.hpp
UI/window-basic-main.hpp
+1
-1
未找到文件。
UI/window-basic-main-outputs.cpp
浏览文件 @
2933b897
...
...
@@ -48,11 +48,14 @@ static void OBSStopStreaming(void *data, calldata_t *params)
{
BasicOutputHandler
*
output
=
static_cast
<
BasicOutputHandler
*>
(
data
);
int
code
=
(
int
)
calldata_int
(
params
,
"code"
);
const
char
*
last_error
=
calldata_string
(
params
,
"last_error"
);
QString
arg_last_error
=
QString
::
fromUtf8
(
last_error
);
output
->
streamingActive
=
false
;
output
->
delayActive
=
false
;
QMetaObject
::
invokeMethod
(
output
->
main
,
"StreamingStop"
,
Q_ARG
(
int
,
code
));
"StreamingStop"
,
Q_ARG
(
int
,
code
)
,
Q_ARG
(
QString
,
arg_last_error
)
);
}
static
void
OBSStartRecording
(
void
*
data
,
calldata_t
*
params
)
...
...
UI/window-basic-main.cpp
浏览文件 @
2933b897
...
...
@@ -32,6 +32,7 @@
#include <util/util.hpp>
#include <util/platform.h>
#include <util/profiler.hpp>
#include <util/dstr.hpp>
#include <graphics/math-defs.h>
#include "obs-app.hpp"
...
...
@@ -4164,34 +4165,45 @@ void OBSBasic::StreamStopping()
api
->
on_event
(
OBS_FRONTEND_EVENT_STREAMING_STOPPING
);
}
void
OBSBasic
::
StreamingStop
(
int
code
)
void
OBSBasic
::
StreamingStop
(
int
code
,
QString
last_error
)
{
const
char
*
errorMessage
;
const
char
*
errorDescription
;
DStr
errorMessage
;
bool
use_last_error
=
false
;
switch
(
code
)
{
case
OBS_OUTPUT_BAD_PATH
:
error
Message
=
Str
(
"Output.ConnectFail.BadPath"
);
error
Description
=
Str
(
"Output.ConnectFail.BadPath"
);
break
;
case
OBS_OUTPUT_CONNECT_FAILED
:
errorMessage
=
Str
(
"Output.ConnectFail.ConnectFailed"
);
use_last_error
=
true
;
errorDescription
=
Str
(
"Output.ConnectFail.ConnectFailed"
);
break
;
case
OBS_OUTPUT_INVALID_STREAM
:
error
Message
=
Str
(
"Output.ConnectFail.InvalidStream"
);
error
Description
=
Str
(
"Output.ConnectFail.InvalidStream"
);
break
;
default:
case
OBS_OUTPUT_ERROR
:
errorMessage
=
Str
(
"Output.ConnectFail.Error"
);
use_last_error
=
true
;
errorDescription
=
Str
(
"Output.ConnectFail.Error"
);
break
;
case
OBS_OUTPUT_DISCONNECTED
:
/* doesn't happen if output is set to reconnect. note that
* reconnects are handled in the output, not in the UI */
errorMessage
=
Str
(
"Output.ConnectFail.Disconnected"
);
use_last_error
=
true
;
errorDescription
=
Str
(
"Output.ConnectFail.Disconnected"
);
}
if
(
use_last_error
&&
!
last_error
.
isEmpty
())
dstr_printf
(
errorMessage
,
"%s
\n\n
%s"
,
errorDescription
,
QT_TO_UTF8
(
last_error
));
else
dstr_copy
(
errorMessage
,
errorDescription
);
ui
->
statusbar
->
StreamStopped
();
ui
->
streamButton
->
setText
(
QTStr
(
"Basic.Main.StartStreaming"
));
...
...
@@ -4215,7 +4227,7 @@ void OBSBasic::StreamingStop(int code)
QTStr
(
"Output.ConnectFail.Title"
),
QT_UTF8
(
errorMessage
));
}
else
if
(
code
!=
OBS_OUTPUT_SUCCESS
&&
!
isVisible
())
{
SysTrayNotify
(
QT_UTF8
(
error
Message
),
QSystemTrayIcon
::
Warning
);
SysTrayNotify
(
QT_UTF8
(
error
Description
),
QSystemTrayIcon
::
Warning
);
}
if
(
!
startStreamMenu
.
isNull
())
{
...
...
UI/window-basic-main.hpp
浏览文件 @
2933b897
...
...
@@ -363,7 +363,7 @@ public slots:
void
StreamingStart
();
void
StreamStopping
();
void
StreamingStop
(
int
errorcode
);
void
StreamingStop
(
int
errorcode
,
QString
last_error
);
void
StartRecording
();
void
StopRecording
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录