Add an option to shuffle the playlist in the playlist viewer

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30563 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2011-09-17 09:29:19 +00:00
parent 66dce4b730
commit e03faf835d

View file

@ -450,7 +450,7 @@ static int onplay_menu(int index)
playlist_buffer_get_track(&viewer.buffer, index); playlist_buffer_get_track(&viewer.buffer, index);
MENUITEM_STRINGLIST(menu_items, ID2P(LANG_PLAYLIST), NULL, MENUITEM_STRINGLIST(menu_items, ID2P(LANG_PLAYLIST), NULL,
ID2P(LANG_CURRENT_PLAYLIST), ID2P(LANG_CATALOG), ID2P(LANG_CURRENT_PLAYLIST), ID2P(LANG_CATALOG),
ID2P(LANG_REMOVE), ID2P(LANG_MOVE), ID2P(LANG_REMOVE), ID2P(LANG_MOVE), ID2P(LANG_SHUFFLE),
ID2P(LANG_SAVE_DYNAMIC_PLAYLIST)); ID2P(LANG_SAVE_DYNAMIC_PLAYLIST));
bool current = (current_track->index == viewer.current_playing_track); bool current = (current_track->index == viewer.current_playing_track);
@ -507,6 +507,11 @@ static int onplay_menu(int index)
ret = 0; ret = 0;
break; break;
case 4: case 4:
/* shuffle */
playlist_randomise(viewer.playlist, current_tick, false);
ret = 1;
break;
case 5:
/* save playlist */ /* save playlist */
save_playlist_screen(viewer.playlist); save_playlist_screen(viewer.playlist);
ret = 0; ret = 0;