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
|
|
|
|
|
|
|
GuiMediaViewerOptions::GuiMediaViewerOptions(Window* window, const std::string& title)
|
2022-01-16 17:18:28 +00:00
|
|
|
: GuiSettings {window, title}
|
2021-05-16 11:12:31 +00:00
|
|
|
{
|
|
|
|
// Keep videos running when viewing images.
|
|
|
|
auto keep_video_running = std::make_shared<SwitchComponent>(mWindow);
|
|
|
|
keep_video_running->setState(Settings::getInstance()->getBool("MediaViewerKeepVideoRunning"));
|
|
|
|
addWithLabel("KEEP VIDEOS RUNNING WHEN VIEWING IMAGES", keep_video_running);
|
|
|
|
addSaveFunc([keep_video_running, this] {
|
|
|
|
if (keep_video_running->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",
|
2021-07-07 18:03:42 +00:00
|
|
|
keep_video_running->getState());
|
2021-05-16 11:12:31 +00:00
|
|
|
setNeedsSaving();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Stretch videos to screen resolution.
|
|
|
|
auto stretch_videos = std::make_shared<SwitchComponent>(mWindow);
|
|
|
|
stretch_videos->setState(Settings::getInstance()->getBool("MediaViewerStretchVideos"));
|
|
|
|
addWithLabel("STRETCH VIDEOS TO SCREEN RESOLUTION", stretch_videos);
|
|
|
|
addSaveFunc([stretch_videos, this] {
|
|
|
|
if (stretch_videos->getState() !=
|
2021-07-07 18:03:42 +00:00
|
|
|
Settings::getInstance()->getBool("MediaViewerStretchVideos")) {
|
2021-05-16 11:12:31 +00:00
|
|
|
Settings::getInstance()->setBool("MediaViewerStretchVideos",
|
2021-07-07 18:03:42 +00:00
|
|
|
stretch_videos->getState());
|
2021-05-16 11:12:31 +00:00
|
|
|
setNeedsSaving();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-07-07 18:03:42 +00:00
|
|
|
#if defined(USE_OPENGL_21)
|
2021-05-16 11:12:31 +00:00
|
|
|
// Render scanlines for videos using a shader.
|
|
|
|
auto video_scanlines = std::make_shared<SwitchComponent>(mWindow);
|
|
|
|
video_scanlines->setState(Settings::getInstance()->getBool("MediaViewerVideoScanlines"));
|
|
|
|
addWithLabel("RENDER SCANLINES FOR VIDEOS", video_scanlines);
|
|
|
|
addSaveFunc([video_scanlines, this] {
|
|
|
|
if (video_scanlines->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",
|
2021-07-07 18:03:42 +00:00
|
|
|
video_scanlines->getState());
|
2021-05-16 11:12:31 +00:00
|
|
|
setNeedsSaving();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Render blur for videos using a shader.
|
|
|
|
auto video_blur = std::make_shared<SwitchComponent>(mWindow);
|
|
|
|
video_blur->setState(Settings::getInstance()->getBool("MediaViewerVideoBlur"));
|
|
|
|
addWithLabel("RENDER BLUR FOR VIDEOS", video_blur);
|
|
|
|
addSaveFunc([video_blur, this] {
|
2021-07-07 18:03:42 +00:00
|
|
|
if (video_blur->getState() != Settings::getInstance()->getBool("MediaViewerVideoBlur")) {
|
|
|
|
Settings::getInstance()->setBool("MediaViewerVideoBlur", video_blur->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.
|
2021-05-16 11:12:31 +00:00
|
|
|
auto screenshot_scanlines = std::make_shared<SwitchComponent>(mWindow);
|
2021-07-07 18:03:42 +00:00
|
|
|
screenshot_scanlines->setState(
|
|
|
|
Settings::getInstance()->getBool("MediaViewerScreenshotScanlines"));
|
2021-10-28 19:00:23 +00:00
|
|
|
addWithLabel("RENDER SCANLINES FOR SCREENSHOTS AND TITLES", screenshot_scanlines);
|
2021-05-16 11:12:31 +00:00
|
|
|
addSaveFunc([screenshot_scanlines, this] {
|
|
|
|
if (screenshot_scanlines->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",
|
2021-07-07 18:03:42 +00:00
|
|
|
screenshot_scanlines->getState());
|
2021-05-16 11:12:31 +00:00
|
|
|
setNeedsSaving();
|
|
|
|
}
|
|
|
|
});
|
2021-07-07 18:03:42 +00:00
|
|
|
#endif
|
2021-05-16 11:12:31 +00:00
|
|
|
}
|