From d2221378cfbf685f2bb2b45cf56e8e782aeee2c7 Mon Sep 17 00:00:00 2001 From: Rob Purchase Date: Tue, 7 Oct 2008 08:13:05 +0000 Subject: 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 --- apps/plugins/vu_meter.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'apps/plugins') 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(1lcd_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; ilcd_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; ilcd_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) { -- cgit v1.2.3