summaryrefslogtreecommitdiff
path: root/apps/recorder
diff options
context:
space:
mode:
authorMartin Scarratt <mmmm@rockbox.org>2006-07-22 17:23:05 +0000
committerMartin Scarratt <mmmm@rockbox.org>2006-07-22 17:23:05 +0000
commit9130a2a4a710a93ecc36d57b1f2abb9332567080 (patch)
treeb8b9214c3ad15f135772c285efe80675d5594e57 /apps/recorder
parent57327044cdfa8258b8bea8a4d837fa4a7d551aff (diff)
downloadrockbox-9130a2a4a710a93ecc36d57b1f2abb9332567080.tar.gz
rockbox-9130a2a4a710a93ecc36d57b1f2abb9332567080.zip
Added options to timesplit recording feature (now renamed filesplit). Choose to split file by either time or filesize. Also have the option to either start a new file or stop recording at split point. Bumped config version so save your settings before you update your build.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10285 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/recording.c53
1 files changed, 38 insertions, 15 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 436212a1be..06a6fd9b94 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -830,27 +830,38 @@ bool recording_screen(void)
830 if(update_countdown == 0 || seconds > last_seconds) 830 if(update_countdown == 0 || seconds > last_seconds)
831 { 831 {
832 unsigned int dseconds, dhours, dminutes; 832 unsigned int dseconds, dhours, dminutes;
833 unsigned long num_recorded_bytes; 833 unsigned long num_recorded_bytes, dsize, dmb;
834 int pos = 0; 834 int pos = 0;
835 char spdif_sfreq[8]; 835 char spdif_sfreq[8];
836 836
837 update_countdown = 5; 837 update_countdown = 5;
838 last_seconds = seconds; 838 last_seconds = seconds;
839 839
840 dseconds = rec_timesplit_seconds();
841 dsize = rec_sizesplit_bytes();
842 num_recorded_bytes = audio_num_recorded_bytes();
843
840 FOR_NB_SCREENS(i) 844 FOR_NB_SCREENS(i)
841 screens[i].clear_display(); 845 screens[i].clear_display();
842 846
843 hours = seconds / 3600; 847 if ((global_settings.rec_sizesplit) && (global_settings.rec_split_method))
844 minutes = (seconds - (hours * 3600)) / 60; 848 {
845 snprintf(buf, 32, "%s %02d:%02d:%02d", 849 dmb = dsize/1024/1024;
846 str(LANG_RECORDING_TIME), 850 snprintf(buf, 32, "%s %dMB",
847 hours, minutes, seconds%60); 851 str(LANG_SPLIT_SIZE), dmb);
852 }
853 else
854 {
855 hours = seconds / 3600;
856 minutes = (seconds - (hours * 3600)) / 60;
857 snprintf(buf, 32, "%s %02d:%02d:%02d",
858 str(LANG_RECORDING_TIME),
859 hours, minutes, seconds%60);
860 }
861
848 FOR_NB_SCREENS(i) 862 FOR_NB_SCREENS(i)
849 screens[i].puts(0, 0, buf); 863 screens[i].puts(0, 0, buf);
850 864
851 dseconds = rec_timesplit_seconds();
852 num_recorded_bytes = audio_num_recorded_bytes();
853
854 if(audio_stat & AUDIO_STATUS_PRERECORD) 865 if(audio_stat & AUDIO_STATUS_PRERECORD)
855 { 866 {
856 snprintf(buf, 32, "%s...", str(LANG_RECORD_PRERECORD)); 867 snprintf(buf, 32, "%s...", str(LANG_RECORD_PRERECORD));
@@ -859,7 +870,7 @@ bool recording_screen(void)
859 { 870 {
860 /* Display the split interval if the record timesplit 871 /* Display the split interval if the record timesplit
861 is active */ 872 is active */
862 if (global_settings.rec_timesplit) 873 if ((global_settings.rec_timesplit) && !(global_settings.rec_split_method))
863 { 874 {
864 /* Display the record timesplit interval rather 875 /* Display the record timesplit interval rather
865 than the file size if the record timer is 876 than the file size if the record timer is
@@ -903,13 +914,25 @@ bool recording_screen(void)
903 /* We will do file splitting regardless, either at the end of 914 /* We will do file splitting regardless, either at the end of
904 a split interval, or when the filesize approaches the 2GB 915 a split interval, or when the filesize approaches the 2GB
905 FAT file size (compatibility) limit. */ 916 FAT file size (compatibility) limit. */
906 if (audio_stat && 917 if ((audio_stat && !(global_settings.rec_split_method)
907 ((global_settings.rec_timesplit && (seconds >= dseconds)) 918 && global_settings.rec_timesplit && (seconds >= dseconds))
908 || (num_recorded_bytes >= MAX_FILE_SIZE))) 919 || (audio_stat && global_settings.rec_split_method
920 && global_settings.rec_sizesplit && (num_recorded_bytes >= dsize))
921 || (num_recorded_bytes >= MAX_FILE_SIZE))
909 { 922 {
910 audio_new_file(rec_create_filename(path_buffer)); 923 if (!(global_settings.rec_split_type)
924 || (num_recorded_bytes >= MAX_FILE_SIZE))
925 {
926 audio_new_file(rec_create_filename(path_buffer));
927 last_seconds = 0;
928 }
929 else
930 {
931 peak_meter_trigger(false);
932 peak_meter_set_trigger_listener(NULL);
933 audio_stop_recording();
934 }
911 update_countdown = 1; 935 update_countdown = 1;
912 last_seconds = 0;
913 } 936 }
914 937
915 snprintf(buf, 32, "%s: %s", str(LANG_VOLUME), 938 snprintf(buf, 32, "%s: %s", str(LANG_VOLUME),