forked from len0rd/rockbox
Show the same information in the ID3 browser as in the WPS screen; use string version of tags if available, format time in the same way.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7029 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3e33a0f8ee
commit
1e5119b77b
3 changed files with 90 additions and 77 deletions
|
@ -45,6 +45,7 @@
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
|
#include "wps-display.h"
|
||||||
#ifdef HAVE_MMC
|
#ifdef HAVE_MMC
|
||||||
#include "ata_mmc.h"
|
#include "ata_mmc.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1315,7 +1316,10 @@ bool browse_id3(void)
|
||||||
case 3:
|
case 3:
|
||||||
lcd_puts(0, 0, str(LANG_ID3_TRACKNUM));
|
lcd_puts(0, 0, str(LANG_ID3_TRACKNUM));
|
||||||
|
|
||||||
if (id3->tracknum) {
|
if (id3->track_string) {
|
||||||
|
lcd_puts_scroll(0, 1, id3->track_string);
|
||||||
|
}
|
||||||
|
else if (id3->tracknum) {
|
||||||
snprintf(scroll_text,sizeof(scroll_text), "%d",
|
snprintf(scroll_text,sizeof(scroll_text), "%d",
|
||||||
id3->tracknum);
|
id3->tracknum);
|
||||||
lcd_puts_scroll(0, 1, scroll_text);
|
lcd_puts_scroll(0, 1, scroll_text);
|
||||||
|
@ -1326,15 +1330,24 @@ bool browse_id3(void)
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
lcd_puts(0, 0, str(LANG_ID3_GENRE));
|
lcd_puts(0, 0, str(LANG_ID3_GENRE));
|
||||||
|
|
||||||
|
if (id3->genre_string) {
|
||||||
|
lcd_puts_scroll(0, 1, id3->genre_string);
|
||||||
|
}
|
||||||
|
else {
|
||||||
lcd_puts_scroll(0, 1,
|
lcd_puts_scroll(0, 1,
|
||||||
id3_get_genre(id3) ?
|
id3_get_genre(id3) ?
|
||||||
id3_get_genre(id3) :
|
id3_get_genre(id3) :
|
||||||
(char*)str(LANG_ID3_NO_INFO));
|
(char*)str(LANG_ID3_NO_INFO));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
lcd_puts(0, 0, str(LANG_ID3_YEAR));
|
lcd_puts(0, 0, str(LANG_ID3_YEAR));
|
||||||
if (id3->year) {
|
if (id3->year_string) {
|
||||||
|
lcd_puts_scroll(0, 1, id3->year_string);
|
||||||
|
}
|
||||||
|
else if (id3->year) {
|
||||||
snprintf(scroll_text,sizeof(scroll_text), "%d",
|
snprintf(scroll_text,sizeof(scroll_text), "%d",
|
||||||
id3->year);
|
id3->year);
|
||||||
lcd_puts_scroll(0, 1, scroll_text);
|
lcd_puts_scroll(0, 1, scroll_text);
|
||||||
|
@ -1345,9 +1358,7 @@ bool browse_id3(void)
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
lcd_puts(0, 0, str(LANG_ID3_LENGHT));
|
lcd_puts(0, 0, str(LANG_ID3_LENGHT));
|
||||||
snprintf(scroll_text,sizeof(scroll_text), "%d:%02d",
|
wps_format_time(scroll_text, sizeof(scroll_text), id3->length);
|
||||||
(int) (id3->length / 60000),
|
|
||||||
(int) (id3->length % 60000 / 1000) );
|
|
||||||
lcd_puts(0, 1, scroll_text);
|
lcd_puts(0, 1, scroll_text);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,7 @@ bool wps_load(const char* file, bool display)
|
||||||
* buf_size - size of buffer.
|
* buf_size - size of buffer.
|
||||||
* time - time to format, in milliseconds.
|
* time - time to format, in milliseconds.
|
||||||
*/
|
*/
|
||||||
static void format_time(char* buf, int buf_size, long time)
|
void wps_format_time(char* buf, int buf_size, long time)
|
||||||
{
|
{
|
||||||
if ( time < 3600000 ) {
|
if ( time < 3600000 ) {
|
||||||
snprintf(buf, buf_size, "%d:%02d",
|
snprintf(buf, buf_size, "%d:%02d",
|
||||||
|
@ -544,18 +544,19 @@ static char* get_tag(struct mp3entry* cid3,
|
||||||
|
|
||||||
case 'c': /* Current Time in Song */
|
case 'c': /* Current Time in Song */
|
||||||
*flags |= WPS_REFRESH_DYNAMIC;
|
*flags |= WPS_REFRESH_DYNAMIC;
|
||||||
format_time(buf, buf_size, id3->elapsed + ff_rewind_count);
|
wps_format_time(buf, buf_size,
|
||||||
|
id3->elapsed + ff_rewind_count);
|
||||||
return buf;
|
return buf;
|
||||||
|
|
||||||
case 'r': /* Remaining Time in Song */
|
case 'r': /* Remaining Time in Song */
|
||||||
*flags |= WPS_REFRESH_DYNAMIC;
|
*flags |= WPS_REFRESH_DYNAMIC;
|
||||||
format_time(buf, buf_size,
|
wps_format_time(buf, buf_size,
|
||||||
id3->length - id3->elapsed - ff_rewind_count);
|
id3->length - id3->elapsed - ff_rewind_count);
|
||||||
return buf;
|
return buf;
|
||||||
|
|
||||||
case 't': /* Total Time */
|
case 't': /* Total Time */
|
||||||
*flags |= WPS_REFRESH_STATIC;
|
*flags |= WPS_REFRESH_STATIC;
|
||||||
format_time(buf, buf_size, id3->length);
|
wps_format_time(buf, buf_size, id3->length);
|
||||||
return buf;
|
return buf;
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
@ -1068,7 +1069,7 @@ bool wps_refresh(struct mp3entry* id3,
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
/* progress */
|
/* progress */
|
||||||
if (flags & refresh_mode & WPS_REFRESH_PLAYER_PROGRESS) {
|
if (flags & refresh_mode & WPS_REFRESH_PLAYER_PROGRESS) {
|
||||||
scrollbar(0, i*h + offset + 1, LCD_WIDTH, 6,
|
scrollbar(0, i*h + offset + (h > 7 ? (h - 6) / 2 : 1), LCD_WIDTH, 6,
|
||||||
id3->length?id3->length:1, 0,
|
id3->length?id3->length:1, 0,
|
||||||
id3->length?id3->elapsed + ff_rewind_count:0,
|
id3->length?id3->elapsed + ff_rewind_count:0,
|
||||||
HORIZONTAL);
|
HORIZONTAL);
|
||||||
|
@ -1284,7 +1285,7 @@ static void draw_player_fullbar(char* buf, int buf_size,
|
||||||
time=(id3->elapsed + ff_rewind_count);
|
time=(id3->elapsed + ff_rewind_count);
|
||||||
|
|
||||||
memset(timestr, 0, sizeof(timestr));
|
memset(timestr, 0, sizeof(timestr));
|
||||||
format_time(timestr, sizeof(timestr), time);
|
wps_format_time(timestr, sizeof(timestr), time);
|
||||||
for(lcd_char_pos=0; lcd_char_pos<6; lcd_char_pos++) {
|
for(lcd_char_pos=0; lcd_char_pos<6; lcd_char_pos++) {
|
||||||
digits[lcd_char_pos] = map_fullbar_char(timestr[lcd_char_pos]);
|
digits[lcd_char_pos] = map_fullbar_char(timestr[lcd_char_pos]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#define WPS_REFRESH_NON_STATIC (WPS_REFRESH_ALL & ~WPS_REFRESH_STATIC & ~WPS_REFRESH_SCROLL)
|
#define WPS_REFRESH_NON_STATIC (WPS_REFRESH_ALL & ~WPS_REFRESH_STATIC & ~WPS_REFRESH_SCROLL)
|
||||||
|
|
||||||
|
|
||||||
|
void wps_format_time(char* buf, int buf_size, long time);
|
||||||
bool wps_refresh(struct mp3entry* id3, struct mp3entry* nid3,
|
bool wps_refresh(struct mp3entry* id3, struct mp3entry* nid3,
|
||||||
int ffwd_offset, unsigned char refresh_mode);
|
int ffwd_offset, unsigned char refresh_mode);
|
||||||
bool wps_display(struct mp3entry* id3, struct mp3entry* nid3);
|
bool wps_display(struct mp3entry* id3, struct mp3entry* nid3);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue