提交 3bd4fe54 编写于 作者: J jp9000

UI: Add command line opts to start streaming/recording

These command line options allow the user to start streaming/recording
on program startup.
上级 b52c4f96
...@@ -57,6 +57,8 @@ static string currentLogFile; ...@@ -57,6 +57,8 @@ static string currentLogFile;
static string lastLogFile; static string lastLogFile;
static bool portable_mode = false; static bool portable_mode = false;
bool opt_start_streaming = false;
bool opt_start_recording = false;
string opt_starting_scene; string opt_starting_scene;
QObject *CreateShortcutFilter() QObject *CreateShortcutFilter()
...@@ -1555,6 +1557,12 @@ int main(int argc, char *argv[]) ...@@ -1555,6 +1557,12 @@ int main(int argc, char *argv[])
if (arg_is(argv[i], "--portable", "-p")) { if (arg_is(argv[i], "--portable", "-p")) {
portable_mode = true; portable_mode = true;
} else if (arg_is(argv[i], "--startstreaming", nullptr)) {
opt_start_streaming = true;
} else if (arg_is(argv[i], "--startrecording", nullptr)) {
opt_start_recording = true;
} else if (arg_is(argv[i], "--scene", nullptr)) { } else if (arg_is(argv[i], "--scene", nullptr)) {
if (++i < argc) opt_starting_scene = argv[i]; if (++i < argc) opt_starting_scene = argv[i];
} }
......
...@@ -154,4 +154,6 @@ static inline int GetProfilePath(char *path, size_t size, const char *file) ...@@ -154,4 +154,6 @@ static inline int GetProfilePath(char *path, size_t size, const char *file)
return window->GetProfilePath(path, size, file); return window->GetProfilePath(path, size, file);
} }
extern bool opt_start_streaming;
extern bool opt_start_recording;
extern std::string opt_starting_scene; extern std::string opt_starting_scene;
...@@ -598,6 +598,18 @@ retryScene: ...@@ -598,6 +598,18 @@ retryScene:
if (!opt_starting_scene.empty()) if (!opt_starting_scene.empty())
opt_starting_scene.clear(); opt_starting_scene.clear();
if (opt_start_streaming) {
QMetaObject::invokeMethod(this, "StartStreaming",
Qt::QueuedConnection);
opt_start_streaming = false;
}
if (opt_start_recording) {
QMetaObject::invokeMethod(this, "StartRecording",
Qt::QueuedConnection);
opt_start_recording = false;
}
disableSaving--; disableSaving--;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册