aboutsummaryrefslogtreecommitdiff
path: root/src/Config.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-10-27 13:09:06 +0100
committerdec05eba <dec05eba@protonmail.com>2024-10-27 13:09:06 +0100
commit59dfd87c21026ef4dc713c3e0648cfa89d534557 (patch)
tree6f2f5242eb9efdcb18f0150c59cb43bd1a348773 /src/Config.cpp
parent28c437e90a3ad4660f44da8b8bf07008032d2bba (diff)
Add hotkeys for replay and streaming, finish everything
Diffstat (limited to 'src/Config.cpp')
-rw-r--r--src/Config.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/Config.cpp b/src/Config.cpp
index 0e256a9..4f68fa1 100644
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -1,5 +1,6 @@
#include "../include/Config.hpp"
#include "../include/Utils.hpp"
+#include "../include/GsrInfo.hpp"
#include <variant>
#include <limits.h>
#include <inttypes.h>
@@ -12,11 +13,23 @@
#define CONFIG_FILE_VERSION 1
namespace gsr {
- Config::Config() {
+ Config::Config(const GsrInfo &gsr_info) {
const std::string default_save_directory = get_videos_dir();
+
streaming_config.record_options.video_quality = "custom";
+ streaming_config.record_options.audio_tracks.push_back("default_output");
+
record_config.save_directory = default_save_directory;
+ record_config.record_options.audio_tracks.push_back("default_output");
+
replay_config.save_directory = default_save_directory;
+ replay_config.record_options.audio_tracks.push_back("default_output");
+
+ if(!gsr_info.supported_capture_options.monitors.empty()) {
+ streaming_config.record_options.record_area_option = gsr_info.supported_capture_options.monitors.front().name;
+ record_config.record_options.record_area_option = gsr_info.supported_capture_options.monitors.front().name;
+ replay_config.record_options.record_area_option = gsr_info.supported_capture_options.monitors.front().name;
+ }
}
static std::optional<KeyValue> parse_key_value(std::string_view line) {
@@ -117,7 +130,7 @@ namespace gsr {
};
}
- std::optional<Config> read_config() {
+ std::optional<Config> read_config(const GsrInfo &gsr_info) {
std::optional<Config> config;
const std::string config_path = get_config_dir() + "/config_ui";
@@ -127,7 +140,11 @@ namespace gsr {
return config;
}
- config = Config();
+ config = Config(gsr_info);
+ config->streaming_config.record_options.audio_tracks.clear();
+ config->record_config.record_options.audio_tracks.clear();
+ config->replay_config.record_options.audio_tracks.clear();
+
auto config_options = get_config_options(config.value());
string_split_char(file_content, '\n', [&](std::string_view line) {