summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/gwps-common.c5
-rw-r--r--apps/gui/gwps.c4
-rw-r--r--apps/gui/gwps.h8
-rw-r--r--apps/gui/wps_parser.c2
4 files changed, 18 insertions, 1 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index c734351..dd941e8 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -1388,6 +1388,11 @@ static const char *get_token_value(struct gui_wps *gwps,
else
return NULL;
#endif
+ case WPS_TOKEN_BUTTON_VOLUME:
+ if (data->button_time_volume &&
+ TIME_BEFORE(current_tick, data->button_time_volume+2*HZ/3))
+ return ".:|";
+ return NULL;
default:
return NULL;
}
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index 722dce6..47cc05a 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -329,6 +329,8 @@ long gui_wps_show(void)
/* volume up */
case ACTION_WPS_VOLUP:
{
+ FOR_NB_SCREENS(i)
+ gui_wps[i].data->button_time_volume = current_tick;
global_settings.volume++;
bool res = false;
setvol();
@@ -347,6 +349,8 @@ long gui_wps_show(void)
/* volume down */
case ACTION_WPS_VOLDOWN:
{
+ FOR_NB_SCREENS(i)
+ gui_wps[i].data->button_time_volume = current_tick;
global_settings.volume--;
setvol();
bool res = false;
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index 99bf701..579a340 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -292,7 +292,10 @@ enum wps_token_type {
#endif
/* Viewport display */
- WPS_VIEWPORT_ENABLE
+ WPS_VIEWPORT_ENABLE,
+
+ /* buttons */
+ WPS_TOKEN_BUTTON_VOLUME
};
struct wps_token {
@@ -423,6 +426,9 @@ struct wps_data
int num_strings;
bool wps_loaded;
+
+ /* tick the volume button was last pressed */
+ unsigned int button_time_volume;
};
/* initial setup of wps_data */
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index b2baddd..eff65ef 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -279,6 +279,7 @@ 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 },
#ifdef HAVE_LCD_BITMAP
{ WPS_TOKEN_PEAKMETER, "pm", WPS_REFRESH_PEAK_METER, NULL },
@@ -1443,6 +1444,7 @@ void wps_data_init(struct wps_data *wps_data)
}
wps_data->full_line_progressbar = false;
#endif
+ wps_data->button_time_volume = 0;
wps_data->wps_loaded = false;
}