summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/recorder/radio.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index 128beaee4b..10a513f01f 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -29,6 +29,7 @@
29#include "status.h" 29#include "status.h"
30#include "kernel.h" 30#include "kernel.h"
31#include "mpeg.h" 31#include "mpeg.h"
32#include "audio.h"
32#include "mp3_playback.h" 33#include "mp3_playback.h"
33#include "ctype.h" 34#include "ctype.h"
34#include "file.h" 35#include "file.h"
@@ -199,7 +200,7 @@ bool radio_screen(void)
199 if(rec_create_directory() > 0) 200 if(rec_create_directory() > 0)
200 have_recorded = true; 201 have_recorded = true;
201 202
202 mpeg_stop(); 203 audio_stop();
203 204
204 mpeg_init_recording(); 205 mpeg_init_recording();
205 206
@@ -281,9 +282,9 @@ bool radio_screen(void)
281 { 282 {
282 case FM_STOP: 283 case FM_STOP:
283#ifndef SIMULATOR 284#ifndef SIMULATOR
284 if(mpeg_status() == MPEG_STATUS_RECORD) 285 if(audio_status() == AUDIO_STATUS_RECORD)
285 { 286 {
286 mpeg_stop(); 287 audio_stop();
287 } 288 }
288 else 289 else
289#endif 290#endif
@@ -296,7 +297,7 @@ bool radio_screen(void)
296#ifdef FM_RECORD 297#ifdef FM_RECORD
297 case FM_RECORD: 298 case FM_RECORD:
298#ifndef SIMULATOR 299#ifndef SIMULATOR
299 if(mpeg_status() == MPEG_STATUS_RECORD) 300 if(audio_status() == AUDIO_STATUS_RECORD)
300 { 301 {
301 mpeg_new_file(rec_create_filename(buf)); 302 mpeg_new_file(rec_create_filename(buf));
302 update_screen = true; 303 update_screen = true;
@@ -315,8 +316,8 @@ bool radio_screen(void)
315 316
316 case FM_EXIT: 317 case FM_EXIT:
317#ifndef SIMULATOR 318#ifndef SIMULATOR
318 if(mpeg_status() == MPEG_STATUS_RECORD) 319 if(audio_status() == AUDIO_STATUS_RECORD)
319 mpeg_stop(); 320 audio_stop();
320#endif 321#endif
321 done = true; 322 done = true;
322 keep_playing = true; 323 keep_playing = true;
@@ -421,7 +422,7 @@ bool radio_screen(void)
421#endif 422#endif
422 case SYS_USB_CONNECTED: 423 case SYS_USB_CONNECTED:
423 /* Only accept USB connection when not recording */ 424 /* Only accept USB connection when not recording */
424 if(mpeg_status() != MPEG_STATUS_RECORD) 425 if(audio_status() != AUDIO_STATUS_RECORD)
425 { 426 {
426 default_event_handler(SYS_USB_CONNECTED); 427 default_event_handler(SYS_USB_CONNECTED);
427 screen_freeze = true; /* Cosmetic: makes sure the 428 screen_freeze = true; /* Cosmetic: makes sure the
@@ -442,7 +443,7 @@ bool radio_screen(void)
442 lcd_setmargins(0, 8); 443 lcd_setmargins(0, 8);
443 444
444 /* Only display the peak meter when not recording */ 445 /* Only display the peak meter when not recording */
445 if(!mpeg_status()) 446 if(!audio_status())
446 { 447 {
447 lcd_clearrect(0, 8 + fh*(top_of_screen + 3), LCD_WIDTH, fh); 448 lcd_clearrect(0, 8 + fh*(top_of_screen + 3), LCD_WIDTH, fh);
448 peak_meter_draw(0, 8 + fh*(top_of_screen + 3), LCD_WIDTH, fh); 449 peak_meter_draw(0, 8 + fh*(top_of_screen + 3), LCD_WIDTH, fh);
@@ -490,7 +491,7 @@ bool radio_screen(void)
490 str(LANG_CHANNEL_MONO)); 491 str(LANG_CHANNEL_MONO));
491 lcd_puts(0, top_of_screen + 2, buf); 492 lcd_puts(0, top_of_screen + 2, buf);
492 493
493 if(mpeg_status() == MPEG_STATUS_RECORD) 494 if(audio_status() == AUDIO_STATUS_RECORD)
494 { 495 {
495 hours = seconds / 3600; 496 hours = seconds / 3600;
496 minutes = (seconds - (hours * 3600)) / 60; 497 minutes = (seconds - (hours * 3600)) / 60;
@@ -520,19 +521,19 @@ bool radio_screen(void)
520 status_draw(update_screen); 521 status_draw(update_screen);
521 } 522 }
522 523
523 if(mpeg_status() & MPEG_STATUS_ERROR) 524 if(audio_status() & AUDIO_STATUS_ERROR)
524 { 525 {
525 done = true; 526 done = true;
526 } 527 }
527 } 528 }
528 529
529#ifndef SIMULATOR 530#ifndef SIMULATOR
530 if(mpeg_status() & MPEG_STATUS_ERROR) 531 if(audio_status() & AUDIO_STATUS_ERROR)
531 { 532 {
532 splash(0, true, str(LANG_DISK_FULL)); 533 splash(0, true, str(LANG_DISK_FULL));
533 status_draw(true); 534 status_draw(true);
534 lcd_update(); 535 lcd_update();
535 mpeg_error_clear(); 536 audio_error_clear();
536 537
537 while(1) 538 while(1)
538 { 539 {
@@ -542,7 +543,7 @@ bool radio_screen(void)
542 } 543 }
543 } 544 }
544 545
545 mpeg_init_playback(); 546 audio_init_playback();
546 547
547 sound_settings_apply(); 548 sound_settings_apply();
548 549