Mercurial > minori
annotate include/gui/pages/now_playing.h @ 250:c130f47f6f48
*: many many changes
e.g. the search page is actually implemented now!
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Sun, 04 Feb 2024 21:17:17 -0500 |
parents | 4d461ef7d424 |
children | 862d0d8619f6 |
rev | line source |
---|---|
9 | 1 #ifndef __gui__pages__now_playing_h |
2 #define __gui__pages__now_playing_h | |
85 | 3 |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
4 #include "gui/widgets/anime_info.h" |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
5 #include "gui/widgets/poster.h" |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
6 #include "gui/widgets/text.h" |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
7 |
64 | 8 #include <QFrame> |
80 | 9 #include <unordered_map> |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
10 #include <memory> |
2 | 11 |
64 | 12 class QStackedWidget; |
85 | 13 |
83 | 14 namespace Anime { |
15 class Anime; | |
16 } | |
64 | 17 |
154 | 18 namespace anitomy { |
19 class Elements; | |
20 } | |
21 | |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
22 namespace NowPlayingPages { |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
23 |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
24 class Default : public QWidget { |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
25 Q_OBJECT |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
26 |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
27 public: |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
28 Default(QWidget* parent = nullptr); |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
29 }; |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
30 |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
31 class Playing : public QWidget { |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
32 Q_OBJECT |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
33 |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
34 public: |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
35 Playing(QWidget* parent = nullptr); |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
36 void SetPlayingAnime(const Anime::Anime& anime, const anitomy::Elements& info); |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
37 int GetPlayingAnime(); |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
38 |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
39 private: |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
40 int _id = 0; |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
41 int _episode = 0; |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
42 std::unique_ptr<QWidget> _main = nullptr; |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
43 std::unique_ptr<TextWidgets::Title> _title = nullptr; |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
44 std::unique_ptr<AnimeInfoWidget> _info = nullptr; |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
45 std::unique_ptr<QWidget> _sidebar = nullptr; |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
46 std::unique_ptr<Poster> _poster = nullptr; |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
47 }; |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
48 |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
49 } |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
50 |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
85
diff
changeset
|
51 class NowPlayingPage final : public QFrame { |
9 | 52 Q_OBJECT |
7 | 53 |
2 | 54 public: |
64 | 55 NowPlayingPage(QWidget* parent = nullptr); |
56 void SetDefault(); | |
154 | 57 void SetPlaying(const Anime::Anime& anime, const anitomy::Elements& episodes); |
69 | 58 int GetPlayingId(); |
64 | 59 |
60 private: | |
61 QStackedWidget* stack; | |
2 | 62 }; |
63 | |
9 | 64 #endif // __gui__pages__now_playing_h |