From 194badb68f7bbf7c61d24b5fdbe8fc1beaf18696 Mon Sep 17 00:00:00 2001 From: jdgordon Date: Wed, 12 May 2010 11:44:09 +0000 Subject: [PATCH] fix the last of the reds, and make RDS tags actually work (and add them to the hardcoded radio skin) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25966 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_display.c | 6 +++++- apps/gui/skin_engine/skin_parser.c | 5 ++++- apps/gui/skin_engine/skin_tokens.c | 2 ++ apps/recorder/radio.c | 7 +++++-- firmware/export/tuner.h | 3 +++ uisimulator/common/fmradio.c | 19 +++++++++++++++++++ 6 files changed, 38 insertions(+), 4 deletions(-) diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 16b2dc121..7710d58ce 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c @@ -58,8 +58,10 @@ #endif #include "backdrop.h" #include "viewport.h" +#if CONFIG_TUNER #include "radio.h" #include "tuner.h" +#endif #include "root_menu.h" @@ -1349,6 +1351,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) bool skin_has_sbs(enum screen_type screen, struct wps_data *data) { (void)screen; + (void)data; bool draw = false; #ifdef HAVE_LCD_BITMAP if (data->wps_sb_tag) @@ -1365,9 +1368,10 @@ bool skin_has_sbs(enum screen_type screen, struct wps_data *data) */ int skin_wait_for_action(struct gui_wps *gwps, int context, int timeout) { + (void)gwps; /* silence charcell warning */ + int button = ACTION_NONE; #ifdef HAVE_LCD_BITMAP int i; - int button = ACTION_NONE; /* when the peak meter is enabled we want to have a few extra updates to make it look smooth. On the other hand we don't want to waste energy if it diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 93df30033..bb8f8c57d 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -52,7 +52,10 @@ #include "skin_engine.h" #include "settings.h" #include "settings_list.h" +#if CONFIG_TUNER #include "radio.h" +#include "tuner.h" +#endif #include "skin_fonts.h" #ifdef HAVE_LCD_BITMAP @@ -362,7 +365,7 @@ static const struct wps_tag all_tags[] = { { WPS_TOKEN_PRESET_FREQ, "Tf", WPS_REFRESH_STATIC, NULL }, { WPS_TOKEN_PRESET_COUNT, "Tc", WPS_REFRESH_STATIC, NULL }, { WPS_TOKEN_HAVE_RDS, "tx", WPS_REFRESH_STATIC, NULL }, -#ifdef HAVE_RDS_CAPS +#ifdef HAVE_RDS_CAP { WPS_TOKEN_RDS_NAME, "ty", WPS_REFRESH_DYNAMIC, NULL }, { WPS_TOKEN_RDS_TEXT, "tz", WPS_REFRESH_DYNAMIC, NULL }, #endif diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 4acf7ea84..e5a34c431 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -61,8 +61,10 @@ #endif #include "language.h" #include "usb.h" +#if CONFIG_TUNER #include "radio.h" #include "tuner.h" +#endif extern struct wps_state wps_state; diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index 10ae10973..6e79adf30 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c @@ -520,7 +520,11 @@ void fms_data_load(enum screen_type screen, const char *buf, bool isfile) #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) "%?Rr<%Sx|Time:| %Rh:%Rn:%Rs|" "%?St|prerecording time|<%Sx|Prerecord Time| %Rs|%pm>>\n" -#endif +#endif +#ifdef HAVE_RDS_CAP + "\n%s%ty\n" + "%s%tz\n" +#endif ; skin_data_load(screen, data, default_fms, false); } @@ -593,7 +597,6 @@ int radio_screen(void) bool have_recorded = false; int timeout = current_tick + HZ/10; unsigned int last_seconds = 0; - int hours, minutes; #ifndef SIMULATOR unsigned int seconds = 0; struct audio_recording_options rec_options; diff --git a/firmware/export/tuner.h b/firmware/export/tuner.h index cac038841..03b6bd79d 100644 --- a/firmware/export/tuner.h +++ b/firmware/export/tuner.h @@ -93,6 +93,9 @@ extern const struct fm_region_data fm_region_data[TUNER_NUM_REGIONS]; #ifdef SIMULATOR int tuner_set(int setting, int value); int tuner_get(int setting); +#ifdef HAVE_RDS_CAP +char* tuner_get_rds_info(int setting); +#endif #else #ifdef CONFIG_TUNER_MULTI diff --git a/uisimulator/common/fmradio.c b/uisimulator/common/fmradio.c index 64bd7f1f9..cef9abf94 100644 --- a/uisimulator/common/fmradio.c +++ b/uisimulator/common/fmradio.c @@ -19,6 +19,7 @@ * ****************************************************************************/ #include +#include #include "config.h" #include "debug.h" #include "tuner.h" @@ -96,4 +97,22 @@ bool tuner_power(bool status) return oldstatus; } +#ifdef HAVE_RDS_CAP +char* tuner_get_rds_info(int setting) +{ + char *text = NULL; + + switch(setting) + { + case RADIO_RDS_NAME: + text = "Rockbox Radio"; + break; + + case RADIO_RDS_TEXT: + text = "http://www.rockbox.org" ; + break; + } + return text; +} +#endif #endif -- 2.11.4.GIT