#ifndef SRC_UI_NOW_PLAYING_WIDGET_HPP_
#define SRC_UI_NOW_PLAYING_WIDGET_HPP_

#include <QWidget>
#include <QTimer>
#include "src/polyfill/process.hpp"
#include "src/core/filesystem.hpp"
#include "src/rhdc/core/layout.hpp"
#include "src/rhdc/ui/star-display-widget.hpp"

namespace Ui {
	class NowPlayingWidget;
}

class NowPlayingWidget : public QWidget {
	Q_OBJECT

	private:
	Ui::NowPlayingWidget *const m_ui;
	AsyncProcess *const m_process;
	StarDisplayWidget *m_starDisplay;
	QTimer m_timer;
	const int64 m_pastPlayTime;
	const int64 m_startTime;

	public:
	explicit NowPlayingWidget(
		QWidget *parent,
		AsyncProcess *process,
		const fs::path &romPath,
		const string &sha1,
		int64 pastPlayTime,
		const StarLayout *layoutOverride = nullptr,
		bool *shouldReloadPtr = nullptr
	);
	virtual ~NowPlayingWidget();

	int64 getSessionTime() const;
	inline StarDisplayWidget *starDisplay() noexcept { return m_starDisplay; }

	private slots:
	void killEmulator();
	void updateTimers();

};



#endif /* SRC_UI_NOW_PLAYING_WIDGET_HPP_ */
