Renamed SystemScreensaver to Screensaver.

This commit is contained in:
Leon Styhre 2022-01-17 18:43:29 +01:00
parent acd18bd1f8
commit a6be6225d8
4 changed files with 30 additions and 29 deletions

View file

@ -20,8 +20,8 @@ set(ES_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/src/MetaData.h ${CMAKE_CURRENT_SOURCE_DIR}/src/MetaData.h
${CMAKE_CURRENT_SOURCE_DIR}/src/MiximageGenerator.h ${CMAKE_CURRENT_SOURCE_DIR}/src/MiximageGenerator.h
${CMAKE_CURRENT_SOURCE_DIR}/src/PlatformId.h ${CMAKE_CURRENT_SOURCE_DIR}/src/PlatformId.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Screensaver.h
${CMAKE_CURRENT_SOURCE_DIR}/src/SystemData.h ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemData.h
${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreensaver.h
${CMAKE_CURRENT_SOURCE_DIR}/src/VolumeControl.h ${CMAKE_CURRENT_SOURCE_DIR}/src/VolumeControl.h
# GUIs # GUIs
@ -70,8 +70,8 @@ set(ES_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/MetaData.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/MetaData.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/MiximageGenerator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/MiximageGenerator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/PlatformId.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/PlatformId.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Screensaver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/SystemData.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemData.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreensaver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/VolumeControl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/VolumeControl.cpp
# GUIs # GUIs

View file

@ -1,13 +1,13 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// SystemScreensaver.cpp // Screensaver.cpp
// //
// Screensaver, supporting the following types: // Screensaver, supporting the following types:
// Dim, black, slideshow, video. // Dim, black, slideshow, video.
// //
#include "SystemScreensaver.h" #include "Screensaver.h"
#include "FileData.h" #include "FileData.h"
#include "Log.h" #include "Log.h"
@ -29,7 +29,7 @@
#define FADE_TIME 300 #define FADE_TIME 300
SystemScreensaver::SystemScreensaver() Screensaver::Screensaver()
: mWindow {Window::getInstance()} : mWindow {Window::getInstance()}
, mState {STATE_INACTIVE} , mState {STATE_INACTIVE}
, mImageScreensaver {nullptr} , mImageScreensaver {nullptr}
@ -50,14 +50,14 @@ SystemScreensaver::SystemScreensaver()
mWindow->setScreensaver(this); mWindow->setScreensaver(this);
} }
SystemScreensaver::~SystemScreensaver() Screensaver::~Screensaver()
{ {
mCurrentGame = nullptr; mCurrentGame = nullptr;
delete mVideoScreensaver; delete mVideoScreensaver;
delete mImageScreensaver; delete mImageScreensaver;
} }
void SystemScreensaver::startScreensaver(bool generateMediaList) void Screensaver::startScreensaver(bool generateMediaList)
{ {
std::string path = ""; std::string path = "";
std::string screensaverType = Settings::getInstance()->getString("ScreensaverType"); std::string screensaverType = Settings::getInstance()->getString("ScreensaverType");
@ -181,7 +181,7 @@ void SystemScreensaver::startScreensaver(bool generateMediaList)
mCurrentGame = nullptr; mCurrentGame = nullptr;
} }
void SystemScreensaver::stopScreensaver() void Screensaver::stopScreensaver()
{ {
delete mVideoScreensaver; delete mVideoScreensaver;
mVideoScreensaver = nullptr; mVideoScreensaver = nullptr;
@ -199,13 +199,13 @@ void SystemScreensaver::stopScreensaver()
mGameOverlay.reset(); mGameOverlay.reset();
} }
void SystemScreensaver::nextGame() void Screensaver::nextGame()
{ {
stopScreensaver(); stopScreensaver();
startScreensaver(false); startScreensaver(false);
} }
void SystemScreensaver::launchGame() void Screensaver::launchGame()
{ {
if (mCurrentGame != nullptr) { if (mCurrentGame != nullptr) {
// Launching game // Launching game
@ -218,7 +218,7 @@ void SystemScreensaver::launchGame()
} }
} }
void SystemScreensaver::goToGame() void Screensaver::goToGame()
{ {
if (mCurrentGame != nullptr) { if (mCurrentGame != nullptr) {
// Go to the game in the gamelist view, but don't launch it. // Go to the game in the gamelist view, but don't launch it.
@ -230,7 +230,7 @@ void SystemScreensaver::goToGame()
} }
} }
void SystemScreensaver::renderScreensaver() void Screensaver::renderScreensaver()
{ {
std::string screensaverType = Settings::getInstance()->getString("ScreensaverType"); std::string screensaverType = Settings::getInstance()->getString("ScreensaverType");
@ -377,7 +377,7 @@ void SystemScreensaver::renderScreensaver()
} }
} }
void SystemScreensaver::update(int deltaTime) void Screensaver::update(int deltaTime)
{ {
// Use this to update the fade value for the current fade stage. // Use this to update the fade value for the current fade stage.
if (mState == STATE_FADE_OUT_WINDOW) { if (mState == STATE_FADE_OUT_WINDOW) {
@ -419,7 +419,7 @@ void SystemScreensaver::update(int deltaTime)
mImageScreensaver->update(deltaTime); mImageScreensaver->update(deltaTime);
} }
void SystemScreensaver::generateImageList() void Screensaver::generateImageList()
{ {
for (auto it = SystemData::sSystemVector.cbegin(); // Line break. for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); ++it) { it != SystemData::sSystemVector.cend(); ++it) {
@ -436,7 +436,7 @@ void SystemScreensaver::generateImageList()
} }
} }
void SystemScreensaver::generateVideoList() void Screensaver::generateVideoList()
{ {
for (auto it = SystemData::sSystemVector.cbegin(); // Line break. for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); ++it) { it != SystemData::sSystemVector.cend(); ++it) {
@ -453,7 +453,7 @@ void SystemScreensaver::generateVideoList()
} }
} }
void SystemScreensaver::generateCustomImageList() void Screensaver::generateCustomImageList()
{ {
std::string imageDir = Utils::FileSystem::expandHomePath( std::string imageDir = Utils::FileSystem::expandHomePath(
Settings::getInstance()->getString("ScreensaverSlideshowImageDir")); Settings::getInstance()->getString("ScreensaverSlideshowImageDir"));
@ -480,7 +480,7 @@ void SystemScreensaver::generateCustomImageList()
} }
} }
void SystemScreensaver::pickRandomImage(std::string& path) void Screensaver::pickRandomImage(std::string& path)
{ {
mCurrentGame = nullptr; mCurrentGame = nullptr;
@ -514,7 +514,7 @@ void SystemScreensaver::pickRandomImage(std::string& path)
mCurrentGame = mImageFiles.at(index); mCurrentGame = mImageFiles.at(index);
} }
void SystemScreensaver::pickRandomVideo(std::string& path) void Screensaver::pickRandomVideo(std::string& path)
{ {
mCurrentGame = nullptr; mCurrentGame = nullptr;
@ -548,7 +548,7 @@ void SystemScreensaver::pickRandomVideo(std::string& path)
mCurrentGame = mVideoFiles.at(index); mCurrentGame = mVideoFiles.at(index);
} }
void SystemScreensaver::pickRandomCustomImage(std::string& path) void Screensaver::pickRandomCustomImage(std::string& path)
{ {
if (mImageCustomFiles.size() == 0) if (mImageCustomFiles.size() == 0)
return; return;
@ -576,7 +576,7 @@ void SystemScreensaver::pickRandomCustomImage(std::string& path)
mSystemName = ""; mSystemName = "";
} }
void SystemScreensaver::generateOverlayInfo() void Screensaver::generateOverlayInfo()
{ {
if (mGameName == "" || mSystemName == "") if (mGameName == "" || mSystemName == "")
return; return;

View file

@ -1,26 +1,27 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// SystemScreensaver.h // Screensaver.h
// //
// Screensaver, supporting the following types: // Screensaver, supporting the following types:
// Dim, black, slideshow, video. // Dim, black, slideshow, video.
// //
#ifndef ES_APP_SYSTEM_SCREEN_SAVER_H #ifndef ES_APP_SCREENSAVER_H
#define ES_APP_SYSTEM_SCREEN_SAVER_H #define ES_APP_SCREENSAVER_H
#include "Window.h" #include "Window.h"
#include "resources/Font.h"
class ImageComponent; class ImageComponent;
class VideoComponent; class VideoComponent;
// Screensaver implementation. // Screensaver implementation.
class SystemScreensaver : public Window::Screensaver class Screensaver : public Window::Screensaver
{ {
public: public:
SystemScreensaver(); Screensaver();
virtual ~SystemScreensaver(); virtual ~Screensaver();
virtual bool allowSleep() virtual bool allowSleep()
{ {
@ -88,4 +89,4 @@ private:
std::vector<float> mGameOverlayRectangleCoords; std::vector<float> mGameOverlayRectangleCoords;
}; };
#endif // ES_APP_SYSTEM_SCREEN_SAVER_H #endif // ES_APP_SCREENSAVER_H

View file

@ -24,10 +24,10 @@
#include "Log.h" #include "Log.h"
#include "MameNames.h" #include "MameNames.h"
#include "MediaViewer.h" #include "MediaViewer.h"
#include "Screensaver.h"
#include "Settings.h" #include "Settings.h"
#include "Sound.h" #include "Sound.h"
#include "SystemData.h" #include "SystemData.h"
#include "SystemScreensaver.h"
#include "guis/GuiDetectDevice.h" #include "guis/GuiDetectDevice.h"
#include "guis/GuiLaunchScreen.h" #include "guis/GuiLaunchScreen.h"
#include "guis/GuiMsgBox.h" #include "guis/GuiMsgBox.h"
@ -597,7 +597,7 @@ int main(int argc, char* argv[])
window = Window::getInstance(); window = Window::getInstance();
ViewController::getInstance(); ViewController::getInstance();
CollectionSystemsManager::getInstance(); CollectionSystemsManager::getInstance();
SystemScreensaver screensaver; Screensaver screensaver;
MediaViewer mediaViewer; MediaViewer mediaViewer;
GuiLaunchScreen guiLaunchScreen; GuiLaunchScreen guiLaunchScreen;