diff options
author | Rob Purchase <shotofadds@rockbox.org> | 2008-10-07 08:13:05 +0000 |
---|---|---|
committer | Rob Purchase <shotofadds@rockbox.org> | 2008-10-07 08:13:05 +0000 |
commit | d2221378cfbf685f2bb2b45cf56e8e782aeee2c7 (patch) | |
tree | b6b8ee861729b63b1e36ee59ab4038388ff0c396 /apps/plugins/vu_meter.c | |
parent | c4fdd2e7881c7ea91a4d8a3a6d227e2fb87e8a76 (diff) |
Accept FS#9325 (colourize digital vu_meter) by Clement Pit-Claudel.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18726 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/vu_meter.c')
-rw-r--r-- | apps/plugins/vu_meter.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index 4c98e6df8f..405f6df01d 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c @@ -298,6 +298,9 @@ int last_num_left_leds; int last_num_right_leds; int i; +#ifdef HAVE_LCD_COLOR +int screen_foreground; +#endif #define MAX_PEAK 0x8000 @@ -510,6 +513,9 @@ void draw_analog_minimeters(void) { } void draw_digital_minimeters(void) { +#ifdef HAVE_LCD_COLOR + rb->lcd_set_foreground(LCD_RGBPACK(255, 255 - 23 * num_left_leds, 0)); +#endif rb->lcd_mono_bitmap(sound_speaker, 34, half_height-8, 4, 8); rb->lcd_set_drawmode(DRMODE_FG); if(1<num_left_leds) @@ -521,6 +527,9 @@ void draw_digital_minimeters(void) { if(8<num_left_leds) rb->lcd_mono_bitmap(sound_max_level, 46, half_height-8, 3, 8); +#ifdef HAVE_LCD_COLOR + rb->lcd_set_foreground(LCD_RGBPACK(255, 255 - 23 * num_right_leds, 0)); +#endif rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_mono_bitmap(sound_speaker, 34, half_height+8, 4, 8); rb->lcd_set_drawmode(DRMODE_FG); @@ -533,6 +542,10 @@ void draw_digital_minimeters(void) { if(8<(num_right_leds)) rb->lcd_mono_bitmap(sound_max_level, 46, half_height+8, 3, 8); rb->lcd_set_drawmode(DRMODE_SOLID); + +#ifdef HAVE_LCD_COLOR + rb->lcd_set_foreground(screen_foreground); +#endif } void analog_meter(void) { @@ -621,15 +634,26 @@ void digital_meter(void) { rb->lcd_set_drawmode(DRMODE_FG); /* LEDS */ - for(i=0; i<num_left_leds; i++) + for(i=0; i<num_left_leds; i++) { +#ifdef HAVE_LCD_COLOR + rb->lcd_set_foreground(LCD_RGBPACK(255, 255 - 23 * i, 0)); +#endif rb->lcd_fillrect((digital_lead + (i*digital_block_width)), 14, digital_block_width - digital_block_gap, digital_block_height); + } - for(i=0; i<num_right_leds; i++) + for(i=0; i<num_right_leds; i++) { +#ifdef HAVE_LCD_COLOR + rb->lcd_set_foreground(LCD_RGBPACK(255, 255 - 23 * i, 0)); +#endif rb->lcd_fillrect((digital_lead + (i*digital_block_width)), (half_height + 20), digital_block_width - digital_block_gap, digital_block_height); - + } + +#ifdef HAVE_LCD_COLOR + rb->lcd_set_foreground(screen_foreground); +#endif rb->lcd_set_drawmode(DRMODE_SOLID); if(vumeter_settings.digital_minimeters) @@ -661,6 +685,9 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame load_settings(); rb->lcd_setfont(FONT_SYSFIXED); +#ifdef HAVE_LCD_COLOR + screen_foreground = rb->lcd_get_foreground(); +#endif while (1) { |