diff options
author | Kjell Ericson <kjell@haxx.se> | 2003-01-29 08:26:11 +0000 |
---|---|---|
committer | Kjell Ericson <kjell@haxx.se> | 2003-01-29 08:26:11 +0000 |
commit | 5cd393c772ce6d9f8f7eff5dc97b007b8249d9f6 (patch) | |
tree | ce2387d895c12fc84dcf4fe9f9373742ab3edd74 /apps/menu.c | |
parent | 2ba4fedd6400cb74c604ba4c9e3c56c6e2f79e78 (diff) | |
download | rockbox-5cd393c772ce6d9f8f7eff5dc97b007b8249d9f6.tar.gz rockbox-5cd393c772ce6d9f8f7eff5dc97b007b8249d9f6.zip |
New onplay-menu for the Player.
The menu_run() function is split into two functions, where the new menu_run() works like before, and the new function menu_show() returns the menu item number you selected.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3180 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menu.c')
-rw-r--r-- | apps/menu.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/apps/menu.c b/apps/menu.c index 9cedbebed8..4f15b4b8ae 100644 --- a/apps/menu.c +++ b/apps/menu.c | |||
@@ -231,7 +231,7 @@ void menu_exit(int m) | |||
231 | inuse[m] = false; | 231 | inuse[m] = false; |
232 | } | 232 | } |
233 | 233 | ||
234 | bool menu_run(int m) | 234 | int menu_show(int m) |
235 | { | 235 | { |
236 | bool exit = false; | 236 | bool exit = false; |
237 | 237 | ||
@@ -289,17 +289,7 @@ bool menu_run(int m) | |||
289 | case BUTTON_PLAY: | 289 | case BUTTON_PLAY: |
290 | /* Erase current display state */ | 290 | /* Erase current display state */ |
291 | lcd_clear_display(); | 291 | lcd_clear_display(); |
292 | 292 | return menus[m].cursor; | |
293 | /* if a child returns that USB was used, | ||
294 | we return immediately */ | ||
295 | if (menus[m].items[menus[m].cursor].function()) { | ||
296 | lcd_stop_scroll(); /* just in case */ | ||
297 | return true; | ||
298 | } | ||
299 | |||
300 | /* Return to previous display state */ | ||
301 | menu_draw(m); | ||
302 | break; | ||
303 | 293 | ||
304 | #ifdef HAVE_RECORDER_KEYPAD | 294 | #ifdef HAVE_RECORDER_KEYPAD |
305 | case BUTTON_LEFT: | 295 | case BUTTON_LEFT: |
@@ -331,11 +321,27 @@ bool menu_run(int m) | |||
331 | #ifdef HAVE_LCD_CHARCELLS | 321 | #ifdef HAVE_LCD_CHARCELLS |
332 | status_set_param(false); | 322 | status_set_param(false); |
333 | #endif | 323 | #endif |
334 | return true; | 324 | return MENU_ATTACHED_USB; |
335 | } | 325 | } |
336 | 326 | ||
337 | status_draw(); | 327 | status_draw(); |
338 | } | 328 | } |
329 | return MENU_SELECTED_EXIT; | ||
330 | } | ||
331 | |||
339 | 332 | ||
340 | return false; | 333 | bool menu_run(int m) |
334 | { | ||
335 | bool stop=false; | ||
336 | while (!stop) { | ||
337 | int result=menu_show(m); | ||
338 | if (result == MENU_SELECTED_EXIT) | ||
339 | return false; | ||
340 | else if (result == MENU_ATTACHED_USB) | ||
341 | return true; | ||
342 | if (menus[m].items[menus[m].cursor].function()) { | ||
343 | return true; | ||
344 | } | ||
345 | } | ||
346 | return false; | ||
341 | } | 347 | } |