summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy/menu.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2006-01-10 21:55:56 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2006-01-10 21:55:56 +0000
commitcf218e33eca3abcc1067b9e78f1c82510bfe7c69 (patch)
tree5f60203774b1080ddfb62092681005d163d4cbb9 /apps/plugins/rockboy/menu.c
parent640eeabfe113695a22bf60ba327210a5526b187d (diff)
downloadrockbox-cf218e33eca3abcc1067b9e78f1c82510bfe7c69.tar.gz
rockbox-cf218e33eca3abcc1067b9e78f1c82510bfe7c69.zip
Patch #1401999 by Karl Kurbjun - Rockboy color, sound support, and speedups
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8324 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockboy/menu.c')
-rw-r--r--apps/plugins/rockboy/menu.c74
1 files changed, 72 insertions, 2 deletions
diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c
index 50f86c3408..140e7a28b1 100644
--- a/apps/plugins/rockboy/menu.c
+++ b/apps/plugins/rockboy/menu.c
@@ -67,11 +67,33 @@ static const char *slot_menu[] = {
67 67
68#define OPT_MENU_TITLE "Options" 68#define OPT_MENU_TITLE "Options"
69typedef enum { 69typedef enum {
70 OM_ITEM_FS,
71 OM_ITEM_SOUND,
70 OM_ITEM_BACK, 72 OM_ITEM_BACK,
71 OM_MENU_LAST 73 OM_MENU_LAST
72} OptMenuItem; 74} OptMenuItem;
73 75
74static const char *opt_menu[] = { 76static const char *opt_menu[] = {
77 "Frameskip",
78 "Sound ON/OFF",
79 "Previous Menu..."
80};
81
82#define FS_MENU_TITLE "Frameskip"
83typedef enum {
84 FS_ITEM_FS0,
85 FS_ITEM_FS1,
86 FS_ITEM_FS2,
87 FS_ITEM_FS3,
88 FS_ITEM_BACK,
89 FS_MENU_LAST
90} FSMenuItem;
91
92static const char *fs_menu[] = {
93 "Skip 0 Frames",
94 "Skip 1 Frames",
95 "Skip 2 Frames",
96 "Skip 3 Frames",
75 "Previous Menu..." 97 "Previous Menu..."
76}; 98};
77 99
@@ -90,6 +112,8 @@ int do_user_menu(void) {
90 int mi, ret, num_items; 112 int mi, ret, num_items;
91 bool done = false; 113 bool done = false;
92 114
115 pcm_init();
116
93 /* set defaults */ 117 /* set defaults */
94 ret = 0; /* return value */ 118 ret = 0; /* return value */
95 mi = 0; /* initial menu selection */ 119 mi = 0; /* initial menu selection */
@@ -119,7 +143,7 @@ int do_user_menu(void) {
119 break; 143 break;
120 } 144 }
121 } 145 }
122 146 rb->lcd_clear_display();
123 /* return somethin' */ 147 /* return somethin' */
124 return ret; 148 return ret;
125} 149}
@@ -314,6 +338,42 @@ static void do_slot_menu(bool is_load) {
314 } 338 }
315} 339}
316 340
341static void do_fs_menu(void) {
342 int mi, ret, num_items;
343 bool done = false;
344
345 /* set defaults */
346 ret = 0; /* return value */
347 mi = 0; /* initial menu selection */
348 num_items = sizeof(fs_menu) / sizeof(char*);
349
350 /* loop until we should exit menu */
351 while (!done) {
352 /* get item selection */
353 mi = do_menu(FS_MENU_TITLE, (char**) fs_menu, num_items, mi);
354
355 /* handle selected menu item */
356 switch (mi) {
357 case MENU_CANCEL:
358 case FS_ITEM_BACK:
359 done = true;
360 break;
361 case FS_ITEM_FS0:
362 frameskip=0;
363 break;
364 case FS_ITEM_FS1:
365 frameskip=1;
366 break;
367 case FS_ITEM_FS2:
368 frameskip=2;
369 break;
370 case FS_ITEM_FS3:
371 frameskip=3;
372 break;
373 }
374 }
375}
376
317static void do_opt_menu(void) { 377static void do_opt_menu(void) {
318 int mi, num_items; 378 int mi, num_items;
319 bool done = false; 379 bool done = false;
@@ -324,8 +384,18 @@ static void do_opt_menu(void) {
324 384
325 while (!done) { 385 while (!done) {
326 mi = do_menu(OPT_MENU_TITLE, (char**) opt_menu, num_items, mi); 386 mi = do_menu(OPT_MENU_TITLE, (char**) opt_menu, num_items, mi);
327 if (mi == MENU_CANCEL || mi == OM_ITEM_BACK) 387 switch (mi) {
388 case OM_ITEM_FS:
389 do_fs_menu();
390 break;
391 case OM_ITEM_SOUND:
392 sound=!sound;
393 break;
394 case MENU_CANCEL:
395 case OM_ITEM_BACK:
328 done = true; 396 done = true;
397 break;
398 }
329 } 399 }
330} 400}
331 401