diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-02-26 17:10:27 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-02-26 17:10:27 +0000 |
commit | 15dbde1ab76cebd553e278a144e3e56d3b1f39d4 (patch) | |
tree | 08ba4cee139b1486abb64b97ea6e58b86d3c5415 | |
parent | af59e2ac3114a16e25a76c611a179670b101c0b1 (diff) | |
download | rockbox-15dbde1ab76cebd553e278a144e3e56d3b1f39d4.tar.gz rockbox-15dbde1ab76cebd553e278a144e3e56d3b1f39d4.zip |
Accept the first patch at FS#9953 - Add Playback Control to more plugins, by Joshua Simmons
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20111 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/bubbles.c | 9 | ||||
-rw-r--r-- | apps/plugins/chessbox/chessbox.c | 7 | ||||
-rw-r--r-- | apps/plugins/chopper.c | 6 | ||||
-rw-r--r-- | apps/plugins/clock/clock_menu.c | 8 | ||||
-rw-r--r-- | apps/plugins/fireworks.c | 6 | ||||
-rw-r--r-- | apps/plugins/minesweeper.c | 8 | ||||
-rw-r--r-- | apps/plugins/reversi/reversi-gui.c | 8 | ||||
-rw-r--r-- | apps/plugins/superdom.c | 6 | ||||
-rw-r--r-- | apps/plugins/vu_meter.c | 8 | ||||
-rw-r--r-- | apps/plugins/wormlet.c | 6 | ||||
-rw-r--r-- | apps/plugins/xobox.c | 5 |
11 files changed, 66 insertions, 11 deletions
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c index c776b6768e..1d199e80b2 100644 --- a/apps/plugins/bubbles.c +++ b/apps/plugins/bubbles.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "lib/xlcd.h" | 28 | #include "lib/xlcd.h" |
29 | #include "lib/pluginlib_actions.h" | 29 | #include "lib/pluginlib_actions.h" |
30 | #include "lib/fixedpoint.h" | 30 | #include "lib/fixedpoint.h" |
31 | #include "lib/playback_control.h" | ||
31 | 32 | ||
32 | PLUGIN_HEADER | 33 | PLUGIN_HEADER |
33 | 34 | ||
@@ -2398,7 +2399,8 @@ static int bubbles(struct game_context* bb) { | |||
2398 | ********************/ | 2399 | ********************/ |
2399 | MENUITEM_STRINGLIST(menu,"Bubbles Menu",NULL, | 2400 | MENUITEM_STRINGLIST(menu,"Bubbles Menu",NULL, |
2400 | "Start New Game", "Resume Game", | 2401 | "Start New Game", "Resume Game", |
2401 | "Level", "Display High Scores", "Quit"); | 2402 | "Level", "Display High Scores", "Playback Control", |
2403 | "Quit"); | ||
2402 | while(!startgame){ | 2404 | while(!startgame){ |
2403 | switch (rb->do_menu(&menu, NULL, NULL, false)) | 2405 | switch (rb->do_menu(&menu, NULL, NULL, false)) |
2404 | { | 2406 | { |
@@ -2421,7 +2423,10 @@ static int bubbles(struct game_context* bb) { | |||
2421 | case 3: /* High scores */ | 2423 | case 3: /* High scores */ |
2422 | bubbles_displayscores(bb); | 2424 | bubbles_displayscores(bb); |
2423 | break; | 2425 | break; |
2424 | case 4: /* quit */ | 2426 | case 4: /* Playback Control */ |
2427 | playback_control(NULL); | ||
2428 | break; | ||
2429 | case 5: /* quit */ | ||
2425 | return BB_QUIT; | 2430 | return BB_QUIT; |
2426 | case MENU_ATTACHED_USB: | 2431 | case MENU_ATTACHED_USB: |
2427 | bubbles_callback(bb); | 2432 | bubbles_callback(bb); |
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c index 1504f8a7cb..5f67d44808 100644 --- a/apps/plugins/chessbox/chessbox.c +++ b/apps/plugins/chessbox/chessbox.c | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #ifdef HAVE_LCD_BITMAP | 26 | #ifdef HAVE_LCD_BITMAP |
27 | 27 | ||
28 | #include "lib/playback_control.h" | ||
28 | #include "gnuchess.h" | 29 | #include "gnuchess.h" |
29 | #include "opening.h" | 30 | #include "opening.h" |
30 | #include "chessbox_pgn.h" | 31 | #include "chessbox_pgn.h" |
@@ -587,7 +588,8 @@ static int cb_menu(void) | |||
587 | bool menu_quit = false; | 588 | bool menu_quit = false; |
588 | 589 | ||
589 | MENUITEM_STRINGLIST(menu,"Chessbox Menu",NULL,"New Game","Resume Game", | 590 | MENUITEM_STRINGLIST(menu,"Chessbox Menu",NULL,"New Game","Resume Game", |
590 | "Save Game", "Restore Game", "Quit"); | 591 | "Save Game", "Restore Game", "Playback Control", |
592 | "Quit"); | ||
591 | 593 | ||
592 | while(!menu_quit) | 594 | while(!menu_quit) |
593 | { | 595 | { |
@@ -610,6 +612,9 @@ static int cb_menu(void) | |||
610 | menu_quit = true; | 612 | menu_quit = true; |
611 | break; | 613 | break; |
612 | case 4: | 614 | case 4: |
615 | playback_control(NULL); | ||
616 | break; | ||
617 | case 5: | ||
613 | result = COMMAND_QUIT; | 618 | result = COMMAND_QUIT; |
614 | menu_quit = true; | 619 | menu_quit = true; |
615 | break; | 620 | break; |
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c index 67fec2ed38..15333c4a99 100644 --- a/apps/plugins/chopper.c +++ b/apps/plugins/chopper.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "lib/xlcd.h" | 24 | #include "lib/xlcd.h" |
25 | #include "lib/configfile.h" | 25 | #include "lib/configfile.h" |
26 | #include "lib/helper.h" | 26 | #include "lib/helper.h" |
27 | #include "lib/playback_control.h" | ||
27 | 28 | ||
28 | PLUGIN_HEADER | 29 | PLUGIN_HEADER |
29 | 30 | ||
@@ -704,7 +705,7 @@ static int chopMenu(int menunum) | |||
704 | }; | 705 | }; |
705 | 706 | ||
706 | MENUITEM_STRINGLIST(menu,"Chopper Menu",NULL,"Start New Game","Resume Game", | 707 | MENUITEM_STRINGLIST(menu,"Chopper Menu",NULL,"Start New Game","Resume Game", |
707 | "Level","Quit"); | 708 | "Level","Playback Control","Quit"); |
708 | 709 | ||
709 | #ifdef HAVE_LCD_COLOR | 710 | #ifdef HAVE_LCD_COLOR |
710 | rb->lcd_set_foreground(LCD_WHITE); | 711 | rb->lcd_set_foreground(LCD_WHITE); |
@@ -736,6 +737,9 @@ static int chopMenu(int menunum) | |||
736 | rb->set_option("Level", &iLevelMode, INT, levels, 2, NULL); | 737 | rb->set_option("Level", &iLevelMode, INT, levels, 2, NULL); |
737 | break; | 738 | break; |
738 | case 3: | 739 | case 3: |
740 | playback_control(NULL); | ||
741 | break; | ||
742 | case 4: | ||
739 | menu_quit=true; | 743 | menu_quit=true; |
740 | res = PLUGIN_OK; | 744 | res = PLUGIN_OK; |
741 | break; | 745 | break; |
diff --git a/apps/plugins/clock/clock_menu.c b/apps/plugins/clock/clock_menu.c index 626222f88b..838335a529 100644 --- a/apps/plugins/clock/clock_menu.c +++ b/apps/plugins/clock/clock_menu.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "clock.h" | 22 | #include "clock.h" |
23 | #include "clock_bitmaps.h" | 23 | #include "clock_bitmaps.h" |
24 | #include "clock_settings.h" | 24 | #include "clock_settings.h" |
25 | #include "lib/playback_control.h" | ||
25 | 26 | ||
26 | /* Option structs (possible selections per each option) */ | 27 | /* Option structs (possible selections per each option) */ |
27 | static const struct opt_items noyes_text[] = { | 28 | static const struct opt_items noyes_text[] = { |
@@ -210,7 +211,8 @@ bool main_menu(void){ | |||
210 | bool exit_clock=false; | 211 | bool exit_clock=false; |
211 | 212 | ||
212 | MENUITEM_STRINGLIST(menu,"Clock Menu",NULL,"View Clock","Mode Selector", | 213 | MENUITEM_STRINGLIST(menu,"Clock Menu",NULL,"View Clock","Mode Selector", |
213 | "Mode Settings","General Settings","Quit"); | 214 | "Mode Settings","General Settings","Playback Control", |
215 | "Quit"); | ||
214 | 216 | ||
215 | while(!done){ | 217 | while(!done){ |
216 | switch(rb->do_menu(&menu, &selection, NULL, false)){ | 218 | switch(rb->do_menu(&menu, &selection, NULL, false)){ |
@@ -235,6 +237,10 @@ bool main_menu(void){ | |||
235 | break; | 237 | break; |
236 | 238 | ||
237 | case 4: | 239 | case 4: |
240 | playback_control(NULL); | ||
241 | break; | ||
242 | |||
243 | case 5: | ||
238 | exit_clock = true; | 244 | exit_clock = true; |
239 | done = true; | 245 | done = true; |
240 | break; | 246 | break; |
diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c index a33d0494f9..df2d998210 100644 --- a/apps/plugins/fireworks.c +++ b/apps/plugins/fireworks.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "plugin.h" | 21 | #include "plugin.h" |
22 | #include "lib/oldmenuapi.h" | 22 | #include "lib/oldmenuapi.h" |
23 | #include "lib/helper.h" | 23 | #include "lib/helper.h" |
24 | #include "lib/playback_control.h" | ||
24 | 25 | ||
25 | PLUGIN_HEADER | 26 | PLUGIN_HEADER |
26 | 27 | ||
@@ -289,6 +290,7 @@ static const struct menu_item items[] = { | |||
289 | { "Gravity", NULL }, | 290 | { "Gravity", NULL }, |
290 | { "Show Rockets", NULL }, | 291 | { "Show Rockets", NULL }, |
291 | { "FPS (Speed)", NULL }, | 292 | { "FPS (Speed)", NULL }, |
293 | { "Playback Control", NULL }, | ||
292 | { "Quit", NULL } | 294 | { "Quit", NULL } |
293 | }; | 295 | }; |
294 | 296 | ||
@@ -403,6 +405,10 @@ void fireworks_menu(void) | |||
403 | break; | 405 | break; |
404 | 406 | ||
405 | case 7: | 407 | case 7: |
408 | playback_control(NULL); | ||
409 | break; | ||
410 | |||
411 | case 8: | ||
406 | quit_plugin = true; | 412 | quit_plugin = true; |
407 | menu_quit = true; | 413 | menu_quit = true; |
408 | break; | 414 | break; |
diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index 4adfc07d0e..eeae12be64 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c | |||
@@ -23,6 +23,8 @@ | |||
23 | 23 | ||
24 | #ifdef HAVE_LCD_BITMAP | 24 | #ifdef HAVE_LCD_BITMAP |
25 | 25 | ||
26 | #include "lib/playback_control.h" | ||
27 | |||
26 | PLUGIN_HEADER | 28 | PLUGIN_HEADER |
27 | 29 | ||
28 | /* what the minesweeper() function can return */ | 30 | /* what the minesweeper() function can return */ |
@@ -548,7 +550,7 @@ enum minesweeper_status menu( void ) | |||
548 | 550 | ||
549 | MENUITEM_STRINGLIST( menu, "Minesweeper Menu", NULL, "Play Minesweeper", | 551 | MENUITEM_STRINGLIST( menu, "Minesweeper Menu", NULL, "Play Minesweeper", |
550 | "Mine Percentage", "Number of Rows", | 552 | "Mine Percentage", "Number of Rows", |
551 | "Number of Columns", "Quit" ); | 553 | "Number of Columns", "Playback Control", "Quit" ); |
552 | 554 | ||
553 | #ifdef HAVE_LCD_COLOR | 555 | #ifdef HAVE_LCD_COLOR |
554 | rb->lcd_set_foreground( rb->global_settings->fg_color ); | 556 | rb->lcd_set_foreground( rb->global_settings->fg_color ); |
@@ -579,6 +581,10 @@ enum minesweeper_status menu( void ) | |||
579 | 1, 1, MAX_WIDTH, NULL ); | 581 | 1, 1, MAX_WIDTH, NULL ); |
580 | break; | 582 | break; |
581 | 583 | ||
584 | case 4: | ||
585 | playback_control( NULL ); | ||
586 | break; | ||
587 | |||
582 | default: | 588 | default: |
583 | result = MINESWEEPER_QUIT; /* quit program */ | 589 | result = MINESWEEPER_QUIT; /* quit program */ |
584 | menu_quit = true; | 590 | menu_quit = true; |
diff --git a/apps/plugins/reversi/reversi-gui.c b/apps/plugins/reversi/reversi-gui.c index 5249a93efd..78e6f068c1 100644 --- a/apps/plugins/reversi/reversi-gui.c +++ b/apps/plugins/reversi/reversi-gui.c | |||
@@ -48,6 +48,7 @@ further options: | |||
48 | #include "reversi-gui.h" | 48 | #include "reversi-gui.h" |
49 | 49 | ||
50 | #include "lib/oldmenuapi.h" | 50 | #include "lib/oldmenuapi.h" |
51 | #include "lib/playback_control.h" | ||
51 | 52 | ||
52 | PLUGIN_HEADER | 53 | PLUGIN_HEADER |
53 | 54 | ||
@@ -383,6 +384,7 @@ static bool reversi_gui_menu(void) { | |||
383 | { MENU_TEXT_STRAT_BLACK, NULL }, | 384 | { MENU_TEXT_STRAT_BLACK, NULL }, |
384 | { MENU_TEXT_STRAT_WHITE, NULL }, | 385 | { MENU_TEXT_STRAT_WHITE, NULL }, |
385 | { MENU_TEXT_WRAP_MODE, NULL }, | 386 | { MENU_TEXT_WRAP_MODE, NULL }, |
387 | { "Playback Control", NULL }, | ||
386 | { "Quit", NULL }, | 388 | { "Quit", NULL }, |
387 | }; | 389 | }; |
388 | 390 | ||
@@ -422,7 +424,11 @@ static bool reversi_gui_menu(void) { | |||
422 | cursor_wrap_mode = cursor_wrap_mode_values[index]; | 424 | cursor_wrap_mode = cursor_wrap_mode_values[index]; |
423 | break; | 425 | break; |
424 | 426 | ||
425 | case 5: /* Quit */ | 427 | case 5: |
428 | playback_control(NULL); | ||
429 | break; | ||
430 | |||
431 | case 6: /* Quit */ | ||
426 | quit_plugin = true; | 432 | quit_plugin = true; |
427 | break; | 433 | break; |
428 | } | 434 | } |
diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c index 5d9cf7ff00..31f04b3b02 100644 --- a/apps/plugins/superdom.c +++ b/apps/plugins/superdom.c | |||
@@ -19,6 +19,7 @@ | |||
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | #include "plugin.h" | 21 | #include "plugin.h" |
22 | #include "lib/playback_control.h" | ||
22 | PLUGIN_HEADER | 23 | PLUGIN_HEADER |
23 | 24 | ||
24 | extern const fb_data superdom_boarditems[]; | 25 | extern const fb_data superdom_boarditems[]; |
@@ -714,7 +715,7 @@ int ingame_menu(void) { | |||
714 | int selection = 0; | 715 | int selection = 0; |
715 | 716 | ||
716 | MENUITEM_STRINGLIST(ingame_menu,"Super Domination Menu",NULL, | 717 | MENUITEM_STRINGLIST(ingame_menu,"Super Domination Menu",NULL, |
717 | "Return to game","Save Game", "Quit"); | 718 | "Return to game","Save Game","Playback Control", "Quit"); |
718 | 719 | ||
719 | selection=rb->do_menu(&ingame_menu,&selection, NULL, false); | 720 | selection=rb->do_menu(&ingame_menu,&selection, NULL, false); |
720 | switch(selection) { | 721 | switch(selection) { |
@@ -728,6 +729,9 @@ int ingame_menu(void) { | |||
728 | rb->splash(HZ, "Error in save"); | 729 | rb->splash(HZ, "Error in save"); |
729 | break; | 730 | break; |
730 | case 2: | 731 | case 2: |
732 | playback_control(NULL); | ||
733 | break; | ||
734 | case 3: | ||
731 | return SUPERDOM_QUIT; | 735 | return SUPERDOM_QUIT; |
732 | break; | 736 | break; |
733 | case MENU_ATTACHED_USB: | 737 | case MENU_ATTACHED_USB: |
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index 673c080102..9dfae72dc0 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c | |||
@@ -19,6 +19,7 @@ | |||
19 | **************************************************************************/ | 19 | **************************************************************************/ |
20 | #include "plugin.h" | 20 | #include "plugin.h" |
21 | #include "lib/fixedpoint.h" | 21 | #include "lib/fixedpoint.h" |
22 | #include "lib/playback_control.h" | ||
22 | 23 | ||
23 | PLUGIN_HEADER | 24 | PLUGIN_HEADER |
24 | 25 | ||
@@ -471,7 +472,8 @@ static bool vu_meter_menu(void) | |||
471 | bool exit = false; | 472 | bool exit = false; |
472 | 473 | ||
473 | MENUITEM_STRINGLIST(menu,"VU Meter Menu",NULL,"Meter Type","Scale", | 474 | MENUITEM_STRINGLIST(menu,"VU Meter Menu",NULL,"Meter Type","Scale", |
474 | "Minimeters","Decay Speed","Quit"); | 475 | "Minimeters","Decay Speed","Playback Control", |
476 | "Quit"); | ||
475 | 477 | ||
476 | static const struct opt_items meter_type_option[2] = { | 478 | static const struct opt_items meter_type_option[2] = { |
477 | { "Analog", -1 }, | 479 | { "Analog", -1 }, |
@@ -536,6 +538,10 @@ static bool vu_meter_menu(void) | |||
536 | break; | 538 | break; |
537 | 539 | ||
538 | case 4: | 540 | case 4: |
541 | playback_control(NULL); | ||
542 | break; | ||
543 | |||
544 | case 5: | ||
539 | exit = true; | 545 | exit = true; |
540 | /* fall through to exit the menu */ | 546 | /* fall through to exit the menu */ |
541 | default: | 547 | default: |
diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c index 63eb43f258..2eed1aa357 100644 --- a/apps/plugins/wormlet.c +++ b/apps/plugins/wormlet.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "plugin.h" | 21 | #include "plugin.h" |
22 | #include "lib/configfile.h" | 22 | #include "lib/configfile.h" |
23 | #include "lib/helper.h" | 23 | #include "lib/helper.h" |
24 | #include "lib/playback_control.h" | ||
24 | 25 | ||
25 | PLUGIN_HEADER | 26 | PLUGIN_HEADER |
26 | 27 | ||
@@ -2671,7 +2672,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
2671 | "Number of Worms", "Number of Players", "Control Style", | 2672 | "Number of Worms", "Number of Players", "Control Style", |
2672 | "Worm Growth Per Food","Worm Speed","Arghs Per Food", | 2673 | "Worm Growth Per Food","Worm Speed","Arghs Per Food", |
2673 | "Argh Size","Food Size","Revert to Default Settings", | 2674 | "Argh Size","Food Size","Revert to Default Settings", |
2674 | "Quit"); | 2675 | "Playback Control", "Quit"); |
2675 | 2676 | ||
2676 | rb->button_clear_queue(); | 2677 | rb->button_clear_queue(); |
2677 | 2678 | ||
@@ -2768,6 +2769,9 @@ enum plugin_status plugin_start(const void* parameter) | |||
2768 | if (new_setting == 1) | 2769 | if (new_setting == 1) |
2769 | default_settings(); | 2770 | default_settings(); |
2770 | break; | 2771 | break; |
2772 | case 10: | ||
2773 | playback_control(NULL); | ||
2774 | break; | ||
2771 | default: | 2775 | default: |
2772 | menu_quit=1; | 2776 | menu_quit=1; |
2773 | break; | 2777 | break; |
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index 22286b0d72..c486e1b4c7 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include "plugin.h" | 23 | #include "plugin.h" |
24 | #include "lib/helper.h" | 24 | #include "lib/helper.h" |
25 | #include "lib/playback_control.h" | ||
25 | 26 | ||
26 | PLUGIN_HEADER | 27 | PLUGIN_HEADER |
27 | 28 | ||
@@ -901,7 +902,7 @@ static inline void move_board (void) | |||
901 | static int game_menu (void) | 902 | static int game_menu (void) |
902 | { | 903 | { |
903 | MENUITEM_STRINGLIST(menu, "XOBOX Menu", NULL, "Start New Game", | 904 | MENUITEM_STRINGLIST(menu, "XOBOX Menu", NULL, "Start New Game", |
904 | "Speed","Difficulty","Quit"); | 905 | "Speed","Difficulty","Playback Control","Quit"); |
905 | int selection = 0; | 906 | int selection = 0; |
906 | #ifdef HAVE_LCD_COLOR | 907 | #ifdef HAVE_LCD_COLOR |
907 | rb->lcd_set_foreground (rb->global_settings->fg_color); | 908 | rb->lcd_set_foreground (rb->global_settings->fg_color); |
@@ -917,6 +918,8 @@ static int game_menu (void) | |||
917 | else if (selection==2) | 918 | else if (selection==2) |
918 | rb->set_int ("Difficulty", "", UNIT_INT, &difficulty, NULL, | 919 | rb->set_int ("Difficulty", "", UNIT_INT, &difficulty, NULL, |
919 | 5, 50, 95, NULL); | 920 | 5, 50, 95, NULL); |
921 | else if (selection==3) | ||
922 | playback_control (NULL); | ||
920 | else | 923 | else |
921 | break; | 924 | break; |
922 | } | 925 | } |