Patch #911298 by Steve Cundari, adds hour display to WPS and bookmarks
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4878 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b1af93c314
commit
3a203ec68d
3 changed files with 38 additions and 5 deletions
|
@ -849,10 +849,22 @@ static void display_bookmark(char* bookmark,
|
|||
lcd_puts_scroll(0, 2, global_temp_buffer);
|
||||
|
||||
/* elapsed time*/
|
||||
snprintf(global_temp_buffer, sizeof(global_temp_buffer), "%s: %d:%02d",
|
||||
if ( ms < 3600000 )
|
||||
{
|
||||
snprintf(global_temp_buffer, sizeof(global_temp_buffer), "%s: %d:%02d",
|
||||
str(LANG_BOOKMARK_SELECT_TIME_TEXT),
|
||||
ms / 60000,
|
||||
ms % 60000 / 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(global_temp_buffer, sizeof(global_temp_buffer),
|
||||
"%s: %d:%02d:%02d",
|
||||
str(LANG_BOOKMARK_SELECT_TIME_TEXT),
|
||||
ms / 60000,
|
||||
ms / 3600000,
|
||||
ms % 3600000 / 60000,
|
||||
ms % 60000 / 1000);
|
||||
}
|
||||
lcd_puts_scroll(0, 3, global_temp_buffer);
|
||||
|
||||
/* commands */
|
||||
|
@ -868,12 +880,26 @@ static void display_bookmark(char* bookmark,
|
|||
dot=NULL;
|
||||
if (dot)
|
||||
*dot='\0';
|
||||
snprintf(global_temp_buffer, sizeof(global_temp_buffer),
|
||||
"%2d, %d:%02d, %s,",
|
||||
if ( ms < 3600000 )
|
||||
{
|
||||
snprintf(global_temp_buffer, sizeof(global_temp_buffer),
|
||||
"%2d, %d:%02d, %s,",
|
||||
(bookmark_count+1),
|
||||
ms / 60000,
|
||||
ms % 60000 / 1000,
|
||||
MP3_file_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(global_temp_buffer, sizeof(global_temp_buffer),
|
||||
"%2d, %d:%02d:%02d, %s,",
|
||||
(bookmark_count+1),
|
||||
ms / 60000,
|
||||
ms % 3600000 / 60000,
|
||||
ms % 60000 / 1000,
|
||||
MP3_file_name);
|
||||
}
|
||||
|
||||
status_draw(false);
|
||||
lcd_puts_scroll(0,0,global_temp_buffer);
|
||||
lcd_puts(0,1,str(LANG_RESUME_CONFIRM_PLAYER));
|
||||
|
|
|
@ -237,7 +237,13 @@ bool wps_load(char* file, bool display)
|
|||
*/
|
||||
static void format_time(char* buf, int buf_size, int time)
|
||||
{
|
||||
snprintf(buf, buf_size, "%d:%02d", time / 60000, time % 60000 / 1000);
|
||||
if ( time < 3600000 ) {
|
||||
snprintf(buf, buf_size, "%d:%02d",
|
||||
time % 3600000 / 60000, time % 60000 / 1000);
|
||||
} else {
|
||||
snprintf(buf, buf_size, "%d:%02d:%02d",
|
||||
time / 3600000, time % 3600000 / 60000, time % 60000 / 1000);
|
||||
}
|
||||
}
|
||||
|
||||
/* Extract a part from a path.
|
||||
|
|
|
@ -87,3 +87,4 @@ Brent Coutts
|
|||
Jens Arnold
|
||||
Gerald Vanbaren
|
||||
Christi Scarborough
|
||||
Steve Cundari
|
||||
|
|
Loading…
Reference in a new issue