ES-DE/es-app/src/guis/GuiMediaViewerOptions.cpp

81 lines
3.4 KiB
C++
Raw Normal View History

2021-05-16 11:12:31 +00:00
// SPDX-License-Identifier: MIT
//
// EmulationStation Desktop Edition
// GuiMediaViewerOptions.cpp
//
// User interface for the media viewer options.
// Submenu to the GuiMenu main menu.
//
#include "guis/GuiMediaViewerOptions.h"
#include "Settings.h"
#include "components/SwitchComponent.h"
2021-05-16 11:12:31 +00:00
GuiMediaViewerOptions::GuiMediaViewerOptions(const std::string& title)
: GuiSettings {title}
2021-05-16 11:12:31 +00:00
{
// Keep videos running when viewing images.
2022-09-03 10:44:49 +00:00
auto keepVideoRunning = std::make_shared<SwitchComponent>();
keepVideoRunning->setState(Settings::getInstance()->getBool("MediaViewerKeepVideoRunning"));
addWithLabel("KEEP VIDEOS RUNNING WHEN VIEWING IMAGES", keepVideoRunning);
addSaveFunc([keepVideoRunning, this] {
if (keepVideoRunning->getState() !=
Settings::getInstance()->getBool("MediaViewerKeepVideoRunning")) {
2021-05-16 11:12:31 +00:00
Settings::getInstance()->setBool("MediaViewerKeepVideoRunning",
2022-09-03 10:44:49 +00:00
keepVideoRunning->getState());
2021-05-16 11:12:31 +00:00
setNeedsSaving();
}
});
// Stretch videos to screen resolution.
2022-09-03 10:44:49 +00:00
auto stretchVideos = std::make_shared<SwitchComponent>();
stretchVideos->setState(Settings::getInstance()->getBool("MediaViewerStretchVideos"));
addWithLabel("STRETCH VIDEOS TO SCREEN RESOLUTION", stretchVideos);
addSaveFunc([stretchVideos, this] {
if (stretchVideos->getState() !=
Settings::getInstance()->getBool("MediaViewerStretchVideos")) {
2022-09-03 10:44:49 +00:00
Settings::getInstance()->setBool("MediaViewerStretchVideos", stretchVideos->getState());
2021-05-16 11:12:31 +00:00
setNeedsSaving();
}
});
// Render scanlines for videos using a shader.
2022-09-03 10:44:49 +00:00
auto videoScanlines = std::make_shared<SwitchComponent>();
videoScanlines->setState(Settings::getInstance()->getBool("MediaViewerVideoScanlines"));
addWithLabel("RENDER SCANLINES FOR VIDEOS", videoScanlines);
addSaveFunc([videoScanlines, this] {
if (videoScanlines->getState() !=
Settings::getInstance()->getBool("MediaViewerVideoScanlines")) {
2021-05-16 11:12:31 +00:00
Settings::getInstance()->setBool("MediaViewerVideoScanlines",
2022-09-03 10:44:49 +00:00
videoScanlines->getState());
2021-05-16 11:12:31 +00:00
setNeedsSaving();
}
});
// Render blur for videos using a shader.
2022-09-03 10:44:49 +00:00
auto videoBlur = std::make_shared<SwitchComponent>();
videoBlur->setState(Settings::getInstance()->getBool("MediaViewerVideoBlur"));
addWithLabel("RENDER BLUR FOR VIDEOS", videoBlur);
addSaveFunc([videoBlur, this] {
if (videoBlur->getState() != Settings::getInstance()->getBool("MediaViewerVideoBlur")) {
Settings::getInstance()->setBool("MediaViewerVideoBlur", videoBlur->getState());
2021-05-16 11:12:31 +00:00
setNeedsSaving();
}
});
// Render scanlines for screenshots and title screens using a shader.
2022-09-03 10:44:49 +00:00
auto screenshotScanlines = std::make_shared<SwitchComponent>();
screenshotScanlines->setState(
Settings::getInstance()->getBool("MediaViewerScreenshotScanlines"));
2022-09-03 10:44:49 +00:00
addWithLabel("RENDER SCANLINES FOR SCREENSHOTS AND TITLES", screenshotScanlines);
addSaveFunc([screenshotScanlines, this] {
if (screenshotScanlines->getState() !=
Settings::getInstance()->getBool("MediaViewerScreenshotScanlines")) {
2021-05-16 11:12:31 +00:00
Settings::getInstance()->setBool("MediaViewerScreenshotScanlines",
2022-09-03 10:44:49 +00:00
screenshotScanlines->getState());
2021-05-16 11:12:31 +00:00
setNeedsSaving();
}
});
}