Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
d3e6148a
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,发现更多精彩内容 >>
提交
d3e6148a
编写于
7月 03, 2014
作者:
J
jp9000
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add auto-reconnect settings
上级
9fc05e2a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
128 addition
and
8 deletion
+128
-8
build/data/obs-studio/locale/en.txt
build/data/obs-studio/locale/en.txt
+5
-2
obs/forms/OBSBasicSettings.ui
obs/forms/OBSBasicSettings.ui
+79
-6
obs/window-basic-main.cpp
obs/window-basic-main.cpp
+17
-0
obs/window-basic-settings.cpp
obs/window-basic-settings.cpp
+25
-0
obs/window-basic-settings.hpp
obs/window-basic-settings.hpp
+2
-0
未找到文件。
build/data/obs-studio/locale/en.txt
浏览文件 @
d3e6148a
...
@@ -170,8 +170,11 @@ Basic.Settings.Output.Mode="Output Mode"
...
@@ -170,8 +170,11 @@ Basic.Settings.Output.Mode="Output Mode"
Basic.Settings.Output.Mode.Simple="Simple (Stream and/or record)"
Basic.Settings.Output.Mode.Simple="Simple (Stream and/or record)"
Basic.Settings.Output.Mode.Advanced="Advanced (Custom output type)"
Basic.Settings.Output.Mode.Advanced="Advanced (Custom output type)"
Basic.Settings.Output.Simple.SavePath="FLV Recording Path"
Basic.Settings.Output.Simple.SavePath="FLV Recording Path"
Basic.Settings.Output.Simple.VideoBitrate="Video Bitrate"
Basic.Settings.Output.VideoBitrate="Video Bitrate"
Basic.Settings.output.Simple.AudioBitrate="Audio Bitrate"
Basic.Settings.Output.AudioBitrate="Audio Bitrate"
Basic.Settings.Output.Reconnect="Automatically Reconnect"
Basic.Settings.Output.RetryDelay="Retry Delay (seconds)"
Basic.Settings.Output.MaxRetries="Maximum Retries"
# basic mode 'video' settings
# basic mode 'video' settings
Basic.Settings.Video="Video"
Basic.Settings.Video="Video"
...
...
obs/forms/OBSBasicSettings.ui
浏览文件 @
d3e6148a
...
@@ -402,7 +402,7 @@
...
@@ -402,7 +402,7 @@
<item
row=
"1"
column=
"0"
>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_19"
>
<widget
class=
"QLabel"
name=
"label_19"
>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Basic.Settings.Output.
Simple.
VideoBitrate
</string>
<string>
Basic.Settings.Output.VideoBitrate
</string>
</property>
</property>
</widget>
</widget>
</item>
</item>
...
@@ -422,7 +422,7 @@
...
@@ -422,7 +422,7 @@
<item
row=
"2"
column=
"0"
>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_20"
>
<widget
class=
"QLabel"
name=
"label_20"
>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Basic.Settings.Output.
Simple.
AudioBitrate
</string>
<string>
Basic.Settings.Output.AudioBitrate
</string>
</property>
</property>
</widget>
</widget>
</item>
</item>
...
@@ -473,6 +473,47 @@
...
@@ -473,6 +473,47 @@
</item>
</item>
</widget>
</widget>
</item>
</item>
<item
row=
"3"
column=
"1"
>
<widget
class=
"QCheckBox"
name=
"simpleOutReconnect"
>
<property
name=
"text"
>
<string>
Basic.Settings.Output.Reconnect
</string>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"4"
column=
"1"
>
<widget
class=
"QSpinBox"
name=
"simpleOutRetryDelay"
>
<property
name=
"maximum"
>
<number>
30
</number>
</property>
</widget>
</item>
<item
row=
"5"
column=
"1"
>
<widget
class=
"QSpinBox"
name=
"simpleOutMaxRetries"
>
<property
name=
"minimum"
>
<number>
1
</number>
</property>
<property
name=
"maximum"
>
<number>
10000
</number>
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_17"
>
<property
name=
"text"
>
<string>
Basic.Settings.Output.RetryDelay
</string>
</property>
</widget>
</item>
<item
row=
"5"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_22"
>
<property
name=
"text"
>
<string>
Basic.Settings.Output.MaxRetries
</string>
</property>
</widget>
</item>
</layout>
</layout>
</widget>
</widget>
</item>
</item>
...
@@ -1021,12 +1062,44 @@
...
@@ -1021,12 +1062,44 @@
<slot>
setCurrentIndex(int)
</slot>
<slot>
setCurrentIndex(int)
</slot>
<hints>
<hints>
<hint
type=
"sourcelabel"
>
<hint
type=
"sourcelabel"
>
<x>
250
</x>
<x>
586
</x>
<y>
3
9
</y>
<y>
3
8
</y>
</hint>
</hint>
<hint
type=
"destinationlabel"
>
<hint
type=
"destinationlabel"
>
<x>
250
</x>
<x>
401
</x>
<y>
39
</y>
<y>
79
</y>
</hint>
</hints>
</connection>
<connection>
<sender>
simpleOutReconnect
</sender>
<signal>
clicked(bool)
</signal>
<receiver>
simpleOutRetryDelay
</receiver>
<slot>
setEnabled(bool)
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
422
</x>
<y>
168
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
420
</x>
<y>
188
</y>
</hint>
</hints>
</connection>
<connection>
<sender>
simpleOutReconnect
</sender>
<signal>
clicked(bool)
</signal>
<receiver>
simpleOutMaxRetries
</receiver>
<slot>
setEnabled(bool)
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
503
</x>
<y>
160
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
501
</x>
<y>
209
</y>
</hint>
</hint>
</hints>
</hints>
</connection>
</connection>
...
...
obs/window-basic-main.cpp
浏览文件 @
d3e6148a
...
@@ -391,6 +391,11 @@ bool OBSBasic::InitBasicConfigDefaults()
...
@@ -391,6 +391,11 @@ bool OBSBasic::InitBasicConfigDefaults()
config_set_default_uint
(
basicConfig
,
"SimpleOutput"
,
"VBitrate"
,
config_set_default_uint
(
basicConfig
,
"SimpleOutput"
,
"VBitrate"
,
2500
);
2500
);
config_set_default_uint
(
basicConfig
,
"SimpleOutput"
,
"ABitrate"
,
128
);
config_set_default_uint
(
basicConfig
,
"SimpleOutput"
,
"ABitrate"
,
128
);
config_set_default_bool
(
basicConfig
,
"SimpleOutput"
,
"Reconnect"
,
true
);
config_set_default_uint
(
basicConfig
,
"SimpleOutput"
,
"RetryDelay"
,
2
);
config_set_default_uint
(
basicConfig
,
"SimpleOutput"
,
"MaxRetries"
,
20
);
config_set_default_uint
(
basicConfig
,
"Video"
,
"BaseCX"
,
cx
);
config_set_default_uint
(
basicConfig
,
"Video"
,
"BaseCX"
,
cx
);
config_set_default_uint
(
basicConfig
,
"Video"
,
"BaseCY"
,
cy
);
config_set_default_uint
(
basicConfig
,
"Video"
,
"BaseCY"
,
cy
);
...
@@ -1758,6 +1763,18 @@ void OBSBasic::on_streamButton_clicked()
...
@@ -1758,6 +1763,18 @@ void OBSBasic::on_streamButton_clicked()
obs_output_set_audio_encoder
(
streamOutput
,
aac
);
obs_output_set_audio_encoder
(
streamOutput
,
aac
);
obs_output_set_service
(
streamOutput
,
service
);
obs_output_set_service
(
streamOutput
,
service
);
bool
reconnect
=
config_get_bool
(
basicConfig
,
"SimpleOutput"
,
"Reconnect"
);
int
retryDelay
=
config_get_uint
(
basicConfig
,
"SimpleOutput"
,
"RetryDelay"
);
int
maxRetries
=
config_get_uint
(
basicConfig
,
"SimpleOutput"
,
"MaxRetries"
);
if
(
!
reconnect
)
maxRetries
=
0
;
obs_output_set_reconnect_settings
(
streamOutput
,
retryDelay
,
maxRetries
);
if
(
obs_output_start
(
streamOutput
))
{
if
(
obs_output_start
(
streamOutput
))
{
activeRefs
++
;
activeRefs
++
;
...
...
obs/window-basic-settings.cpp
浏览文件 @
d3e6148a
...
@@ -110,6 +110,7 @@ void OBSBasicSettings::HookWidget(QWidget *widget, const char *signal,
...
@@ -110,6 +110,7 @@ void OBSBasicSettings::HookWidget(QWidget *widget, const char *signal,
#define COMBO_CHANGED SIGNAL(currentIndexChanged(int))
#define COMBO_CHANGED SIGNAL(currentIndexChanged(int))
#define EDIT_CHANGED SIGNAL(textChanged(const QString &))
#define EDIT_CHANGED SIGNAL(textChanged(const QString &))
#define CBEDIT_CHANGED SIGNAL(editTextChanged(const QString &))
#define CBEDIT_CHANGED SIGNAL(editTextChanged(const QString &))
#define CHECK_CHANGED SIGNAL(clicked(bool))
#define SCROLL_CHANGED SIGNAL(valueChanged(int))
#define SCROLL_CHANGED SIGNAL(valueChanged(int))
#define GENERAL_CHANGED SLOT(GeneralChanged())
#define GENERAL_CHANGED SLOT(GeneralChanged())
...
@@ -146,6 +147,9 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
...
@@ -146,6 +147,9 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
HookWidget
(
ui
->
simpleOutputPath
,
EDIT_CHANGED
,
OUTPUTS_CHANGED
);
HookWidget
(
ui
->
simpleOutputPath
,
EDIT_CHANGED
,
OUTPUTS_CHANGED
);
HookWidget
(
ui
->
simpleOutputVBitrate
,
SCROLL_CHANGED
,
OUTPUTS_CHANGED
);
HookWidget
(
ui
->
simpleOutputVBitrate
,
SCROLL_CHANGED
,
OUTPUTS_CHANGED
);
HookWidget
(
ui
->
simpleOutputABitrate
,
COMBO_CHANGED
,
OUTPUTS_CHANGED
);
HookWidget
(
ui
->
simpleOutputABitrate
,
COMBO_CHANGED
,
OUTPUTS_CHANGED
);
HookWidget
(
ui
->
simpleOutReconnect
,
CHECK_CHANGED
,
OUTPUTS_CHANGED
);
HookWidget
(
ui
->
simpleOutRetryDelay
,
SCROLL_CHANGED
,
OUTPUTS_CHANGED
);
HookWidget
(
ui
->
simpleOutMaxRetries
,
SCROLL_CHANGED
,
OUTPUTS_CHANGED
);
HookWidget
(
ui
->
channelSetup
,
COMBO_CHANGED
,
AUDIO_RESTART
);
HookWidget
(
ui
->
channelSetup
,
COMBO_CHANGED
,
AUDIO_RESTART
);
HookWidget
(
ui
->
sampleRate
,
COMBO_CHANGED
,
AUDIO_RESTART
);
HookWidget
(
ui
->
sampleRate
,
COMBO_CHANGED
,
AUDIO_RESTART
);
HookWidget
(
ui
->
desktopAudioDevice1
,
COMBO_CHANGED
,
AUDIO_CHANGED
);
HookWidget
(
ui
->
desktopAudioDevice1
,
COMBO_CHANGED
,
AUDIO_CHANGED
);
...
@@ -191,6 +195,14 @@ void OBSBasicSettings::SaveComboData(QComboBox *widget, const char *section,
...
@@ -191,6 +195,14 @@ void OBSBasicSettings::SaveComboData(QComboBox *widget, const char *section,
}
}
}
}
void
OBSBasicSettings
::
SaveCheckBox
(
QCheckBox
*
widget
,
const
char
*
section
,
const
char
*
value
)
{
if
(
WidgetChanged
(
widget
))
config_set_bool
(
main
->
Config
(),
section
,
value
,
widget
->
isChecked
());
}
void
OBSBasicSettings
::
SaveEdit
(
QLineEdit
*
widget
,
const
char
*
section
,
void
OBSBasicSettings
::
SaveEdit
(
QLineEdit
*
widget
,
const
char
*
section
,
const
char
*
value
)
const
char
*
value
)
{
{
...
@@ -423,12 +435,22 @@ void OBSBasicSettings::LoadSimpleOutputSettings()
...
@@ -423,12 +435,22 @@ void OBSBasicSettings::LoadSimpleOutputSettings()
"VBitrate"
);
"VBitrate"
);
int
audioBitrate
=
config_get_uint
(
main
->
Config
(),
"SimpleOutput"
,
int
audioBitrate
=
config_get_uint
(
main
->
Config
(),
"SimpleOutput"
,
"ABitrate"
);
"ABitrate"
);
bool
reconnect
=
config_get_bool
(
main
->
Config
(),
"SimpleOutput"
,
"Reconnect"
);
int
retryDelay
=
config_get_uint
(
main
->
Config
(),
"SimpleOutput"
,
"RetryDelay"
);
int
maxRetries
=
config_get_uint
(
main
->
Config
(),
"SimpleOutput"
,
"MaxRetries"
);
ui
->
simpleOutputPath
->
setText
(
path
);
ui
->
simpleOutputPath
->
setText
(
path
);
ui
->
simpleOutputVBitrate
->
setValue
(
videoBitrate
);
ui
->
simpleOutputVBitrate
->
setValue
(
videoBitrate
);
SetComboByName
(
ui
->
simpleOutputABitrate
,
SetComboByName
(
ui
->
simpleOutputABitrate
,
std
::
to_string
(
audioBitrate
).
c_str
());
std
::
to_string
(
audioBitrate
).
c_str
());
ui
->
simpleOutReconnect
->
setChecked
(
reconnect
);
ui
->
simpleOutRetryDelay
->
setValue
(
retryDelay
);
ui
->
simpleOutMaxRetries
->
setValue
(
maxRetries
);
}
}
void
OBSBasicSettings
::
LoadOutputSettings
()
void
OBSBasicSettings
::
LoadOutputSettings
()
...
@@ -598,6 +620,9 @@ void OBSBasicSettings::SaveOutputSettings()
...
@@ -598,6 +620,9 @@ void OBSBasicSettings::SaveOutputSettings()
SaveSpinBox
(
ui
->
simpleOutputVBitrate
,
"SimpleOutput"
,
"VBitrate"
);
SaveSpinBox
(
ui
->
simpleOutputVBitrate
,
"SimpleOutput"
,
"VBitrate"
);
SaveCombo
(
ui
->
simpleOutputABitrate
,
"SimpleOutput"
,
"ABitrate"
);
SaveCombo
(
ui
->
simpleOutputABitrate
,
"SimpleOutput"
,
"ABitrate"
);
SaveEdit
(
ui
->
simpleOutputPath
,
"SimpleOutput"
,
"FilePath"
);
SaveEdit
(
ui
->
simpleOutputPath
,
"SimpleOutput"
,
"FilePath"
);
SaveCheckBox
(
ui
->
simpleOutReconnect
,
"SimpleOutput"
,
"Reconnect"
);
SaveSpinBox
(
ui
->
simpleOutRetryDelay
,
"SimpleOutput"
,
"RetryDelay"
);
SaveSpinBox
(
ui
->
simpleOutMaxRetries
,
"SimpleOutput"
,
"MaxRetries"
);
}
}
void
OBSBasicSettings
::
SaveAudioSettings
()
void
OBSBasicSettings
::
SaveAudioSettings
()
...
...
obs/window-basic-settings.hpp
浏览文件 @
d3e6148a
...
@@ -51,6 +51,8 @@ private:
...
@@ -51,6 +51,8 @@ private:
const
char
*
value
);
const
char
*
value
);
void
SaveComboData
(
QComboBox
*
widget
,
const
char
*
section
,
void
SaveComboData
(
QComboBox
*
widget
,
const
char
*
section
,
const
char
*
value
);
const
char
*
value
);
void
SaveCheckBox
(
QCheckBox
*
widget
,
const
char
*
section
,
const
char
*
value
);
void
SaveEdit
(
QLineEdit
*
widget
,
const
char
*
section
,
void
SaveEdit
(
QLineEdit
*
widget
,
const
char
*
section
,
const
char
*
value
);
const
char
*
value
);
void
SaveSpinBox
(
QSpinBox
*
widget
,
const
char
*
section
,
void
SaveSpinBox
(
QSpinBox
*
widget
,
const
char
*
section
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录