mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-23 22:55:39 +00:00
40 lines
754 B
C++
40 lines
754 B
C++
#pragma once
|
|
|
|
#include "Window.h"
|
|
|
|
class VideoComponent;
|
|
|
|
// Screensaver implementation for main window
|
|
class SystemScreenSaver : public Window::ScreenSaver
|
|
{
|
|
public:
|
|
SystemScreenSaver(Window* window);
|
|
virtual ~SystemScreenSaver();
|
|
|
|
virtual void startScreenSaver();
|
|
virtual void stopScreenSaver();
|
|
virtual void renderScreenSaver();
|
|
virtual bool allowSleep();
|
|
virtual void update(int deltaTime);
|
|
|
|
private:
|
|
void countVideos();
|
|
void pickRandomVideo(std::string& path);
|
|
|
|
enum STATE {
|
|
STATE_INACTIVE,
|
|
STATE_FADE_OUT_WINDOW,
|
|
STATE_FADE_IN_VIDEO,
|
|
STATE_SCREENSAVER_ACTIVE
|
|
};
|
|
|
|
private:
|
|
bool mCounted;
|
|
unsigned long mVideoCount;
|
|
VideoComponent* mVideoScreensaver;
|
|
Window* mWindow;
|
|
STATE mState;
|
|
float mOpacity;
|
|
int mTimer;
|
|
};
|