diff options
author | Magnus Holmgren <magnushol@gmail.com> | 2005-08-11 18:21:14 +0000 |
---|---|---|
committer | Magnus Holmgren <magnushol@gmail.com> | 2005-08-11 18:21:14 +0000 |
commit | eab21c6cb56c7584290a15768e1412baed6e73a0 (patch) | |
tree | cbf8fd52999a372f8f0e5183aa5b3c49d73cc39a /apps | |
parent | 591d2890f11e5e9a2e762496486982ad222e25cb (diff) | |
download | rockbox-eab21c6cb56c7584290a15768e1412baed6e73a0.tar.gz rockbox-eab21c6cb56c7584290a15768e1412baed6e73a0.zip |
Updated ID3 info screen for devices with a bitmapped screen: show a list of all items, rather than item one at a time.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7302 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/english.lang | 74 | ||||
-rw-r--r-- | apps/screens.c | 280 |
2 files changed, 197 insertions, 157 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index c50a1269d4..3137ff7ed7 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -11,7 +11,7 @@ | |||
11 | # If you re-order things or remove entries, you must bump the binary language | 11 | # If you re-order things or remove entries, you must bump the binary language |
12 | # file version number in both the 'binlang' tool and the language loader code. | 12 | # file version number in both the 'binlang' tool and the language loader code. |
13 | # | 13 | # |
14 | # The "voice' entry contains how we want the speech UI to pronounce this. | 14 | # The "voice' entry contains how we want the speech UI to pronounce this. |
15 | # | 15 | # |
16 | id: LANG_SOUND_SETTINGS | 16 | id: LANG_SOUND_SETTINGS |
17 | desc: in the main menu | 17 | desc: in the main menu |
@@ -233,7 +233,7 @@ id: LANG_RESET_ASK_RECORDER | |||
233 | desc: confirm to reset settings | 233 | desc: confirm to reset settings |
234 | eng: "Are You Sure?" | 234 | eng: "Are You Sure?" |
235 | voice: "" | 235 | voice: "" |
236 | new: | 236 | new: |
237 | 237 | ||
238 | id: LANG_RESET_DONE_SETTING | 238 | id: LANG_RESET_DONE_SETTING |
239 | desc: visual confirmation after settings reset | 239 | desc: visual confirmation after settings reset |
@@ -470,20 +470,20 @@ voice: "" | |||
470 | new: | 470 | new: |
471 | 471 | ||
472 | id: LANG_ID3_NO_TITLE | 472 | id: LANG_ID3_NO_TITLE |
473 | desc: in wps when no title is avaible | 473 | desc: DEPRECATED |
474 | eng: "<No Title>" | 474 | eng: "" |
475 | voice: "" | 475 | voice: "" |
476 | new: | 476 | new: |
477 | 477 | ||
478 | id: LANG_ID3_ARTIST | 478 | id: LANG_ID3_ARTIST |
479 | desc: in wps | 479 | desc: in wps |
480 | eng: "[Artist]" | 480 | eng: "[Artist]" |
481 | voice: "" | 481 | voice: "" |
482 | new: | 482 | new: |
483 | 483 | ||
484 | id: LANG_ID3_NO_ARTIST | 484 | id: LANG_ID3_NO_ARTIST |
485 | desc: in wps when no artist is avaible | 485 | desc: DEPRECATED |
486 | eng: "<No Artist>" | 486 | eng: "" |
487 | voice: "" | 487 | voice: "" |
488 | new: | 488 | new: |
489 | 489 | ||
@@ -494,8 +494,8 @@ voice: "" | |||
494 | new: | 494 | new: |
495 | 495 | ||
496 | id: LANG_ID3_NO_ALBUM | 496 | id: LANG_ID3_NO_ALBUM |
497 | desc: in wps when no album is avaible | 497 | desc: DEPRECATED |
498 | eng: "<No Album>" | 498 | eng: "" |
499 | voice: "" | 499 | voice: "" |
500 | new: | 500 | new: |
501 | 501 | ||
@@ -506,8 +506,8 @@ voice: "" | |||
506 | new: | 506 | new: |
507 | 507 | ||
508 | id: LANG_ID3_NO_TRACKNUM | 508 | id: LANG_ID3_NO_TRACKNUM |
509 | desc: in wps if no track number is avaible | 509 | desc: DEPRECATED |
510 | eng: "<No Tracknum>" | 510 | eng: "" |
511 | voice: "" | 511 | voice: "" |
512 | new: | 512 | new: |
513 | 513 | ||
@@ -539,7 +539,7 @@ id: LANG_ID3_PATH | |||
539 | desc: in wps | 539 | desc: in wps |
540 | eng: "[Path]" | 540 | eng: "[Path]" |
541 | voice: "" | 541 | voice: "" |
542 | new: | 542 | new: |
543 | 543 | ||
544 | id: LANG_PITCH_UP | 544 | id: LANG_PITCH_UP |
545 | desc: in wps | 545 | desc: in wps |
@@ -593,7 +593,7 @@ id: LANG_END_PLAYLIST_RECORDER | |||
593 | desc: when playlist has finished | 593 | desc: when playlist has finished |
594 | eng: "End Of Song List" | 594 | eng: "End Of Song List" |
595 | voice: "" | 595 | voice: "" |
596 | new: | 596 | new: |
597 | 597 | ||
598 | id: LANG_POWEROFF_IDLE | 598 | id: LANG_POWEROFF_IDLE |
599 | desc: in settings_menu | 599 | desc: in settings_menu |
@@ -647,37 +647,37 @@ id: LANG_PM_MENU | |||
647 | desc: in the display menu | 647 | desc: in the display menu |
648 | eng: "Peak Meter" | 648 | eng: "Peak Meter" |
649 | voice: "Peak Meter" | 649 | voice: "Peak Meter" |
650 | new: | 650 | new: |
651 | 651 | ||
652 | id: LANG_PM_RELEASE | 652 | id: LANG_PM_RELEASE |
653 | desc: in the peak meter menu | 653 | desc: in the peak meter menu |
654 | eng: "Peak Release" | 654 | eng: "Peak Release" |
655 | voice: "Peak Release" | 655 | voice: "Peak Release" |
656 | new: | 656 | new: |
657 | 657 | ||
658 | id: LANG_PM_PEAK_HOLD | 658 | id: LANG_PM_PEAK_HOLD |
659 | desc: in the peak meter menu | 659 | desc: in the peak meter menu |
660 | eng: "Peak Hold Time" | 660 | eng: "Peak Hold Time" |
661 | voice: "Peak Hold Time" | 661 | voice: "Peak Hold Time" |
662 | new: | 662 | new: |
663 | 663 | ||
664 | id: LANG_PM_CLIP_HOLD | 664 | id: LANG_PM_CLIP_HOLD |
665 | desc: in the peak meter menu | 665 | desc: in the peak meter menu |
666 | eng: "Clip Hold Time" | 666 | eng: "Clip Hold Time" |
667 | voice: "Clip Hold Time" | 667 | voice: "Clip Hold Time" |
668 | new: | 668 | new: |
669 | 669 | ||
670 | id: LANG_PM_ETERNAL | 670 | id: LANG_PM_ETERNAL |
671 | desc: in the peak meter menu | 671 | desc: in the peak meter menu |
672 | eng: "Eternal" | 672 | eng: "Eternal" |
673 | voice: "Eternal" | 673 | voice: "Eternal" |
674 | new: | 674 | new: |
675 | 675 | ||
676 | id: LANG_PM_UNITS_PER_READ | 676 | id: LANG_PM_UNITS_PER_READ |
677 | desc: in the peak meter menu | 677 | desc: in the peak meter menu |
678 | eng: "Units Per Read" | 678 | eng: "Units Per Read" |
679 | voice: "Units Per Read" | 679 | voice: "Units Per Read" |
680 | new: | 680 | new: |
681 | 681 | ||
682 | id: LANG_BACKLIGHT_ON_WHEN_CHARGING | 682 | id: LANG_BACKLIGHT_ON_WHEN_CHARGING |
683 | desc: in display_settings_menu | 683 | desc: in display_settings_menu |
@@ -708,7 +708,7 @@ desc: confirm to reset settings | |||
708 | eng: "PLAY=Reset" | 708 | eng: "PLAY=Reset" |
709 | voice: "" | 709 | voice: "" |
710 | new: | 710 | new: |
711 | 711 | ||
712 | id: LANG_RESET_CANCEL | 712 | id: LANG_RESET_CANCEL |
713 | desc: confirm to reset settings | 713 | desc: confirm to reset settings |
714 | eng: "OFF=Cancel" | 714 | eng: "OFF=Cancel" |
@@ -1133,43 +1133,43 @@ id: LANG_FAILED | |||
1133 | desc: Something failed. To be appended after above actions | 1133 | desc: Something failed. To be appended after above actions |
1134 | eng: "Failed" | 1134 | eng: "Failed" |
1135 | voice: "" | 1135 | voice: "" |
1136 | new: | 1136 | new: |
1137 | 1137 | ||
1138 | id: LANG_ALARM_MOD_ALARM_MENU | 1138 | id: LANG_ALARM_MOD_ALARM_MENU |
1139 | desc: The name of the additional entry in the main menu for the RTC alarm mod. | 1139 | desc: The name of the additional entry in the main menu for the RTC alarm mod. |
1140 | eng: "Wake-Up Alarm" | 1140 | eng: "Wake-Up Alarm" |
1141 | voice: "Wake-Up Alarm" | 1141 | voice: "Wake-Up Alarm" |
1142 | new: | 1142 | new: |
1143 | 1143 | ||
1144 | id: LANG_ALARM_MOD_TIME | 1144 | id: LANG_ALARM_MOD_TIME |
1145 | desc: The current alarm time shown in the alarm menu for the RTC alarm mod. | 1145 | desc: The current alarm time shown in the alarm menu for the RTC alarm mod. |
1146 | eng: "Alarm Time: %02d:%02d" | 1146 | eng: "Alarm Time: %02d:%02d" |
1147 | voice: "" | 1147 | voice: "" |
1148 | new: | 1148 | new: |
1149 | 1149 | ||
1150 | id: LANG_ALARM_MOD_TIME_TO_GO | 1150 | id: LANG_ALARM_MOD_TIME_TO_GO |
1151 | desc: The time until the alarm will go off shown in the alarm menu for the RTC alarm mod. | 1151 | desc: The time until the alarm will go off shown in the alarm menu for the RTC alarm mod. |
1152 | eng: "Waking Up In %d:%02d" | 1152 | eng: "Waking Up In %d:%02d" |
1153 | voice: "" | 1153 | voice: "" |
1154 | new: | 1154 | new: |
1155 | 1155 | ||
1156 | id: LANG_ALARM_MOD_SHUTDOWN | 1156 | id: LANG_ALARM_MOD_SHUTDOWN |
1157 | desc: The text that tells the user that the alarm time is ok and the device shuts off (for the RTC alarm mod). | 1157 | desc: The text that tells the user that the alarm time is ok and the device shuts off (for the RTC alarm mod). |
1158 | eng: "Alarm Set" | 1158 | eng: "Alarm Set" |
1159 | voice: "" | 1159 | voice: "" |
1160 | new: | 1160 | new: |
1161 | 1161 | ||
1162 | id: LANG_ALARM_MOD_ERROR | 1162 | id: LANG_ALARM_MOD_ERROR |
1163 | desc: The text that tells that the time is incorrect (for the RTC alarm mod). | 1163 | desc: The text that tells that the time is incorrect (for the RTC alarm mod). |
1164 | eng: "Alarm Time Is Too Soon!" | 1164 | eng: "Alarm Time Is Too Soon!" |
1165 | voice: "" | 1165 | voice: "" |
1166 | new: | 1166 | new: |
1167 | 1167 | ||
1168 | id: LANG_ALARM_MOD_KEYS | 1168 | id: LANG_ALARM_MOD_KEYS |
1169 | desc: Shown key functions in alarm menu (for the RTC alarm mod). | 1169 | desc: Shown key functions in alarm menu (for the RTC alarm mod). |
1170 | eng: "PLAY=Set OFF=Cancel" | 1170 | eng: "PLAY=Set OFF=Cancel" |
1171 | voice: "" | 1171 | voice: "" |
1172 | new: | 1172 | new: |
1173 | 1173 | ||
1174 | id: LANG_CREATE_PLAYLIST | 1174 | id: LANG_CREATE_PLAYLIST |
1175 | desc: Menu option for creating a playlist | 1175 | desc: Menu option for creating a playlist |
@@ -1253,7 +1253,7 @@ id: LANG_SETTINGS_LOADED2 | |||
1253 | desc: Feedback shown when a .cfg file is loaded | 1253 | desc: Feedback shown when a .cfg file is loaded |
1254 | eng: "Loaded" | 1254 | eng: "Loaded" |
1255 | voice: "" | 1255 | voice: "" |
1256 | new: | 1256 | new: |
1257 | 1257 | ||
1258 | id: LANG_FADE_ON_STOP | 1258 | id: LANG_FADE_ON_STOP |
1259 | desc: options menu to set fade on stop or pause | 1259 | desc: options menu to set fade on stop or pause |
@@ -1301,37 +1301,37 @@ id: LANG_SAVE_SETTINGS | |||
1301 | desc: in system_settings_menu() | 1301 | desc: in system_settings_menu() |
1302 | eng: "Write .cfg file" | 1302 | eng: "Write .cfg file" |
1303 | voice: "Write configuration file" | 1303 | voice: "Write configuration file" |
1304 | new: | 1304 | new: |
1305 | 1305 | ||
1306 | id: LANG_SETTINGS_SAVED1 | 1306 | id: LANG_SETTINGS_SAVED1 |
1307 | desc: Feedback shown when a .cfg file is saved | 1307 | desc: Feedback shown when a .cfg file is saved |
1308 | eng: "Settings" | 1308 | eng: "Settings" |
1309 | voice: "" | 1309 | voice: "" |
1310 | new: | 1310 | new: |
1311 | 1311 | ||
1312 | id: LANG_SETTINGS_SAVED2 | 1312 | id: LANG_SETTINGS_SAVED2 |
1313 | desc: Feedback shown when a .cfg file is saved | 1313 | desc: Feedback shown when a .cfg file is saved |
1314 | eng: "Saved" | 1314 | eng: "Saved" |
1315 | voice: "" | 1315 | voice: "" |
1316 | new: | 1316 | new: |
1317 | 1317 | ||
1318 | id: LANG_VBRFIX_STOP_PLAY | 1318 | id: LANG_VBRFIX_STOP_PLAY |
1319 | desc: DEPRECATED | 1319 | desc: DEPRECATED |
1320 | eng: "" | 1320 | eng: "" |
1321 | voice: "" | 1321 | voice: "" |
1322 | new: | 1322 | new: |
1323 | 1323 | ||
1324 | id: LANG_VBRFIX_NOT_VBR | 1324 | id: LANG_VBRFIX_NOT_VBR |
1325 | desc: DEPRECATED | 1325 | desc: DEPRECATED |
1326 | eng: "" | 1326 | eng: "" |
1327 | voice: "" | 1327 | voice: "" |
1328 | new: | 1328 | new: |
1329 | 1329 | ||
1330 | id: LANG_VBRFIX | 1330 | id: LANG_VBRFIX |
1331 | desc: DEPRECATED | 1331 | desc: DEPRECATED |
1332 | eng: "" | 1332 | eng: "" |
1333 | voice: "" | 1333 | voice: "" |
1334 | new: | 1334 | new: |
1335 | 1335 | ||
1336 | id: LANG_INVERT_CURSOR | 1336 | id: LANG_INVERT_CURSOR |
1337 | desc: in settings_menu | 1337 | desc: in settings_menu |
@@ -1663,7 +1663,7 @@ id: LANG_CAR_ADAPTER_MODE | |||
1663 | desc: Displayed for setting car adapter mode to on/off | 1663 | desc: Displayed for setting car adapter mode to on/off |
1664 | eng: "Car Adapter Mode" | 1664 | eng: "Car Adapter Mode" |
1665 | voice: "Car Adapter Mode" | 1665 | voice: "Car Adapter Mode" |
1666 | new: | 1666 | new: |
1667 | 1667 | ||
1668 | id: LANG_LINE_IN | 1668 | id: LANG_LINE_IN |
1669 | desc: in settings_menu | 1669 | desc: in settings_menu |
@@ -3234,8 +3234,8 @@ voice "" | |||
3234 | new: | 3234 | new: |
3235 | 3235 | ||
3236 | id: LANG_ID3_NO_GAIN | 3236 | id: LANG_ID3_NO_GAIN |
3237 | desc: in browse_id3 | 3237 | desc: DEPRECATED |
3238 | eng: "<No gain>" | 3238 | eng: "" |
3239 | voice "" | 3239 | voice "" |
3240 | new: | 3240 | new: |
3241 | 3241 | ||
diff --git a/apps/screens.c b/apps/screens.c index 2c7d5fe9b1..1cbda99d0f 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -46,11 +46,16 @@ | |||
46 | #include "led.h" | 46 | #include "led.h" |
47 | #include "sound.h" | 47 | #include "sound.h" |
48 | #include "wps-display.h" | 48 | #include "wps-display.h" |
49 | #if defined(HAVE_LCD_BITMAP) | ||
50 | #include "widgets.h" | ||
51 | #endif | ||
49 | #ifdef HAVE_MMC | 52 | #ifdef HAVE_MMC |
50 | #include "ata_mmc.h" | 53 | #include "ata_mmc.h" |
51 | #endif | 54 | #endif |
52 | 55 | ||
53 | #ifdef HAVE_LCD_BITMAP | 56 | #ifdef HAVE_LCD_BITMAP |
57 | #define SCROLLBAR_WIDTH 6 | ||
58 | |||
54 | #define BMPHEIGHT_usb_logo 32 | 59 | #define BMPHEIGHT_usb_logo 32 |
55 | #define BMPWIDTH_usb_logo 100 | 60 | #define BMPWIDTH_usb_logo 100 |
56 | static const unsigned char usb_logo[] = { | 61 | static const unsigned char usb_logo[] = { |
@@ -1269,156 +1274,186 @@ bool shutdown_screen(void) | |||
1269 | } | 1274 | } |
1270 | #endif | 1275 | #endif |
1271 | 1276 | ||
1272 | bool browse_id3(void) | 1277 | int draw_id3_item(int line, int top, int header, const char* body) |
1273 | { | 1278 | { |
1274 | struct mp3entry* id3 = audio_current_track(); | 1279 | if (line >= top) |
1275 | int button; | 1280 | { |
1276 | int menu_pos = 0; | 1281 | #if defined(HAVE_LCD_BITMAP) |
1282 | const int rows = LCD_HEIGHT / font_get(FONT_UI)->height; | ||
1283 | #else | ||
1284 | const int rows = 2; | ||
1285 | #endif | ||
1286 | int y = line - top; | ||
1287 | |||
1288 | if (y < rows) | ||
1289 | { | ||
1290 | lcd_puts(0, y, str(header)); | ||
1291 | } | ||
1292 | |||
1293 | if (++y < rows) | ||
1294 | { | ||
1295 | lcd_puts_scroll(0, y, | ||
1296 | body ? (const unsigned char*) body : str(LANG_ID3_NO_INFO)); | ||
1297 | } | ||
1298 | } | ||
1299 | |||
1300 | return line + 2; | ||
1301 | } | ||
1302 | |||
1277 | #if CONFIG_HWCODEC == MASNONE | 1303 | #if CONFIG_HWCODEC == MASNONE |
1278 | int menu_max = 12; | 1304 | #define ID3_ITEMS 13 |
1279 | #else | 1305 | #else |
1280 | int menu_max = 10; | 1306 | #define ID3_ITEMS 11 |
1281 | #endif | 1307 | #endif |
1308 | |||
1309 | bool browse_id3(void) | ||
1310 | { | ||
1311 | char buf[32]; | ||
1312 | const struct mp3entry* id3 = audio_current_track(); | ||
1313 | #if defined(HAVE_LCD_BITMAP) | ||
1314 | const int y_margin = lcd_getymargin(); | ||
1315 | const int line_height = font_get(FONT_UI)->height; | ||
1316 | const int rows = (LCD_HEIGHT - y_margin) / line_height; | ||
1317 | const bool show_scrollbar = global_settings.scrollbar | ||
1318 | && (ID3_ITEMS * 2 > rows); | ||
1319 | #else | ||
1320 | const int rows = 2; | ||
1321 | #endif | ||
1322 | const int top_max = (ID3_ITEMS * 2) - (rows & ~1); | ||
1323 | int top = 0; | ||
1324 | int button; | ||
1282 | bool exit = false; | 1325 | bool exit = false; |
1283 | char scroll_text[MAX_PATH]; | ||
1284 | 1326 | ||
1285 | if (!(audio_status() & AUDIO_STATUS_PLAY)) | 1327 | if (!id3 || (!(audio_status() & AUDIO_STATUS_PLAY))) |
1328 | { | ||
1286 | return false; | 1329 | return false; |
1330 | } | ||
1331 | |||
1332 | #if defined(HAVE_LCD_BITMAP) | ||
1333 | lcd_setmargins(show_scrollbar ? SCROLLBAR_WIDTH : 0, y_margin); | ||
1334 | #endif | ||
1287 | 1335 | ||
1288 | while (!exit) | 1336 | while (!exit) |
1289 | { | 1337 | { |
1338 | int line = 0; | ||
1339 | int old_top = top; | ||
1340 | char* body; | ||
1341 | |||
1290 | lcd_clear_display(); | 1342 | lcd_clear_display(); |
1343 | status_draw(true); | ||
1344 | line = draw_id3_item(line, top, LANG_ID3_TITLE, id3->title); | ||
1345 | line = draw_id3_item(line, top, LANG_ID3_ARTIST, id3->artist); | ||
1346 | line = draw_id3_item(line, top, LANG_ID3_ALBUM, id3->album); | ||
1291 | 1347 | ||
1292 | switch (menu_pos) | 1348 | if (id3->track_string) |
1293 | { | 1349 | { |
1294 | case 0: | 1350 | body = id3->track_string; |
1295 | lcd_puts(0, 0, str(LANG_ID3_TITLE)); | 1351 | } |
1296 | lcd_puts_scroll(0, 1, id3->title ? id3->title : | 1352 | else if (id3->tracknum) |
1297 | (char*)str(LANG_ID3_NO_TITLE)); | 1353 | { |
1298 | break; | 1354 | snprintf(buf, sizeof(buf), "%d", id3->tracknum); |
1299 | 1355 | body = buf; | |
1300 | case 1: | 1356 | } |
1301 | lcd_puts(0, 0, str(LANG_ID3_ARTIST)); | 1357 | else |
1302 | lcd_puts_scroll(0, 1, | 1358 | { |
1303 | id3->artist ? id3->artist : | 1359 | body = NULL; |
1304 | (char*)str(LANG_ID3_NO_ARTIST)); | 1360 | } |
1305 | break; | ||
1306 | |||
1307 | case 2: | ||
1308 | lcd_puts(0, 0, str(LANG_ID3_ALBUM)); | ||
1309 | lcd_puts_scroll(0, 1, id3->album ? id3->album : | ||
1310 | (char*)str(LANG_ID3_NO_ALBUM)); | ||
1311 | break; | ||
1312 | |||
1313 | case 3: | ||
1314 | lcd_puts(0, 0, str(LANG_ID3_TRACKNUM)); | ||
1315 | |||
1316 | if (id3->track_string) { | ||
1317 | lcd_puts_scroll(0, 1, id3->track_string); | ||
1318 | } | ||
1319 | else if (id3->tracknum) { | ||
1320 | snprintf(scroll_text,sizeof(scroll_text), "%d", | ||
1321 | id3->tracknum); | ||
1322 | lcd_puts_scroll(0, 1, scroll_text); | ||
1323 | } | ||
1324 | else | ||
1325 | lcd_puts_scroll(0, 1, str(LANG_ID3_NO_TRACKNUM)); | ||
1326 | break; | ||
1327 | 1361 | ||
1328 | case 4: | 1362 | line = draw_id3_item(line, top, LANG_ID3_TRACKNUM, body); |
1329 | lcd_puts(0, 0, str(LANG_ID3_GENRE)); | ||
1330 | 1363 | ||
1331 | if (id3->genre_string) { | 1364 | body = id3->genre_string ? id3->genre_string : id3_get_genre(id3); |
1332 | lcd_puts_scroll(0, 1, id3->genre_string); | 1365 | line = draw_id3_item(line, top, LANG_ID3_GENRE, body); |
1333 | } | ||
1334 | else { | ||
1335 | lcd_puts_scroll(0, 1, | ||
1336 | id3_get_genre(id3) ? | ||
1337 | id3_get_genre(id3) : | ||
1338 | (char*)str(LANG_ID3_NO_INFO)); | ||
1339 | } | ||
1340 | break; | ||
1341 | 1366 | ||
1342 | case 5: | 1367 | if (id3->year_string) |
1343 | lcd_puts(0, 0, str(LANG_ID3_YEAR)); | 1368 | { |
1344 | if (id3->year_string) { | 1369 | body = id3->year_string; |
1345 | lcd_puts_scroll(0, 1, id3->year_string); | 1370 | } |
1346 | } | 1371 | else if (id3->year) |
1347 | else if (id3->year) { | 1372 | { |
1348 | snprintf(scroll_text,sizeof(scroll_text), "%d", | 1373 | snprintf(buf, sizeof(buf), "%d", id3->year); |
1349 | id3->year); | 1374 | body = buf; |
1350 | lcd_puts_scroll(0, 1, scroll_text); | 1375 | } |
1351 | } | 1376 | else |
1352 | else | 1377 | { |
1353 | lcd_puts_scroll(0, 1, str(LANG_ID3_NO_INFO)); | 1378 | body = NULL; |
1354 | break; | 1379 | } |
1355 | 1380 | ||
1356 | case 6: | 1381 | line = draw_id3_item(line, top, LANG_ID3_YEAR, body); |
1357 | lcd_puts(0, 0, str(LANG_ID3_LENGHT)); | ||
1358 | wps_format_time(scroll_text, sizeof(scroll_text), id3->length); | ||
1359 | lcd_puts(0, 1, scroll_text); | ||
1360 | break; | ||
1361 | 1382 | ||
1362 | case 7: | 1383 | wps_format_time(buf, sizeof(buf), id3->length); |
1363 | lcd_puts(0, 0, str(LANG_ID3_PLAYLIST)); | 1384 | line = draw_id3_item(line, top, LANG_ID3_LENGHT, buf); |
1364 | snprintf(scroll_text,sizeof(scroll_text), "%d/%d", | ||
1365 | playlist_get_display_index(), playlist_amount()); | ||
1366 | lcd_puts_scroll(0, 1, scroll_text); | ||
1367 | break; | ||
1368 | 1385 | ||
1386 | snprintf(buf, sizeof(buf), "%d/%d", playlist_get_display_index(), | ||
1387 | playlist_amount()); | ||
1388 | line = draw_id3_item(line, top, LANG_ID3_PLAYLIST, buf); | ||
1369 | 1389 | ||
1370 | case 8: | 1390 | snprintf(buf, sizeof(buf), "%d kbps", id3->bitrate); |
1371 | lcd_puts(0, 0, str(LANG_ID3_BITRATE)); | 1391 | line = draw_id3_item(line, top, LANG_ID3_BITRATE, buf); |
1372 | snprintf(scroll_text,sizeof(scroll_text), "%d kbps", | ||
1373 | id3->bitrate); | ||
1374 | lcd_puts(0, 1, scroll_text); | ||
1375 | break; | ||
1376 | 1392 | ||
1377 | case 9: | 1393 | snprintf(buf, sizeof(buf), "%d Hz", id3->frequency); |
1378 | lcd_puts(0, 0, str(LANG_ID3_FRECUENCY)); | 1394 | line = draw_id3_item(line, top, LANG_ID3_FRECUENCY, buf); |
1379 | snprintf(scroll_text,sizeof(scroll_text), "%d Hz", | ||
1380 | id3->frequency); | ||
1381 | lcd_puts(0, 1, scroll_text); | ||
1382 | break; | ||
1383 | 1395 | ||
1384 | case 10: | ||
1385 | lcd_puts(0, 0, str(LANG_ID3_PATH)); | ||
1386 | lcd_puts_scroll(0, 1, id3->path); | ||
1387 | break; | ||
1388 | #if CONFIG_HWCODEC == MASNONE | 1396 | #if CONFIG_HWCODEC == MASNONE |
1389 | case 11: | 1397 | line = draw_id3_item(line, top, LANG_ID3_TRACK_GAIN, |
1390 | lcd_puts(0, 0, str(LANG_ID3_TRACK_GAIN)); | 1398 | id3->track_gain_string); |
1391 | lcd_puts(0, 1, id3->track_gain_string | ||
1392 | ? id3->track_gain_string | ||
1393 | : (char*) str(LANG_ID3_NO_GAIN)); | ||
1394 | break; | ||
1395 | 1399 | ||
1396 | case 12: | 1400 | line = draw_id3_item(line, top, LANG_ID3_ALBUM_GAIN, |
1397 | lcd_puts(0, 0, str(LANG_ID3_ALBUM_GAIN)); | 1401 | id3->album_gain_string); |
1398 | lcd_puts(0, 1, id3->album_gain_string | ||
1399 | ? id3->album_gain_string | ||
1400 | : (char*) str(LANG_ID3_NO_GAIN)); | ||
1401 | break; | ||
1402 | #endif | 1402 | #endif |
1403 | } | ||
1404 | lcd_update(); | ||
1405 | 1403 | ||
1406 | button = button_get(true); | 1404 | line = draw_id3_item(line, top, LANG_ID3_PATH, id3->path); |
1407 | 1405 | ||
1408 | switch(button) | 1406 | #if defined(HAVE_LCD_BITMAP) |
1407 | if (show_scrollbar) | ||
1409 | { | 1408 | { |
1409 | scrollbar(0, y_margin, SCROLLBAR_WIDTH - 1, rows * line_height, | ||
1410 | ID3_ITEMS * 2 + (rows & 1), top, top + rows, VERTICAL); | ||
1411 | } | ||
1412 | #endif | ||
1413 | |||
1414 | while (!exit && (top == old_top)) | ||
1415 | { | ||
1416 | status_draw(false); | ||
1417 | lcd_update(); | ||
1418 | button = button_get_w_tmo(HZ / 2); | ||
1419 | |||
1420 | switch(button) | ||
1421 | { | ||
1422 | /* It makes more sense to have the keys mapped "backwards" when | ||
1423 | * scrolling a list. | ||
1424 | */ | ||
1425 | #if defined(HAVE_LCD_BITMAP) | ||
1426 | case SETTINGS_INC: | ||
1427 | case SETTINGS_INC | BUTTON_REPEAT: | ||
1428 | #else | ||
1410 | case SETTINGS_DEC: | 1429 | case SETTINGS_DEC: |
1411 | if (menu_pos > 0) | 1430 | #endif |
1412 | menu_pos--; | 1431 | if (top > 0) |
1413 | else | 1432 | { |
1414 | menu_pos = menu_max; | 1433 | top -= 2; |
1434 | } | ||
1435 | else if (!(button & BUTTON_REPEAT)) | ||
1436 | { | ||
1437 | top = top_max; | ||
1438 | } | ||
1439 | |||
1415 | break; | 1440 | break; |
1416 | 1441 | ||
1442 | #if defined(HAVE_LCD_BITMAP) | ||
1443 | case SETTINGS_DEC: | ||
1444 | case SETTINGS_DEC | BUTTON_REPEAT: | ||
1445 | #else | ||
1417 | case SETTINGS_INC: | 1446 | case SETTINGS_INC: |
1418 | if (menu_pos < menu_max) | 1447 | #endif |
1419 | menu_pos++; | 1448 | if (top < top_max) |
1420 | else | 1449 | { |
1421 | menu_pos = 0; | 1450 | top += 2; |
1451 | } | ||
1452 | else if (!(button & BUTTON_REPEAT)) | ||
1453 | { | ||
1454 | top = 0; | ||
1455 | } | ||
1456 | |||
1422 | break; | 1457 | break; |
1423 | 1458 | ||
1424 | #ifdef SETTINGS_OK2 | 1459 | #ifdef SETTINGS_OK2 |
@@ -1426,17 +1461,22 @@ bool browse_id3(void) | |||
1426 | #endif | 1461 | #endif |
1427 | case SETTINGS_CANCEL: | 1462 | case SETTINGS_CANCEL: |
1428 | lcd_stop_scroll(); | 1463 | lcd_stop_scroll(); |
1429 | /* eat release event */ | 1464 | /* Eat release event */ |
1430 | button_get(true); | 1465 | button_get(true); |
1431 | exit = true; | 1466 | exit = true; |
1432 | break; | 1467 | break; |
1433 | 1468 | ||
1434 | default: | 1469 | default: |
1435 | if(default_event_handler(button) == SYS_USB_CONNECTED) | 1470 | if (default_event_handler(button) == SYS_USB_CONNECTED) |
1471 | { | ||
1436 | return true; | 1472 | return true; |
1473 | } | ||
1474 | |||
1437 | break; | 1475 | break; |
1476 | } | ||
1438 | } | 1477 | } |
1439 | } | 1478 | } |
1479 | |||
1440 | return false; | 1480 | return false; |
1441 | } | 1481 | } |
1442 | 1482 | ||