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
This commit is contained in:
parent
1a549d49f7
commit
85600e629b
2 changed files with 11 additions and 8 deletions
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue