From 6368ae0cc1f86495382768ebc79259d37ce8b140 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 10 Nov 2020 22:33:57 +0100 Subject: [PATCH] OCD update renaming ScreenSaver to Screensaver. --- es-app/CMakeLists.txt | 4 +- ...mScreenSaver.cpp => SystemScreensaver.cpp} | 4 +- ...ystemScreenSaver.h => SystemScreensaver.h} | 2 +- es-app/src/main.cpp | 2 +- es-core/src/GuiComponent.cpp | 8 +-- es-core/src/GuiComponent.h | 4 +- es-core/src/PowerSaver.cpp | 14 ++--- es-core/src/PowerSaver.h | 6 +-- es-core/src/Window.cpp | 52 +++++++++---------- es-core/src/Window.h | 8 +-- es-core/src/components/VideoComponent.cpp | 4 +- es-core/src/components/VideoComponent.h | 4 +- 12 files changed, 56 insertions(+), 56 deletions(-) rename es-app/src/{SystemScreenSaver.cpp => SystemScreensaver.cpp} (99%) rename es-app/src/{SystemScreenSaver.h => SystemScreensaver.h} (98%) diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt index f6e2b4b7e..1e3da0b1f 100644 --- a/es-app/CMakeLists.txt +++ b/es-app/CMakeLists.txt @@ -10,7 +10,7 @@ set(ES_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/VolumeControl.h ${CMAKE_CURRENT_SOURCE_DIR}/src/Gamelist.h ${CMAKE_CURRENT_SOURCE_DIR}/src/FileFilterIndex.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreenSaver.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreensaver.h ${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemManager.h # Guis @@ -58,7 +58,7 @@ set(ES_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/VolumeControl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/Gamelist.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/FileFilterIndex.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreenSaver.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreensaver.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemManager.cpp # Guis diff --git a/es-app/src/SystemScreenSaver.cpp b/es-app/src/SystemScreensaver.cpp similarity index 99% rename from es-app/src/SystemScreenSaver.cpp rename to es-app/src/SystemScreensaver.cpp index 29c96b262..bdb43404d 100644 --- a/es-app/src/SystemScreenSaver.cpp +++ b/es-app/src/SystemScreensaver.cpp @@ -1,13 +1,13 @@ // SPDX-License-Identifier: MIT // // EmulationStation Desktop Edition -// SystemScreenSaver.cpp +// SystemScreensaver.cpp // // Screensaver, supporting the following types: // Dim, black, slideshow, video. // -#include "SystemScreenSaver.h" +#include "SystemScreensaver.h" #if defined(_RPI_) #include "components/VideoPlayerComponent.h" diff --git a/es-app/src/SystemScreenSaver.h b/es-app/src/SystemScreensaver.h similarity index 98% rename from es-app/src/SystemScreenSaver.h rename to es-app/src/SystemScreensaver.h index b745d5a22..fed6d5127 100644 --- a/es-app/src/SystemScreenSaver.h +++ b/es-app/src/SystemScreensaver.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // // EmulationStation Desktop Edition -// SystemScreenSaver.h +// SystemScreensaver.h // // Screensaver, supporting the following types: // Dim, black, slideshow, video. diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 940ec67f4..d3396db2a 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -33,7 +33,7 @@ #include "PowerSaver.h" #include "Settings.h" #include "SystemData.h" -#include "SystemScreenSaver.h" +#include "SystemScreensaver.h" #include #include diff --git a/es-core/src/GuiComponent.cpp b/es-core/src/GuiComponent.cpp index 90333da2a..a11df4c56 100644 --- a/es-core/src/GuiComponent.cpp +++ b/es-core/src/GuiComponent.cpp @@ -545,16 +545,16 @@ void GuiComponent::onUnpauseVideo() getChild(i)->onUnpauseVideo(); } -void GuiComponent::onScreenSaverActivate() +void GuiComponent::onScreensaverActivate() { for (unsigned int i = 0; i < getChildCount(); i++) - getChild(i)->onScreenSaverActivate(); + getChild(i)->onScreensaverActivate(); } -void GuiComponent::onScreenSaverDeactivate() +void GuiComponent::onScreensaverDeactivate() { for (unsigned int i = 0; i < getChildCount(); i++) - getChild(i)->onScreenSaverDeactivate(); + getChild(i)->onScreensaverDeactivate(); } void GuiComponent::onGameLaunchedActivate() diff --git a/es-core/src/GuiComponent.h b/es-core/src/GuiComponent.h index e330726cb..b7966f98b 100644 --- a/es-core/src/GuiComponent.h +++ b/es-core/src/GuiComponent.h @@ -177,8 +177,8 @@ public: virtual void setRenderView(bool status) { mRenderView = status; } virtual bool getRenderView() { return mRenderView; }; - virtual void onScreenSaverActivate(); - virtual void onScreenSaverDeactivate(); + virtual void onScreensaverActivate(); + virtual void onScreensaverDeactivate(); virtual void onGameLaunchedActivate(); virtual void onGameLaunchedDeactivate(); virtual void topWindow(bool isTop); diff --git a/es-core/src/PowerSaver.cpp b/es-core/src/PowerSaver.cpp index 199968911..5cd46abd5 100644 --- a/es-core/src/PowerSaver.cpp +++ b/es-core/src/PowerSaver.cpp @@ -16,10 +16,10 @@ #endif bool PowerSaver::mState = false; -bool PowerSaver::mRunningScreenSaver = false; +bool PowerSaver::mRunningScreensaver = false; int PowerSaver::mWakeupTimeout = -1; -int PowerSaver::mScreenSaverTimeout = -1; +int PowerSaver::mScreensaverTimeout = -1; PowerSaver::mode PowerSaver::mMode = PowerSaver::DISABLED; void PowerSaver::init() @@ -34,7 +34,7 @@ int PowerSaver::getTimeout() AudioManager::getInstance()->deinit(); // Used only for SDL_WaitEventTimeout. Use `getMode()` for modes. - return mRunningScreenSaver ? mWakeupTimeout : mScreenSaverTimeout; + return mRunningScreensaver ? mWakeupTimeout : mScreensaverTimeout; } void PowerSaver::loadWakeupTime() @@ -51,8 +51,8 @@ void PowerSaver::loadWakeupTime() void PowerSaver::updateTimeouts() { - mScreenSaverTimeout = (unsigned int) Settings::getInstance()->getInt("ScreensaverTimer"); - mScreenSaverTimeout = mScreenSaverTimeout > 0 ? mScreenSaverTimeout - getMode() : -1; + mScreensaverTimeout = (unsigned int) Settings::getInstance()->getInt("ScreensaverTimer"); + mScreensaverTimeout = mScreensaverTimeout > 0 ? mScreensaverTimeout - getMode() : -1; loadWakeupTime(); } @@ -93,7 +93,7 @@ void PowerSaver::setState(bool state) void PowerSaver::runningScreensaver(bool state) { - mRunningScreenSaver = state; + mRunningScreensaver = state; if (mWakeupTimeout < mMode) { // Disable PS if wake up time is less than mode as PS will never trigger. setState(!state); @@ -102,5 +102,5 @@ void PowerSaver::runningScreensaver(bool state) bool PowerSaver::isScreensaverActive() { - return mRunningScreenSaver; + return mRunningScreensaver; } diff --git a/es-core/src/PowerSaver.h b/es-core/src/PowerSaver.h index 556182bc8..29ed0d4b0 100644 --- a/es-core/src/PowerSaver.h +++ b/es-core/src/PowerSaver.h @@ -42,17 +42,17 @@ public: static void pause() { setState(false); } static void resume() { setState(true); } - // This is used by ScreenSaver to let PS know when to switch to SS timeouts. + // This is used by Screensaver to let PS know when to switch to SS timeouts. static void runningScreensaver(bool state); static bool isScreensaverActive(); private: static bool mState; - static bool mRunningScreenSaver; + static bool mRunningScreensaver; static mode mMode; static int mWakeupTimeout; - static int mScreenSaverTimeout; + static int mScreensaverTimeout; static void loadWakeupTime(); }; diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index 48c8d193c..056431bdc 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -20,7 +20,7 @@ #include Window::Window() - : mScreenSaver(nullptr), + : mScreensaver(nullptr), mInfoPopup(nullptr), mNormalizeNextUpdate(false), mFrameTimeElapsed(0), @@ -29,7 +29,7 @@ Window::Window() mAllowSleep(true), mSleeping(false), mTimeSinceLastInput(0), - mRenderScreenSaver(false), + mRenderScreensaver(false), mGameLaunchedState(false), mAllowTextScrolling(true), mCachedBackground(false), @@ -144,8 +144,8 @@ void Window::input(InputConfig* config, Input input) if (Settings::getInstance()->getBool("Debug")) logInput(config, input); - if (mScreenSaver) { - if (mScreenSaver->isScreensaverActive() && + if (mScreensaver) { + if (mScreensaver->isScreensaverActive() && Settings::getInstance()->getBool("ScreensaverControls") && ((Settings::getInstance()->getString("ScreensaverType") == "video") || (Settings::getInstance()->getString("ScreensaverType") == "slideshow"))) { @@ -154,21 +154,21 @@ void Window::input(InputConfig* config, Input input) Settings::getInstance()->getBool("ScreensaverSlideshowCustomImages")) customImageSlideshow = true; - if (customImageSlideshow || mScreenSaver->getCurrentGame() != nullptr && + if (customImageSlideshow || mScreensaver->getCurrentGame() != nullptr && (config->isMappedTo("a", input) || config->isMappedLike("left", input) || config->isMappedLike("right", input))) { // Left or right browses to the next video or image. if (config->isMappedLike("left", input) || config->isMappedLike("right", input)) { if (input.value != 0) { // Handle screensaver control. - mScreenSaver->nextGame(); + mScreensaver->nextGame(); } return; } else if (config->isMappedTo("a", input) && input.value != 0) { // Launch game. cancelScreensaver(); - mScreenSaver->launchGame(); + mScreensaver->launchGame(); // To force handling the wake up process. mSleeping = true; } @@ -279,8 +279,8 @@ void Window::update(int deltaTime) peekGui()->update(deltaTime); // Update the screensaver. - if (mScreenSaver) - mScreenSaver->update(deltaTime); + if (mScreensaver) + mScreensaver->update(deltaTime); } void Window::render() @@ -294,7 +294,7 @@ void Window::render() auto& bottom = mGuiStack.front(); auto& top = mGuiStack.back(); - if (mRenderScreenSaver) { + if (mRenderScreensaver) { bottom->cancelAllAnimations(); bottom->stopAllAnimations(); } @@ -373,7 +373,7 @@ void Window::render() // the screensaver in the background when running a game. else if (mGameLaunchedState) mTimeSinceLastInput = 0; - else if (!isProcessing() && !mScreenSaver->isScreensaverActive()) + else if (!isProcessing() && !mScreensaver->isScreensaverActive()) startScreensaver(); } @@ -381,11 +381,11 @@ void Window::render() // or not because it may perform a fade on transition. renderScreensaver(); - if (!mRenderScreenSaver && mInfoPopup) + if (!mRenderScreensaver && mInfoPopup) mInfoPopup->render(transform); if (mTimeSinceLastInput >= screensaverTimer && screensaverTimer != 0) { - if (!isProcessing() && mAllowSleep && (!mScreenSaver)) { + if (!isProcessing() && mAllowSleep && (!mScreensaver)) { // Go to sleep. if (mSleeping == false) { mSleeping = true; @@ -396,9 +396,9 @@ void Window::render() #if defined(USE_OPENGL_21) // Shaders for the screensavers. - if (mScreenSaver->isScreensaverActive()) { + if (mScreensaver->isScreensaverActive()) { if (Settings::getInstance()->getString("ScreensaverType") == "video") { - if (mScreenSaver->getHasMediaFiles()) { + if (mScreensaver->getHasMediaFiles()) { if (Settings::getInstance()->getBool("ScreensaverVideoBlur")) Renderer::shaderPostprocessing(Renderer::SHADER_BLUR_HORIZONTAL); if (Settings::getInstance()->getBool("ScreensaverVideoScanlines")) @@ -414,7 +414,7 @@ void Window::render() } } else if (Settings::getInstance()->getString("ScreensaverType") == "slideshow") { - if (mScreenSaver->getHasMediaFiles()) { + if (mScreensaver->getHasMediaFiles()) { if (Settings::getInstance()->getBool("ScreensaverImageScanlines")) Renderer::shaderPostprocessing(Renderer::SHADER_SCANLINES); } @@ -607,26 +607,26 @@ void Window::unsetLaunchedGame() void Window::startScreensaver() { - if (mScreenSaver && !mRenderScreenSaver) { + if (mScreensaver && !mRenderScreensaver) { // Tell the GUI components the screensaver is starting. for (auto it = mGuiStack.cbegin(); it != mGuiStack.cend(); it++) - (*it)->onScreenSaverActivate(); + (*it)->onScreensaverActivate(); stopInfoPopup(); - mScreenSaver->startScreensaver(true); - mRenderScreenSaver = true; + mScreensaver->startScreensaver(true); + mRenderScreensaver = true; } } bool Window::cancelScreensaver() { - if (mScreenSaver && mRenderScreenSaver) { - mScreenSaver->stopScreensaver(); - mRenderScreenSaver = false; + if (mScreensaver && mRenderScreensaver) { + mScreensaver->stopScreensaver(); + mRenderScreensaver = false; // Tell the GUI components the screensaver has stopped. for (auto it = mGuiStack.cbegin(); it != mGuiStack.cend(); it++) { - (*it)->onScreenSaverDeactivate(); + (*it)->onScreensaverDeactivate(); // If the menu is open, pause the video so it won't start playing beneath the menu. if (mGuiStack.front() != mGuiStack.back()) (*it)->onPauseVideo(); @@ -643,6 +643,6 @@ bool Window::cancelScreensaver() void Window::renderScreensaver() { - if (mScreenSaver) - mScreenSaver->renderScreensaver(); + if (mScreensaver) + mScreensaver->renderScreensaver(); } diff --git a/es-core/src/Window.h b/es-core/src/Window.h index 7fbc6635f..b1ddb34cd 100644 --- a/es-core/src/Window.h +++ b/es-core/src/Window.h @@ -81,14 +81,14 @@ public: void renderHelpPromptsEarly(); // Used to render HelpPrompts before a fade. void setHelpPrompts(const std::vector& prompts, const HelpStyle& style); - void setScreensaver(Screensaver* screenSaver) { mScreenSaver = screenSaver; } + void setScreensaver(Screensaver* screensaver) { mScreensaver = screensaver; } void setInfoPopup(InfoPopup* infoPopup) { delete mInfoPopup; mInfoPopup = infoPopup; } inline void stopInfoPopup() { if (mInfoPopup) mInfoPopup->stop(); }; void startScreensaver(); bool cancelScreensaver(); void renderScreensaver(); - bool isScreensaverActive() { return mRenderScreenSaver; }; + bool isScreensaverActive() { return mRenderScreensaver; }; void setLaunchedGame(); void unsetLaunchedGame(); @@ -107,7 +107,7 @@ private: HelpComponent* mHelp; ImageComponent* mBackgroundOverlay; - Screensaver* mScreenSaver; + Screensaver* mScreensaver; InfoPopup* mInfoPopup; std::vector mGuiStack; std::vector> mDefaultFonts; @@ -121,7 +121,7 @@ private: bool mSleeping; unsigned int mTimeSinceLastInput; - bool mRenderScreenSaver; + bool mRenderScreensaver; bool mGameLaunchedState; bool mAllowTextScrolling; bool mCachedBackground; diff --git a/es-core/src/components/VideoComponent.cpp b/es-core/src/components/VideoComponent.cpp index 401dfcaff..f9b750d8d 100644 --- a/es-core/src/components/VideoComponent.cpp +++ b/es-core/src/components/VideoComponent.cpp @@ -328,7 +328,7 @@ void VideoComponent::onUnpauseVideo() manageState(); } -void VideoComponent::onScreenSaverActivate() +void VideoComponent::onScreensaverActivate() { mBlockPlayer = true; mPause = true; @@ -337,7 +337,7 @@ void VideoComponent::onScreenSaverActivate() manageState(); } -void VideoComponent::onScreenSaverDeactivate() +void VideoComponent::onScreensaverDeactivate() { mBlockPlayer = false; // Stop video when deactivating the screensaver to force a reload of the diff --git a/es-core/src/components/VideoComponent.h b/es-core/src/components/VideoComponent.h index 554506bed..ecf45eecf 100644 --- a/es-core/src/components/VideoComponent.h +++ b/es-core/src/components/VideoComponent.h @@ -46,8 +46,8 @@ public: virtual void onPauseVideo() override; virtual void onUnpauseVideo() override; virtual bool isVideoPaused() override { return mPause; } - virtual void onScreenSaverActivate() override; - virtual void onScreenSaverDeactivate() override; + virtual void onScreensaverActivate() override; + virtual void onScreensaverDeactivate() override; virtual void onGameLaunchedActivate() override; virtual void onGameLaunchedDeactivate() override; virtual void topWindow(bool isTop) override;