From 0aa10ae9a143861a1cfd3abbed9e3478923891ef Mon Sep 17 00:00:00 2001 From: pjft Date: Mon, 26 Feb 2024 10:07:54 +0000 Subject: [PATCH 1/2] Update VLC Mute logic This updates it to support mixer passthrough, and accommodate cases where the mute function wasn't supported. --- es-core/src/components/VideoVlcComponent.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/es-core/src/components/VideoVlcComponent.cpp b/es-core/src/components/VideoVlcComponent.cpp index e34470f50..4ef7500d0 100644 --- a/es-core/src/components/VideoVlcComponent.cpp +++ b/es-core/src/components/VideoVlcComponent.cpp @@ -344,8 +344,7 @@ void VideoVlcComponent::stopVideo() void VideoVlcComponent::setMuteMode() { Settings *cfg = Settings::getInstance(); - if (!cfg->getBool("VideoAudio") || (cfg->getBool("ScreenSaverVideoMute") && mScreensaverMode)) - libvlc_audio_set_mute(mMediaPlayer, 1); - else - libvlc_audio_set_mute(mMediaPlayer, 0); + if (!cfg->getBool("VideoAudio") || (cfg->getBool("ScreenSaverVideoMute") && mScreensaverMode)) { + libvlc_media_add_option(mMedia, ":no-audio"); + } } From 485b995196ba7158aea4c60b9487afc14b894171 Mon Sep 17 00:00:00 2001 From: Gemba Date: Sun, 14 Apr 2024 18:17:07 +0200 Subject: [PATCH 2/2] Fix for cursor overrun in last played collection when LR/LB paging is active and fix cursor placement when changing theme with a smaller/larger gamelist viewport. --- es-app/src/CollectionSystemManager.cpp | 3 +++ es-app/src/components/TextListComponent.h | 5 +++++ es-app/src/guis/GuiMenu.cpp | 3 +-- es-app/src/views/ViewController.cpp | 12 +++++++----- es-app/src/views/ViewController.h | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/es-app/src/CollectionSystemManager.cpp b/es-app/src/CollectionSystemManager.cpp index 610e62675..a040a8e4e 100644 --- a/es-app/src/CollectionSystemManager.cpp +++ b/es-app/src/CollectionSystemManager.cpp @@ -1,5 +1,6 @@ #include "CollectionSystemManager.h" +#include "components/TextListComponent.h" #include "guis/GuiInfoPopup.h" #include "utils/FileSystemUtil.h" #include "utils/StringUtil.h" @@ -284,6 +285,8 @@ void CollectionSystemManager::updateCollectionSystem(FileData* file, CollectionS { trimCollectionCount(rootFolder, LAST_PLAYED_MAX, false); ViewController::get()->onFileChanged(rootFolder, FILE_METADATA_CHANGED); + // Force re-calculation of cursor position + ViewController::get()->getGameListView(curSys)->setViewportTop(TextListComponent::REFRESH_LIST_CURSOR_POS); } else ViewController::get()->onFileChanged(rootFolder, FILE_SORTED); diff --git a/es-app/src/components/TextListComponent.h b/es-app/src/components/TextListComponent.h index 1c9080674..2250769d3 100644 --- a/es-app/src/components/TextListComponent.h +++ b/es-app/src/components/TextListComponent.h @@ -392,6 +392,11 @@ void TextListComponent::onCursorChanged(const CursorState& state) template void TextListComponent::applyTheme(const std::shared_ptr& theme, const std::string& view, const std::string& element, unsigned int properties) { + if(Settings::getInstance()->getBool("UseFullscreenPaging")) + { + mViewportTop = REFRESH_LIST_CURSOR_POS; + } + GuiComponent::applyTheme(theme, view, element, properties); const ThemeData::ThemeElement* elem = theme->getElement(view, element, "textlist"); diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 09f377e0d..b3150db4a 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -301,8 +301,7 @@ void GuiMenu::openUISettings() { Scripting::fireEvent("theme-changed", theme_set->getSelected(), oldTheme); CollectionSystemManager::get()->updateSystemsList(); - ViewController::get()->goToStart(); - ViewController::get()->reloadAll(); // TODO - replace this with some sort of signal-based implementation + ViewController::get()->reloadAll(true); // TODO - replace this with some sort of signal-based implementation } }); } diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index c0a348349..3d5079ace 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -555,7 +555,7 @@ void ViewController::reloadGameListView(IGameListView* view, bool reloadTheme) } -void ViewController::reloadAll() +void ViewController::reloadAll(bool themeChanged) { // clear all gamelistviews std::map cursorMap; @@ -567,7 +567,6 @@ void ViewController::reloadAll() } mGameListViews.clear(); - // load themes, create gamelistviews and reset filters for(auto it = cursorMap.cbegin(); it != cursorMap.cend(); it++) { @@ -576,10 +575,13 @@ void ViewController::reloadAll() getGameListView(it->first)->setCursor(it->second); } - // restore index of first list item on display - for(auto it = viewportTopMap.cbegin(); it != viewportTopMap.cend(); it++) + if(!themeChanged || !Settings::getInstance()->getBool("UseFullscreenPaging")) { - getGameListView(it->first)->setViewportTop(it->second); + // restore index of first list item on display + for(auto it = viewportTopMap.cbegin(); it != viewportTopMap.cend(); it++) + { + getGameListView(it->first)->setViewportTop(it->second); + } } // Rebuild SystemListView diff --git a/es-app/src/views/ViewController.h b/es-app/src/views/ViewController.h index 0a8696d0a..13a9a0c7a 100644 --- a/es-app/src/views/ViewController.h +++ b/es-app/src/views/ViewController.h @@ -28,7 +28,7 @@ class ViewController : public GuiComponent // the current gamelist view (as it may change to be detailed). void reloadGameListView(IGameListView* gamelist, bool reloadTheme = false); inline void reloadGameListView(SystemData* system, bool reloadTheme = false) { reloadGameListView(getGameListView(system).get(), reloadTheme); } - void reloadAll(); // Reload everything with a theme. Used when the "ThemeSet" setting changes. + void reloadAll(bool themeChanged = false); // Reload everything with a theme. When the "ThemeSet" setting changes, themeChanged is true. // Navigation. void goToNextGameList();