aboutsummaryrefslogtreecommitdiff
path: root/include/Config.hpp
blob: 68e44624b0479678b94522c12281f5ea3744413b (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#pragma once

#include <string>
#include <vector>

namespace QuickMedia {
    struct SearchConfig {
        int font_size = 16;
    };

    struct TabConfig {
        int font_size = 16;
    };

    struct BodyConfig {
        int title_font_size = 16;
        int author_font_size = 14;
        int description_font_size = 14;
        int timestamp_font_size = 10;
        int reaction_font_size = 14;
        int progress_font_size = 14;
        int replies_font_size = 14;
        int embedded_load_font_size = 14;
        int loading_text_font_size = 30;
    };

    struct InputConfig {
        int font_size = 16;
    };

    struct AnimationConfig {
        float move_speed = 30.0f;
        float loading_icon_speed = 400.0;
    };

    struct VideoConfig {
        int max_height = 0;
    };

    struct LocalMangaConfig {
        std::string directory;
        bool sort_by_name = false;
        bool sort_chapters_by_name = false;
    };

    struct LocalAnimeConfig {
        std::string directory;
        bool sort_by_name = false; // Series
        bool sort_episodes_by_name = true;
        bool auto_group_episodes = true;
    };

    struct YoutubeSponsorblock {
        bool enable = false;
        std::string api_endpoint = "https://sponsor.ajay.app";
        int min_votes = 0;
    };

    struct YoutubeConfig {
        bool load_progress = true;
        std::string invidious_instance;
        YoutubeSponsorblock sponsorblock;
    };

    struct MatrixConfig {
        std::vector<std::string> known_homeservers;
        std::string gpg_user_id;
        int room_name_font_size = 18;
        int room_description_font_size = 12;
        bool send_read_receipts = true;
        bool send_typing_notifications = true;
        bool appear_online = true;
        bool clear_message_on_escape = true;
    };

    struct PeertubeConfig {
        std::vector<std::string> known_instances;
    };

    struct DownloadConfig {
        std::string video_directory;
        std::string image_directory;
        std::string music_directory;
        std::string file_directory;
    };

    struct FontScaleConfig {
        float latin = 1.0f;
        float latin_bold = 1.0f;
        float latin_monospace = 1.0f;
        float cjk = 1.0f;
        float symbols = 1.0f;
    };

    struct FontConfig {
        std::string latin;
        std::string latin_bold;
        std::string latin_monospace;
        std::string cjk;
        std::string symbols;
        FontScaleConfig scale;
    };

    struct MangadexConfig {
        bool allow_hentai = false;
    };

    struct FileManagerConfig {
        bool grid_view = true;
    };

    struct Config {
        Config() = default;
        Config(const Config&) = delete;
        Config&operator=(const Config&) = delete;

        SearchConfig search;
        TabConfig tab;
        BodyConfig body;
        InputConfig input;
        AnimationConfig animation;
        VideoConfig video;
        LocalMangaConfig local_manga;
        LocalAnimeConfig local_anime;
        YoutubeConfig youtube;
        MatrixConfig matrix;
        PeertubeConfig peertube;
        DownloadConfig download;
        FontConfig font;
        MangadexConfig mangadex;
        FileManagerConfig file_manager;
        bool use_system_fonts = false;
        bool use_system_mpv_config = false;
        bool enable_shaders = true;
        std::string theme = "default";
        float scale = 1.0f;
        float font_scale = 1.0f;
        float spacing_scale = 1.0f;
        bool low_latency_mode = false;
    };

    const Config& get_config();
}