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"
|
2021-07-07 18:03:42 +00:00
|
|
|
#include "components/SwitchComponent.h"
|
2021-05-16 11:12:31 +00:00
|
|
|
|
2022-01-19 17:01:54 +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() !=
|
2021-07-07 18:03:42 +00:00
|
|
|
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() !=
|
2021-07-07 18:03:42 +00:00
|
|
|
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() !=
|
2021-07-07 18:03:42 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-10-28 19:00:23 +00:00
|
|
|
// 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(
|
2021-07-07 18:03:42 +00:00
|
|
|
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() !=
|
2021-07-07 18:03:42 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|