From de870b3ee049262f984254305c7a062a1cdf3026 Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Thu, 11 Nov 2010 21:13:29 +0000 Subject: Signal strength meter for FM radio - FS#8151 by Przemysław Hołubowski MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28559 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_tokens.c | 11 +++++++++++ apps/lang/english.lang | 17 +++++++++++++++++ apps/lang/polski.lang | 17 +++++++++++++++++ apps/radio/radio_skin.c | 4 ++++ 4 files changed, 49 insertions(+) (limited to 'apps') diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 665e73a545..efe67a186e 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -475,6 +475,17 @@ const char *get_radio_token(struct wps_token *token, int preset_offset, case SKIN_TOKEN_TUNER_CURFREQ: return format_freq_MHz(radio_current_frequency(), region_data->freq_step, buf, buf_size); +#ifdef HAVE_RADIO_RSSI + case SKIN_TOKEN_TUNER_RSSI: + snprintf(buf, buf_size, "%d",tuner_get(RADIO_RSSI)); + return buf; + case SKIN_TOKEN_TUNER_RSSI_MIN: + snprintf(buf, buf_size, "%d",tuner_get(RADIO_RSSI_MIN)); + return buf; + case SKIN_TOKEN_TUNER_RSSI_MAX: + snprintf(buf, buf_size, "%d",tuner_get(RADIO_RSSI_MAX)); + return buf; +#endif case SKIN_TOKEN_PRESET_NAME: case SKIN_TOKEN_PRESET_FREQ: case SKIN_TOKEN_PRESET_ID: diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 903413005b..0817134976 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -12647,3 +12647,20 @@ *: "Start File Browser at root" + + id: LANG_FM_RSSI + desc: Signal strength of a received FM station + user: core + + *: none + radio: "Signal strength:" + + + *: none + radio: "Signal strength:" + + + *: none + radio: "Signal strength:" + + diff --git a/apps/lang/polski.lang b/apps/lang/polski.lang index 8661a2da6b..bc54d11c14 100644 --- a/apps/lang/polski.lang +++ b/apps/lang/polski.lang @@ -12580,3 +12580,20 @@ *: "Rozpocznij Przeglądanie Plików Tutaj" + + id: LANG_FM_RSSI + desc: Signal strength of a received FM station + user: core + + *: none + radio: "Signal strength:" + + + *: none + radio: "Poziom sygnału:" + + + *: none + radio: "Poziom sygnału:" + + diff --git a/apps/radio/radio_skin.c b/apps/radio/radio_skin.c index 3079693cc3..68314d62b5 100644 --- a/apps/radio/radio_skin.c +++ b/apps/radio/radio_skin.c @@ -27,6 +27,7 @@ #include "skin_engine/skin_engine.h" #include "settings.h" #include "radio.h" +#include "tuner.h" #include "action.h" #include "appevents.h" #include "statusbar-skinned.h" @@ -41,6 +42,9 @@ char* default_radio_skin(enum screen_type screen) "%Sx(Station:) %tf MHz\n" "%?St(force fm mono)<%Sx(Force Mono)|%?ts<%Sx(Stereo)|%Sx(Mono)>>\n" "%Sx(Mode:) %?tm<%Sx(Scan)|%Sx(Preset)>\n" +#ifdef HAVE_RADIO_RSSI + "%Sx(Signal strength:) %tr dBuV\n" +#endif #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) "%?Rr<%Sx(Time:) %Rh:%Rn:%Rs|%?St(prerecording time)<%pm|%Sx(Prerecord Time) %Rs>>\n" #endif -- cgit