diff include/gui/pages/now_playing.h @ 375:abd956418fe9

gui/pages/now_playing: automatically update progress when the episode is "finished"
author Paper <paper@tflc.us>
date Fri, 25 Jul 2025 11:22:55 -0400
parents 6b0768158dcd
children
line wrap: on
line diff
--- a/include/gui/pages/now_playing.h	Fri Jul 25 11:03:34 2025 -0400
+++ b/include/gui/pages/now_playing.h	Fri Jul 25 11:22:55 2025 -0400
@@ -8,6 +8,7 @@
 
 #include <QFrame>
 #include <QStackedWidget>
+#include <QTimer>
 
 #include <memory>
 #include <unordered_map>
@@ -22,7 +23,7 @@
 }
 
 /* -------------------------------------------------------------- */
-/* separate pages */
+/* this is kinda ugly. */
 
 namespace NowPlayingPages {
 
@@ -43,6 +44,7 @@
 	Playing(QWidget* parent = nullptr);
 	void SetPlayingAnime(const Anime::Anime& anime, const anitomy::Elements& info);
 	int GetPlayingAnime();
+	int GetPlayingEpisode();
 
 private:
 	int _id = 0;
@@ -70,6 +72,9 @@
 	void SetPlaying(const Anime::Anime& anime, const anitomy::Elements& episodes);
 	int GetPlayingId();
 
+private slots:
+	void TimerDone();
+
 private:
 	enum class Subpages {
 		Default = 0,
@@ -77,6 +82,7 @@
 	};
 
 	QStackedWidget stack_;
+	QTimer timer_;
 
 	NowPlayingPages::Default default_;
 	NowPlayingPages::Playing playing_;