summaryrefslogtreecommitdiff
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
parent5e4a6824bb0ad1829a51e3b2a71a1d1d748eca37 (diff)
downloadrockbox-0394ebe44df99f8fc725dc4a66ab37209ef4d55b.tar.gz
rockbox-0394ebe44df99f8fc725dc4a66ab37209ef4d55b.zip
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
-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 a81b8555f7..a0e09b8117 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -65,6 +65,14 @@
65 /* 3% of 30min file == 54s step size */ 65 /* 3% of 30min file == 54s step size */
66#define MIN_FF_REWIND_STEP 500 66#define MIN_FF_REWIND_STEP 500
67 67
68/* Timeout unit expressed in HZ. In WPS, all timeouts are given in seconds
69 (possibly with a decimal fraction) but stored as integer values.
70 E.g. 2.5 is stored as 25. This means 25 tenth of a second, i.e. 25 units.
71*/
72#define TIMEOUT_UNIT (HZ/10) /* I.e. 0.1 sec */
73#define DEFAULT_SUBLINE_TIME_MULTIPLIER 20 /* In TIMEOUT_UNIT's */
74
75
68/* draws the statusbar on the given wps-screen */ 76/* draws the statusbar on the given wps-screen */
69#ifdef HAVE_LCD_BITMAP 77#ifdef HAVE_LCD_BITMAP
70static void gui_wps_statusbar_draw(struct gui_wps *wps, bool force) 78static 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,
1391 case WPS_TOKEN_BUTTON_VOLUME: 1399 case WPS_TOKEN_BUTTON_VOLUME:
1392 if (data->button_time_volume && 1400 if (data->button_time_volume &&
1393 TIME_BEFORE(current_tick, data->button_time_volume + 1401 TIME_BEFORE(current_tick, data->button_time_volume +
1394 token->value.i)) 1402 token->value.i * TIMEOUT_UNIT))
1395 return "v"; 1403 return "v";
1396 return NULL; 1404 return NULL;
1397 default: 1405 default:
@@ -1728,7 +1736,7 @@ static bool update_curr_subline(struct gui_wps *gwps, int line)
1728 new_subline_refresh = true; 1736 new_subline_refresh = true;
1729 data->lines[line].subline_expire_time = (reset_subline ? 1737 data->lines[line].subline_expire_time = (reset_subline ?
1730 current_tick : data->lines[line].subline_expire_time) + 1738 current_tick : data->lines[line].subline_expire_time) +
1731 BASE_SUBLINE_TIME*data->sublines[subline_idx].time_mult; 1739 TIMEOUT_UNIT*data->sublines[subline_idx].time_mult;
1732 break; 1740 break;
1733 } 1741 }
1734 } 1742 }
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index 6a4849c347..ff402a73a9 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -121,9 +121,6 @@ struct align_pos {
121 121
122#endif 122#endif
123 123
124#define DEFAULT_SUBLINE_TIME_MULTIPLIER 20 /* (10ths of sec) */
125#define BASE_SUBLINE_TIME 10 /* base time that multiplier is applied to
126 (1/HZ sec, or 100ths of sec) */
127#define SUBLINE_RESET -1 124#define SUBLINE_RESET -1
128 125
129enum wps_parse_error { 126enum wps_parse_error {
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index d43680cae7..ca15348eae 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -26,7 +26,6 @@
26#include "file.h" 26#include "file.h"
27#include "misc.h" 27#include "misc.h"
28#include "plugin.h" 28#include "plugin.h"
29#include "kernel.h"
30 29
31#ifdef __PCTOOL__ 30#ifdef __PCTOOL__
32#ifdef WPSEDITOR 31#ifdef WPSEDITOR
@@ -811,7 +810,7 @@ static int parse_timeout(const char *wps_bufptr,
811 case WPS_TOKEN_SUBLINE_TIMEOUT: 810 case WPS_TOKEN_SUBLINE_TIMEOUT:
812 return -1; 811 return -1;
813 case WPS_TOKEN_BUTTON_VOLUME: 812 case WPS_TOKEN_BUTTON_VOLUME:
814 val = HZ; 813 val = 10;
815 break; 814 break;
816 } 815 }
817 } 816 }