ES-DE/es-app/src/SystemScreenSaver.h

74 lines
1.8 KiB
C
Raw Normal View History

// SPDX-License-Identifier: MIT
//
// EmulationStation Desktop Edition
// SystemScreenSaver.h
//
2020-11-10 21:18:20 +00:00
// Screensaver, supporting the following types:
// Dim, black, slideshow, video.
//
#ifndef ES_APP_SYSTEM_SCREEN_SAVER_H
#define ES_APP_SYSTEM_SCREEN_SAVER_H
#include "Window.h"
class ImageComponent;
class Sound;
2017-11-01 22:21:10 +00:00
class VideoComponent;
2020-11-10 21:18:20 +00:00
// Screensaver implementation.
class SystemScreensaver : public Window::Screensaver
{
public:
2020-11-10 21:18:20 +00:00
SystemScreensaver(Window* window);
virtual ~SystemScreensaver();
virtual bool allowSleep();
2020-11-10 21:18:20 +00:00
virtual bool isScreensaverActive();
2020-11-10 21:18:20 +00:00
virtual void startScreensaver(bool generateMediaList);
virtual void stopScreensaver();
virtual void nextGame();
virtual void launchGame();
2020-11-10 21:18:20 +00:00
virtual void renderScreensaver();
virtual void update(int deltaTime);
virtual bool getHasMediaFiles() { return mHasMediaFiles; };
virtual FileData* getCurrentGame() { return mCurrentGame; };
private:
2020-11-10 21:18:20 +00:00
void generateImageList();
void generateVideoList();
void generateCustomImageList();
void pickRandomImage(std::string& path);
void pickRandomVideo(std::string& path);
void pickRandomCustomImage(std::string& path);
enum STATE {
STATE_INACTIVE,
STATE_FADE_OUT_WINDOW,
STATE_FADE_IN_VIDEO,
STATE_SCREENSAVER_ACTIVE
};
2020-11-10 21:18:20 +00:00
std::vector<FileData*> mImageFiles;
std::vector<FileData*> mVideoFiles;
std::vector<std::string> mImageCustomFiles;
bool mHasMediaFiles;
VideoComponent* mVideoScreensaver;
ImageComponent* mImageScreensaver;
Window* mWindow;
STATE mState;
float mOpacity;
int mTimer;
FileData* mCurrentGame;
FileData* mPreviousGame;
2020-11-10 21:18:20 +00:00
std::string mPreviousCustomImage;
std::string mGameName;
std::string mSystemName;
int mVideoChangeTime;
};
#endif // ES_APP_SYSTEM_SCREEN_SAVER_H