From 1c80f5358110edd5777aeed15080249050ec2378 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sun, 27 Aug 2023 10:54:44 -0400 Subject: [Bugfix] shuffle shenanigans from g5288 Fix #13369 shuffle & repeat callbacks shuffle and sort were called on startup before playlist_init and also on setting switch even without select repeat is also now handled in settings_list as well after moving the callbacks to settings_list.c there was then a problem of unintended callbacks on exit of the menus fixed that with F_CB_ON_SELECT_ONLY since the callback was called regardless of the setting being changed on F_CB_ON_SELECT_ONLY which is preferable in some circumstances I co-opted F_TEMPVAR to allow the callback only when the setting was changed with the flag F_CB_ON_SELECT_ONLY_IF_CHANGED Change-Id: I5265233bbb556dc06c45273e742be5d78510a806 --- apps/menus/playback_menu.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'apps/menus') diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c index e4945be0b5..a0732d3feb 100644 --- a/apps/menus/playback_menu.c +++ b/apps/menus/playback_menu.c @@ -244,19 +244,9 @@ static int playback_callback(int action, struct gui_synclist *this_list) { (void)this_list; - static bool old_shuffle = false; - static int old_repeat = 0; switch (action) { case ACTION_ENTER_MENUITEM: - if (this_item == &shuffle_item) - { - old_shuffle = global_settings.playlist_shuffle; - } - else if (this_item == &repeat_mode) - { - old_repeat = global_settings.repeat_mode; - } break; case ACTION_EXIT_MENUITEM: /* on exit */ @@ -268,35 +258,6 @@ static int playback_callback(int action, break; } #endif /* HAVE_PLAY_FREQ */ - - if (!(audio_status() & AUDIO_STATUS_PLAY)) - break; - - /* Playing only */ - if (this_item == &shuffle_item) - { - if (old_shuffle == global_settings.playlist_shuffle) - break; - - replaygain_update(); - - if (global_settings.playlist_shuffle) - { - playlist_randomise(NULL, current_tick, true); - } - else - { - playlist_sort(NULL, true); - } - } - else if (this_item == &repeat_mode) - { - if (old_repeat == global_settings.repeat_mode) - break; - - audio_flush_and_reload_tracks(); - } - break; } return action; -- cgit v1.2.3