1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 Robert E. Hak
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
25 /* button definitions */
26 #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
27 (CONFIG_KEYPAD == IRIVER_H300_PAD)
28 #define MENU_NEXT BUTTON_DOWN
29 #define MENU_PREV BUTTON_UP
30 #define MENU_EXIT BUTTON_LEFT
31 #define MENU_EXIT2 BUTTON_OFF
32 #define MENU_EXIT_MENU BUTTON_MODE
33 #define MENU_ENTER BUTTON_RIGHT
34 #define MENU_ENTER2 BUTTON_SELECT
36 #define MENU_RC_NEXT BUTTON_RC_FF
37 #define MENU_RC_PREV BUTTON_RC_REW
38 #define MENU_RC_EXIT BUTTON_RC_STOP
39 #define MENU_RC_ENTER BUTTON_RC_ON
41 #elif CONFIG_KEYPAD == RECORDER_PAD
42 #define MENU_NEXT BUTTON_DOWN
43 #define MENU_PREV BUTTON_UP
44 #define MENU_EXIT BUTTON_LEFT
45 #define MENU_EXIT2 BUTTON_OFF
46 #define MENU_EXIT_MENU BUTTON_F1
47 #define MENU_ENTER BUTTON_RIGHT
48 #define MENU_ENTER2 BUTTON_PLAY
50 #define MENU_RC_NEXT BUTTON_RC_RIGHT
51 #define MENU_RC_PREV BUTTON_RC_LEFT
52 #define MENU_RC_EXIT BUTTON_RC_STOP
53 #define MENU_RC_ENTER BUTTON_RC_PLAY
55 #elif CONFIG_KEYPAD == PLAYER_PAD
56 #define MENU_NEXT BUTTON_RIGHT
57 #define MENU_PREV BUTTON_LEFT
58 #define MENU_EXIT BUTTON_STOP
59 #define MENU_EXIT_MENU BUTTON_MENU
60 #define MENU_ENTER BUTTON_PLAY
62 #define MENU_RC_NEXT BUTTON_RC_RIGHT
63 #define MENU_RC_PREV BUTTON_RC_LEFT
64 #define MENU_RC_EXIT BUTTON_RC_STOP
65 #define MENU_RC_ENTER BUTTON_RC_PLAY
67 #elif CONFIG_KEYPAD == ONDIO_PAD
68 #define MENU_NEXT BUTTON_DOWN
69 #define MENU_PREV BUTTON_UP
70 #define MENU_EXIT BUTTON_LEFT
71 #define MENU_EXIT_MENU BUTTON_MENU
72 #define MENU_ENTER BUTTON_RIGHT
74 #elif CONFIG_KEYPAD == GMINI100_PAD
75 #define MENU_NEXT BUTTON_DOWN
76 #define MENU_PREV BUTTON_UP
77 #define MENU_EXIT BUTTON_LEFT
78 #define MENU_EXIT2 BUTTON_OFF
79 #define MENU_EXIT_MENU BUTTON_MENU
80 #define MENU_ENTER BUTTON_RIGHT
81 #define MENU_ENTER2 BUTTON_PLAY
86 unsigned char *desc
; /* string or ID */
87 bool (*function
) (void); /* return true if USB was connected */
90 int menu_init(const struct menu_item
* mitems
, int count
, int (*callback
)(int, int),
91 const char *button1
, const char *button2
, const char *button3
);
92 void menu_exit(int menu
);
94 void put_cursorxy(int x
, int y
, bool on
);
96 /* Returns below define, or number of selected menu item*/
98 #define MENU_ATTACHED_USB -1
99 #define MENU_SELECTED_EXIT -2
101 bool menu_run(int menu
);
102 int menu_cursor(int menu
);
103 char* menu_description(int menu
, int position
);
104 void menu_delete(int menu
, int position
);
105 int menu_count(int menu
);
106 bool menu_moveup(int menu
);
107 bool menu_movedown(int menu
);
108 void menu_draw(int menu
);
109 void menu_insert(int menu
, int position
, char *desc
, bool (*function
) (void));
110 void menu_set_cursor(int menu
, int position
);
112 #endif /* End __MENU_H__ */