summaryrefslogtreecommitdiff
path: root/apps/recorder/recording.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder/recording.c')
-rw-r--r--apps/recorder/recording.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 2cef11ae13..86b4a46a52 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -25,6 +25,7 @@
25 25
26#include "system.h" 26#include "system.h"
27#include "lcd.h" 27#include "lcd.h"
28#include "led.h"
28#include "mpeg.h" 29#include "mpeg.h"
29#include "mp3_playback.h" 30#include "mp3_playback.h"
30#include "mas.h" 31#include "mas.h"
@@ -179,6 +180,8 @@ bool recording_screen(void)
179 int hours, minutes; 180 int hours, minutes;
180 char path_buffer[MAX_PATH]; 181 char path_buffer[MAX_PATH];
181 bool been_in_usb_mode = false; 182 bool been_in_usb_mode = false;
183 bool led_state;
184 int led_delay;
182 185
183 cursor = 0; 186 cursor = 0;
184 mpeg_init_recording(); 187 mpeg_init_recording();
@@ -210,9 +213,34 @@ bool recording_screen(void)
210 213
211 if(rec_create_directory() > 0) 214 if(rec_create_directory() > 0)
212 have_recorded = true; 215 have_recorded = true;
216
217 led_state = false;
218 led_delay = 0;
213 219
214 while(!done) 220 while(!done)
215 { 221 {
222 /*
223 * Flash the LED while waiting to record. Turn it on while
224 * recording.
225 */
226 if(mpeg_status() != MPEG_STATUS_RECORD)
227 {
228 if(led_delay++ >= 4)
229 {
230 led_state = !led_state;
231 invert_led(led_state);
232 led_delay = 0;
233 }
234 }
235 else
236 {
237 if(!led_state)
238 {
239 led_state = true;
240 invert_led(true);
241 }
242 }
243
216 button = button_get_w_tmo(HZ / peak_meter_fps); 244 button = button_get_w_tmo(HZ / peak_meter_fps);
217 switch(button) 245 switch(button)
218 { 246 {
@@ -565,7 +593,6 @@ bool recording_screen(void)
565 done = true; 593 done = true;
566 } 594 }
567 } 595 }
568
569 if(mpeg_status() & MPEG_STATUS_ERROR) 596 if(mpeg_status() & MPEG_STATUS_ERROR)
570 { 597 {
571 status_set_playmode(STATUS_STOP); 598 status_set_playmode(STATUS_STOP);
@@ -582,6 +609,8 @@ bool recording_screen(void)
582 } 609 }
583 } 610 }
584 611
612 invert_led(false);
613
585 mpeg_init_playback(); 614 mpeg_init_playback();
586 615
587 mpeg_sound_channel_config(global_settings.channel_config); 616 mpeg_sound_channel_config(global_settings.channel_config);