summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/rockboy/menu.c')
-rw-r--r--apps/plugins/rockboy/menu.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c
index a22aef46f8..84bfeaa3cb 100644
--- a/apps/plugins/rockboy/menu.c
+++ b/apps/plugins/rockboy/menu.c
@@ -10,6 +10,20 @@
10#include "rockmacros.h" 10#include "rockmacros.h"
11#include "mem.h" 11#include "mem.h"
12 12
13#if (CONFIG_KEYPAD == IPOD_4G_PAD)
14#define MENU_BUTTON_UP BUTTON_SCROLL_BACK
15#define MENU_BUTTON_DOWN BUTTON_SCROLL_FWD
16#define MENU_BUTTON_LEFT BUTTON_LEFT
17#define MENU_BUTTON_RIGHT BUTTON_RIGHT
18#define MENU_BUTTON_CANCEL BUTTON_MENU
19#else
20#define MENU_BUTTON_UP BUTTON_UP
21#define MENU_BUTTON_DOWN BUTTON_DOWN
22#define MENU_BUTTON_LEFT BUTTON_LEFT
23#define MENU_BUTTON_RIGHT BUTTON_RIGHT
24#define MENU_BUTTON_CANCEL BUTTON_OFF
25#endif
26
13/* load/save state function declarations */ 27/* load/save state function declarations */
14static void do_slot_menu(bool is_load); 28static void do_slot_menu(bool is_load);
15static void do_opt_menu(void); 29static void do_opt_menu(void);
@@ -115,10 +129,10 @@ int getbutton(char *text)
115 button = rb->button_get(true); 129 button = rb->button_get(true);
116 button=button&0x00000FFF; 130 button=button&0x00000FFF;
117 switch(button) { 131 switch(button) {
118 case BUTTON_LEFT: 132 case MENU_BUTTON_LEFT:
119 case BUTTON_RIGHT: 133 case MENU_BUTTON_RIGHT:
120 case BUTTON_UP: 134 case MENU_BUTTON_UP:
121 case BUTTON_DOWN: 135 case MENU_BUTTON_DOWN:
122 break; 136 break;
123 default: 137 default:
124 return button; 138 return button;
@@ -581,7 +595,7 @@ static int do_menu(char *title, char **items, size_t num_items, int sel) {
581 595
582 /* handle the button */ 596 /* handle the button */
583 switch (btn) { 597 switch (btn) {
584 case BUTTON_DOWN: 598 case MENU_BUTTON_DOWN:
585 /* select next item in list */ 599 /* select next item in list */
586 sel_item = curr_item + 1; 600 sel_item = curr_item + 1;
587 if (sel_item >= (int) num_items) 601 if (sel_item >= (int) num_items)
@@ -589,7 +603,7 @@ static int do_menu(char *title, char **items, size_t num_items, int sel) {
589 select_item(title, curr_item, sel_item); 603 select_item(title, curr_item, sel_item);
590 curr_item = sel_item; 604 curr_item = sel_item;
591 break; 605 break;
592 case BUTTON_UP: 606 case MENU_BUTTON_UP:
593 /* select prev item in list */ 607 /* select prev item in list */
594 sel_item = curr_item - 1; 608 sel_item = curr_item - 1;
595 if (sel_item < 0) 609 if (sel_item < 0)
@@ -597,13 +611,13 @@ static int do_menu(char *title, char **items, size_t num_items, int sel) {
597 select_item(title, curr_item, sel_item); 611 select_item(title, curr_item, sel_item);
598 curr_item = sel_item; 612 curr_item = sel_item;
599 break; 613 break;
600 case BUTTON_RIGHT: 614 case MENU_BUTTON_RIGHT:
601 /* select current item */ 615 /* select current item */
602 ret = curr_item; 616 ret = curr_item;
603 done = true; 617 done = true;
604 break; 618 break;
605 case BUTTON_LEFT: 619 case MENU_BUTTON_LEFT:
606 case BUTTON_OFF: 620 case MENU_BUTTON_CANCEL:
607 /* cancel out of menu */ 621 /* cancel out of menu */
608 ret = MENU_CANCEL; 622 ret = MENU_CANCEL;
609 done = true; 623 done = true;