diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-07-14 10:18:11 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-07-14 10:18:11 +0000 |
| commit | 3a203ec68de8778003d7ed5b62a810e7fa51b102 (patch) | |
| tree | 6e1a414b4cdb9b858de06a8d6b7ac53a329aeaa2 | |
| parent | b1af93c31461879d7d36f409261a12af74be4671 (diff) | |
| download | rockbox-3a203ec68de8778003d7ed5b62a810e7fa51b102.zip rockbox-3a203ec68de8778003d7ed5b62a810e7fa51b102.tar.gz rockbox-3a203ec68de8778003d7ed5b62a810e7fa51b102.tar.bz2 rockbox-3a203ec68de8778003d7ed5b62a810e7fa51b102.tar.xz | |
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
| -rw-r--r-- | apps/bookmark.c | 34 | ||||
| -rw-r--r-- | apps/wps-display.c | 8 | ||||
| -rw-r--r-- | docs/CREDITS | 1 |
3 files changed, 38 insertions, 5 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c index aa03004..7cc11ac 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c @@ -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)); diff --git a/apps/wps-display.c b/apps/wps-display.c index 457282c..9f136ff 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c @@ -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. diff --git a/docs/CREDITS b/docs/CREDITS index 6b0a47b..85cd470 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -87,3 +87,4 @@ Brent Coutts Jens Arnold Gerald Vanbaren Christi Scarborough +Steve Cundari |