Mercurial > minori
annotate include/core/config.h @ 226:f784b5b1914c
settings: add library page
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 08 Jan 2024 21:23:00 -0500 |
parents | 53211cb1e7f5 |
children | d030b30526d5 |
rev | line source |
---|---|
9 | 1 #ifndef __core__config_h |
2 #define __core__config_h | |
85 | 3 |
9 | 4 #include "core/anime.h" |
102 | 5 #include "gui/theme.h" |
108 | 6 #include "gui/locale.h" |
147
6fdf0632c003
track: use a bit of a more sane way to manage recognition
Paper <mrpapersonic@gmail.com>
parents:
120
diff
changeset
|
7 |
6fdf0632c003
track: use a bit of a more sane way to manage recognition
Paper <mrpapersonic@gmail.com>
parents:
120
diff
changeset
|
8 #include "animia/player.h" |
6fdf0632c003
track: use a bit of a more sane way to manage recognition
Paper <mrpapersonic@gmail.com>
parents:
120
diff
changeset
|
9 |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
116
diff
changeset
|
10 #include <string> |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
116
diff
changeset
|
11 #include <vector> |
226 | 12 #include <set> |
147
6fdf0632c003
track: use a bit of a more sane way to manage recognition
Paper <mrpapersonic@gmail.com>
parents:
120
diff
changeset
|
13 #include <utility> |
9 | 14 |
150
ffa535b6d630
*: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents:
149
diff
changeset
|
15 struct MediaPlayer { |
ffa535b6d630
*: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents:
149
diff
changeset
|
16 bool enabled = true; |
ffa535b6d630
*: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents:
149
diff
changeset
|
17 animia::Player player; |
ffa535b6d630
*: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents:
149
diff
changeset
|
18 }; |
ffa535b6d630
*: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents:
149
diff
changeset
|
19 |
9 | 20 class Config { |
21 public: | |
22 int Load(); | |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
116
diff
changeset
|
23 int Save() const; |
9 | 24 |
25 Anime::Services service; | |
102 | 26 Theme::Theme theme; |
108 | 27 Locale::Locale locale; |
9 | 28 |
29 struct { | |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
30 Anime::TitleLanguage language; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
31 Anime::ScoreFormat score_format; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
32 bool display_aired_episodes; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
33 bool display_available_episodes; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
34 bool highlight_anime_if_available; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
35 bool highlighted_anime_above_others; |
9 | 36 } anime_list; |
37 | |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
38 /* these should preferably be in an |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
39 "auth" struct... */ |
9 | 40 struct { |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
41 struct { |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
42 std::string auth_token; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
43 std::string username; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
44 int user_id; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
45 } anilist; |
120 | 46 } auth; |
47 | |
48 struct { | |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
49 bool detect_media_players; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
50 std::vector<MediaPlayer> players; |
120 | 51 } recognition; |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
52 |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
53 struct { |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
54 std::string feed_link; |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
55 } torrents; |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
56 |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
57 struct { |
226 | 58 bool real_time_monitor; |
59 std::set<std::string> paths; | |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
60 } library; |
9 | 61 }; |
11 | 62 |
114
ab191e28e69d
*: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
108
diff
changeset
|
63 #if (defined(WIN32) || defined(MACOSX)) |
189 | 64 constexpr std::string_view CONFIG_DIR = "Minori"; |
114
ab191e28e69d
*: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
108
diff
changeset
|
65 #else |
189 | 66 constexpr std::string_view CONFIG_DIR = "minori"; |
114
ab191e28e69d
*: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
108
diff
changeset
|
67 #endif |
ab191e28e69d
*: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
108
diff
changeset
|
68 |
189 | 69 constexpr std::string_view CONFIG_NAME = "config.ini"; |
85 | 70 |
9 | 71 #endif // __core__config_h |