2016-12-14 08:30:54 +00:00
|
|
|
#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();
|
2017-06-01 20:08:44 +00:00
|
|
|
virtual void nextVideo();
|
2016-12-14 08:30:54 +00:00
|
|
|
virtual void renderScreenSaver();
|
|
|
|
virtual bool allowSleep();
|
|
|
|
virtual void update(int deltaTime);
|
2017-06-01 20:08:44 +00:00
|
|
|
virtual bool isScreenSaverActive();
|
|
|
|
|
|
|
|
virtual FileData* getCurrentGame();
|
|
|
|
virtual void launchGame();
|
2016-12-14 08:30:54 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void countVideos();
|
|
|
|
void pickRandomVideo(std::string& path);
|
|
|
|
|
2017-06-01 20:08:44 +00:00
|
|
|
void input(InputConfig* config, Input input);
|
|
|
|
|
2016-12-14 08:30:54 +00:00
|
|
|
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;
|
2017-06-01 20:08:44 +00:00
|
|
|
FileData* mCurrentGame;
|
|
|
|
std::string mGameName;
|
2017-08-02 19:56:33 +00:00
|
|
|
std::string mSystemName;
|
2016-12-14 08:30:54 +00:00
|
|
|
};
|