diff options
author | Peter D'Hoye <peter.dhoye@gmail.com> | 2007-08-01 22:04:28 +0000 |
---|---|---|
committer | Peter D'Hoye <peter.dhoye@gmail.com> | 2007-08-01 22:04:28 +0000 |
commit | 705ca703e3f12ea3f829535fc06adc73183d9545 (patch) | |
tree | 735ead8fa77810906805a8e90473bbcdfd0d75bc /apps | |
parent | 4aaded5c767d8c4d3073716d59608eb146acb03c (diff) |
Let recording create filenames based on the recording source, closes FS #921 (yes, he waited 4 years for his feature request to make it)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14125 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/recorder/recording.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 30e3c315c8..8213bce53c 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -604,20 +604,49 @@ static bool check_dir(char *folder) char *rec_create_filename(char *buffer) { char ext[16]; + char pref[9]; strcpy(buffer,global_settings.rec_directory); if (!check_dir(buffer)) return NULL; + + switch(global_settings.rec_source) + { +#ifdef HAVE_MIC_IN + case AUDIO_SRC_MIC: + snprintf(pref, 9, "R_MIC_"); + break; +#endif +#ifdef HAVE_LINE_REC + case AUDIO_SRC_LINEIN: + snprintf(pref, 9, "R_LINE_"); + break; +#endif +#ifdef HAVE_FMRADIO_REC + case AUDIO_SRC_FMRADIO: + snprintf(pref, 9, "R_FM_"); + break; +#endif +#ifdef HAVE_SPDIF_IN + case AUDIO_SRC_SPDIF: + snprintf(pref, 9, "R_SPDIF_"); + break; +#endif + default: + /* this should never happen */ + snprintf(pref, 9, "R_"); + break; + } snprintf(ext, sizeof(ext), ".%s", REC_FILE_ENDING(global_settings.rec_format)); #if CONFIG_RTC == 0 - return create_numbered_filename(buffer, buffer, "rec_", ext, 4, + return create_numbered_filename(buffer, buffer, pref, ext, 4, &file_number); #else /* We'll wait at least up to the start of the next second so no duplicate names are created */ - return create_datetime_filename(buffer, buffer, "R", ext, true); + return create_datetime_filename(buffer, buffer, pref, ext, true); #endif } |