forked from len0rd/rockbox
Removed hard-coded time display on recorder and added %pb progress bar tag instead.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2218 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
84d4812492
commit
11fbddb5b6
1 changed files with 21 additions and 25 deletions
|
|
@ -60,9 +60,7 @@ struct format_flags
|
||||||
{
|
{
|
||||||
bool dynamic;
|
bool dynamic;
|
||||||
bool scroll;
|
bool scroll;
|
||||||
#ifdef HAVE_LCD_CHARCELLS
|
|
||||||
bool player_progress;
|
bool player_progress;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static char format_buffer[FORMAT_BUFFER_SIZE];
|
static char format_buffer[FORMAT_BUFFER_SIZE];
|
||||||
|
|
@ -309,12 +307,10 @@ static char* get_tag(struct mp3entry* id3,
|
||||||
case 'p': /* Playlist/Song Information */
|
case 'p': /* Playlist/Song Information */
|
||||||
switch(tag[1])
|
switch(tag[1])
|
||||||
{
|
{
|
||||||
#if defined(HAVE_LCD_CHARCELLS) && !defined(SIMULATOR)
|
case 'b': /* progress bar */
|
||||||
case 'b': /* Player progress bar */
|
|
||||||
flags->player_progress = true;
|
flags->player_progress = true;
|
||||||
flags->dynamic = true;
|
flags->dynamic = true;
|
||||||
return "\x01";
|
return "\x01";
|
||||||
#endif
|
|
||||||
|
|
||||||
case 'p': /* Playlist Position */
|
case 'p': /* Playlist Position */
|
||||||
snprintf(buf, buf_size, "%d", id3->index + 1);
|
snprintf(buf, buf_size, "%d", id3->index + 1);
|
||||||
|
|
@ -527,9 +523,6 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, bool refresh_all)
|
||||||
struct format_flags flags;
|
struct format_flags flags;
|
||||||
bool scroll_active = false;
|
bool scroll_active = false;
|
||||||
int i;
|
int i;
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
int bmp_time_line;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!id3)
|
if (!id3)
|
||||||
{
|
{
|
||||||
|
|
@ -549,16 +542,29 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, bool refresh_all)
|
||||||
{
|
{
|
||||||
flags.dynamic = false;
|
flags.dynamic = false;
|
||||||
flags.scroll = false;
|
flags.scroll = false;
|
||||||
#ifdef HAVE_LCD_CHARCELLS
|
|
||||||
flags.player_progress = false;
|
flags.player_progress = false;
|
||||||
#endif
|
|
||||||
format_display(buf, sizeof(buf), id3, format_lines[i], &flags);
|
format_display(buf, sizeof(buf), id3, format_lines[i], &flags);
|
||||||
dynamic_lines[i] = flags.dynamic;
|
dynamic_lines[i] = flags.dynamic;
|
||||||
|
|
||||||
#if defined(HAVE_LCD_CHARCELLS) && !defined(SIMULATOR)
|
if (flags.player_progress) {
|
||||||
if (flags.player_progress)
|
#ifdef HAVE_LCD_CHARCELLS
|
||||||
|
#ifndef SIMULATOR
|
||||||
draw_player_progress(id3, ff_rewind_count);
|
draw_player_progress(id3, ff_rewind_count);
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
int w,h;
|
||||||
|
int offset = global_settings.statusbar ? STATUSBAR_HEIGHT : 0;
|
||||||
|
#ifdef LCD_PROPFONTS
|
||||||
|
lcd_getstringsize("M",0,&w,&h);
|
||||||
|
#else
|
||||||
|
lcd_getfontsize(0,&w,&h);
|
||||||
|
#endif
|
||||||
|
slidebar(0, i*h + offset + 1, LCD_WIDTH, 6,
|
||||||
|
(id3->elapsed + ff_rewind_count) * 100 / id3->length,
|
||||||
|
Grow_Right);
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (!scroll_active && flags.scroll && !flags.dynamic)
|
if (!scroll_active && flags.scroll && !flags.dynamic)
|
||||||
{
|
{
|
||||||
|
|
@ -571,19 +577,8 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, bool refresh_all)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
if (global_settings.statusbar)
|
|
||||||
bmp_time_line = 5;
|
|
||||||
else
|
|
||||||
bmp_time_line = 6;
|
|
||||||
|
|
||||||
format_display(buf, sizeof(buf), id3, "Time: %pc/%pt", &flags);
|
|
||||||
lcd_puts(0, bmp_time_line, buf);
|
|
||||||
|
|
||||||
slidebar(0, LCD_HEIGHT-6, LCD_WIDTH, 6,
|
|
||||||
id3->elapsed * 100 / id3->length, Grow_Right);
|
|
||||||
lcd_update();
|
lcd_update();
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -625,7 +620,8 @@ void wps_display(struct mp3entry* id3)
|
||||||
"%id\n"
|
"%id\n"
|
||||||
"%ia\n"
|
"%ia\n"
|
||||||
"%fb kbit %fv\n"
|
"%fb kbit %fv\n"
|
||||||
"%ff Hz\n");
|
"Time: %pc / %pt\n"
|
||||||
|
"%pb\n");
|
||||||
#else
|
#else
|
||||||
wps_format("%s%pp/%pe: %?ia<%ia - >%?it<%it|%fm>\n"
|
wps_format("%s%pp/%pe: %?ia<%ia - >%?it<%it|%fm>\n"
|
||||||
"%pc/%pt\n");
|
"%pc/%pt\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue