diff options
author | Magnus Holmgren <magnushol@gmail.com> | 2005-07-05 19:33:33 +0000 |
---|---|---|
committer | Magnus Holmgren <magnushol@gmail.com> | 2005-07-05 19:33:33 +0000 |
commit | 1e5119b77bda5f67ad032a9587ead2d311b0767a (patch) | |
tree | 8b83c755a9b7c065935e95db8e328d2e82db6e61 /apps/screens.c | |
parent | 3e33a0f8ee62dc37e6e028e5dcb39b91e0e0d154 (diff) | |
download | rockbox-1e5119b77bda5f67ad032a9587ead2d311b0767a.tar.gz rockbox-1e5119b77bda5f67ad032a9587ead2d311b0767a.zip |
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
Diffstat (limited to 'apps/screens.c')
-rw-r--r-- | apps/screens.c | 135 |
1 files changed, 73 insertions, 62 deletions
diff --git a/apps/screens.c b/apps/screens.c index 6d9b299c54..20e4ceac02 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -40,11 +40,12 @@ | |||
40 | #include "action.h" | 40 | #include "action.h" |
41 | #include "talk.h" | 41 | #include "talk.h" |
42 | #include "misc.h" | 42 | #include "misc.h" |
43 | #include "id3.h" | 43 | #include "id3.h" |
44 | #include "screens.h" | 44 | #include "screens.h" |
45 | #include "debug.h" | 45 | #include "debug.h" |
46 | #include "led.h" | 46 | #include "led.h" |
47 | #include "sound.h" | 47 | #include "sound.h" |
48 | #include "wps-display.h" | ||
48 | #ifdef HAVE_MMC | 49 | #ifdef HAVE_MMC |
49 | #include "ata_mmc.h" | 50 | #include "ata_mmc.h" |
50 | #endif | 51 | #endif |
@@ -60,7 +61,7 @@ static const unsigned char usb_logo[] = { | |||
60 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x81, 0x81, 0x81, | 61 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x81, 0x81, 0x81, |
61 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, | 62 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, |
62 | 0x01, 0x01, 0x01, 0x01, 0xf1, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, | 63 | 0x01, 0x01, 0x01, 0x01, 0xf1, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, |
63 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, | 64 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, |
64 | 0x00, 0x00, 0xe0, 0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | 65 | 0x00, 0x00, 0xe0, 0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, |
65 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | 66 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, |
66 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x81, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, | 67 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x81, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, |
@@ -68,7 +69,7 @@ static const unsigned char usb_logo[] = { | |||
68 | 0x0c, 0x0e, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, | 69 | 0x0c, 0x0e, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, |
69 | 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, | 70 | 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, |
70 | 0x00, 0x00, 0xe0, 0x1f, 0x00, 0xf8, 0x06, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, | 71 | 0x00, 0x00, 0xe0, 0x1f, 0x00, 0xf8, 0x06, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, |
71 | 0x02, 0x02, 0x02, 0x82, 0x7e, 0x00, 0xc0, 0x3e, 0x01, | 72 | 0x02, 0x02, 0x02, 0x82, 0x7e, 0x00, 0xc0, 0x3e, 0x01, |
72 | 0x70, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, | 73 | 0x70, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, |
73 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, | 74 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, |
74 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x07, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, | 75 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x07, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, |
@@ -76,7 +77,7 @@ static const unsigned char usb_logo[] = { | |||
76 | 0x1f, 0x3f, 0x7b, 0xf3, 0xe3, 0xc3, 0x83, 0x83, 0x83, 0x83, 0xe3, 0xe3, 0xe3, | 77 | 0x1f, 0x3f, 0x7b, 0xf3, 0xe3, 0xc3, 0x83, 0x83, 0x83, 0x83, 0xe3, 0xe3, 0xe3, |
77 | 0xe3, 0xe3, 0xe3, 0x03, 0x03, 0x03, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x07, 0x02, | 78 | 0xe3, 0xe3, 0xe3, 0x03, 0x03, 0x03, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x07, 0x02, |
78 | 0xc0, 0x3e, 0x01, 0xe0, 0x9f, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, | 79 | 0xc0, 0x3e, 0x01, 0xe0, 0x9f, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, |
79 | 0x80, 0x80, 0xf0, 0x0f, 0x80, 0x78, 0x07, 0x00, 0x00, | 80 | 0x80, 0x80, 0xf0, 0x0f, 0x80, 0x78, 0x07, 0x00, 0x00, |
80 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 81 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
81 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 82 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
82 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x10, 0x20, 0x40, 0x40, 0x80, 0x80, | 83 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x10, 0x20, 0x40, 0x40, 0x80, 0x80, |
@@ -84,7 +85,7 @@ static const unsigned char usb_logo[] = { | |||
84 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x81, 0x81, 0x87, 0x87, 0x87, | 85 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x81, 0x81, 0x87, 0x87, 0x87, |
85 | 0x87, 0x87, 0x87, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf0, | 86 | 0x87, 0x87, 0x87, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf0, |
86 | 0x0f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | 87 | 0x0f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, |
87 | 0x04, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, | 88 | 0x04, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, |
88 | }; | 89 | }; |
89 | #endif | 90 | #endif |
90 | 91 | ||
@@ -148,7 +149,7 @@ int mmc_remove_request(void) | |||
148 | splash(1, true, str(LANG_REMOVE_MMC)); | 149 | splash(1, true, str(LANG_REMOVE_MMC)); |
149 | if (global_settings.talk_menu) | 150 | if (global_settings.talk_menu) |
150 | talk_id(LANG_REMOVE_MMC, false); | 151 | talk_id(LANG_REMOVE_MMC, false); |
151 | 152 | ||
152 | while (1) | 153 | while (1) |
153 | { | 154 | { |
154 | queue_wait_w_tmo(&button_queue, &ev, HZ/2); | 155 | queue_wait_w_tmo(&button_queue, &ev, HZ/2); |
@@ -156,7 +157,7 @@ int mmc_remove_request(void) | |||
156 | { | 157 | { |
157 | case SYS_MMC_EXTRACTED: | 158 | case SYS_MMC_EXTRACTED: |
158 | return SYS_MMC_EXTRACTED; | 159 | return SYS_MMC_EXTRACTED; |
159 | 160 | ||
160 | case SYS_USB_DISCONNECTED: | 161 | case SYS_USB_DISCONNECTED: |
161 | return SYS_USB_DISCONNECTED; | 162 | return SYS_USB_DISCONNECTED; |
162 | } | 163 | } |
@@ -223,20 +224,20 @@ void charging_display_info(bool animate) | |||
223 | animate = false; | 224 | animate = false; |
224 | #endif /* HAVE_CHARGE_CTRL */ | 225 | #endif /* HAVE_CHARGE_CTRL */ |
225 | 226 | ||
226 | 227 | ||
227 | /* middle part */ | 228 | /* middle part */ |
228 | memset(charging_logo+3, 0x00, 32); | 229 | memset(charging_logo+3, 0x00, 32); |
229 | charging_logo[0] = 0x3C; | 230 | charging_logo[0] = 0x3C; |
230 | charging_logo[1] = 0x24; | 231 | charging_logo[1] = 0x24; |
231 | charging_logo[2] = charging_logo[35] = 0xFF; | 232 | charging_logo[2] = charging_logo[35] = 0xFF; |
232 | 233 | ||
233 | if (!animate) | 234 | if (!animate) |
234 | { /* draw the outline */ | 235 | { /* draw the outline */ |
235 | /* middle part */ | 236 | /* middle part */ |
236 | lcd_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8); | 237 | lcd_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8); |
237 | lcd_set_drawmode(DRMODE_FG); | 238 | lcd_set_drawmode(DRMODE_FG); |
238 | /* upper line */ | 239 | /* upper line */ |
239 | charging_logo[0] = charging_logo[1] = 0x00; | 240 | charging_logo[0] = charging_logo[1] = 0x00; |
240 | memset(charging_logo+2, 0x80, 34); | 241 | memset(charging_logo+2, 0x80, 34); |
241 | lcd_bitmap(charging_logo, pox_x, pox_y, sizeof(charging_logo), 8); | 242 | lcd_bitmap(charging_logo, pox_x, pox_y, sizeof(charging_logo), 8); |
242 | /* lower line */ | 243 | /* lower line */ |
@@ -252,7 +253,7 @@ void charging_display_info(bool animate) | |||
252 | { /* draw a "bubble" here */ | 253 | { /* draw a "bubble" here */ |
253 | unsigned bitpos; | 254 | unsigned bitpos; |
254 | bitpos = (phase + i/8) % 15; /* "bounce" effect */ | 255 | bitpos = (phase + i/8) % 15; /* "bounce" effect */ |
255 | if (bitpos > 7) | 256 | if (bitpos > 7) |
256 | bitpos = 14 - bitpos; | 257 | bitpos = 14 - bitpos; |
257 | charging_logo[i] = 0x01 << bitpos; | 258 | charging_logo[i] = 0x01 << bitpos; |
258 | } | 259 | } |
@@ -274,7 +275,7 @@ static const unsigned char logo_pattern[] = { | |||
274 | 275 | ||
275 | static void logo_lock_patterns(bool on) | 276 | static void logo_lock_patterns(bool on) |
276 | { | 277 | { |
277 | int i; | 278 | int i; |
278 | 279 | ||
279 | if (on) | 280 | if (on) |
280 | { | 281 | { |
@@ -301,7 +302,7 @@ void charging_display_info(bool animate) | |||
301 | snprintf(buf, sizeof(buf), "%s %d.%02dV", logo_chars, | 302 | snprintf(buf, sizeof(buf), "%s %d.%02dV", logo_chars, |
302 | battery_voltage / 100, battery_voltage % 100); | 303 | battery_voltage / 100, battery_voltage % 100); |
303 | lcd_puts(0, 1, buf); | 304 | lcd_puts(0, 1, buf); |
304 | 305 | ||
305 | memcpy(buf, logo_pattern, 28); /* copy logo patterns */ | 306 | memcpy(buf, logo_pattern, 28); /* copy logo patterns */ |
306 | 307 | ||
307 | if (!animate) /* build the screen */ | 308 | if (!animate) /* build the screen */ |
@@ -323,7 +324,7 @@ void charging_display_info(bool animate) | |||
323 | } | 324 | } |
324 | phase++; | 325 | phase++; |
325 | } | 326 | } |
326 | 327 | ||
327 | for (i = 0; i < 4; i++) | 328 | for (i = 0; i < 4; i++) |
328 | lcd_define_pattern(logo_chars[i], buf + 7 * i); | 329 | lcd_define_pattern(logo_chars[i], buf + 7 * i); |
329 | } | 330 | } |
@@ -410,7 +411,7 @@ int pitch_screen(void) | |||
410 | 411 | ||
411 | lcd_clear_display(); | 412 | lcd_clear_display(); |
412 | lcd_setfont(FONT_SYSFIXED); | 413 | lcd_setfont(FONT_SYSFIXED); |
413 | 414 | ||
414 | ptr = str(LANG_PITCH_UP); | 415 | ptr = str(LANG_PITCH_UP); |
415 | lcd_getstringsize(ptr,&w,&h); | 416 | lcd_getstringsize(ptr,&w,&h); |
416 | lcd_putsxy((LCD_WIDTH-w)/2, 0, ptr); | 417 | lcd_putsxy((LCD_WIDTH-w)/2, 0, ptr); |
@@ -528,7 +529,7 @@ bool quick_screen(int context, int button) | |||
528 | int w, h, key; | 529 | int w, h, key; |
529 | char buf[32]; | 530 | char buf[32]; |
530 | int oldrepeat = global_settings.repeat_mode; | 531 | int oldrepeat = global_settings.repeat_mode; |
531 | 532 | ||
532 | /* just to stop compiler warning */ | 533 | /* just to stop compiler warning */ |
533 | context = context; | 534 | context = context; |
534 | lcd_setfont(FONT_SYSFIXED); | 535 | lcd_setfont(FONT_SYSFIXED); |
@@ -551,8 +552,8 @@ bool quick_screen(int context, int button) | |||
551 | /* Shuffle mode */ | 552 | /* Shuffle mode */ |
552 | lcd_putsxy(0, LCD_HEIGHT/2 - h*2, str(LANG_SHUFFLE)); | 553 | lcd_putsxy(0, LCD_HEIGHT/2 - h*2, str(LANG_SHUFFLE)); |
553 | lcd_putsxy(0, LCD_HEIGHT/2 - h, str(LANG_F2_MODE)); | 554 | lcd_putsxy(0, LCD_HEIGHT/2 - h, str(LANG_F2_MODE)); |
554 | lcd_putsxy(0, LCD_HEIGHT/2, | 555 | lcd_putsxy(0, LCD_HEIGHT/2, |
555 | global_settings.playlist_shuffle ? | 556 | global_settings.playlist_shuffle ? |
556 | str(LANG_ON) : str(LANG_OFF)); | 557 | str(LANG_ON) : str(LANG_OFF)); |
557 | 558 | ||
558 | /* Directory Filter */ | 559 | /* Directory Filter */ |
@@ -560,15 +561,15 @@ bool quick_screen(int context, int button) | |||
560 | case SHOW_ALL: | 561 | case SHOW_ALL: |
561 | ptr = str(LANG_FILTER_ALL); | 562 | ptr = str(LANG_FILTER_ALL); |
562 | break; | 563 | break; |
563 | 564 | ||
564 | case SHOW_SUPPORTED: | 565 | case SHOW_SUPPORTED: |
565 | ptr = str(LANG_FILTER_SUPPORTED); | 566 | ptr = str(LANG_FILTER_SUPPORTED); |
566 | break; | 567 | break; |
567 | 568 | ||
568 | case SHOW_MUSIC: | 569 | case SHOW_MUSIC: |
569 | ptr = str(LANG_FILTER_MUSIC); | 570 | ptr = str(LANG_FILTER_MUSIC); |
570 | break; | 571 | break; |
571 | 572 | ||
572 | case SHOW_PLAYLIST: | 573 | case SHOW_PLAYLIST: |
573 | ptr = str(LANG_FILTER_PLAYLIST); | 574 | ptr = str(LANG_FILTER_PLAYLIST); |
574 | break; | 575 | break; |
@@ -577,7 +578,7 @@ bool quick_screen(int context, int button) | |||
577 | ptr = str(LANG_FILTER_ID3DB); | 578 | ptr = str(LANG_FILTER_ID3DB); |
578 | break; | 579 | break; |
579 | } | 580 | } |
580 | 581 | ||
581 | snprintf(buf, sizeof buf, "%s:", str(LANG_FILTER)); | 582 | snprintf(buf, sizeof buf, "%s:", str(LANG_FILTER)); |
582 | lcd_getstringsize(buf,&w,&h); | 583 | lcd_getstringsize(buf,&w,&h); |
583 | lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h*2, buf); | 584 | lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h*2, buf); |
@@ -589,20 +590,20 @@ bool quick_screen(int context, int button) | |||
589 | case REPEAT_OFF: | 590 | case REPEAT_OFF: |
590 | ptr = str(LANG_OFF); | 591 | ptr = str(LANG_OFF); |
591 | break; | 592 | break; |
592 | 593 | ||
593 | case REPEAT_ALL: | 594 | case REPEAT_ALL: |
594 | ptr = str(LANG_REPEAT_ALL); | 595 | ptr = str(LANG_REPEAT_ALL); |
595 | break; | 596 | break; |
596 | 597 | ||
597 | case REPEAT_ONE: | 598 | case REPEAT_ONE: |
598 | ptr = str(LANG_REPEAT_ONE); | 599 | ptr = str(LANG_REPEAT_ONE); |
599 | break; | 600 | break; |
600 | 601 | ||
601 | case REPEAT_SHUFFLE: | 602 | case REPEAT_SHUFFLE: |
602 | ptr = str(LANG_SHUFFLE); | 603 | ptr = str(LANG_SHUFFLE); |
603 | break; | 604 | break; |
604 | } | 605 | } |
605 | 606 | ||
606 | lcd_getstringsize(str(LANG_SHUFFLE),&w,&h); | 607 | lcd_getstringsize(str(LANG_SHUFFLE),&w,&h); |
607 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2, str(LANG_REPEAT)); | 608 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2, str(LANG_REPEAT)); |
608 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, str(LANG_F2_MODE)); | 609 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, str(LANG_F2_MODE)); |
@@ -613,17 +614,17 @@ bool quick_screen(int context, int button) | |||
613 | /* Scrollbar */ | 614 | /* Scrollbar */ |
614 | lcd_putsxy(0, LCD_HEIGHT/2 - h*2, str(LANG_F3_SCROLL)); | 615 | lcd_putsxy(0, LCD_HEIGHT/2 - h*2, str(LANG_F3_SCROLL)); |
615 | lcd_putsxy(0, LCD_HEIGHT/2 - h, str(LANG_F3_BAR)); | 616 | lcd_putsxy(0, LCD_HEIGHT/2 - h, str(LANG_F3_BAR)); |
616 | lcd_putsxy(0, LCD_HEIGHT/2, | 617 | lcd_putsxy(0, LCD_HEIGHT/2, |
617 | global_settings.scrollbar ? str(LANG_ON) : str(LANG_OFF)); | 618 | global_settings.scrollbar ? str(LANG_ON) : str(LANG_OFF)); |
618 | 619 | ||
619 | /* Status bar */ | 620 | /* Status bar */ |
620 | ptr = str(LANG_F3_STATUS); | 621 | ptr = str(LANG_F3_STATUS); |
621 | lcd_getstringsize(ptr,&w,&h); | 622 | lcd_getstringsize(ptr,&w,&h); |
622 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2, ptr); | 623 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2, ptr); |
623 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, str(LANG_F3_BAR)); | 624 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, str(LANG_F3_BAR)); |
624 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, | 625 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, |
625 | global_settings.statusbar ? str(LANG_ON) : str(LANG_OFF)); | 626 | global_settings.statusbar ? str(LANG_ON) : str(LANG_OFF)); |
626 | 627 | ||
627 | /* Flip */ | 628 | /* Flip */ |
628 | ptr = str(LANG_FLIP_DISPLAY); | 629 | ptr = str(LANG_FLIP_DISPLAY); |
629 | lcd_getstringsize(ptr,&w,&h); | 630 | lcd_getstringsize(ptr,&w,&h); |
@@ -636,7 +637,7 @@ bool quick_screen(int context, int button) | |||
636 | #endif | 637 | #endif |
637 | } | 638 | } |
638 | 639 | ||
639 | lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], | 640 | lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], |
640 | LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8); | 641 | LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8); |
641 | lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow], | 642 | lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow], |
642 | LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); | 643 | LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); |
@@ -645,15 +646,15 @@ bool quick_screen(int context, int button) | |||
645 | 646 | ||
646 | lcd_update(); | 647 | lcd_update(); |
647 | key = button_get(true); | 648 | key = button_get(true); |
648 | 649 | ||
649 | /* | 650 | /* |
650 | * This is a temporary kludge so that the F2 & F3 menus operate in exactly | 651 | * This is a temporary kludge so that the F2 & F3 menus operate in exactly |
651 | * the same manner up until the full F2/F3 configurable menus are complete | 652 | * the same manner up until the full F2/F3 configurable menus are complete |
652 | */ | 653 | */ |
653 | 654 | ||
654 | if( key == BUTTON_LEFT || key == BUTTON_RIGHT || key == BUTTON_DOWN || key == ( BUTTON_LEFT | BUTTON_REPEAT ) || key == ( BUTTON_RIGHT | BUTTON_REPEAT ) || key == ( BUTTON_DOWN | BUTTON_REPEAT ) ) | 655 | if( key == BUTTON_LEFT || key == BUTTON_RIGHT || key == BUTTON_DOWN || key == ( BUTTON_LEFT | BUTTON_REPEAT ) || key == ( BUTTON_RIGHT | BUTTON_REPEAT ) || key == ( BUTTON_DOWN | BUTTON_REPEAT ) ) |
655 | key = button | key; | 656 | key = button | key; |
656 | 657 | ||
657 | switch (key) { | 658 | switch (key) { |
658 | case SCREENS_QUICK | BUTTON_LEFT: | 659 | case SCREENS_QUICK | BUTTON_LEFT: |
659 | case SCREENS_QUICK | BUTTON_LEFT | BUTTON_REPEAT: | 660 | case SCREENS_QUICK | BUTTON_LEFT | BUTTON_REPEAT: |
@@ -712,12 +713,12 @@ bool quick_screen(int context, int button) | |||
712 | case BUTTON_F3 | BUTTON_REL: | 713 | case BUTTON_F3 | BUTTON_REL: |
713 | #endif | 714 | #endif |
714 | case SCREENS_QUICK | BUTTON_REL: | 715 | case SCREENS_QUICK | BUTTON_REL: |
715 | 716 | ||
716 | if( used ) | 717 | if( used ) |
717 | exit = true; | 718 | exit = true; |
718 | 719 | ||
719 | used = true; | 720 | used = true; |
720 | 721 | ||
721 | break; | 722 | break; |
722 | 723 | ||
723 | case BUTTON_OFF | BUTTON_REL: | 724 | case BUTTON_OFF | BUTTON_REL: |
@@ -732,7 +733,7 @@ bool quick_screen(int context, int button) | |||
732 | } | 733 | } |
733 | 734 | ||
734 | settings_save(); | 735 | settings_save(); |
735 | 736 | ||
736 | switch( button ) | 737 | switch( button ) |
737 | { | 738 | { |
738 | case SCREENS_QUICK: | 739 | case SCREENS_QUICK: |
@@ -748,11 +749,11 @@ bool quick_screen(int context, int button) | |||
748 | lcd_setmargins(0, STATUSBAR_HEIGHT); | 749 | lcd_setmargins(0, STATUSBAR_HEIGHT); |
749 | else | 750 | else |
750 | lcd_setmargins(0, 0); | 751 | lcd_setmargins(0, 0); |
751 | 752 | ||
752 | break; | 753 | break; |
753 | #endif | 754 | #endif |
754 | } | 755 | } |
755 | 756 | ||
756 | lcd_setfont(FONT_UI); | 757 | lcd_setfont(FONT_UI); |
757 | 758 | ||
758 | return false; | 759 | return false; |
@@ -794,13 +795,13 @@ void splash(int ticks, /* how long the splash is displayed */ | |||
794 | #endif | 795 | #endif |
795 | 796 | ||
796 | #ifdef HAVE_LCD_CHARCELLS | 797 | #ifdef HAVE_LCD_CHARCELLS |
797 | lcd_double_height (false); | 798 | lcd_double_height (false); |
798 | #endif | 799 | #endif |
799 | va_start( ap, fmt ); | 800 | va_start( ap, fmt ); |
800 | vsnprintf( splash_buf, sizeof(splash_buf), fmt, ap ); | 801 | vsnprintf( splash_buf, sizeof(splash_buf), fmt, ap ); |
801 | 802 | ||
802 | if(center) { | 803 | if(center) { |
803 | 804 | ||
804 | /* first a pass to measure sizes */ | 805 | /* first a pass to measure sizes */ |
805 | next = strtok_r(splash_buf, " ", &store); | 806 | next = strtok_r(splash_buf, " ", &store); |
806 | while (next) { | 807 | while (next) { |
@@ -965,7 +966,7 @@ static void say_time(int cursorpos, const struct tm *tm) | |||
965 | value = tm->tm_mday; | 966 | value = tm->tm_mday; |
966 | break; | 967 | break; |
967 | } | 968 | } |
968 | 969 | ||
969 | if (cursorpos == 4) /* month */ | 970 | if (cursorpos == 4) /* month */ |
970 | talk_id(LANG_MONTH_JANUARY + tm->tm_mon, false); | 971 | talk_id(LANG_MONTH_JANUARY + tm->tm_mon, false); |
971 | else | 972 | else |
@@ -1019,7 +1020,7 @@ bool set_time_screen(const char* string, struct tm *tm) | |||
1019 | char cursor[][3] = {{ 0, 8, 12}, {18, 8, 12}, {36, 8, 12}, | 1020 | char cursor[][3] = {{ 0, 8, 12}, {18, 8, 12}, {36, 8, 12}, |
1020 | {24, 16, 24}, {54, 16, 18}, {78, 16, 12}}; | 1021 | {24, 16, 24}, {54, 16, 18}, {78, 16, 12}}; |
1021 | char daysinmonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; | 1022 | char daysinmonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; |
1022 | 1023 | ||
1023 | int monthname_len = 0, dayname_len = 0; | 1024 | int monthname_len = 0, dayname_len = 0; |
1024 | 1025 | ||
1025 | int *valptr = NULL; | 1026 | int *valptr = NULL; |
@@ -1205,7 +1206,7 @@ bool set_time_screen(const char* string, struct tm *tm) | |||
1205 | break; | 1206 | break; |
1206 | case BUTTON_DOWN: | 1207 | case BUTTON_DOWN: |
1207 | case BUTTON_DOWN | BUTTON_REPEAT: | 1208 | case BUTTON_DOWN | BUTTON_REPEAT: |
1208 | *valptr = (*valptr + steps - min - 1) % | 1209 | *valptr = (*valptr + steps - min - 1) % |
1209 | steps + min; | 1210 | steps + min; |
1210 | if(*valptr == 0) | 1211 | if(*valptr == 0) |
1211 | *valptr = min; | 1212 | *valptr = min; |
@@ -1259,7 +1260,7 @@ bool shutdown_screen(void) | |||
1259 | default: | 1260 | default: |
1260 | if(default_event_handler(button) == SYS_USB_CONNECTED) | 1261 | if(default_event_handler(button) == SYS_USB_CONNECTED) |
1261 | return true; | 1262 | return true; |
1262 | 1263 | ||
1263 | /* Return if any other button was pushed, or if there | 1264 | /* Return if any other button was pushed, or if there |
1264 | was a timeout. We ignore RELEASE events, since we may | 1265 | was a timeout. We ignore RELEASE events, since we may |
1265 | have been called by a button down event, and the user might | 1266 | have been called by a button down event, and the user might |
@@ -1295,27 +1296,30 @@ bool browse_id3(void) | |||
1295 | { | 1296 | { |
1296 | case 0: | 1297 | case 0: |
1297 | lcd_puts(0, 0, str(LANG_ID3_TITLE)); | 1298 | lcd_puts(0, 0, str(LANG_ID3_TITLE)); |
1298 | lcd_puts_scroll(0, 1, id3->title ? id3->title : | 1299 | lcd_puts_scroll(0, 1, id3->title ? id3->title : |
1299 | (char*)str(LANG_ID3_NO_TITLE)); | 1300 | (char*)str(LANG_ID3_NO_TITLE)); |
1300 | break; | 1301 | break; |
1301 | 1302 | ||
1302 | case 1: | 1303 | case 1: |
1303 | lcd_puts(0, 0, str(LANG_ID3_ARTIST)); | 1304 | lcd_puts(0, 0, str(LANG_ID3_ARTIST)); |
1304 | lcd_puts_scroll(0, 1, | 1305 | lcd_puts_scroll(0, 1, |
1305 | id3->artist ? id3->artist : | 1306 | id3->artist ? id3->artist : |
1306 | (char*)str(LANG_ID3_NO_ARTIST)); | 1307 | (char*)str(LANG_ID3_NO_ARTIST)); |
1307 | break; | 1308 | break; |
1308 | 1309 | ||
1309 | case 2: | 1310 | case 2: |
1310 | lcd_puts(0, 0, str(LANG_ID3_ALBUM)); | 1311 | lcd_puts(0, 0, str(LANG_ID3_ALBUM)); |
1311 | lcd_puts_scroll(0, 1, id3->album ? id3->album : | 1312 | lcd_puts_scroll(0, 1, id3->album ? id3->album : |
1312 | (char*)str(LANG_ID3_NO_ALBUM)); | 1313 | (char*)str(LANG_ID3_NO_ALBUM)); |
1313 | break; | 1314 | break; |
1314 | 1315 | ||
1315 | case 3: | 1316 | case 3: |
1316 | lcd_puts(0, 0, str(LANG_ID3_TRACKNUM)); | 1317 | lcd_puts(0, 0, str(LANG_ID3_TRACKNUM)); |
1317 | 1318 | ||
1318 | if (id3->tracknum) { | 1319 | if (id3->track_string) { |
1320 | lcd_puts_scroll(0, 1, id3->track_string); | ||
1321 | } | ||
1322 | else if (id3->tracknum) { | ||
1319 | snprintf(scroll_text,sizeof(scroll_text), "%d", | 1323 | snprintf(scroll_text,sizeof(scroll_text), "%d", |
1320 | id3->tracknum); | 1324 | id3->tracknum); |
1321 | lcd_puts_scroll(0, 1, scroll_text); | 1325 | lcd_puts_scroll(0, 1, scroll_text); |
@@ -1326,15 +1330,24 @@ bool browse_id3(void) | |||
1326 | 1330 | ||
1327 | case 4: | 1331 | case 4: |
1328 | lcd_puts(0, 0, str(LANG_ID3_GENRE)); | 1332 | lcd_puts(0, 0, str(LANG_ID3_GENRE)); |
1329 | lcd_puts_scroll(0, 1, | 1333 | |
1330 | id3_get_genre(id3) ? | 1334 | if (id3->genre_string) { |
1331 | id3_get_genre(id3) : | 1335 | lcd_puts_scroll(0, 1, id3->genre_string); |
1332 | (char*)str(LANG_ID3_NO_INFO)); | 1336 | } |
1337 | else { | ||
1338 | lcd_puts_scroll(0, 1, | ||
1339 | id3_get_genre(id3) ? | ||
1340 | id3_get_genre(id3) : | ||
1341 | (char*)str(LANG_ID3_NO_INFO)); | ||
1342 | } | ||
1333 | break; | 1343 | break; |
1334 | 1344 | ||
1335 | case 5: | 1345 | case 5: |
1336 | lcd_puts(0, 0, str(LANG_ID3_YEAR)); | 1346 | lcd_puts(0, 0, str(LANG_ID3_YEAR)); |
1337 | if (id3->year) { | 1347 | if (id3->year_string) { |
1348 | lcd_puts_scroll(0, 1, id3->year_string); | ||
1349 | } | ||
1350 | else if (id3->year) { | ||
1338 | snprintf(scroll_text,sizeof(scroll_text), "%d", | 1351 | snprintf(scroll_text,sizeof(scroll_text), "%d", |
1339 | id3->year); | 1352 | id3->year); |
1340 | lcd_puts_scroll(0, 1, scroll_text); | 1353 | lcd_puts_scroll(0, 1, scroll_text); |
@@ -1345,9 +1358,7 @@ bool browse_id3(void) | |||
1345 | 1358 | ||
1346 | case 6: | 1359 | case 6: |
1347 | lcd_puts(0, 0, str(LANG_ID3_LENGHT)); | 1360 | lcd_puts(0, 0, str(LANG_ID3_LENGHT)); |
1348 | snprintf(scroll_text,sizeof(scroll_text), "%d:%02d", | 1361 | wps_format_time(scroll_text, sizeof(scroll_text), id3->length); |
1349 | (int) (id3->length / 60000), | ||
1350 | (int) (id3->length % 60000 / 1000) ); | ||
1351 | lcd_puts(0, 1, scroll_text); | 1362 | lcd_puts(0, 1, scroll_text); |
1352 | break; | 1363 | break; |
1353 | 1364 | ||
@@ -1361,7 +1372,7 @@ bool browse_id3(void) | |||
1361 | 1372 | ||
1362 | case 8: | 1373 | case 8: |
1363 | lcd_puts(0, 0, str(LANG_ID3_BITRATE)); | 1374 | lcd_puts(0, 0, str(LANG_ID3_BITRATE)); |
1364 | snprintf(scroll_text,sizeof(scroll_text), "%d kbps", | 1375 | snprintf(scroll_text,sizeof(scroll_text), "%d kbps", |
1365 | id3->bitrate); | 1376 | id3->bitrate); |
1366 | lcd_puts(0, 1, scroll_text); | 1377 | lcd_puts(0, 1, scroll_text); |
1367 | break; | 1378 | break; |