1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Jonathan Gordon 2010-05-12 11:44:09 +00:00
parent 7b931f0a5a
commit a5d8d21596
6 changed files with 38 additions and 4 deletions

View file

@ -58,8 +58,10 @@
#endif #endif
#include "backdrop.h" #include "backdrop.h"
#include "viewport.h" #include "viewport.h"
#if CONFIG_TUNER
#include "radio.h" #include "radio.h"
#include "tuner.h" #include "tuner.h"
#endif
#include "root_menu.h" #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) bool skin_has_sbs(enum screen_type screen, struct wps_data *data)
{ {
(void)screen; (void)screen;
(void)data;
bool draw = false; bool draw = false;
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
if (data->wps_sb_tag) 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) 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 #ifdef HAVE_LCD_BITMAP
int i; int i;
int button = ACTION_NONE;
/* when the peak meter is enabled we want to have a /* when the peak meter is enabled we want to have a
few extra updates to make it look smooth. On the few extra updates to make it look smooth. On the
other hand we don't want to waste energy if it other hand we don't want to waste energy if it

View file

@ -52,7 +52,10 @@
#include "skin_engine.h" #include "skin_engine.h"
#include "settings.h" #include "settings.h"
#include "settings_list.h" #include "settings_list.h"
#if CONFIG_TUNER
#include "radio.h" #include "radio.h"
#include "tuner.h"
#endif
#include "skin_fonts.h" #include "skin_fonts.h"
#ifdef HAVE_LCD_BITMAP #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_FREQ, "Tf", WPS_REFRESH_STATIC, NULL },
{ WPS_TOKEN_PRESET_COUNT, "Tc", WPS_REFRESH_STATIC, NULL }, { WPS_TOKEN_PRESET_COUNT, "Tc", WPS_REFRESH_STATIC, NULL },
{ WPS_TOKEN_HAVE_RDS, "tx", 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_NAME, "ty", WPS_REFRESH_DYNAMIC, NULL },
{ WPS_TOKEN_RDS_TEXT, "tz", WPS_REFRESH_DYNAMIC, NULL }, { WPS_TOKEN_RDS_TEXT, "tz", WPS_REFRESH_DYNAMIC, NULL },
#endif #endif

View file

@ -61,8 +61,10 @@
#endif #endif
#include "language.h" #include "language.h"
#include "usb.h" #include "usb.h"
#if CONFIG_TUNER
#include "radio.h" #include "radio.h"
#include "tuner.h" #include "tuner.h"
#endif
extern struct wps_state wps_state; extern struct wps_state wps_state;

View file

@ -520,6 +520,10 @@ void fms_data_load(enum screen_type screen, const char *buf, bool isfile)
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
"%?Rr<%Sx|Time:| %Rh:%Rn:%Rs|" "%?Rr<%Sx|Time:| %Rh:%Rn:%Rs|"
"%?St|prerecording time|<%Sx|Prerecord Time| %Rs|%pm>>\n" "%?St|prerecording time|<%Sx|Prerecord Time| %Rs|%pm>>\n"
#endif
#ifdef HAVE_RDS_CAP
"\n%s%ty\n"
"%s%tz\n"
#endif #endif
; ;
skin_data_load(screen, data, default_fms, false); skin_data_load(screen, data, default_fms, false);
@ -593,7 +597,6 @@ int radio_screen(void)
bool have_recorded = false; bool have_recorded = false;
int timeout = current_tick + HZ/10; int timeout = current_tick + HZ/10;
unsigned int last_seconds = 0; unsigned int last_seconds = 0;
int hours, minutes;
#ifndef SIMULATOR #ifndef SIMULATOR
unsigned int seconds = 0; unsigned int seconds = 0;
struct audio_recording_options rec_options; struct audio_recording_options rec_options;

View file

@ -93,6 +93,9 @@ extern const struct fm_region_data fm_region_data[TUNER_NUM_REGIONS];
#ifdef SIMULATOR #ifdef SIMULATOR
int tuner_set(int setting, int value); int tuner_set(int setting, int value);
int tuner_get(int setting); int tuner_get(int setting);
#ifdef HAVE_RDS_CAP
char* tuner_get_rds_info(int setting);
#endif
#else #else
#ifdef CONFIG_TUNER_MULTI #ifdef CONFIG_TUNER_MULTI

View file

@ -19,6 +19,7 @@
* *
****************************************************************************/ ****************************************************************************/
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h>
#include "config.h" #include "config.h"
#include "debug.h" #include "debug.h"
#include "tuner.h" #include "tuner.h"
@ -96,4 +97,22 @@ bool tuner_power(bool status)
return oldstatus; 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 #endif