Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Simple parameter display patch.
From: Mats Lidell (matsl_at_contactor.se)
Date: 2002-08-08


Hi,

This patch (for the player) changes the parameter setting menu to use
a bar off '#' on line two to show the parameter setting.

Index: sound_menu.c
===================================================================
RCS file: /cvsroot/rockbox/apps/sound_menu.c,v
retrieving revision 1.18
diff -u -u -r1.18 sound_menu.c
--- sound_menu.c 27 Jul 2002 22:45:29 -0000 1.18
+++ sound_menu.c 8 Aug 2002 12:29:24 -0000
@@ -45,14 +45,13 @@
     char* unit;
     char str[32];
 
+ int numval, i;
+
     unit = mpeg_sound_unit(setting);
     numdec = mpeg_sound_numdecimals(setting);
     min = mpeg_sound_min(setting);
     max = mpeg_sound_max(setting);
     
- lcd_clear_display();
- lcd_puts_scroll(0,0,string);
-
     while (!done) {
         val = mpeg_val2phys(setting, *variable);
         if(numdec)
@@ -63,9 +62,16 @@
         }
         else
         {
- snprintf(str,sizeof str,"%d %s ", val, unit);
+ snprintf(str,sizeof str,"%6s%3d%s ", string, val, unit);
         }
- lcd_puts(0,1,str);
+ lcd_clear_display();
+ lcd_puts(0,0,str);
+
+ numval = ((*variable - min) * 11) / (max - min);
+ for (i = 0; i < numval; ++i) str[i] = '#';
+ str[i] = '\0';
+ lcd_puts(0, 1, str);
+
         lcd_update();
 
         switch( button_get(true) ) {
@@ -109,12 +115,12 @@
 
 static void volume(void)
 {
- set_sound("Volume", &global_settings.volume, SOUND_VOLUME);
+ set_sound("Volume ", &global_settings.volume, SOUND_VOLUME);
 }
 
 static void bass(void)
 {
- set_sound("Bass", &global_settings.bass, SOUND_BASS);
+ set_sound("Bass ", &global_settings.bass, SOUND_BASS);
 };
 
 static void treble(void)

-- 
%% Mats



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa