summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-10-11 12:20:09 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-10-11 12:20:09 +0000
commit85600e629bf6a6a0583b0b7cb601431f05c61f1d (patch)
tree39722bc619d903efc6b3a0126d98984f82159add /apps
parent1a549d49f77da1fdf028bfe9b9669ece055069a4 (diff)
downloadrockbox-85600e629bf6a6a0583b0b7cb601431f05c61f1d.tar.gz
rockbox-85600e629bf6a6a0583b0b7cb601431f05c61f1d.tar.bz2
rockbox-85600e629bf6a6a0583b0b7cb601431f05c61f1d.zip
update the %mv wps tag to let you specify how long it should wait after being released to go back to false.
e.g %mv2 will stay true for 2 seconds or %mv3.5 is 3.5 seconds (same as the %t syntax)... if no number is specified it defaults to 1 second git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18769 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/gwps-common.c5
-rw-r--r--apps/gui/wps_parser.c14
2 files changed, 11 insertions, 8 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 18c7098511..806ce19d71 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -1389,8 +1389,11 @@ static const char *get_token_value(struct gui_wps *gwps,
return NULL;
#endif
case WPS_TOKEN_BUTTON_VOLUME:
+ if (token->value.i == 0)
+ token->value.i = HZ;
if (data->button_time_volume &&
- TIME_BEFORE(current_tick, data->button_time_volume+HZ))
+ TIME_BEFORE(current_tick, data->button_time_volume +
+ token->value.i))
return "v";
return NULL;
default:
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index eff65ef113..96e8d6664c 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -131,7 +131,7 @@ struct wps_tag {
};
/* prototypes of all special parse functions : */
-static int parse_subline_timeout(const char *wps_bufptr,
+static int parse_timeout(const char *wps_bufptr,
struct wps_token *token, struct wps_data *wps_data);
static int parse_progressbar(const char *wps_bufptr,
struct wps_token *token, struct wps_data *wps_data);
@@ -279,7 +279,8 @@ static const struct wps_tag all_tags[] = {
{ WPS_TOKEN_REPEAT_MODE, "mm", WPS_REFRESH_DYNAMIC, NULL },
{ WPS_TOKEN_PLAYBACK_STATUS, "mp", WPS_REFRESH_DYNAMIC, NULL },
- { WPS_TOKEN_BUTTON_VOLUME, "mv", WPS_REFRESH_DYNAMIC, NULL },
+ { WPS_TOKEN_BUTTON_VOLUME, "mv", WPS_REFRESH_DYNAMIC,
+ parse_timeout },
#ifdef HAVE_LCD_BITMAP
{ WPS_TOKEN_PEAKMETER, "pm", WPS_REFRESH_PEAK_METER, NULL },
@@ -314,7 +315,7 @@ static const struct wps_tag all_tags[] = {
#endif
{ WPS_NO_TOKEN, "s", WPS_REFRESH_SCROLL, NULL },
- { WPS_TOKEN_SUBLINE_TIMEOUT, "t", 0, parse_subline_timeout },
+ { WPS_TOKEN_SUBLINE_TIMEOUT, "t", 0, parse_timeout },
#ifdef HAVE_LCD_BITMAP
{ WPS_NO_TOKEN, "we", 0, parse_statusbar_enable },
@@ -766,9 +767,9 @@ static int parse_dir_level(const char *wps_bufptr,
return 1;
}
-static int parse_subline_timeout(const char *wps_bufptr,
- struct wps_token *token,
- struct wps_data *wps_data)
+static int parse_timeout(const char *wps_bufptr,
+ struct wps_token *token,
+ struct wps_data *wps_data)
{
int skip = 0;
int val = 0;
@@ -1110,7 +1111,6 @@ static int parse_albumart_conditional(const char *wps_bufptr,
};
#endif /* HAVE_ALBUMART */
-
/* Parse a generic token from the given string. Return the length read */
static int parse_token(const char *wps_bufptr, struct wps_data *wps_data)
{