summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-11-29 15:10:07 +0000
committerJens Arnold <amiconn@rockbox.org>2005-11-29 15:10:07 +0000
commit2a31407513192a84167c217e7ba92d896eb8013b (patch)
treec9d686f2296941fa070849009070df3ce5f0e869
parentd5af4b0f48acb9c9b68e9df22871379fb5c4554f (diff)
downloadrockbox-2a31407513192a84167c217e7ba92d896eb8013b.tar.gz
rockbox-2a31407513192a84167c217e7ba92d896eb8013b.zip
Ondio FM: * Bugfix: Cancelling 'Auto Scan Presets' left the radio screen. * Put radio mode switch in radio menu.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8107 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/lang/deutsch.lang30
-rw-r--r--apps/lang/english.lang13
-rw-r--r--apps/recorder/radio.c51
3 files changed, 66 insertions, 28 deletions
diff --git a/apps/lang/deutsch.lang b/apps/lang/deutsch.lang
index c00575f650..b91fbe140c 100644
--- a/apps/lang/deutsch.lang
+++ b/apps/lang/deutsch.lang
@@ -3164,7 +3164,7 @@ id: LANG_CROSSFADE_DURATION
3164desc: DEPRECATED 3164desc: DEPRECATED
3165eng: "" 3165eng: ""
3166voice: "" 3166voice: ""
3167new: 3167new:
3168 3168
3169id: LANG_MIX 3169id: LANG_MIX
3170desc: in playback settings, crossfade option 3170desc: in playback settings, crossfade option
@@ -3362,19 +3362,19 @@ id: LANG_RECORDING_MONITOR
3362desc: DEPRECATED 3362desc: DEPRECATED
3363eng: "" 3363eng: ""
3364voice: "" 3364voice: ""
3365new: 3365new:
3366 3366
3367id: LANG_RADIO_SCAN_MODE 3367id: LANG_RADIO_SCAN_MODE
3368desc: in radio screen 3368desc: in radio screen / menu
3369eng: "Scan Mode" 3369eng: "Scan"
3370voice: "" 3370voice: ""
3371new: "Abstimmmodus" 3371new: "Abstimmen"
3372 3372
3373id: LANG_RADIO_PRESET_MODE 3373id: LANG_RADIO_PRESET_MODE
3374desc: in radio screen 3374desc: in radio screen / menu
3375eng: "Preset Mode" 3375eng: "Preset"
3376voice: "" 3376voice: ""
3377new: "Sendermodus" 3377new: "Sender"
3378 3378
3379id: LANG_FM_FREEZE 3379id: LANG_FM_FREEZE
3380desc: splash screen during freeze in radio mode 3380desc: splash screen during freeze in radio mode
@@ -3385,8 +3385,8 @@ new: "Anzeige eingefroren!"
3385id: LANG_CROSSFEED_ENABLE 3385id: LANG_CROSSFEED_ENABLE
3386desc: DEPRECATED 3386desc: DEPRECATED
3387eng: "" 3387eng: ""
3388voice: 3388voice:
3389new: 3389new:
3390 3390
3391id: LANG_CROSSFEED 3391id: LANG_CROSSFEED
3392desc: in the sound settings menu 3392desc: in the sound settings menu
@@ -3402,7 +3402,7 @@ new: "Automatische Sendersuche"
3402 3402
3403id: LANG_FM_SCANNING 3403id: LANG_FM_SCANNING
3404desc: during auto scan 3404desc: during auto scan
3405eng: "Scanning %d.%dMHz" 3405eng: "Scanning %d.%01dMHz"
3406voice: "" 3406voice: ""
3407new: "Suche %d,%01dMHz" 3407new: "Suche %d,%01dMHz"
3408 3408
@@ -3434,7 +3434,7 @@ id: VOICE_EXT_RWPS
3434desc: spoken only, for file extension 3434desc: spoken only, for file extension
3435eng: "" 3435eng: ""
3436voice: "RWPS" 3436voice: "RWPS"
3437new: 3437new:
3438 3438
3439id: LANG_REMOTE_WHILE_PLAYING 3439id: LANG_REMOTE_WHILE_PLAYING
3440desc: in settings_menu() 3440desc: in settings_menu()
@@ -3453,3 +3453,9 @@ desc: in remote lcd settings menu
3453eng: "Reduce ticking" 3453eng: "Reduce ticking"
3454voice: "Ticken verringern" 3454voice: "Ticken verringern"
3455new: "Ticken verringern" 3455new: "Ticken verringern"
3456
3457id: LANG_FM_TUNE_MODE
3458desc: in radio screen / menu
3459eng: "Mode:"
3460voice: ""
3461new: "Modus:"
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 0ec34b9cba..40b84bbeab 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -3372,14 +3372,14 @@ voice: ""
3372new: 3372new:
3373 3373
3374id: LANG_RADIO_SCAN_MODE 3374id: LANG_RADIO_SCAN_MODE
3375desc: in radio screen 3375desc: in radio screen / menu
3376eng: "Scan Mode" 3376eng: "Scan"
3377voice: "" 3377voice: ""
3378new: 3378new:
3379 3379
3380id: LANG_RADIO_PRESET_MODE 3380id: LANG_RADIO_PRESET_MODE
3381desc: in radio screen 3381desc: in radio screen / menu
3382eng: "Preset Mode" 3382eng: "Preset"
3383voice: "" 3383voice: ""
3384new: 3384new:
3385 3385
@@ -3461,3 +3461,8 @@ eng: "Reduce ticking"
3461voice: "Reduce ticking" 3461voice: "Reduce ticking"
3462new: 3462new:
3463 3463
3464id: LANG_FM_TUNE_MODE
3465desc: in radio screen / menu
3466eng: "Mode:"
3467voice: ""
3468new:
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index 2be0e26067..2ed2a68ef8 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -77,6 +77,7 @@
77#define FM_EXIT (BUTTON_ON | BUTTON_REL) 77#define FM_EXIT (BUTTON_ON | BUTTON_REL)
78#define FM_PRESET_ADD BUTTON_F1 78#define FM_PRESET_ADD BUTTON_F1
79#define FM_PRESET_ACTION BUTTON_F3 79#define FM_PRESET_ACTION BUTTON_F3
80
80#elif CONFIG_KEYPAD == IRIVER_H100_PAD 81#elif CONFIG_KEYPAD == IRIVER_H100_PAD
81/* pause/play - short PLAY */ 82/* pause/play - short PLAY */
82#define FM_PLAY_PRE BUTTON_ON 83#define FM_PLAY_PRE BUTTON_ON
@@ -105,10 +106,12 @@
105/* stop and exit radio - STOP */ 106/* stop and exit radio - STOP */
106#define FM_STOP BUTTON_OFF 107#define FM_STOP BUTTON_OFF
107#define FM_RC_STOP BUTTON_RC_STOP 108#define FM_RC_STOP BUTTON_RC_STOP
109
108#elif CONFIG_KEYPAD == ONDIO_PAD /* restricted keypad */ 110#elif CONFIG_KEYPAD == ONDIO_PAD /* restricted keypad */
109#define FM_MENU (BUTTON_MENU | BUTTON_REPEAT) 111#define FM_MENU (BUTTON_MENU | BUTTON_REPEAT)
110#define FM_RECORD_DBLPRE BUTTON_MENU 112#define FM_RECORD_DBLPRE BUTTON_MENU
111#define FM_RECORD (BUTTON_MENU | BUTTON_REL) 113#define FM_RECORD (BUTTON_MENU | BUTTON_REL)
114#define FM_STOP_PRE BUTTON_OFF
112#define FM_STOP (BUTTON_OFF | BUTTON_REL) 115#define FM_STOP (BUTTON_OFF | BUTTON_REL)
113#define FM_EXIT (BUTTON_OFF | BUTTON_REPEAT) 116#define FM_EXIT (BUTTON_OFF | BUTTON_REPEAT)
114#endif 117#endif
@@ -377,10 +380,8 @@ bool radio_screen(void)
377 } 380 }
378 381
379 curr_preset = find_preset(curr_freq); 382 curr_preset = find_preset(curr_freq);
380#ifdef FM_MODE
381 if(curr_preset != -1) 383 if(curr_preset != -1)
382 radio_mode = RADIO_PRESET_MODE; 384 radio_mode = RADIO_PRESET_MODE;
383#endif
384 385
385#ifdef HAS_BUTTONBAR 386#ifdef HAS_BUTTONBAR
386 gui_buttonbar_set(&buttonbar, str(LANG_BUTTONBAR_MENU), str(LANG_FM_BUTTONBAR_PRESETS), 387 gui_buttonbar_set(&buttonbar, str(LANG_BUTTONBAR_MENU), str(LANG_FM_BUTTONBAR_PRESETS),
@@ -431,6 +432,10 @@ bool radio_screen(void)
431 case FM_RC_STOP: 432 case FM_RC_STOP:
432#endif 433#endif
433 case FM_STOP: 434 case FM_STOP:
435#ifdef FM_STOP_PRE
436 if (lastbutton != FM_STOP_PRE)
437 break;
438#endif
434#ifndef SIMULATOR 439#ifndef SIMULATOR
435 if(audio_status() == AUDIO_STATUS_RECORD) 440 if(audio_status() == AUDIO_STATUS_RECORD)
436 { 441 {
@@ -761,7 +766,7 @@ bool radio_screen(void)
761 if(update_screen || seconds > last_seconds) 766 if(update_screen || seconds > last_seconds)
762 { 767 {
763 last_seconds = seconds; 768 last_seconds = seconds;
764 769
765 FOR_NB_SCREENS(i) 770 FOR_NB_SCREENS(i)
766 screens[i].setfont(FONT_UI); 771 screens[i].setfont(FONT_UI);
767 772
@@ -786,12 +791,11 @@ bool radio_screen(void)
786 FOR_NB_SCREENS(i) 791 FOR_NB_SCREENS(i)
787 screens[i].puts_scroll(0, top_of_screen + 2, buf); 792 screens[i].puts_scroll(0, top_of_screen + 2, buf);
788 793
789#ifdef FM_MODE 794 snprintf(buf, 128, "%s %s", str(LANG_FM_TUNE_MODE),
790 snprintf(buf, 128, radio_mode?str(LANG_RADIO_PRESET_MODE): 795 radio_mode ? str(LANG_RADIO_PRESET_MODE) :
791 str(LANG_RADIO_SCAN_MODE)); 796 str(LANG_RADIO_SCAN_MODE));
792 FOR_NB_SCREENS(i) 797 FOR_NB_SCREENS(i)
793 screens[i].puts_scroll(0, top_of_screen + 3, buf); 798 screens[i].puts_scroll(0, top_of_screen + 3, buf);
794#endif
795 799
796 if(audio_status() == AUDIO_STATUS_RECORD) 800 if(audio_status() == AUDIO_STATUS_RECORD)
797 { 801 {
@@ -1185,7 +1189,8 @@ char monomode_menu_string[32];
1185 1189
1186static void create_monomode_menu(void) 1190static void create_monomode_menu(void)
1187{ 1191{
1188 snprintf(monomode_menu_string, 32, "%s: %s", str(LANG_FM_MONO_MODE), 1192 snprintf(monomode_menu_string, sizeof monomode_menu_string,
1193 "%s: %s", str(LANG_FM_MONO_MODE),
1189 global_settings.fm_force_mono? 1194 global_settings.fm_force_mono?
1190 str(LANG_SET_BOOL_YES):str(LANG_SET_BOOL_NO)); 1195 str(LANG_SET_BOOL_YES):str(LANG_SET_BOOL_NO));
1191} 1196}
@@ -1199,6 +1204,25 @@ static bool toggle_mono_mode(void)
1199 return false; 1204 return false;
1200} 1205}
1201 1206
1207#ifndef FM_MODE
1208char radiomode_menu_string[32];
1209
1210static void create_radiomode_menu(void)
1211{
1212 snprintf(radiomode_menu_string, 32, "%s %s", str(LANG_FM_TUNE_MODE),
1213 radio_mode ? str(LANG_RADIO_PRESET_MODE) :
1214 str(LANG_RADIO_SCAN_MODE));
1215}
1216
1217static bool toggle_radio_mode(void)
1218{
1219 radio_mode = (radio_mode == RADIO_SCAN_MODE) ?
1220 RADIO_PRESET_MODE : RADIO_SCAN_MODE;
1221 create_radiomode_menu();
1222 return false;
1223}
1224#endif
1225
1202static bool scan_presets(void) 1226static bool scan_presets(void)
1203{ 1227{
1204 bool tuned = false; 1228 bool tuned = false;
@@ -1249,9 +1273,7 @@ static bool scan_presets(void)
1249 curr_freq = presets[0].frequency; 1273 curr_freq = presets[0].frequency;
1250 radio_set(RADIO_FREQUENCY, curr_freq); 1274 radio_set(RADIO_FREQUENCY, curr_freq);
1251 remember_frequency(); 1275 remember_frequency();
1252#ifdef FM_MODE
1253 radio_mode = RADIO_PRESET_MODE; 1276 radio_mode = RADIO_PRESET_MODE;
1254#endif
1255 } 1277 }
1256 } 1278 }
1257 return true; 1279 return true;
@@ -1300,15 +1322,20 @@ bool radio_menu(void)
1300 { ID2P(LANG_FM_ADD_PRESET) , radio_add_preset }, 1322 { ID2P(LANG_FM_ADD_PRESET) , radio_add_preset },
1301#endif 1323#endif
1302 { monomode_menu_string , toggle_mono_mode }, 1324 { monomode_menu_string , toggle_mono_mode },
1325#ifndef FM_MODE
1326 { radiomode_menu_string , toggle_radio_mode },
1327#endif
1303 { ID2P(LANG_SOUND_SETTINGS) , sound_menu }, 1328 { ID2P(LANG_SOUND_SETTINGS) , sound_menu },
1304#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) 1329#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
1305 { ID2P(LANG_RECORDING_SETTINGS) , fm_recording_settings}, 1330 { ID2P(LANG_RECORDING_SETTINGS) , fm_recording_settings},
1306#endif 1331#endif
1307 { ID2P(LANG_FM_SCAN_PRESETS) , scan_presets}, 1332 { ID2P(LANG_FM_SCAN_PRESETS) , scan_presets },
1308 }; 1333 };
1309 1334
1310 create_monomode_menu(); 1335 create_monomode_menu();
1311 1336#ifndef FM_MODE
1337 create_radiomode_menu();
1338#endif
1312 m = menu_init(items, sizeof(items) / sizeof(*items), 1339 m = menu_init(items, sizeof(items) / sizeof(*items),
1313 radio_menu_cb, NULL, NULL, NULL); 1340 radio_menu_cb, NULL, NULL, NULL);
1314 result = menu_run(m); 1341 result = menu_run(m);