Mercurial > minori
annotate include/core/config.h @ 147:6fdf0632c003
track: use a bit of a more sane way to manage recognition
it also works with the new animia API
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Tue, 14 Nov 2023 13:19:40 -0500 |
parents | 275da698697d |
children | e41505d24733 |
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> |
147
6fdf0632c003
track: use a bit of a more sane way to manage recognition
Paper <mrpapersonic@gmail.com>
parents:
120
diff
changeset
|
12 #include <utility> |
9 | 13 |
14 class Config { | |
15 public: | |
16 int Load(); | |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
116
diff
changeset
|
17 int Save() const; |
9 | 18 |
19 Anime::Services service; | |
102 | 20 Theme::Theme theme; |
108 | 21 Locale::Locale locale; |
9 | 22 |
23 struct { | |
24 public: | |
25 Anime::TitleLanguage language; | |
26 bool display_aired_episodes; | |
27 bool display_available_episodes; | |
28 bool highlight_anime_if_available; | |
29 bool highlighted_anime_above_others; | |
30 } anime_list; | |
31 | |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
32 /* these should preferably be in an |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
33 "auth" struct... */ |
9 | 34 struct { |
35 public: | |
120 | 36 struct { |
37 public: | |
38 std::string auth_token; | |
39 std::string username; | |
40 int user_id; | |
41 } anilist; | |
42 } auth; | |
43 | |
44 struct { | |
45 public: | |
46 bool detect_media_players; | |
147
6fdf0632c003
track: use a bit of a more sane way to manage recognition
Paper <mrpapersonic@gmail.com>
parents:
120
diff
changeset
|
47 std::vector<std::pair<bool, animia::Player>> players; |
120 | 48 } recognition; |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
49 |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
50 struct { |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
51 public: |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
52 std::string feed_link; |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
53 } torrents; |
9 | 54 }; |
11 | 55 |
102 | 56 #define WIDEIFY_EX(x) L##x |
57 #define WIDEIFY(x) WIDEIFY_EX(x) | |
114
ab191e28e69d
*: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
108
diff
changeset
|
58 |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
59 /* only on these platforms keep this uppercase. |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
60 this will not remove compatibility with older |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
61 versions, since these platforms are case insensitive |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
62 (on macOS, only by default) */ |
114
ab191e28e69d
*: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
108
diff
changeset
|
63 #if (defined(WIN32) || defined(MACOSX)) |
ab191e28e69d
*: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
108
diff
changeset
|
64 #define CONFIG_DIR "Minori" |
ab191e28e69d
*: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
108
diff
changeset
|
65 #else |
63 | 66 #define 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 |
102 | 69 #define CONFIG_WDIR WIDEIFY(CONFIG_DIR) |
101
c537996cf67b
*: multitude of config changes
Paper <mrpapersonic@gmail.com>
parents:
85
diff
changeset
|
70 #define CONFIG_NAME "config.ini" |
102 | 71 #define CONFIG_WNAME WIDEIFY(CONFIG_NAME) |
62 | 72 |
9 | 73 #define MAX_LINE_LENGTH 256 |
85 | 74 |
9 | 75 #endif // __core__config_h |