mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-11 06:05:21 -05:00
Added a "Shuffle playlist" option to the context menu. Someone on the forum came up with it, and I liked the idea :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6842 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3e2b6ede5d
commit
8fd0378c6f
2 changed files with 25 additions and 2 deletions
|
|
@ -3105,3 +3105,9 @@ desc: in settings_menu
|
||||||
eng: "Backlight fade out"
|
eng: "Backlight fade out"
|
||||||
voice: "Backlight fade out"
|
voice: "Backlight fade out"
|
||||||
new:
|
new:
|
||||||
|
|
||||||
|
id: LANG_SHUFFLE_PLAYLIST
|
||||||
|
desc: in playlist menu, shuffles the playlist.
|
||||||
|
eng: "Shuffle playlist"
|
||||||
|
voice: "Shuffle playlist"
|
||||||
|
new:
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,18 @@ static bool list_viewers(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool shuffle_playlist(void)
|
||||||
|
{
|
||||||
|
int seed, index;
|
||||||
|
|
||||||
|
seed = playlist_get_seed(NULL);
|
||||||
|
index = playlist_get_first_index(NULL);
|
||||||
|
|
||||||
|
playlist_shuffle(seed, index);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static bool save_playlist(void)
|
static bool save_playlist(void)
|
||||||
{
|
{
|
||||||
char filename[MAX_PATH+1];
|
char filename[MAX_PATH+1];
|
||||||
|
|
@ -237,8 +249,8 @@ static bool view_playlist(void)
|
||||||
/* Sub-menu for playlist options */
|
/* Sub-menu for playlist options */
|
||||||
static bool playlist_options(void)
|
static bool playlist_options(void)
|
||||||
{
|
{
|
||||||
struct menu_item items[10];
|
struct menu_item items[11];
|
||||||
struct playlist_args args[10]; /* increase these 2 if you add entries! */
|
struct playlist_args args[11]; /* increase these 2 if you add entries! */
|
||||||
int m, i=0, pstart=0, result;
|
int m, i=0, pstart=0, result;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
|
|
@ -262,6 +274,11 @@ static bool playlist_options(void)
|
||||||
items[i].function = save_playlist;
|
items[i].function = save_playlist;
|
||||||
i++;
|
i++;
|
||||||
pstart++;
|
pstart++;
|
||||||
|
|
||||||
|
items[i].desc = ID2P(LANG_SHUFFLE_PLAYLIST);
|
||||||
|
items[i].function = shuffle_playlist;
|
||||||
|
i++;
|
||||||
|
pstart++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context == CONTEXT_TREE)
|
if (context == CONTEXT_TREE)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue