Mercurial > minori
annotate include/gui/pages/now_playing.h @ 367:8d45d892be88 default tip
*: instead of pugixml, use Qt XML features
this means we have one extra Qt dependency though...
author | Paper <paper@tflc.us> |
---|---|
date | Sun, 17 Nov 2024 22:55:47 -0500 |
parents | 6b0768158dcd |
children |
rev | line source |
---|---|
261
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
1 #ifndef MINORI_GUI_PAGES_NOW_PLAYING_H_ |
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
2 #define MINORI_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" |
348
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
6 #include "gui/widgets/sidebar.h" |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
7 #include "gui/widgets/text.h" |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
8 |
64 | 9 #include <QFrame> |
348
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
10 #include <QStackedWidget> |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
11 |
258 | 12 #include <memory> |
80 | 13 #include <unordered_map> |
2 | 14 |
85 | 15 |
83 | 16 namespace Anime { |
17 class Anime; | |
18 } | |
64 | 19 |
154 | 20 namespace anitomy { |
21 class Elements; | |
22 } | |
23 | |
348
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
24 /* -------------------------------------------------------------- */ |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
25 /* separate pages */ |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
26 |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
27 namespace NowPlayingPages { |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
28 |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
29 class Default : public QWidget { |
258 | 30 Q_OBJECT |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
31 |
258 | 32 public: |
33 Default(QWidget* parent = nullptr); | |
348
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
34 |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
35 private: |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
36 TextWidgets::Title title_; |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
37 }; |
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 class Playing : public QWidget { |
258 | 40 Q_OBJECT |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
41 |
258 | 42 public: |
43 Playing(QWidget* parent = nullptr); | |
44 void SetPlayingAnime(const Anime::Anime& anime, const anitomy::Elements& info); | |
45 int GetPlayingAnime(); | |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
46 |
258 | 47 private: |
48 int _id = 0; | |
49 int _episode = 0; | |
348
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
50 |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
51 QWidget _main; |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
52 TextWidgets::Title _title; |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
53 AnimeInfoWidget _info; |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
54 |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
55 QWidget _sidebar; |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
56 Poster _poster; |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
57 }; |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
58 |
258 | 59 } // namespace NowPlayingPages |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
60 |
348
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
61 /* -------------------------------------------------------------- */ |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
62 /* the full page */ |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
63 |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
85
diff
changeset
|
64 class NowPlayingPage final : public QFrame { |
258 | 65 Q_OBJECT |
7 | 66 |
258 | 67 public: |
68 NowPlayingPage(QWidget* parent = nullptr); | |
69 void SetDefault(); | |
70 void SetPlaying(const Anime::Anime& anime, const anitomy::Elements& episodes); | |
71 int GetPlayingId(); | |
64 | 72 |
258 | 73 private: |
348
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
74 enum class Subpages { |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
75 Default = 0, |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
76 Playing = 1, |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
77 }; |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
78 |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
79 QStackedWidget stack_; |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
80 |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
81 NowPlayingPages::Default default_; |
6b0768158dcd
text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
82 NowPlayingPages::Playing playing_; |
2 | 83 }; |
84 | |
261
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
85 #endif // MINORI_GUI_PAGES_NOW_PLAYING_H_ |