forked from len0rd/rockbox
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
This commit is contained in:
parent
4aaded5c76
commit
705ca703e3
1 changed files with 31 additions and 2 deletions
|
|
@ -604,20 +604,49 @@ static bool check_dir(char *folder)
|
||||||
char *rec_create_filename(char *buffer)
|
char *rec_create_filename(char *buffer)
|
||||||
{
|
{
|
||||||
char ext[16];
|
char ext[16];
|
||||||
|
char pref[9];
|
||||||
strcpy(buffer,global_settings.rec_directory);
|
strcpy(buffer,global_settings.rec_directory);
|
||||||
if (!check_dir(buffer))
|
if (!check_dir(buffer))
|
||||||
return NULL;
|
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",
|
snprintf(ext, sizeof(ext), ".%s",
|
||||||
REC_FILE_ENDING(global_settings.rec_format));
|
REC_FILE_ENDING(global_settings.rec_format));
|
||||||
|
|
||||||
#if CONFIG_RTC == 0
|
#if CONFIG_RTC == 0
|
||||||
return create_numbered_filename(buffer, buffer, "rec_", ext, 4,
|
return create_numbered_filename(buffer, buffer, pref, ext, 4,
|
||||||
&file_number);
|
&file_number);
|
||||||
#else
|
#else
|
||||||
/* We'll wait at least up to the start of the next second so no duplicate
|
/* We'll wait at least up to the start of the next second so no duplicate
|
||||||
names are created */
|
names are created */
|
||||||
return create_datetime_filename(buffer, buffer, "R", ext, true);
|
return create_datetime_filename(buffer, buffer, pref, ext, true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue