summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2007-02-17 13:36:44 +0000
committerMagnus Holmgren <magnushol@gmail.com>2007-02-17 13:36:44 +0000
commit14ba91eaa9a94411457cc396a4c7c5e39e63a00a (patch)
treea550e288bda8052a05feb5355df0a16f39897466 /apps/gui
parent471d881979e0027737a435fd03efea493ea696f3 (diff)
downloadrockbox-14ba91eaa9a94411457cc396a4c7c5e39e63a00a.zip
rockbox-14ba91eaa9a94411457cc396a4c7c5e39e63a00a.tar.gz
rockbox-14ba91eaa9a94411457cc396a4c7c5e39e63a00a.tar.bz2
rockbox-14ba91eaa9a94411457cc396a4c7c5e39e63a00a.tar.xz
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
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/gwps-common.c36
-rw-r--r--apps/gui/gwps-common.h1
2 files changed, 9 insertions, 28 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 2037ad5..d533e33 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 b4d6df5..77bec83 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,