From 60a102b75a64418bf3d28f6a08947cf86bf6cc9d Mon Sep 17 00:00:00 2001 From: aidenjbass Date: Mon, 6 May 2024 12:19:22 +0100 Subject: [PATCH 1/4] Initial merge from PR in PH-RetroFE https://github.com/phulshof/RetroFE/pull/12 --- RetroFE/Source/Execute/Launcher.cpp | 10 ++++++++-- RetroFE/Source/RetroFE.cpp | 16 +++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/RetroFE/Source/Execute/Launcher.cpp b/RetroFE/Source/Execute/Launcher.cpp index ba6906533..44666a635 100644 --- a/RetroFE/Source/Execute/Launcher.cpp +++ b/RetroFE/Source/Execute/Launcher.cpp @@ -196,8 +196,14 @@ void Launcher::LEDBlinky( int command, std::string collection, Item *collectionI std::string exe = Utils::combinePath(LEDBlinkyDirectory, "LEDBlinky.exe"); std::string args = std::to_string( command ); bool wait = false; - if ( command == 2 ) - wait = true; + if ( command == 2 ) { + bool LEDBlinkyCloseOnExit; + config_.getProperty("LEDBlinkyCloseOnExit", LEDBlinkyCloseOnExit); + if (LEDBlinkyCloseOnExit == true) { + wait = true; + } + else wait = false; + } if ( command == 8 ) { std::string launcherName = collectionItem->collectionInfo->launcher; std::string launcherFile = Utils::combinePath( Configuration::absolutePath, "collections", collectionItem->collectionInfo->name, "launchers", collectionItem->name + ".conf" ); diff --git a/RetroFE/Source/RetroFE.cpp b/RetroFE/Source/RetroFE.cpp index e76d7513b..c30e22652 100644 --- a/RetroFE/Source/RetroFE.cpp +++ b/RetroFE/Source/RetroFE.cpp @@ -362,6 +362,7 @@ bool RetroFE::run( ) int attractModeCollectionTime = 0; int attractModeMinTime = 1000; int attractModeMaxTime = 5000; + bool LEDBlinkyCloseOnExit = true; std::string firstCollection = "Main"; bool running = true; RETROFE_STATE state = RETROFE_NEW; @@ -374,6 +375,7 @@ bool RetroFE::run( ) config_.getProperty( OPTION_ATTRACTMODEMAXTIME, attractModeMaxTime ); config_.getProperty( OPTION_FIRSTCOLLECTION, firstCollection ); config_.getProperty( OPTION_ATTRACTMODEFAST, attractModeFast); + config_.getProperty( "LEDBlinkyCloseOnExit", LEDBlinkyCloseOnExit); // added checks for LEDBLINKY closing or not closing boolean attract_.idleTime = static_cast(attractModeTime); attract_.idleNextTime = static_cast(attractModeNextTime); @@ -1680,11 +1682,15 @@ bool RetroFE::run( ) // Wait for onExit animation to finish before quitting RetroFE case RETROFE_QUIT: - if ( currentPage_->isGraphicsIdle( ) ) { - l.LEDBlinky( 2 ); - l.exitScript(); - running = false; - } + bool LEDBlinkyCloseOnExit = true; + config_.getProperty("LEDBlinkyCloseOnExit", LEDBlinkyCloseOnExit); + if ( currentPage_->isGraphicsIdle() ) { + if (LEDBlinkyCloseOnExit == true) { + l.LEDBlinky(2); + running = false; + } + else running = false; + } break; } From 0a573d2d49ae2ef5906d2ac5bda6e46f38798908 Mon Sep 17 00:00:00 2001 From: aidenjbass Date: Mon, 6 May 2024 12:46:02 +0100 Subject: [PATCH 2/4] added to GlobalOpts class --- RetroFE/Source/Database/GlobalOpts.cpp | 1 + RetroFE/Source/Database/GlobalOpts.h | 2 ++ RetroFE/Source/Execute/Launcher.cpp | 2 +- RetroFE/Source/RetroFE.cpp | 16 ++++++++-------- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/RetroFE/Source/Database/GlobalOpts.cpp b/RetroFE/Source/Database/GlobalOpts.cpp index 57cfbbec9..de8af156b 100644 --- a/RetroFE/Source/Database/GlobalOpts.cpp +++ b/RetroFE/Source/Database/GlobalOpts.cpp @@ -128,6 +128,7 @@ const global_options::options_entry global_options::s_option_entries[] = { nullptr, nullptr, global_options::option_type::HEADER, "WINDOWS ONLY OPTIONS" }, { OPTION_LEDBLINKYDIRECTORY, "", global_options::option_type::PATH, "Path to LEDBlinky installation" }, + { OPTION_LEDBLINKYCLOSEONEXIT, "true", global_options::option_type::BOOLEAN, "If set to no, LEDBlinky will not close with RetroFE and keep the session open" }, { nullptr, nullptr, global_options::option_type::HEADER, "MEDIA SEARCH PATH OPTIONS" }, { OPTION_BASEMEDIAPATH, "", global_options::option_type::PATH, "Path to media if stored outside the build" }, diff --git a/RetroFE/Source/Database/GlobalOpts.h b/RetroFE/Source/Database/GlobalOpts.h index 582788c18..c34478e7f 100644 --- a/RetroFE/Source/Database/GlobalOpts.h +++ b/RetroFE/Source/Database/GlobalOpts.h @@ -122,6 +122,7 @@ // WINDOWS ONLY OPTIONS #define OPTION_LEDBLINKYDIRECTORY "LEDBlinkyDirectory" +#define OPTION_LEDBLINKYCLOSEONEXIT "LEDBlinkyCloseOnExit" // MEDIA SEARCH PATH OPTIONS #define OPTION_BASEMEDIAPATH "baseMediaPath" @@ -251,6 +252,7 @@ class global_options bool showsquarebrackets() const { return bool_value(OPTION_SHOWSQUAREBRACKETS); } const char *ledblinkydirectory() const { return value(OPTION_LEDBLINKYDIRECTORY); } + bool ledblinkycloseonexit() const { return bool_value(OPTION_LEDBLINKYCLOSEONEXIT); } const char *basemediapath() const { return value(OPTION_BASEMEDIAPATH); } const char *baseitempath() const { return value(OPTION_BASEITEMPATH); } diff --git a/RetroFE/Source/Execute/Launcher.cpp b/RetroFE/Source/Execute/Launcher.cpp index 44666a635..feb8a9442 100644 --- a/RetroFE/Source/Execute/Launcher.cpp +++ b/RetroFE/Source/Execute/Launcher.cpp @@ -198,7 +198,7 @@ void Launcher::LEDBlinky( int command, std::string collection, Item *collectionI bool wait = false; if ( command == 2 ) { bool LEDBlinkyCloseOnExit; - config_.getProperty("LEDBlinkyCloseOnExit", LEDBlinkyCloseOnExit); + config_.getProperty(OPTION_LEDBLINKYCLOSEONEXIT, LEDBlinkyCloseOnExit); if (LEDBlinkyCloseOnExit == true) { wait = true; } diff --git a/RetroFE/Source/RetroFE.cpp b/RetroFE/Source/RetroFE.cpp index c30e22652..10ba3393f 100644 --- a/RetroFE/Source/RetroFE.cpp +++ b/RetroFE/Source/RetroFE.cpp @@ -375,7 +375,7 @@ bool RetroFE::run( ) config_.getProperty( OPTION_ATTRACTMODEMAXTIME, attractModeMaxTime ); config_.getProperty( OPTION_FIRSTCOLLECTION, firstCollection ); config_.getProperty( OPTION_ATTRACTMODEFAST, attractModeFast); - config_.getProperty( "LEDBlinkyCloseOnExit", LEDBlinkyCloseOnExit); // added checks for LEDBLINKY closing or not closing boolean + config_.getProperty( OPTION_LEDBLINKYCLOSEONEXIT, LEDBlinkyCloseOnExit); attract_.idleTime = static_cast(attractModeTime); attract_.idleNextTime = static_cast(attractModeNextTime); @@ -1683,13 +1683,13 @@ bool RetroFE::run( ) // Wait for onExit animation to finish before quitting RetroFE case RETROFE_QUIT: bool LEDBlinkyCloseOnExit = true; - config_.getProperty("LEDBlinkyCloseOnExit", LEDBlinkyCloseOnExit); - if ( currentPage_->isGraphicsIdle() ) { - if (LEDBlinkyCloseOnExit == true) { - l.LEDBlinky(2); - running = false; - } - else running = false; + config_.getProperty(OPTION_LEDBLINKYCLOSEONEXIT, LEDBlinkyCloseOnExit); + if ( currentPage_->isGraphicsIdle() ) { + if (LEDBlinkyCloseOnExit == true) { + l.LEDBlinky(2); + running = false; + } + else running = false; } break; } From ac409d77a089322ba59697946b09b6740bcf7a53 Mon Sep 17 00:00:00 2001 From: aidenjbass <72824515+aidenjbass@users.noreply.github.com> Date: Tue, 14 May 2024 22:07:04 +0100 Subject: [PATCH 3/4] Update GlobalOpts.cpp --- RetroFE/Source/Database/GlobalOpts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RetroFE/Source/Database/GlobalOpts.cpp b/RetroFE/Source/Database/GlobalOpts.cpp index de8af156b..f219b94b3 100644 --- a/RetroFE/Source/Database/GlobalOpts.cpp +++ b/RetroFE/Source/Database/GlobalOpts.cpp @@ -128,7 +128,7 @@ const global_options::options_entry global_options::s_option_entries[] = { nullptr, nullptr, global_options::option_type::HEADER, "WINDOWS ONLY OPTIONS" }, { OPTION_LEDBLINKYDIRECTORY, "", global_options::option_type::PATH, "Path to LEDBlinky installation" }, - { OPTION_LEDBLINKYCLOSEONEXIT, "true", global_options::option_type::BOOLEAN, "If set to no, LEDBlinky will not close with RetroFE and keep the session open" }, + { OPTION_LEDBLINKYCLOSEONEXIT, "true", global_options::option_type::BOOLEAN, "If set to false, LEDBlinky will not close with RetroFE and keep the session open" }, { nullptr, nullptr, global_options::option_type::HEADER, "MEDIA SEARCH PATH OPTIONS" }, { OPTION_BASEMEDIAPATH, "", global_options::option_type::PATH, "Path to media if stored outside the build" }, From 3313bcdc896df6f1229a49b5edab1a0ad8435e74 Mon Sep 17 00:00:00 2001 From: aidenjbass Date: Sun, 13 Apr 2025 09:22:57 +0100 Subject: [PATCH 4/4] Rebase RetroFE.cpp Apply changes to current master --- RetroFE/Source/RetroFE.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/RetroFE/Source/RetroFE.cpp b/RetroFE/Source/RetroFE.cpp index 2ebf66cd1..64f945b89 100644 --- a/RetroFE/Source/RetroFE.cpp +++ b/RetroFE/Source/RetroFE.cpp @@ -2250,11 +2250,14 @@ bool RetroFE::run() // Wait for onExit animation to finish before quitting RetroFE case RETROFE_QUIT: - if (currentPage_->isGraphicsIdle()) - { - l.LEDBlinky(2); - l.exitScript(); - running = false; + bool LEDBlinkyCloseOnExit = true; + config_.getProperty(OPTION_LEDBLINKYCLOSEONEXIT, LEDBlinkyCloseOnExit); + if ( currentPage_->isGraphicsIdle() ) { + if (LEDBlinkyCloseOnExit == true) { + l.LEDBlinky(2); + running = false; + } + else running = false; } break; }