forked from len0rd/rockbox
The /recordings directory is now automatically created in the radio screen as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4721 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
313f67651f
commit
3405d13020
3 changed files with 32 additions and 19 deletions
|
|
@ -155,6 +155,9 @@ bool radio_screen(void)
|
||||||
|
|
||||||
radio_load_presets();
|
radio_load_presets();
|
||||||
|
|
||||||
|
if(rec_create_directory() > 0)
|
||||||
|
have_recorded = true;
|
||||||
|
|
||||||
mpeg_stop();
|
mpeg_stop();
|
||||||
|
|
||||||
mpeg_init_recording();
|
mpeg_init_recording();
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,32 @@ char *rec_create_filename(char *buffer)
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int rec_create_directory(void)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
/* Try to create the base directory if needed */
|
||||||
|
if(global_settings.rec_directory == 0)
|
||||||
|
{
|
||||||
|
rc = mkdir(rec_base_directory, 0);
|
||||||
|
if(rc < 0 && errno != EEXIST)
|
||||||
|
{
|
||||||
|
splash(HZ * 2, true,
|
||||||
|
"Can't create the %s directory. Error code %d.",
|
||||||
|
rec_base_directory, rc);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* If we have created the directory, we want the dir browser to
|
||||||
|
be refreshed even if we haven't recorded anything */
|
||||||
|
if(errno != EEXIST)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool recording_screen(void)
|
bool recording_screen(void)
|
||||||
{
|
{
|
||||||
int button;
|
int button;
|
||||||
|
|
@ -152,7 +178,6 @@ bool recording_screen(void)
|
||||||
unsigned int last_seconds = 0;
|
unsigned int last_seconds = 0;
|
||||||
int hours, minutes;
|
int hours, minutes;
|
||||||
char path_buffer[MAX_PATH];
|
char path_buffer[MAX_PATH];
|
||||||
int rc;
|
|
||||||
bool been_in_usb_mode = false;
|
bool been_in_usb_mode = false;
|
||||||
|
|
||||||
cursor = 0;
|
cursor = 0;
|
||||||
|
|
@ -183,24 +208,8 @@ bool recording_screen(void)
|
||||||
lcd_getstringsize("M", &w, &h);
|
lcd_getstringsize("M", &w, &h);
|
||||||
lcd_setmargins(global_settings.invert_cursor ? 0 : w, 8);
|
lcd_setmargins(global_settings.invert_cursor ? 0 : w, 8);
|
||||||
|
|
||||||
/* Try to create the base directory if needed */
|
if(rec_create_directory() > 0)
|
||||||
if(global_settings.rec_directory == 0)
|
have_recorded = true;
|
||||||
{
|
|
||||||
rc = mkdir(rec_base_directory, 0);
|
|
||||||
if(rc < 0 && errno != EEXIST)
|
|
||||||
{
|
|
||||||
splash(HZ * 2, true,
|
|
||||||
"Can't create the %s directory. Error code %d.",
|
|
||||||
rec_base_directory, rc);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* If we have created the directory, we want the dir browser to
|
|
||||||
be refreshed even if we haven't recorded anything */
|
|
||||||
if(errno != EEXIST)
|
|
||||||
have_recorded = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while(!done)
|
while(!done)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -21,5 +21,6 @@
|
||||||
|
|
||||||
bool recording_screen(void);
|
bool recording_screen(void);
|
||||||
char *rec_create_filename(char *buf);
|
char *rec_create_filename(char *buf);
|
||||||
|
int rec_create_directory(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue