summaryrefslogtreecommitdiff
path: root/apps/onplay.c
diff options
context:
space:
mode:
authorTomas Salfischberger <tomas@rockbox.org>2005-06-23 15:49:36 +0000
committerTomas Salfischberger <tomas@rockbox.org>2005-06-23 15:49:36 +0000
commit8fd0378c6fff3297e106250f7235839068def7f7 (patch)
treec7d23d2268fa96fddaa1a4b23ccbbe02f4b1b216 /apps/onplay.c
parent3e2b6ede5db0576a994ea3da522f74e4d1028770 (diff)
downloadrockbox-8fd0378c6fff3297e106250f7235839068def7f7.tar.gz
rockbox-8fd0378c6fff3297e106250f7235839068def7f7.zip
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
Diffstat (limited to 'apps/onplay.c')
-rw-r--r--apps/onplay.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/apps/onplay.c b/apps/onplay.c
index d262eced3d..7655a8e075 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -134,6 +134,18 @@ static bool list_viewers(void)
134 return false; 134 return false;
135} 135}
136 136
137static bool shuffle_playlist(void)
138{
139 int seed, index;
140
141 seed = playlist_get_seed(NULL);
142 index = playlist_get_first_index(NULL);
143
144 playlist_shuffle(seed, index);
145
146 return false;
147}
148
137static bool save_playlist(void) 149static bool save_playlist(void)
138{ 150{
139 char filename[MAX_PATH+1]; 151 char filename[MAX_PATH+1];
@@ -237,8 +249,8 @@ static bool view_playlist(void)
237/* Sub-menu for playlist options */ 249/* Sub-menu for playlist options */
238static bool playlist_options(void) 250static bool playlist_options(void)
239{ 251{
240 struct menu_item items[10]; 252 struct menu_item items[11];
241 struct playlist_args args[10]; /* increase these 2 if you add entries! */ 253 struct playlist_args args[11]; /* increase these 2 if you add entries! */
242 int m, i=0, pstart=0, result; 254 int m, i=0, pstart=0, result;
243 bool ret = false; 255 bool ret = false;
244 256
@@ -262,6 +274,11 @@ static bool playlist_options(void)
262 items[i].function = save_playlist; 274 items[i].function = save_playlist;
263 i++; 275 i++;
264 pstart++; 276 pstart++;
277
278 items[i].desc = ID2P(LANG_SHUFFLE_PLAYLIST);
279 items[i].function = shuffle_playlist;
280 i++;
281 pstart++;
265 } 282 }
266 283
267 if (context == CONTEXT_TREE) 284 if (context == CONTEXT_TREE)