summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-11-22 10:31:33 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-11-22 10:31:33 +0000
commit0394ebe44df99f8fc725dc4a66ab37209ef4d55b (patch)
treeb1b768b0ef85a92ab2917e0225410a0f366bf742 /apps
parent5e4a6824bb0ad1829a51e3b2a71a1d1d748eca37 (diff)
downloadrockbox-0394ebe44df99f8fc725dc4a66ab37209ef4d55b.zip
rockbox-0394ebe44df99f8fc725dc4a66ab37209ef4d55b.tar.gz
rockbox-0394ebe44df99f8fc725dc4a66ab37209ef4d55b.tar.bz2
rockbox-0394ebe44df99f8fc725dc4a66ab37209ef4d55b.tar.xz
FS#9557 - fix the %mv and %t timeout so its intrepreted correctly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19177 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/gwps-common.c12
-rw-r--r--apps/gui/gwps.h3
-rw-r--r--apps/gui/wps_parser.c3
3 files changed, 11 insertions, 7 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index a81b855..a0e09b8 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -65,6 +65,14 @@
/* 3% of 30min file == 54s step size */
#define MIN_FF_REWIND_STEP 500
+/* Timeout unit expressed in HZ. In WPS, all timeouts are given in seconds
+ (possibly with a decimal fraction) but stored as integer values.
+ E.g. 2.5 is stored as 25. This means 25 tenth of a second, i.e. 25 units.
+*/
+#define TIMEOUT_UNIT (HZ/10) /* I.e. 0.1 sec */
+#define DEFAULT_SUBLINE_TIME_MULTIPLIER 20 /* In TIMEOUT_UNIT's */
+
+
/* draws the statusbar on the given wps-screen */
#ifdef HAVE_LCD_BITMAP
static void gui_wps_statusbar_draw(struct gui_wps *wps, bool force)
@@ -1391,7 +1399,7 @@ static const char *get_token_value(struct gui_wps *gwps,
case WPS_TOKEN_BUTTON_VOLUME:
if (data->button_time_volume &&
TIME_BEFORE(current_tick, data->button_time_volume +
- token->value.i))
+ token->value.i * TIMEOUT_UNIT))
return "v";
return NULL;
default:
@@ -1728,7 +1736,7 @@ static bool update_curr_subline(struct gui_wps *gwps, int line)
new_subline_refresh = true;
data->lines[line].subline_expire_time = (reset_subline ?
current_tick : data->lines[line].subline_expire_time) +
- BASE_SUBLINE_TIME*data->sublines[subline_idx].time_mult;
+ TIMEOUT_UNIT*data->sublines[subline_idx].time_mult;
break;
}
}
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index 6a4849c..ff402a7 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -121,9 +121,6 @@ struct align_pos {
#endif
-#define DEFAULT_SUBLINE_TIME_MULTIPLIER 20 /* (10ths of sec) */
-#define BASE_SUBLINE_TIME 10 /* base time that multiplier is applied to
- (1/HZ sec, or 100ths of sec) */
#define SUBLINE_RESET -1
enum wps_parse_error {
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index d43680c..ca15348 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -26,7 +26,6 @@
#include "file.h"
#include "misc.h"
#include "plugin.h"
-#include "kernel.h"
#ifdef __PCTOOL__
#ifdef WPSEDITOR
@@ -811,7 +810,7 @@ static int parse_timeout(const char *wps_bufptr,
case WPS_TOKEN_SUBLINE_TIMEOUT:
return -1;
case WPS_TOKEN_BUTTON_VOLUME:
- val = HZ;
+ val = 10;
break;
}
}