summaryrefslogtreecommitdiff
path: root/apps/recorder/icons.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder/icons.c')
-rw-r--r--apps/recorder/icons.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c
index 6e0ff73fc8..b831e59f53 100644
--- a/apps/recorder/icons.c
+++ b/apps/recorder/icons.c
@@ -205,7 +205,7 @@ void statusbar_icon_battery(int percent, bool charging)
205/* 205/*
206 * Print volume gauge to status bar 206 * Print volume gauge to status bar
207 */ 207 */
208void statusbar_icon_volume(int percent) 208bool statusbar_icon_volume(int percent)
209{ 209{
210 int i,j; 210 int i,j;
211 int volume; 211 int volume;
@@ -213,6 +213,8 @@ void statusbar_icon_volume(int percent)
213 int step=0; 213 int step=0;
214 char buffer[4]; 214 char buffer[4];
215 unsigned int width, height; 215 unsigned int width, height;
216 bool needs_redraw = false;
217 int type = global_settings.volume_type;
216#if defined(LOADABLE_FONTS) 218#if defined(LOADABLE_FONTS)
217 unsigned char *font; 219 unsigned char *font;
218#endif 220#endif
@@ -231,13 +233,20 @@ void statusbar_icon_volume(int percent)
231 STATUSBAR_Y_POS, 7, STATUSBAR_HEIGHT, false); 233 STATUSBAR_Y_POS, 7, STATUSBAR_HEIGHT, false);
232 } 234 }
233 else { 235 else {
236 /* We want to redraw the icon later on */
234 if (last_volume != volume && last_volume >= 0) { 237 if (last_volume != volume && last_volume >= 0) {
235 switch_tick = current_tick + HZ; 238 switch_tick = current_tick + HZ;
236 } 239 }
237 240
241 /* If the timeout hasn't yet been reached, we show it numerically
242 and tell the caller that we want to be called again */
243 if(TIME_BEFORE(current_tick,switch_tick)) {
244 type = 1;
245 needs_redraw = true;
246 }
247
238 /* display volume level numerical? */ 248 /* display volume level numerical? */
239 if (global_settings.volume_type || 249 if (type)
240 TIME_BEFORE(current_tick,switch_tick))
241 { 250 {
242 snprintf(buffer, sizeof(buffer), "%2d", percent); 251 snprintf(buffer, sizeof(buffer), "%2d", percent);
243 lcd_setfont(FONT_SYSFIXED); 252 lcd_setfont(FONT_SYSFIXED);
@@ -259,6 +268,8 @@ void statusbar_icon_volume(int percent)
259 } 268 }
260 } 269 }
261 last_volume = volume; 270 last_volume = volume;
271
272 return needs_redraw;
262} 273}
263 274
264/* 275/*