summaryrefslogtreecommitdiffstats
path: root/apps/recorder/icons.c
diff options
context:
space:
mode:
authorMarkus Braun <markus.braun@krawel.de>2002-08-09 11:57:31 +0000
committerMarkus Braun <markus.braun@krawel.de>2002-08-09 11:57:31 +0000
commit9bf86f75fac571e79e9fd85632704e43fb026ae1 (patch)
tree2e9fa73be15037323f22ef288d8a0159bd8de1bc /apps/recorder/icons.c
parentded1ef158a077c8dd75aeb84b428759082bda68b (diff)
downloadrockbox-9bf86f75fac571e79e9fd85632704e43fb026ae1.tar.gz
rockbox-9bf86f75fac571e79e9fd85632704e43fb026ae1.tar.bz2
rockbox-9bf86f75fac571e79e9fd85632704e43fb026ae1.zip
Volume is shown numerical after a change
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1642 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder/icons.c')
-rw-r--r--apps/recorder/icons.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c
index 89d7186224..78d07dbd1a 100644
--- a/apps/recorder/icons.c
+++ b/apps/recorder/icons.c
@@ -17,6 +17,7 @@
*
****************************************************************************/
#include <lcd.h>
+#include "kernel.h"
#include "icons.h"
#ifndef SIMULATOR
@@ -208,6 +209,9 @@ void statusbar_icon_volume(int percent)
int i,j;
int volume;
int step=0;
+ char buffer[4];
+ static long switch_tick;
+ static int last_volume;
volume=percent;
if(volume<0)
@@ -218,12 +222,22 @@ void statusbar_icon_volume(int percent)
if(volume==0)
lcd_bitmap(bitmap_icon_7x8[Icon_Mute], ICON_VOLUME_X_POS+ICON_VOLUME_WIDTH/2-4, STATUSBAR_Y_POS, 7, STATUSBAR_HEIGHT, false);
else {
- volume=volume*14/100;
- for(i=0;i<volume;i++) {
- if(i%2 == 0)
- step++;
- for(j=1;j<=step;j++)
- DRAW_PIXEL((ICON_VOLUME_X_POS+i),(STATUSBAR_Y_POS+7-j));
+ if(last_volume!=volume) {
+ switch_tick=current_tick+HZ;
+ last_volume=volume;
+ }
+ if(TIME_BEFORE(current_tick,switch_tick)) { /* display volume lever numerical */
+ snprintf(buffer, sizeof(buffer), "%2d", percent);
+ lcd_putsxy(ICON_VOLUME_X_POS+ICON_VOLUME_WIDTH/2-6, STATUSBAR_Y_POS, buffer, 0);
+ }
+ else { /* display volume bar */
+ volume=volume*14/100;
+ for(i=0;i<volume;i++) {
+ if(i%2 == 0)
+ step++;
+ for(j=1;j<=step;j++)
+ DRAW_PIXEL((ICON_VOLUME_X_POS+i),(STATUSBAR_Y_POS+7-j));
+ }
}
}
}