mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-17 22:55:38 +00:00
OCD update renaming ScreenSaver to Screensaver.
This commit is contained in:
parent
bbb2aa5217
commit
6368ae0cc1
|
@ -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
|
||||
|
|
|
@ -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"
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
// EmulationStation Desktop Edition
|
||||
// SystemScreenSaver.h
|
||||
// SystemScreensaver.h
|
||||
//
|
||||
// Screensaver, supporting the following types:
|
||||
// Dim, black, slideshow, video.
|
|
@ -33,7 +33,7 @@
|
|||
#include "PowerSaver.h"
|
||||
#include "Settings.h"
|
||||
#include "SystemData.h"
|
||||
#include "SystemScreenSaver.h"
|
||||
#include "SystemScreensaver.h"
|
||||
|
||||
#include <SDL2/SDL_events.h>
|
||||
#include <SDL2/SDL_main.h>
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <iomanip>
|
||||
|
||||
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();
|
||||
}
|
||||
|
|
|
@ -81,14 +81,14 @@ public:
|
|||
void renderHelpPromptsEarly(); // Used to render HelpPrompts before a fade.
|
||||
void setHelpPrompts(const std::vector<HelpPrompt>& 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<GuiComponent*> mGuiStack;
|
||||
std::vector<std::shared_ptr<Font>> mDefaultFonts;
|
||||
|
@ -121,7 +121,7 @@ private:
|
|||
bool mSleeping;
|
||||
unsigned int mTimeSinceLastInput;
|
||||
|
||||
bool mRenderScreenSaver;
|
||||
bool mRenderScreensaver;
|
||||
bool mGameLaunchedState;
|
||||
bool mAllowTextScrolling;
|
||||
bool mCachedBackground;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue