aboutsummaryrefslogtreecommitdiff
path: root/include/Config.hpp
blob: d7f0923d77b41e0c091d0f05c586bbf4951805c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

#pragma once

#include "Utils.hpp"
#include <stdint.h>

namespace gsr {
    struct ConfigHotkey {
        int64_t keysym = 0;
        uint32_t modifiers = 0;
    };

    struct MainConfig {
        std::string record_area_option;
        int32_t record_area_width = 0;
        int32_t record_area_height = 0;
        int32_t fps = 60;
        bool merge_audio_tracks = true;
        std::vector<std::string> audio_input;
        std::string color_range;
        std::string quality;
        std::string video_codec;
        std::string audio_codec;
        std::string framerate_mode;
        bool advanced_view = false;
        bool overclock = false;
        bool show_recording_started_notifications = false;
        bool show_recording_stopped_notifications = false;
        bool show_recording_saved_notifications = true;
        bool record_cursor = true;
        bool hide_window_when_recording = false;
        bool software_encoding_warning_shown = false;
        bool restore_portal_session = true;
    };

    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_stop_recording_hotkey;
    };

    struct RecordConfig {
        std::string save_directory;
        std::string container;
        ConfigHotkey start_stop_recording_hotkey;
        ConfigHotkey pause_unpause_recording_hotkey;
    };

    struct ReplayConfig {
        std::string save_directory;
        std::string container;
        int32_t replay_time = 30;
        ConfigHotkey start_stop_recording_hotkey;
        ConfigHotkey save_recording_hotkey;
    };

    struct Config {
        MainConfig main_config;
        StreamingConfig streaming_config;
        RecordConfig record_config;
        ReplayConfig replay_config;
    };

    Config read_config(bool &config_empty);
    void save_config(Config &config);
}