Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
e0135823
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,发现更多精彩内容 >>
提交
e0135823
编写于
2月 16, 2020
作者:
C
Clayton Groeneveld
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UI: Restart program when audio/locale changed
上级
fd244a68
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
48 addition
and
4 deletion
+48
-4
UI/data/locale/en-US.ini
UI/data/locale/en-US.ini
+5
-1
UI/obs-app.cpp
UI/obs-app.cpp
+10
-3
UI/obs-app.hpp
UI/obs-app.hpp
+1
-0
UI/window-basic-main.cpp
UI/window-basic-main.cpp
+11
-0
UI/window-basic-settings.cpp
UI/window-basic-settings.cpp
+20
-0
UI/window-basic-settings.hpp
UI/window-basic-settings.hpp
+1
-0
未找到文件。
UI/data/locale/en-US.ini
浏览文件 @
e0135823
...
...
@@ -1013,4 +1013,8 @@ Importer.AutomaticCollectionText="OBS can automatically find importable scene co
OBSStudio
=
"OBS Studio"
OBSClassic
=
"OBS Classic"
Streamlabs
=
"Streamlabs"
XSplitBroadcaster
=
"XSplit Broadcaster"
\ No newline at end of file
XSplitBroadcaster
=
"XSplit Broadcaster"
# OBS restart
Restart
=
"Restart"
NeedsRestart
=
"OBS Studio needs to be restarted. Do you want to restart now?"
UI/obs-app.cpp
浏览文件 @
e0135823
...
...
@@ -34,6 +34,7 @@
#include <QGuiApplication>
#include <QProxyStyle>
#include <QScreen>
#include <QProcess>
#include "qt-wrappers.hpp"
#include "obs-app.hpp"
...
...
@@ -83,6 +84,8 @@ string opt_starting_scene;
bool
remuxAfterRecord
=
false
;
string
remuxFilename
;
bool
restart
=
false
;
// GPU hint exports for AMD/NVIDIA laptops
#ifdef _MSC_VER
extern
"C"
__declspec
(
dllexport
)
DWORD
NvOptimusEnablement
=
1
;
...
...
@@ -1806,7 +1809,7 @@ static int run_program(fstream &logFile, int argc, char *argv[])
}
if
(
cancel_launch
)
ret
urn
0
;
ret
=
0
;
if
(
!
created_log
)
{
create_log_file
(
logFile
);
...
...
@@ -1844,17 +1847,21 @@ static int run_program(fstream &logFile, int argc, char *argv[])
}
if
(
!
program
.
OBSInit
())
ret
urn
0
;
ret
=
0
;
prof
.
Stop
();
ret
urn
program
.
exec
();
ret
=
program
.
exec
();
}
catch
(
const
char
*
error
)
{
blog
(
LOG_ERROR
,
"%s"
,
error
);
OBSErrorBox
(
nullptr
,
"%s"
,
error
);
}
if
(
restart
)
QProcess
::
startDetached
(
qApp
->
arguments
()[
0
],
qApp
->
arguments
());
return
ret
;
}
...
...
UI/obs-app.hpp
浏览文件 @
e0135823
...
...
@@ -230,3 +230,4 @@ extern bool opt_studio_mode;
extern
bool
opt_allow_opengl
;
extern
bool
opt_always_on_top
;
extern
std
::
string
opt_starting_scene
;
extern
bool
restart
;
UI/window-basic-main.cpp
浏览文件 @
e0135823
...
...
@@ -3882,6 +3882,7 @@ void OBSBasic::closeEvent(QCloseEvent *event)
if
(
button
==
QMessageBox
::
No
)
{
event
->
ignore
();
restart
=
false
;
return
;
}
}
...
...
@@ -4012,6 +4013,16 @@ void OBSBasic::on_action_Settings_triggered()
SystemTray
(
false
);
settings_already_executing
=
false
;
if
(
restart
)
{
QMessageBox
::
StandardButton
button
=
OBSMessageBox
::
question
(
this
,
QTStr
(
"Restart"
),
QTStr
(
"NeedsRestart"
));
if
(
button
==
QMessageBox
::
Yes
)
close
();
else
restart
=
false
;
}
}
void
OBSBasic
::
on_actionAdvAudioProperties_triggered
()
...
...
UI/window-basic-settings.cpp
浏览文件 @
e0135823
...
...
@@ -1248,6 +1248,11 @@ void OBSBasicSettings::LoadGeneralSettings()
ui
->
multiviewLayout
->
setCurrentIndex
(
config_get_int
(
GetGlobalConfig
(),
"BasicWindow"
,
"MultiviewLayout"
));
prevLangIndex
=
ui
->
language
->
currentIndex
();
if
(
obs_video_active
())
ui
->
language
->
setEnabled
(
false
);
loading
=
false
;
}
...
...
@@ -2121,6 +2126,11 @@ void OBSBasicSettings::LoadAudioDevices()
LoadListValues
(
ui
->
desktopAudioDevice2
,
outputs
,
2
);
obs_properties_destroy
(
output_props
);
}
if
(
obs_video_active
())
{
ui
->
sampleRate
->
setEnabled
(
false
);
ui
->
channelSetup
->
setEnabled
(
false
);
}
}
#define NBSP "\xC2\xA0"
...
...
@@ -3514,6 +3524,15 @@ void OBSBasicSettings::SaveSettings()
blog
(
LOG_INFO
,
"Settings changed (%s)"
,
changed
.
c_str
());
blog
(
LOG_INFO
,
MINOR_SEPARATOR
);
}
bool
langChanged
=
(
ui
->
language
->
currentIndex
()
!=
prevLangIndex
);
bool
audioRestart
=
(
ui
->
channelSetup
->
currentIndex
()
!=
channelIndex
||
ui
->
sampleRate
->
currentIndex
()
!=
sampleRateIndex
);
if
(
langChanged
||
audioRestart
)
restart
=
true
;
else
restart
=
false
;
}
bool
OBSBasicSettings
::
QueryChanges
()
...
...
@@ -3535,6 +3554,7 @@ bool OBSBasicSettings::QueryChanges()
if
(
toggleAero
)
SetAeroEnabled
(
!
aeroWasDisabled
);
#endif
restart
=
false
;
}
ClearChanged
();
...
...
UI/window-basic-settings.hpp
浏览文件 @
e0135823
...
...
@@ -234,6 +234,7 @@ private:
void
OnOAuthStreamKeyConnected
();
void
OnAuthConnected
();
QString
lastService
;
int
prevLangIndex
;
private
slots
:
void
UpdateServerList
();
void
UpdateKeyLink
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录