view include/gui/pages/now_playing.h @ 266:1a6a5d3a94cd

dep/animone: make bsd.cc and x11.cc actually work apparently I broke these, and even now the x11 code *still* doesn't want to work correctly (at least on FreeBSD). half of the PID response codes are just 0 or the PID for the X server itself... wtf? maybe dwm just doesn't support the XRes extension, or I'm just stupid. i don't know.
author Paper <paper@paper.us.eu.org>
date Thu, 11 Apr 2024 22:05:41 -0400
parents 3ec7804abf17
children 6b0768158dcd
line wrap: on
line source

#ifndef MINORI_GUI_PAGES_NOW_PLAYING_H_
#define MINORI_GUI_PAGES_NOW_PLAYING_H_

#include "gui/widgets/anime_info.h"
#include "gui/widgets/poster.h"
#include "gui/widgets/text.h"

#include <QFrame>
#include <memory>
#include <unordered_map>

class QStackedWidget;

namespace Anime {
class Anime;
}

namespace anitomy {
class Elements;
}

namespace NowPlayingPages {

class Default : public QWidget {
	Q_OBJECT

public:
	Default(QWidget* parent = nullptr);
};

class Playing : public QWidget {
	Q_OBJECT

public:
	Playing(QWidget* parent = nullptr);
	void SetPlayingAnime(const Anime::Anime& anime, const anitomy::Elements& info);
	int GetPlayingAnime();

private:
	int _id = 0;
	int _episode = 0;
	std::unique_ptr<QWidget> _main = nullptr;
	std::unique_ptr<TextWidgets::Title> _title = nullptr;
	std::unique_ptr<AnimeInfoWidget> _info = nullptr;
	std::unique_ptr<QWidget> _sidebar = nullptr;
	std::unique_ptr<Poster> _poster = nullptr;
};

} // namespace NowPlayingPages

class NowPlayingPage final : public QFrame {
	Q_OBJECT

public:
	NowPlayingPage(QWidget* parent = nullptr);
	void SetDefault();
	void SetPlaying(const Anime::Anime& anime, const anitomy::Elements& episodes);
	int GetPlayingId();

private:
	QStackedWidget* stack;
};

#endif // MINORI_GUI_PAGES_NOW_PLAYING_H_