diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-11-20 00:02:52 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-11-20 00:02:52 +0000 |
commit | 6100dd099b870deb657372503aa8d0e673a315a6 (patch) | |
tree | 72e5acef16e02ff6e866ba1674628744d6da476e /apps/recorder/recording.c | |
parent | d3d1583adbb1489e6d6e6c38dd018c77c0cfdcc1 (diff) | |
download | rockbox-6100dd099b870deb657372503aa8d0e673a315a6.tar.gz rockbox-6100dd099b870deb657372503aa8d0e673a315a6.zip |
New filename generation based on date/time
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2863 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder/recording.c')
-rw-r--r-- | apps/recorder/recording.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 491907666f..7a1a47f842 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -37,6 +37,8 @@ | |||
37 | #include "status.h" | 37 | #include "status.h" |
38 | #include "menu.h" | 38 | #include "menu.h" |
39 | #include "sound_menu.h" | 39 | #include "sound_menu.h" |
40 | #include "timefuncs.h" | ||
41 | #include "debug.h" | ||
40 | 42 | ||
41 | bool f2_rec_screen(void); | 43 | bool f2_rec_screen(void); |
42 | bool f3_rec_screen(void); | 44 | bool f3_rec_screen(void); |
@@ -129,6 +131,22 @@ unsigned int frame_times[] = | |||
129 | 3200 /* 16kHz */ | 131 | 3200 /* 16kHz */ |
130 | }; | 132 | }; |
131 | 133 | ||
134 | static char *create_filename(void) | ||
135 | { | ||
136 | static char fname[32]; | ||
137 | struct tm * tm; | ||
138 | |||
139 | tm = get_time(); | ||
140 | |||
141 | /* Create a filename: RYYMMDDHHMMSS.mp3 */ | ||
142 | snprintf(fname, 32, "/R%02d%02d%02d%02d%02d%02d.mp3", | ||
143 | tm->tm_year-2000, tm->tm_mon, tm->tm_mday, | ||
144 | tm->tm_hour, tm->tm_min, tm->tm_sec); | ||
145 | |||
146 | DEBUGF("Filename: %s\n", fname); | ||
147 | return fname; | ||
148 | } | ||
149 | |||
132 | bool recording_screen(void) | 150 | bool recording_screen(void) |
133 | { | 151 | { |
134 | int button; | 152 | int button; |
@@ -164,7 +182,7 @@ bool recording_screen(void) | |||
164 | lcd_setfont(FONT_UI); | 182 | lcd_setfont(FONT_UI); |
165 | lcd_getstringsize("M", &w, &h); | 183 | lcd_getstringsize("M", &w, &h); |
166 | lcd_setmargins(w, 8); | 184 | lcd_setmargins(w, 8); |
167 | 185 | ||
168 | while(!done) | 186 | while(!done) |
169 | { | 187 | { |
170 | button = button_get(false); | 188 | button = button_get(false); |
@@ -190,7 +208,7 @@ bool recording_screen(void) | |||
190 | if(!mpeg_status()) | 208 | if(!mpeg_status()) |
191 | { | 209 | { |
192 | have_recorded = true; | 210 | have_recorded = true; |
193 | mpeg_record(""); | 211 | mpeg_record(create_filename()); |
194 | status_set_playmode(STATUS_RECORD); | 212 | status_set_playmode(STATUS_RECORD); |
195 | update_countdown = 1; /* Update immediately */ | 213 | update_countdown = 1; /* Update immediately */ |
196 | last_seconds = 0; | 214 | last_seconds = 0; |