aboutsummaryrefslogtreecommitdiff
path: root/src/config.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.hpp')
-rw-r--r--src/config.hpp36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/config.hpp b/src/config.hpp
index 9120394..e7f57e3 100644
--- a/src/config.hpp
+++ b/src/config.hpp
@@ -37,10 +37,24 @@ struct MainConfig {
bool record_cursor = true;
};
-struct StreamingConfig {
- std::string streaming_service;
+struct YoutubeStreamConfig {
+ std::string stream_key;
+};
+
+struct TwitchStreamConfig {
std::string stream_key;
+};
+
+struct CustomStreamConfig {
+ std::string url;
std::string container;
+};
+
+struct StreamingConfig {
+ std::string streaming_service;
+ YoutubeStreamConfig youtube;
+ TwitchStreamConfig twitch;
+ CustomStreamConfig custom;
ConfigHotkey start_recording_hotkey;
};
@@ -351,10 +365,14 @@ static Config read_config(bool &config_empty) {
config.main_config.record_cursor = false;
} else if(key == "streaming.service") {
config.streaming_config.streaming_service.assign(value.str, value.size);
- } else if(key == "streaming.key") {
- config.streaming_config.stream_key.assign(value.str, value.size);
- } else if(key == "streaming.container") {
- config.streaming_config.container.assign(value.str, value.size);
+ } else if(key == "streaming.youtube.key") {
+ config.streaming_config.youtube.stream_key.assign(value.str, value.size);
+ } else if(key == "streaming.twitch.key") {
+ config.streaming_config.twitch.stream_key.assign(value.str, value.size);
+ } else if(key == "streaming.custom.url") {
+ config.streaming_config.custom.url.assign(value.str, value.size);
+ } else if(key == "streaming.custom.container") {
+ config.streaming_config.custom.container.assign(value.str, value.size);
} else if(key == "streaming.start_recording_hotkey") {
std::string value_str(value.str, value.size);
if(sscanf(value_str.c_str(), FORMAT_I64 " " FORMAT_U32, &config.streaming_config.start_recording_hotkey.keysym, &config.streaming_config.start_recording_hotkey.modifiers) != 2) {
@@ -450,8 +468,10 @@ static void save_config(const Config &config) {
fprintf(file, "main.record_cursor %s\n", config.main_config.record_cursor ? "true" : "false");
fprintf(file, "streaming.service %s\n", config.streaming_config.streaming_service.c_str());
- fprintf(file, "streaming.key %s\n", config.streaming_config.stream_key.c_str());
- fprintf(file, "streaming.container %s\n", config.streaming_config.container.c_str());
+ fprintf(file, "streaming.youtube.key %s\n", config.streaming_config.youtube.stream_key.c_str());
+ fprintf(file, "streaming.twitch.key %s\n", config.streaming_config.twitch.stream_key.c_str());
+ fprintf(file, "streaming.custom.url %s\n", config.streaming_config.custom.url.c_str());
+ fprintf(file, "streaming.custom.container %s\n", config.streaming_config.custom.container.c_str());
fprintf(file, "streaming.start_recording_hotkey " FORMAT_I64 " " FORMAT_U32 "\n", config.streaming_config.start_recording_hotkey.keysym, config.streaming_config.start_recording_hotkey.modifiers);
fprintf(file, "record.save_directory %s\n", config.record_config.save_directory.c_str());