diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2022-10-18 19:10:59 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2022-10-21 03:59:49 +0200 |
commit | 653082ad1d7a5d55cdaf0a1e8071ebecc5aaa5fc (patch) | |
tree | 786cb38da1c5b32615378db8a1844c652f6f05a7 | |
parent | e27a6bad4fd9b0528d580e343a43257d25df269a (diff) | |
download | rockbox-653082ad1d.tar.gz rockbox-653082ad1d.zip |
Database: Adjust "Play Selected First"&"Shuffle" behavior
- With "Play Selected First" and "Shuffle" enabled,
another item was randomly selected when returning
to the list. This appears to be a bug
- With "Play Selected First" disabled, the first item was
selected. This appeared to be intentional, since, at least with
"Shuffle" disabled, that is the item that was played
back. This may not be helpful either, since it makes you lose
your place in what can be a long list. It is also not
consistent with the behavior of the File Browser. The current
selection should probably be maintained in all cases.
- At least according to the manual and the behavior of the File
Browser, "Play Selected First" should only apply when "Shuffle"
is enabled.
Change-Id: Ic1205477d5bf8b22f8f32dd6d31d3b9ceb5a2d24
-rw-r--r-- | apps/tagtree.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c index 2ebab7949c..0506dd2edd 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -2161,6 +2161,8 @@ bool tagtree_insert_selection_playlist(int position, bool queue) static int tagtree_play_folder(struct tree_context* c) { + int start_index = c->selected_item; + if (playlist_create(NULL, NULL) < 0) { logf("Failed creating playlist\n"); @@ -2171,12 +2173,13 @@ static int tagtree_play_folder(struct tree_context* c) return -2; if (global_settings.playlist_shuffle) - c->selected_item = playlist_shuffle(current_tick, c->selected_item); - if (!global_settings.play_selected) - c->selected_item = 0; - gui_synclist_select_item(&tree_lists, c->selected_item); + { + start_index = playlist_shuffle(current_tick, c->selected_item); + if (!global_settings.play_selected) + start_index = 0; + } - playlist_start(c->selected_item, 0, 0); + playlist_start(start_index, 0, 0); playlist_get_current()->num_inserted_tracks = 0; /* make warn on playlist erase work */ return 0; } |