From 15dbde1ab76cebd553e278a144e3e56d3b1f39d4 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Thu, 26 Feb 2009 17:10:27 +0000 Subject: [PATCH] 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 --- apps/plugins/bubbles.c | 9 +++++++-- apps/plugins/chessbox/chessbox.c | 7 ++++++- apps/plugins/chopper.c | 6 +++++- apps/plugins/clock/clock_menu.c | 8 +++++++- apps/plugins/fireworks.c | 6 ++++++ apps/plugins/minesweeper.c | 8 +++++++- apps/plugins/reversi/reversi-gui.c | 8 +++++++- apps/plugins/superdom.c | 6 +++++- apps/plugins/vu_meter.c | 8 +++++++- apps/plugins/wormlet.c | 6 +++++- 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 @@ #include "lib/xlcd.h" #include "lib/pluginlib_actions.h" #include "lib/fixedpoint.h" +#include "lib/playback_control.h" PLUGIN_HEADER @@ -2398,7 +2399,8 @@ static int bubbles(struct game_context* bb) { ********************/ MENUITEM_STRINGLIST(menu,"Bubbles Menu",NULL, "Start New Game", "Resume Game", - "Level", "Display High Scores", "Quit"); + "Level", "Display High Scores", "Playback Control", + "Quit"); while(!startgame){ switch (rb->do_menu(&menu, NULL, NULL, false)) { @@ -2421,7 +2423,10 @@ static int bubbles(struct game_context* bb) { case 3: /* High scores */ bubbles_displayscores(bb); break; - case 4: /* quit */ + case 4: /* Playback Control */ + playback_control(NULL); + break; + case 5: /* quit */ return BB_QUIT; case MENU_ATTACHED_USB: 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 @@ #ifdef HAVE_LCD_BITMAP +#include "lib/playback_control.h" #include "gnuchess.h" #include "opening.h" #include "chessbox_pgn.h" @@ -587,7 +588,8 @@ static int cb_menu(void) bool menu_quit = false; MENUITEM_STRINGLIST(menu,"Chessbox Menu",NULL,"New Game","Resume Game", - "Save Game", "Restore Game", "Quit"); + "Save Game", "Restore Game", "Playback Control", + "Quit"); while(!menu_quit) { @@ -610,6 +612,9 @@ static int cb_menu(void) menu_quit = true; break; case 4: + playback_control(NULL); + break; + case 5: result = COMMAND_QUIT; menu_quit = true; 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 @@ #include "lib/xlcd.h" #include "lib/configfile.h" #include "lib/helper.h" +#include "lib/playback_control.h" PLUGIN_HEADER @@ -704,7 +705,7 @@ static int chopMenu(int menunum) }; MENUITEM_STRINGLIST(menu,"Chopper Menu",NULL,"Start New Game","Resume Game", - "Level","Quit"); + "Level","Playback Control","Quit"); #ifdef HAVE_LCD_COLOR rb->lcd_set_foreground(LCD_WHITE); @@ -736,6 +737,9 @@ static int chopMenu(int menunum) rb->set_option("Level", &iLevelMode, INT, levels, 2, NULL); break; case 3: + playback_control(NULL); + break; + case 4: menu_quit=true; res = PLUGIN_OK; 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 @@ #include "clock.h" #include "clock_bitmaps.h" #include "clock_settings.h" +#include "lib/playback_control.h" /* Option structs (possible selections per each option) */ static const struct opt_items noyes_text[] = { @@ -210,7 +211,8 @@ bool main_menu(void){ bool exit_clock=false; MENUITEM_STRINGLIST(menu,"Clock Menu",NULL,"View Clock","Mode Selector", - "Mode Settings","General Settings","Quit"); + "Mode Settings","General Settings","Playback Control", + "Quit"); while(!done){ switch(rb->do_menu(&menu, &selection, NULL, false)){ @@ -235,6 +237,10 @@ bool main_menu(void){ break; case 4: + playback_control(NULL); + break; + + case 5: exit_clock = true; done = true; 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 @@ #include "plugin.h" #include "lib/oldmenuapi.h" #include "lib/helper.h" +#include "lib/playback_control.h" PLUGIN_HEADER @@ -289,6 +290,7 @@ static const struct menu_item items[] = { { "Gravity", NULL }, { "Show Rockets", NULL }, { "FPS (Speed)", NULL }, + { "Playback Control", NULL }, { "Quit", NULL } }; @@ -403,6 +405,10 @@ void fireworks_menu(void) break; case 7: + playback_control(NULL); + break; + + case 8: quit_plugin = true; menu_quit = true; 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 @@ #ifdef HAVE_LCD_BITMAP +#include "lib/playback_control.h" + PLUGIN_HEADER /* what the minesweeper() function can return */ @@ -548,7 +550,7 @@ enum minesweeper_status menu( void ) MENUITEM_STRINGLIST( menu, "Minesweeper Menu", NULL, "Play Minesweeper", "Mine Percentage", "Number of Rows", - "Number of Columns", "Quit" ); + "Number of Columns", "Playback Control", "Quit" ); #ifdef HAVE_LCD_COLOR rb->lcd_set_foreground( rb->global_settings->fg_color ); @@ -579,6 +581,10 @@ enum minesweeper_status menu( void ) 1, 1, MAX_WIDTH, NULL ); break; + case 4: + playback_control( NULL ); + break; + default: result = MINESWEEPER_QUIT; /* quit program */ 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: #include "reversi-gui.h" #include "lib/oldmenuapi.h" +#include "lib/playback_control.h" PLUGIN_HEADER @@ -383,6 +384,7 @@ static bool reversi_gui_menu(void) { { MENU_TEXT_STRAT_BLACK, NULL }, { MENU_TEXT_STRAT_WHITE, NULL }, { MENU_TEXT_WRAP_MODE, NULL }, + { "Playback Control", NULL }, { "Quit", NULL }, }; @@ -422,7 +424,11 @@ static bool reversi_gui_menu(void) { cursor_wrap_mode = cursor_wrap_mode_values[index]; break; - case 5: /* Quit */ + case 5: + playback_control(NULL); + break; + + case 6: /* Quit */ quit_plugin = true; break; } 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 @@ * ****************************************************************************/ #include "plugin.h" +#include "lib/playback_control.h" PLUGIN_HEADER extern const fb_data superdom_boarditems[]; @@ -714,7 +715,7 @@ int ingame_menu(void) { int selection = 0; MENUITEM_STRINGLIST(ingame_menu,"Super Domination Menu",NULL, - "Return to game","Save Game", "Quit"); + "Return to game","Save Game","Playback Control", "Quit"); selection=rb->do_menu(&ingame_menu,&selection, NULL, false); switch(selection) { @@ -728,6 +729,9 @@ int ingame_menu(void) { rb->splash(HZ, "Error in save"); break; case 2: + playback_control(NULL); + break; + case 3: return SUPERDOM_QUIT; break; 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 @@ **************************************************************************/ #include "plugin.h" #include "lib/fixedpoint.h" +#include "lib/playback_control.h" PLUGIN_HEADER @@ -471,7 +472,8 @@ static bool vu_meter_menu(void) bool exit = false; MENUITEM_STRINGLIST(menu,"VU Meter Menu",NULL,"Meter Type","Scale", - "Minimeters","Decay Speed","Quit"); + "Minimeters","Decay Speed","Playback Control", + "Quit"); static const struct opt_items meter_type_option[2] = { { "Analog", -1 }, @@ -536,6 +538,10 @@ static bool vu_meter_menu(void) break; case 4: + playback_control(NULL); + break; + + case 5: exit = true; /* fall through to exit the menu */ 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 @@ #include "plugin.h" #include "lib/configfile.h" #include "lib/helper.h" +#include "lib/playback_control.h" PLUGIN_HEADER @@ -2671,7 +2672,7 @@ enum plugin_status plugin_start(const void* parameter) "Number of Worms", "Number of Players", "Control Style", "Worm Growth Per Food","Worm Speed","Arghs Per Food", "Argh Size","Food Size","Revert to Default Settings", - "Quit"); + "Playback Control", "Quit"); rb->button_clear_queue(); @@ -2768,6 +2769,9 @@ enum plugin_status plugin_start(const void* parameter) if (new_setting == 1) default_settings(); break; + case 10: + playback_control(NULL); + break; default: menu_quit=1; 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 @@ #include "plugin.h" #include "lib/helper.h" +#include "lib/playback_control.h" PLUGIN_HEADER @@ -901,7 +902,7 @@ static inline void move_board (void) static int game_menu (void) { MENUITEM_STRINGLIST(menu, "XOBOX Menu", NULL, "Start New Game", - "Speed","Difficulty","Quit"); + "Speed","Difficulty","Playback Control","Quit"); int selection = 0; #ifdef HAVE_LCD_COLOR rb->lcd_set_foreground (rb->global_settings->fg_color); @@ -917,6 +918,8 @@ static int game_menu (void) else if (selection==2) rb->set_int ("Difficulty", "", UNIT_INT, &difficulty, NULL, 5, 50, 95, NULL); + else if (selection==3) + playback_control (NULL); else break; }