summaryrefslogtreecommitdiff
path: root/apps/recorder
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2008-05-15 22:47:07 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2008-05-15 22:47:07 +0000
commita3524029bf3681fccd8b221a24849794f30bd26d (patch)
tree4bc29dcdf8915071dd7aaa6a0604422549c4d0a2 /apps/recorder
parent3cec5e2b6a1039bb065d5f7bc8e9bc3dafe3f904 (diff)
downloadrockbox-a3524029bf3681fccd8b221a24849794f30bd26d.tar.gz
rockbox-a3524029bf3681fccd8b221a24849794f30bd26d.zip
Accept FS #8994: add another recording filesplit option: stop recording and shutdown
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17531 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/recording.c16
-rw-r--r--apps/recorder/recording.h3
2 files changed, 17 insertions, 2 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 6a2b9257d4..715a06d823 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 "power.h" 27#include "power.h"
28#include "powermgmt.h"
28#include "lcd.h" 29#include "lcd.h"
29#include "led.h" 30#include "led.h"
30#include "mpeg.h" 31#include "mpeg.h"
@@ -717,6 +718,12 @@ void rec_command(enum recording_command cmd)
717{ 718{
718 switch(cmd) 719 switch(cmd)
719 { 720 {
721 case RECORDING_CMD_STOP_SHUTDOWN:
722 pm_activate_clipcount(false);
723 audio_stop_recording();
724 audio_close_recording();
725 sys_poweroff();
726 break;
720 case RECORDING_CMD_STOP: 727 case RECORDING_CMD_STOP:
721 pm_activate_clipcount(false); 728 pm_activate_clipcount(false);
722 audio_stop_recording(); 729 audio_stop_recording();
@@ -808,6 +815,10 @@ static void trigger_listener(int trigger_status)
808 /* tell recording_screen to reset the time */ 815 /* tell recording_screen to reset the time */
809 last_seconds = 0; 816 last_seconds = 0;
810 break; 817 break;
818
819 case 3: /* Stop and shutdown */
820 rec_command(RECORDING_CMD_STOP_SHUTDOWN);
821 break;
811 } 822 }
812 823
813 if (global_settings.rec_trigger_mode != TRIG_MODE_REARM) 824 if (global_settings.rec_trigger_mode != TRIG_MODE_REARM)
@@ -1571,7 +1582,10 @@ bool recording_screen(bool no_source)
1571 { 1582 {
1572 peak_meter_trigger(false); 1583 peak_meter_trigger(false);
1573 peak_meter_set_trigger_listener(NULL); 1584 peak_meter_set_trigger_listener(NULL);
1574 rec_command(RECORDING_CMD_STOP); 1585 if( global_settings.rec_split_type == 1)
1586 rec_command(RECORDING_CMD_STOP);
1587 else
1588 rec_command(RECORDING_CMD_STOP_SHUTDOWN);
1575 } 1589 }
1576 update_countdown = 1; 1590 update_countdown = 1;
1577 } 1591 }
diff --git a/apps/recorder/recording.h b/apps/recorder/recording.h
index a622f01d40..11d6e86e8c 100644
--- a/apps/recorder/recording.h
+++ b/apps/recorder/recording.h
@@ -49,7 +49,8 @@ enum recording_command
49 start recording */ 49 start recording */
50 RECORDING_CMD_START_NEWFILE, /* create unique filename and start recording*/ 50 RECORDING_CMD_START_NEWFILE, /* create unique filename and start recording*/
51 RECORDING_CMD_PAUSE, 51 RECORDING_CMD_PAUSE,
52 RECORDING_CMD_RESUME 52 RECORDING_CMD_RESUME,
53 RECORDING_CMD_STOP_SHUTDOWN /* stop recording and shutdown */
53}; 54};
54 55
55/* centralized way to start/stop/... recording */ 56/* centralized way to start/stop/... recording */