summaryrefslogtreecommitdiff
path: root/apps/recorder/radio.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder/radio.c')
-rw-r--r--apps/recorder/radio.c63
1 files changed, 56 insertions, 7 deletions
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index b70c682922..87614aec15 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -49,6 +49,9 @@
49#ifdef HAVE_RECORDING 49#ifdef HAVE_RECORDING
50#include "recording.h" 50#include "recording.h"
51#endif 51#endif
52#ifdef IPOD_ACCESSORY_PROTOCOL
53#include "iap.h"
54#endif
52#include "talk.h" 55#include "talk.h"
53#include "tuner.h" 56#include "tuner.h"
54#include "power.h" 57#include "power.h"
@@ -114,6 +117,15 @@
114#define FM_MODE 117#define FM_MODE
115#define FM_EXIT 118#define FM_EXIT
116#define FM_PLAY 119#define FM_PLAY
120
121#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \
122 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
123#define FM_MENU
124#define FM_STOP
125#define FM_EXIT
126#define FM_PLAY
127#define FM_MODE
128
117#endif 129#endif
118 130
119#define RADIO_SCAN_MODE 0 131#define RADIO_SCAN_MODE 0
@@ -586,7 +598,6 @@ int radio_screen(void)
586 end_search(); 598 end_search();
587 talk = true; 599 talk = true;
588 } 600 }
589
590 trigger_cpu_boost(); 601 trigger_cpu_boost();
591 } 602 }
592 603
@@ -873,6 +884,33 @@ int radio_screen(void)
873 884
874 default: 885 default:
875 default_event_handler(button); 886 default_event_handler(button);
887#ifdef HAVE_RDS_CAP
888 if (tuner_get(RADIO_EVENT))
889 update_screen = true;
890#endif
891 if (!tuner_get(RADIO_PRESENT))
892 {
893#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
894 if(audio_status() == AUDIO_STATUS_RECORD)
895 audio_stop();
896#endif
897 keep_playing = false;
898 done = true;
899 ret_val = GO_TO_ROOT;
900 if(presets_changed)
901 {
902 if(yesno_pop(ID2P(LANG_FM_SAVE_CHANGES)))
903 {
904 if(filepreset[0] == '\0')
905 save_preset_list();
906 else
907 radio_save_presets();
908 }
909 }
910
911 /* Clear the preset list on exit. */
912 clear_preset_list();
913 }
876 break; 914 break;
877 } /*switch(button)*/ 915 } /*switch(button)*/
878 916
@@ -895,11 +933,11 @@ int radio_screen(void)
895 { 933 {
896 screens[i].set_viewport(&vp[i]); 934 screens[i].set_viewport(&vp[i]);
897 peak_meter_screen(&screens[i],0, 935 peak_meter_screen(&screens[i],0,
898 STATUSBAR_HEIGHT + fh*(top_of_screen + 4), 936 STATUSBAR_HEIGHT + fh*(top_of_screen + 4),
899 fh); 937 fh);
900 screens[i].update_rect(0, 938 screens[i].update_rect(0,
901 STATUSBAR_HEIGHT + fh*(top_of_screen + 4), 939 STATUSBAR_HEIGHT + fh*(top_of_screen + 4),
902 screens[i].getwidth(), fh); 940 screens[i].getwidth(), fh);
903 screens[i].set_viewport(NULL); 941 screens[i].set_viewport(NULL);
904 } 942 }
905 } 943 }
@@ -963,7 +1001,18 @@ int radio_screen(void)
963 str(LANG_RADIO_SCAN_MODE)); 1001 str(LANG_RADIO_SCAN_MODE));
964 FOR_NB_SCREENS(i) 1002 FOR_NB_SCREENS(i)
965 screens[i].puts_scroll(0, top_of_screen + 3, buf); 1003 screens[i].puts_scroll(0, top_of_screen + 3, buf);
1004#ifndef SIMULATOR
1005#ifdef HAVE_RDS_CAP
1006 snprintf(buf, 128, "%s",tuner_get_rds_info(RADIO_RDS_NAME));
1007 FOR_NB_SCREENS(i)
1008 screens[i].puts_scroll(0, top_of_screen + 4, buf);
966 1009
1010 snprintf(buf, 128, "%s",tuner_get_rds_info(RADIO_RDS_TEXT));
1011 FOR_NB_SCREENS(i)
1012 screens[i].puts_scroll(0, top_of_screen + 5, buf);
1013#endif
1014#endif /* SIMULATOR */
1015
967#if CONFIG_CODEC != SWCODEC 1016#if CONFIG_CODEC != SWCODEC
968 if(audio_status() == AUDIO_STATUS_RECORD) 1017 if(audio_status() == AUDIO_STATUS_RECORD)
969 { 1018 {
@@ -1498,6 +1547,7 @@ static int scan_presets(void *viewports)
1498 curr_freq = fmr->freq_min; 1547 curr_freq = fmr->freq_min;
1499 num_presets = 0; 1548 num_presets = 0;
1500 memset(presets, 0, sizeof(presets)); 1549 memset(presets, 0, sizeof(presets));
1550
1501 tuner_set(RADIO_MUTE, 1); 1551 tuner_set(RADIO_MUTE, 1);
1502 1552
1503 while(curr_freq <= fmr->freq_max) 1553 while(curr_freq <= fmr->freq_max)
@@ -1563,7 +1613,6 @@ static int fm_recording_screen(void)
1563 /* switch recording source to FMRADIO for the duration */ 1613 /* switch recording source to FMRADIO for the duration */
1564 int rec_source = global_settings.rec_source; 1614 int rec_source = global_settings.rec_source;
1565 global_settings.rec_source = AUDIO_SRC_FMRADIO; 1615 global_settings.rec_source = AUDIO_SRC_FMRADIO;
1566
1567 ret = recording_screen(true); 1616 ret = recording_screen(true);
1568 1617
1569 /* safe to reset as changing sources is prohibited here */ 1618 /* safe to reset as changing sources is prohibited here */
@@ -1649,7 +1698,7 @@ MAKE_MENU(radio_settings_menu, ID2P(LANG_FM_MENU), NULL,
1649static bool radio_menu(void) 1698static bool radio_menu(void)
1650{ 1699{
1651 return do_menu(&radio_settings_menu, NULL, NULL, false) == 1700 return do_menu(&radio_settings_menu, NULL, NULL, false) ==
1652 MENU_ATTACHED_USB; 1701 MENU_ATTACHED_USB;
1653} 1702}
1654 1703
1655#endif 1704#endif