summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/option_select.c3
-rw-r--r--apps/gui/skin_engine/skin_parser.c1
-rw-r--r--apps/gui/skin_engine/skin_tokens.c4
-rw-r--r--apps/gui/skin_engine/wps_internals.h2
-rw-r--r--apps/gui/wps.c2
-rw-r--r--apps/main.c1
-rw-r--r--apps/misc.c1
-rw-r--r--apps/settings.h1
8 files changed, 8 insertions, 7 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c
index 7d142b0311..1f5e8706f9 100644
--- a/apps/gui/option_select.c
+++ b/apps/gui/option_select.c
@@ -564,6 +564,9 @@ bool option_screen(const struct settings_list *setting,
564 /* callback */ 564 /* callback */
565 if ( function ) 565 if ( function )
566 function(*variable); 566 function(*variable);
567 /* if the volume is changing we need to let the skins know */
568 if (function == sound_get_fn(SOUND_VOLUME))
569 global_status.last_volume_change = current_tick;
567 } 570 }
568 return false; 571 return false;
569} 572}
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 434e7c9fa5..7f6e80d108 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -1632,7 +1632,6 @@ void skin_data_reset(struct wps_data *wps_data)
1632#endif 1632#endif
1633 wps_data->tokens = NULL; 1633 wps_data->tokens = NULL;
1634 wps_data->num_tokens = 0; 1634 wps_data->num_tokens = 0;
1635 wps_data->button_time_volume = 0;
1636 1635
1637#ifdef HAVE_LCD_BITMAP 1636#ifdef HAVE_LCD_BITMAP
1638 wps_data->peak_meter_enabled = false; 1637 wps_data->peak_meter_enabled = false;
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index aeb7bdbbde..5156dd7ce7 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -818,8 +818,8 @@ const char *get_token_value(struct gui_wps *gwps,
818 return NULL; 818 return NULL;
819#endif 819#endif
820 case WPS_TOKEN_BUTTON_VOLUME: 820 case WPS_TOKEN_BUTTON_VOLUME:
821 if (data->button_time_volume && 821 if (global_status.last_volume_change &&
822 TIME_BEFORE(current_tick, data->button_time_volume + 822 TIME_BEFORE(current_tick, global_status.last_volume_change +
823 token->value.i * TIMEOUT_UNIT)) 823 token->value.i * TIMEOUT_UNIT))
824 return "v"; 824 return "v";
825 return NULL; 825 return NULL;
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index 1fd68646ad..d54b54ff00 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -264,8 +264,6 @@ struct wps_data
264 /* Total number of tokens in the WPS. During WPS parsing, this is 264 /* Total number of tokens in the WPS. During WPS parsing, this is
265 the index of the token being parsed. */ 265 the index of the token being parsed. */
266 int num_tokens; 266 int num_tokens;
267 /* tick the volume button was last pressed */
268 unsigned int button_time_volume;
269 267
270#ifdef HAVE_LCD_BITMAP 268#ifdef HAVE_LCD_BITMAP
271 bool peak_meter_enabled; 269 bool peak_meter_enabled;
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index e449644502..441ac3f9d8 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -1130,8 +1130,6 @@ long gui_wps_show(void)
1130 1130
1131 if (vol_changed) 1131 if (vol_changed)
1132 { 1132 {
1133 FOR_NB_SCREENS(i)
1134 gui_wps[i].data->button_time_volume = current_tick;
1135 bool res = false; 1133 bool res = false;
1136 setvol(); 1134 setvol();
1137 FOR_NB_SCREENS(i) 1135 FOR_NB_SCREENS(i)
diff --git a/apps/main.c b/apps/main.c
index 4c7d48e2d9..677eeb5b21 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -158,6 +158,7 @@ static void app_main(void)
158 } 158 }
159#endif /* #ifdef AUTOROCK */ 159#endif /* #ifdef AUTOROCK */
160 160
161 global_status.last_volume_change = 0;
161 root_menu(); 162 root_menu();
162} 163}
163 164
diff --git a/apps/misc.c b/apps/misc.c
index 6be9f8f010..f1c38f376c 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -739,6 +739,7 @@ void setvol(void)
739 if (global_settings.volume > max_vol) 739 if (global_settings.volume > max_vol)
740 global_settings.volume = max_vol; 740 global_settings.volume = max_vol;
741 sound_set_volume(global_settings.volume); 741 sound_set_volume(global_settings.volume);
742 global_status.last_volume_change = current_tick;
742 settings_save(); 743 settings_save();
743} 744}
744 745
diff --git a/apps/settings.h b/apps/settings.h
index 07f6f22efb..6de820807f 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -308,6 +308,7 @@ struct system_status
308#endif 308#endif
309 signed char last_screen; 309 signed char last_screen;
310 int viewer_icon_count; 310 int viewer_icon_count;
311 int last_volume_change; /* tick the last volume change happened. skins use this */
311}; 312};
312 313
313struct user_settings 314struct user_settings