From 133eb841771c7b59e0b48e721e420c8cb0e757cb Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Thu, 9 Jan 2025 03:23:54 +0100 Subject: [PATCH] playlist: Allow replaying finished playlist Instead of responding with a "Nothing to resume" message when user tries to resume a playlist that's finished playing, offer to start from the beginning again. Change-Id: Icc4894d4e2d2e29beb1c7646462f9af69e5733aa --- apps/lang/english.lang | 14 ++++++++++++++ apps/root_menu.c | 12 ++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 5abf704a76..c06f94c436 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -16601,3 +16601,17 @@ *: "view log" + + id: LANG_REPLAY_FINISHED_PLAYLIST + desc: Resume playback of finished playlist + user: core + + *: "Playlist finished. Play again?" + + + *: "Playlist finished. Play again?" + + + *: "Playlist finished. Play again?" + + diff --git a/apps/root_menu.c b/apps/root_menu.c index 6cd9cfc3a2..27718174f4 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c @@ -328,7 +328,7 @@ static int wpsscrn(void* param) talk_shutup(); ret_val = gui_wps_show(); } - else if ( global_status.resume_index != -1 ) + else if (global_status.resume_index != -1) { DEBUGF("Resume index %d crc32 %lX offset %lX\n", global_status.resume_index, @@ -343,9 +343,13 @@ static int wpsscrn(void* param) ret_val = gui_wps_show(); } } - else - { + else if (!file_exists(PLAYLIST_CONTROL_FILE)) splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME)); + else if (yesno_pop(ID2P(LANG_REPLAY_FINISHED_PLAYLIST)) && + playlist_resume() != -1) + { + playlist_start(0, 0, 0); + ret_val = gui_wps_show(); } if (ret_val == GO_TO_PLAYLIST_VIEWER @@ -1038,7 +1042,7 @@ void root_menu(void) next_screen = GO_TO_FILEBROWSER; shortcut_origin = GO_TO_ROOT; /* note in some cases there is a screen to return to - but the history is rewritten as if you browsed here + but the history is rewritten as if you browsed here from the root so return there when finished */ } else if (shortcut_origin != GO_TO_ROOT)