forked from len0rd/rockbox
A few more bookmark code tweaks. Also improves how the bookmark selection screen is displayed on Archos players.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12350 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
471d881979
commit
14ba91eaa9
6 changed files with 67 additions and 107 deletions
21
apps/misc.c
21
apps/misc.c
|
|
@ -186,6 +186,27 @@ char *create_numbered_filename(char *buffer, const char *path,
|
|||
return buffer;
|
||||
}
|
||||
|
||||
/* Format time into buf.
|
||||
*
|
||||
* buf - buffer to format to.
|
||||
* buf_size - size of buffer.
|
||||
* t - time to format, in milliseconds.
|
||||
*/
|
||||
void format_time(char* buf, int buf_size, long t)
|
||||
{
|
||||
if ( t < 3600000 )
|
||||
{
|
||||
snprintf(buf, buf_size, "%d:%02d",
|
||||
(int) (t / 60000), (int) (t % 60000 / 1000));
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(buf, buf_size, "%d:%02d:%02d",
|
||||
(int) (t / 3600000), (int) (t % 3600000 / 60000),
|
||||
(int) (t % 60000 / 1000));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
/* Create a filename with a date+time part.
|
||||
It is allowed that buffer and path point to the same memory location,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue