summaryrefslogtreecommitdiff
path: root/apps/plugins/chessclock.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-08-05 14:29:29 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-08-05 14:29:29 +0000
commite2e7ecf350a4d085f6f58052f55ba29e8fe77718 (patch)
treed5abd6a205b9d32cb11e1c2d0ea08602812248d4 /apps/plugins/chessclock.c
parenteac0a5b840571a11b181fdfd463be61aca466976 (diff)
downloadrockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.zip
rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.gz
rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.bz2
rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.xz
add playback control to more menu of plugins.
although it doesn't make much sense for some plugins like dice as the menu is only shown when you start that plugin. change star plugin to go back to menu when exit game instead of closing plugin so that above change makes useful. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22171 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/chessclock.c')
-rw-r--r--apps/plugins/chessclock.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index 28b1d95..337e2cc 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -19,6 +19,7 @@
*
****************************************************************************/
#include "plugin.h"
+#include "lib/playback_control.h"
PLUGIN_HEADER
@@ -327,13 +328,13 @@ enum plugin_status plugin_start(const void* parameter)
int i;
bool done;
int nr;
-
+
(void)parameter;
settings.nr_timers = 1;
settings.total_time = 10;
settings.round_time = 10;
-
+
/* now go ahead and have fun! */
rb->splash(HZ, "Chess Clock");
@@ -380,7 +381,7 @@ enum plugin_status plugin_start(const void* parameter)
timer_holder[i].used_time=0;
timer_holder[i].hidden=false;
}
-
+
pause=true; /* We start paused */
nr=0;
@@ -431,7 +432,7 @@ enum plugin_status plugin_start(const void* parameter)
static void show_pause_mode(bool enabled)
{
static const char pause_icon[] = {0x00,0x7f,0x7f,0x00,0x7f,0x7f,0x00};
-
+
if (enabled)
rb->lcd_mono_bitmap((unsigned char *)pause_icon, 52, 0, 7, 8);
else
@@ -524,13 +525,14 @@ static int run_timer(int nr)
{
MENUITEM_STRINGLIST(menu, "Menu", NULL,
"Delete player", "Restart round",
- "Set round time", "Set total time");
+ "Set round time", "Set total time",
+ "Playback Control");
int val, res;
switch(rb->do_menu(&menu, NULL, NULL, false))
{
case 0:
- /* delete player */
+ /* delete player */
timer_holder[nr].hidden=true;
retval = CHCL_NEXT;
done=true;
@@ -544,8 +546,7 @@ static int run_timer(int nr)
/* set round time */
val=(max_ticks-ticks)/HZ;
res=chessclock_set_int("Round time",
- &val,
- 10, 0, MAX_TIME,
+ &val, 10, 0, MAX_TIME,
FLAGS_SET_INT_SECONDS);
if (res==CHCL_USB) {
retval = CHCL_USB;
@@ -569,6 +570,9 @@ static int run_timer(int nr)
timer_holder[nr].total_time=val;
}
break;
+ case 4:
+ playback_control(NULL);
+ break;
case MENU_ATTACHED_USB:
retval = CHCL_USB;
done=true;