From 14ba91eaa9a94411457cc396a4c7c5e39e63a00a Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Sat, 17 Feb 2007 13:36:44 +0000 Subject: 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 --- apps/gui/gwps-common.c | 36 +++++++++--------------------------- apps/gui/gwps-common.h | 1 - 2 files changed, 9 insertions(+), 28 deletions(-) (limited to 'apps/gui') diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 2037ad57a5..d533e33f9c 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c @@ -371,24 +371,6 @@ static void gui_wps_statusbar_draw(struct gui_wps *wps, bool force) gui_statusbar_draw((wps)->statusbar, (force)) #endif -/* Format time into buf. - * - * buf - buffer to format to. - * buf_size - size of buffer. - * time - time to format, in milliseconds. - */ -void gui_wps_format_time(char* buf, int buf_size, long time) -{ - if ( time < 3600000 ) { - snprintf(buf, buf_size, "%d:%02d", - (int) (time % 3600000 / 60000), (int) (time % 60000 / 1000)); - } else { - snprintf(buf, buf_size, "%d:%02d:%02d", - (int) (time / 3600000), (int) (time % 3600000 / 60000), - (int) (time % 60000 / 1000)); - } -} - /* Extract a part from a path. * * buf - buffer extract part to. @@ -688,20 +670,20 @@ static char* get_tag(struct wps_data* wps_data, case 'c': /* Current Time in Song */ *flags |= WPS_REFRESH_DYNAMIC; - gui_wps_format_time(buf, buf_size, - id3->elapsed + wps_state.ff_rewind_count); + format_time(buf, buf_size, + id3->elapsed + wps_state.ff_rewind_count); return buf; case 'r': /* Remaining Time in Song */ *flags |= WPS_REFRESH_DYNAMIC; - gui_wps_format_time(buf, buf_size, - id3->length - id3->elapsed - - wps_state.ff_rewind_count); + format_time(buf, buf_size, + id3->length - id3->elapsed - + wps_state.ff_rewind_count); return buf; case 't': /* Total Time */ *flags |= WPS_REFRESH_STATIC; - gui_wps_format_time(buf, buf_size, id3->length); + format_time(buf, buf_size, id3->length); return buf; #ifdef HAVE_LCD_BITMAP @@ -835,8 +817,8 @@ static char* get_tag(struct wps_data* wps_data, } else { - gui_wps_format_time(buf, buf_size, \ - get_sleep_timer() * 1000); + format_time(buf, buf_size, \ + get_sleep_timer() * 1000); return buf; } } @@ -2252,7 +2234,7 @@ static void draw_player_fullbar(struct gui_wps *gwps, char* buf, int buf_size) time=(state->id3->elapsed + state->ff_rewind_count); memset(timestr, 0, sizeof(timestr)); - gui_wps_format_time(timestr, sizeof(timestr), time); + format_time(timestr, sizeof(timestr), time); for(lcd_char_pos=0; lcd_char_pos<6; lcd_char_pos++) { digits[lcd_char_pos] = map_fullbar_char(timestr[lcd_char_pos]); } diff --git a/apps/gui/gwps-common.h b/apps/gui/gwps-common.h index b4d6df589a..77bec83951 100644 --- a/apps/gui/gwps-common.h +++ b/apps/gui/gwps-common.h @@ -23,7 +23,6 @@ #include "gwps.h" -void gui_wps_format_time(char* buf, int buf_size, long time); void fade(bool fade_in); void gui_wps_format(struct wps_data *data); bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, -- cgit v1.2.3