From 1ce7ba4931c64a7ae6a95981e838db97d7e05699 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 18 Nov 2010 11:47:42 +0000 Subject: Make the %tr (radio RSSI) tag work as a bar tag or as a conditional. As a conditional it scales its value to the number of options you give it (like volume) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28613 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_display.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'apps/gui/skin_engine/skin_display.c') diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 78db4eb371..47de4638d8 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c @@ -162,9 +162,22 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb) #if CONFIG_TUNER else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF)) { - int min = fm_region_data[global_settings.fm_region].freq_min; - end = radio_current_frequency() - min; - length = fm_region_data[global_settings.fm_region].freq_max - min; +#ifdef HAVE_RADIO_RSSI + if (pb->type == SKIN_TOKEN_TUNER_RSSI_BAR) + { + int val = tuner_get(RADIO_RSSI); + int min = tuner_get(RADIO_RSSI_MIN); + int max = tuner_get(RADIO_RSSI_MAX); + end = val - min; + length = max - min; + } + else +#endif + { + int min = fm_region_data[global_settings.fm_region].freq_min; + end = radio_current_frequency() - min; + length = fm_region_data[global_settings.fm_region].freq_max - min; + } } #endif else if (id3 && id3->length) -- cgit v1.2.3