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 | |
parent | 4aaded5c767d8c4d3073716d59608eb146acb03c (diff) | |
download | rockbox-705ca703e3f12ea3f829535fc06adc73183d9545.tar.gz rockbox-705ca703e3f12ea3f829535fc06adc73183d9545.zip |
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
-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) | |||
604 | char *rec_create_filename(char *buffer) | 604 | char *rec_create_filename(char *buffer) |
605 | { | 605 | { |
606 | char ext[16]; | 606 | char ext[16]; |
607 | char pref[9]; | ||
607 | strcpy(buffer,global_settings.rec_directory); | 608 | strcpy(buffer,global_settings.rec_directory); |
608 | if (!check_dir(buffer)) | 609 | if (!check_dir(buffer)) |
609 | return NULL; | 610 | return NULL; |
611 | |||
612 | switch(global_settings.rec_source) | ||
613 | { | ||
614 | #ifdef HAVE_MIC_IN | ||
615 | case AUDIO_SRC_MIC: | ||
616 | snprintf(pref, 9, "R_MIC_"); | ||
617 | break; | ||
618 | #endif | ||
619 | #ifdef HAVE_LINE_REC | ||
620 | case AUDIO_SRC_LINEIN: | ||
621 | snprintf(pref, 9, "R_LINE_"); | ||
622 | break; | ||
623 | #endif | ||
624 | #ifdef HAVE_FMRADIO_REC | ||
625 | case AUDIO_SRC_FMRADIO: | ||
626 | snprintf(pref, 9, "R_FM_"); | ||
627 | break; | ||
628 | #endif | ||
629 | #ifdef HAVE_SPDIF_IN | ||
630 | case AUDIO_SRC_SPDIF: | ||
631 | snprintf(pref, 9, "R_SPDIF_"); | ||
632 | break; | ||
633 | #endif | ||
634 | default: | ||
635 | /* this should never happen */ | ||
636 | snprintf(pref, 9, "R_"); | ||
637 | break; | ||
638 | } | ||
610 | 639 | ||
611 | snprintf(ext, sizeof(ext), ".%s", | 640 | snprintf(ext, sizeof(ext), ".%s", |
612 | REC_FILE_ENDING(global_settings.rec_format)); | 641 | REC_FILE_ENDING(global_settings.rec_format)); |
613 | 642 | ||
614 | #if CONFIG_RTC == 0 | 643 | #if CONFIG_RTC == 0 |
615 | return create_numbered_filename(buffer, buffer, "rec_", ext, 4, | 644 | return create_numbered_filename(buffer, buffer, pref, ext, 4, |
616 | &file_number); | 645 | &file_number); |
617 | #else | 646 | #else |
618 | /* We'll wait at least up to the start of the next second so no duplicate | 647 | /* We'll wait at least up to the start of the next second so no duplicate |
619 | names are created */ | 648 | names are created */ |
620 | return create_datetime_filename(buffer, buffer, "R", ext, true); | 649 | return create_datetime_filename(buffer, buffer, pref, ext, true); |
621 | #endif | 650 | #endif |
622 | } | 651 | } |
623 | 652 | ||