From a6be6225d89c4f38ecf9274348dadee51aa6504d Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 17 Jan 2022 18:43:29 +0100 Subject: [PATCH] Renamed SystemScreensaver to Screensaver. --- es-app/CMakeLists.txt | 4 +-- ...{SystemScreensaver.cpp => Screensaver.cpp} | 36 +++++++++---------- .../{SystemScreensaver.h => Screensaver.h} | 15 ++++---- es-app/src/main.cpp | 4 +-- 4 files changed, 30 insertions(+), 29 deletions(-) rename es-app/src/{SystemScreensaver.cpp => Screensaver.cpp} (96%) rename es-app/src/{SystemScreensaver.h => Screensaver.h} (89%) diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt index af2353fc2..685a9e81e 100644 --- a/es-app/CMakeLists.txt +++ b/es-app/CMakeLists.txt @@ -20,8 +20,8 @@ set(ES_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/MetaData.h ${CMAKE_CURRENT_SOURCE_DIR}/src/MiximageGenerator.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/SystemScreensaver.h ${CMAKE_CURRENT_SOURCE_DIR}/src/VolumeControl.h # GUIs @@ -70,8 +70,8 @@ set(ES_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/MetaData.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/MiximageGenerator.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/SystemScreensaver.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/VolumeControl.cpp # GUIs diff --git a/es-app/src/SystemScreensaver.cpp b/es-app/src/Screensaver.cpp similarity index 96% rename from es-app/src/SystemScreensaver.cpp rename to es-app/src/Screensaver.cpp index 60eeb62e7..5d444f6eb 100644 --- a/es-app/src/SystemScreensaver.cpp +++ b/es-app/src/Screensaver.cpp @@ -1,13 +1,13 @@ // SPDX-License-Identifier: MIT // // EmulationStation Desktop Edition -// SystemScreensaver.cpp +// Screensaver.cpp // // Screensaver, supporting the following types: // Dim, black, slideshow, video. // -#include "SystemScreensaver.h" +#include "Screensaver.h" #include "FileData.h" #include "Log.h" @@ -29,7 +29,7 @@ #define FADE_TIME 300 -SystemScreensaver::SystemScreensaver() +Screensaver::Screensaver() : mWindow {Window::getInstance()} , mState {STATE_INACTIVE} , mImageScreensaver {nullptr} @@ -50,14 +50,14 @@ SystemScreensaver::SystemScreensaver() mWindow->setScreensaver(this); } -SystemScreensaver::~SystemScreensaver() +Screensaver::~Screensaver() { mCurrentGame = nullptr; delete mVideoScreensaver; delete mImageScreensaver; } -void SystemScreensaver::startScreensaver(bool generateMediaList) +void Screensaver::startScreensaver(bool generateMediaList) { std::string path = ""; std::string screensaverType = Settings::getInstance()->getString("ScreensaverType"); @@ -181,7 +181,7 @@ void SystemScreensaver::startScreensaver(bool generateMediaList) mCurrentGame = nullptr; } -void SystemScreensaver::stopScreensaver() +void Screensaver::stopScreensaver() { delete mVideoScreensaver; mVideoScreensaver = nullptr; @@ -199,13 +199,13 @@ void SystemScreensaver::stopScreensaver() mGameOverlay.reset(); } -void SystemScreensaver::nextGame() +void Screensaver::nextGame() { stopScreensaver(); startScreensaver(false); } -void SystemScreensaver::launchGame() +void Screensaver::launchGame() { if (mCurrentGame != nullptr) { // Launching game @@ -218,7 +218,7 @@ void SystemScreensaver::launchGame() } } -void SystemScreensaver::goToGame() +void Screensaver::goToGame() { if (mCurrentGame != nullptr) { // 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"); @@ -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. if (mState == STATE_FADE_OUT_WINDOW) { @@ -419,7 +419,7 @@ void SystemScreensaver::update(int deltaTime) mImageScreensaver->update(deltaTime); } -void SystemScreensaver::generateImageList() +void Screensaver::generateImageList() { for (auto it = SystemData::sSystemVector.cbegin(); // Line break. 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. it != SystemData::sSystemVector.cend(); ++it) { @@ -453,7 +453,7 @@ void SystemScreensaver::generateVideoList() } } -void SystemScreensaver::generateCustomImageList() +void Screensaver::generateCustomImageList() { std::string imageDir = Utils::FileSystem::expandHomePath( 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; @@ -514,7 +514,7 @@ void SystemScreensaver::pickRandomImage(std::string& path) mCurrentGame = mImageFiles.at(index); } -void SystemScreensaver::pickRandomVideo(std::string& path) +void Screensaver::pickRandomVideo(std::string& path) { mCurrentGame = nullptr; @@ -548,7 +548,7 @@ void SystemScreensaver::pickRandomVideo(std::string& path) mCurrentGame = mVideoFiles.at(index); } -void SystemScreensaver::pickRandomCustomImage(std::string& path) +void Screensaver::pickRandomCustomImage(std::string& path) { if (mImageCustomFiles.size() == 0) return; @@ -576,7 +576,7 @@ void SystemScreensaver::pickRandomCustomImage(std::string& path) mSystemName = ""; } -void SystemScreensaver::generateOverlayInfo() +void Screensaver::generateOverlayInfo() { if (mGameName == "" || mSystemName == "") return; diff --git a/es-app/src/SystemScreensaver.h b/es-app/src/Screensaver.h similarity index 89% rename from es-app/src/SystemScreensaver.h rename to es-app/src/Screensaver.h index 165dedfd2..20ad08569 100644 --- a/es-app/src/SystemScreensaver.h +++ b/es-app/src/Screensaver.h @@ -1,26 +1,27 @@ // SPDX-License-Identifier: MIT // // EmulationStation Desktop Edition -// SystemScreensaver.h +// Screensaver.h // // Screensaver, supporting the following types: // Dim, black, slideshow, video. // -#ifndef ES_APP_SYSTEM_SCREEN_SAVER_H -#define ES_APP_SYSTEM_SCREEN_SAVER_H +#ifndef ES_APP_SCREENSAVER_H +#define ES_APP_SCREENSAVER_H #include "Window.h" +#include "resources/Font.h" class ImageComponent; class VideoComponent; // Screensaver implementation. -class SystemScreensaver : public Window::Screensaver +class Screensaver : public Window::Screensaver { public: - SystemScreensaver(); - virtual ~SystemScreensaver(); + Screensaver(); + virtual ~Screensaver(); virtual bool allowSleep() { @@ -88,4 +89,4 @@ private: std::vector mGameOverlayRectangleCoords; }; -#endif // ES_APP_SYSTEM_SCREEN_SAVER_H +#endif // ES_APP_SCREENSAVER_H diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 78a115e1d..752338bcf 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -24,10 +24,10 @@ #include "Log.h" #include "MameNames.h" #include "MediaViewer.h" +#include "Screensaver.h" #include "Settings.h" #include "Sound.h" #include "SystemData.h" -#include "SystemScreensaver.h" #include "guis/GuiDetectDevice.h" #include "guis/GuiLaunchScreen.h" #include "guis/GuiMsgBox.h" @@ -597,7 +597,7 @@ int main(int argc, char* argv[]) window = Window::getInstance(); ViewController::getInstance(); CollectionSystemsManager::getInstance(); - SystemScreensaver screensaver; + Screensaver screensaver; MediaViewer mediaViewer; GuiLaunchScreen guiLaunchScreen;