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.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index d6a0b82cc9..f75387739a 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -130,7 +130,7 @@ bool radio_screen(void)
130 bool stereo = false; 130 bool stereo = false;
131 int search_dir = 0; 131 int search_dir = 0;
132 int fw, fh; 132 int fw, fh;
133 int last_stereo_status = false; 133 bool last_stereo_status = false;
134 int top_of_screen = 0; 134 int top_of_screen = 0;
135 bool update_screen = true; 135 bool update_screen = true;
136 int timeout = current_tick + HZ/10; 136 int timeout = current_tick + HZ/10;
@@ -155,6 +155,7 @@ bool radio_screen(void)
155 155
156 radio_load_presets(); 156 radio_load_presets();
157 157
158#ifndef SIMULATOR
158 if(rec_create_directory() > 0) 159 if(rec_create_directory() > 0)
159 have_recorded = true; 160 have_recorded = true;
160 161
@@ -189,6 +190,7 @@ bool radio_screen(void)
189 190
190 mpeg_set_recording_gain(mpeg_sound_default(SOUND_LEFT_GAIN), 191 mpeg_set_recording_gain(mpeg_sound_default(SOUND_LEFT_GAIN),
191 mpeg_sound_default(SOUND_RIGHT_GAIN), false); 192 mpeg_sound_default(SOUND_RIGHT_GAIN), false);
193#endif
192 194
193 fmradio_set(2, 0x140884); /* 5kHz, 7.2MHz crystal */ 195 fmradio_set(2, 0x140884); /* 5kHz, 7.2MHz crystal */
194 radio_set_frequency(curr_freq); 196 radio_set_frequency(curr_freq);
@@ -236,11 +238,13 @@ bool radio_screen(void)
236 switch(button) 238 switch(button)
237 { 239 {
238 case BUTTON_OFF: 240 case BUTTON_OFF:
241#ifndef SIMULATOR
239 if(mpeg_status() == MPEG_STATUS_RECORD) 242 if(mpeg_status() == MPEG_STATUS_RECORD)
240 { 243 {
241 mpeg_stop(); 244 mpeg_stop();
242 } 245 }
243 else 246 else
247#endif
244 { 248 {
245 radio_stop(); 249 radio_stop();
246 done = true; 250 done = true;
@@ -249,6 +253,7 @@ bool radio_screen(void)
249 break; 253 break;
250 254
251 case BUTTON_F3: 255 case BUTTON_F3:
256#ifndef SIMULATOR
252 if(mpeg_status() == MPEG_STATUS_RECORD) 257 if(mpeg_status() == MPEG_STATUS_RECORD)
253 { 258 {
254 mpeg_new_file(rec_create_filename(buf)); 259 mpeg_new_file(rec_create_filename(buf));
@@ -261,6 +266,7 @@ bool radio_screen(void)
261 mpeg_record(rec_create_filename(buf)); 266 mpeg_record(rec_create_filename(buf));
262 update_screen = true; 267 update_screen = true;
263 } 268 }
269#endif
264 last_seconds = 0; 270 last_seconds = 0;
265 break; 271 break;
266 272
@@ -395,7 +401,9 @@ bool radio_screen(void)
395 } 401 }
396 } 402 }
397 403
404#ifndef SIMULATOR
398 seconds = mpeg_recorded_time() / HZ; 405 seconds = mpeg_recorded_time() / HZ;
406#endif
399 407
400 if(update_screen || seconds > last_seconds) 408 if(update_screen || seconds > last_seconds)
401 { 409 {
@@ -455,7 +463,7 @@ bool radio_screen(void)
455 } 463 }
456 } 464 }
457 465
458 466#ifndef SIMULATOR
459 if(mpeg_status() & MPEG_STATUS_ERROR) 467 if(mpeg_status() & MPEG_STATUS_ERROR)
460 { 468 {
461 splash(0, true, str(LANG_DISK_FULL)); 469 splash(0, true, str(LANG_DISK_FULL));
@@ -491,6 +499,7 @@ bool radio_screen(void)
491 mpeg_sound_default(SOUND_RIGHT_GAIN), false); 499 mpeg_sound_default(SOUND_RIGHT_GAIN), false);
492 mas_codec_writereg(6, 0x4000); 500 mas_codec_writereg(6, 0x4000);
493 } 501 }
502#endif
494 return have_recorded; 503 return have_recorded;
495} 504}
496 505
@@ -696,6 +705,7 @@ bool radio_delete_preset(void)
696 return reload_dir; 705 return reload_dir;
697} 706}
698 707
708#ifndef SIMULATOR
699static bool fm_recording_settings(void) 709static bool fm_recording_settings(void)
700{ 710{
701 bool ret; 711 bool ret;
@@ -715,14 +725,16 @@ static bool fm_recording_settings(void)
715 } 725 }
716 return ret; 726 return ret;
717} 727}
718 728#endif
719bool radio_menu(void) 729bool radio_menu(void)
720{ 730{
721 struct menu_item radio_menu_items[] = { 731 struct menu_item radio_menu_items[] = {
722 { STR(LANG_FM_SAVE_PRESET), radio_add_preset }, 732 { STR(LANG_FM_SAVE_PRESET), radio_add_preset },
723 { STR(LANG_FM_DELETE_PRESET), radio_delete_preset }, 733 { STR(LANG_FM_DELETE_PRESET), radio_delete_preset },
724 { STR(LANG_SOUND_SETTINGS), sound_menu }, 734 { STR(LANG_SOUND_SETTINGS), sound_menu },
735#ifndef SIMULATOR
725 { STR(LANG_RECORDING_SETTINGS), fm_recording_settings } 736 { STR(LANG_RECORDING_SETTINGS), fm_recording_settings }
737#endif
726 }; 738 };
727 int m; 739 int m;
728 bool result; 740 bool result;