summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2005-08-11 18:21:14 +0000
committerMagnus Holmgren <magnushol@gmail.com>2005-08-11 18:21:14 +0000
commiteab21c6cb56c7584290a15768e1412baed6e73a0 (patch)
treecbf8fd52999a372f8f0e5183aa5b3c49d73cc39a
parent591d2890f11e5e9a2e762496486982ad222e25cb (diff)
downloadrockbox-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
-rw-r--r--apps/lang/english.lang74
-rw-r--r--apps/screens.c280
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#
16id: LANG_SOUND_SETTINGS 16id: LANG_SOUND_SETTINGS
17desc: in the main menu 17desc: in the main menu
@@ -233,7 +233,7 @@ id: LANG_RESET_ASK_RECORDER
233desc: confirm to reset settings 233desc: confirm to reset settings
234eng: "Are You Sure?" 234eng: "Are You Sure?"
235voice: "" 235voice: ""
236new: 236new:
237 237
238id: LANG_RESET_DONE_SETTING 238id: LANG_RESET_DONE_SETTING
239desc: visual confirmation after settings reset 239desc: visual confirmation after settings reset
@@ -470,20 +470,20 @@ voice: ""
470new: 470new:
471 471
472id: LANG_ID3_NO_TITLE 472id: LANG_ID3_NO_TITLE
473desc: in wps when no title is avaible 473desc: DEPRECATED
474eng: "<No Title>" 474eng: ""
475voice: "" 475voice: ""
476new: 476new:
477 477
478id: LANG_ID3_ARTIST 478id: LANG_ID3_ARTIST
479desc: in wps 479desc: in wps
480eng: "[Artist]" 480eng: "[Artist]"
481voice: "" 481voice: ""
482new: 482new:
483 483
484id: LANG_ID3_NO_ARTIST 484id: LANG_ID3_NO_ARTIST
485desc: in wps when no artist is avaible 485desc: DEPRECATED
486eng: "<No Artist>" 486eng: ""
487voice: "" 487voice: ""
488new: 488new:
489 489
@@ -494,8 +494,8 @@ voice: ""
494new: 494new:
495 495
496id: LANG_ID3_NO_ALBUM 496id: LANG_ID3_NO_ALBUM
497desc: in wps when no album is avaible 497desc: DEPRECATED
498eng: "<No Album>" 498eng: ""
499voice: "" 499voice: ""
500new: 500new:
501 501
@@ -506,8 +506,8 @@ voice: ""
506new: 506new:
507 507
508id: LANG_ID3_NO_TRACKNUM 508id: LANG_ID3_NO_TRACKNUM
509desc: in wps if no track number is avaible 509desc: DEPRECATED
510eng: "<No Tracknum>" 510eng: ""
511voice: "" 511voice: ""
512new: 512new:
513 513
@@ -539,7 +539,7 @@ id: LANG_ID3_PATH
539desc: in wps 539desc: in wps
540eng: "[Path]" 540eng: "[Path]"
541voice: "" 541voice: ""
542new: 542new:
543 543
544id: LANG_PITCH_UP 544id: LANG_PITCH_UP
545desc: in wps 545desc: in wps
@@ -593,7 +593,7 @@ id: LANG_END_PLAYLIST_RECORDER
593desc: when playlist has finished 593desc: when playlist has finished
594eng: "End Of Song List" 594eng: "End Of Song List"
595voice: "" 595voice: ""
596new: 596new:
597 597
598id: LANG_POWEROFF_IDLE 598id: LANG_POWEROFF_IDLE
599desc: in settings_menu 599desc: in settings_menu
@@ -647,37 +647,37 @@ id: LANG_PM_MENU
647desc: in the display menu 647desc: in the display menu
648eng: "Peak Meter" 648eng: "Peak Meter"
649voice: "Peak Meter" 649voice: "Peak Meter"
650new: 650new:
651 651
652id: LANG_PM_RELEASE 652id: LANG_PM_RELEASE
653desc: in the peak meter menu 653desc: in the peak meter menu
654eng: "Peak Release" 654eng: "Peak Release"
655voice: "Peak Release" 655voice: "Peak Release"
656new: 656new:
657 657
658id: LANG_PM_PEAK_HOLD 658id: LANG_PM_PEAK_HOLD
659desc: in the peak meter menu 659desc: in the peak meter menu
660eng: "Peak Hold Time" 660eng: "Peak Hold Time"
661voice: "Peak Hold Time" 661voice: "Peak Hold Time"
662new: 662new:
663 663
664id: LANG_PM_CLIP_HOLD 664id: LANG_PM_CLIP_HOLD
665desc: in the peak meter menu 665desc: in the peak meter menu
666eng: "Clip Hold Time" 666eng: "Clip Hold Time"
667voice: "Clip Hold Time" 667voice: "Clip Hold Time"
668new: 668new:
669 669
670id: LANG_PM_ETERNAL 670id: LANG_PM_ETERNAL
671desc: in the peak meter menu 671desc: in the peak meter menu
672eng: "Eternal" 672eng: "Eternal"
673voice: "Eternal" 673voice: "Eternal"
674new: 674new:
675 675
676id: LANG_PM_UNITS_PER_READ 676id: LANG_PM_UNITS_PER_READ
677desc: in the peak meter menu 677desc: in the peak meter menu
678eng: "Units Per Read" 678eng: "Units Per Read"
679voice: "Units Per Read" 679voice: "Units Per Read"
680new: 680new:
681 681
682id: LANG_BACKLIGHT_ON_WHEN_CHARGING 682id: LANG_BACKLIGHT_ON_WHEN_CHARGING
683desc: in display_settings_menu 683desc: in display_settings_menu
@@ -708,7 +708,7 @@ desc: confirm to reset settings
708eng: "PLAY=Reset" 708eng: "PLAY=Reset"
709voice: "" 709voice: ""
710new: 710new:
711 711
712id: LANG_RESET_CANCEL 712id: LANG_RESET_CANCEL
713desc: confirm to reset settings 713desc: confirm to reset settings
714eng: "OFF=Cancel" 714eng: "OFF=Cancel"
@@ -1133,43 +1133,43 @@ id: LANG_FAILED
1133desc: Something failed. To be appended after above actions 1133desc: Something failed. To be appended after above actions
1134eng: "Failed" 1134eng: "Failed"
1135voice: "" 1135voice: ""
1136new: 1136new:
1137 1137
1138id: LANG_ALARM_MOD_ALARM_MENU 1138id: LANG_ALARM_MOD_ALARM_MENU
1139desc: The name of the additional entry in the main menu for the RTC alarm mod. 1139desc: The name of the additional entry in the main menu for the RTC alarm mod.
1140eng: "Wake-Up Alarm" 1140eng: "Wake-Up Alarm"
1141voice: "Wake-Up Alarm" 1141voice: "Wake-Up Alarm"
1142new: 1142new:
1143 1143
1144id: LANG_ALARM_MOD_TIME 1144id: LANG_ALARM_MOD_TIME
1145desc: The current alarm time shown in the alarm menu for the RTC alarm mod. 1145desc: The current alarm time shown in the alarm menu for the RTC alarm mod.
1146eng: "Alarm Time: %02d:%02d" 1146eng: "Alarm Time: %02d:%02d"
1147voice: "" 1147voice: ""
1148new: 1148new:
1149 1149
1150id: LANG_ALARM_MOD_TIME_TO_GO 1150id: LANG_ALARM_MOD_TIME_TO_GO
1151desc: The time until the alarm will go off shown in the alarm menu for the RTC alarm mod. 1151desc: The time until the alarm will go off shown in the alarm menu for the RTC alarm mod.
1152eng: "Waking Up In %d:%02d" 1152eng: "Waking Up In %d:%02d"
1153voice: "" 1153voice: ""
1154new: 1154new:
1155 1155
1156id: LANG_ALARM_MOD_SHUTDOWN 1156id: LANG_ALARM_MOD_SHUTDOWN
1157desc: The text that tells the user that the alarm time is ok and the device shuts off (for the RTC alarm mod). 1157desc: The text that tells the user that the alarm time is ok and the device shuts off (for the RTC alarm mod).
1158eng: "Alarm Set" 1158eng: "Alarm Set"
1159voice: "" 1159voice: ""
1160new: 1160new:
1161 1161
1162id: LANG_ALARM_MOD_ERROR 1162id: LANG_ALARM_MOD_ERROR
1163desc: The text that tells that the time is incorrect (for the RTC alarm mod). 1163desc: The text that tells that the time is incorrect (for the RTC alarm mod).
1164eng: "Alarm Time Is Too Soon!" 1164eng: "Alarm Time Is Too Soon!"
1165voice: "" 1165voice: ""
1166new: 1166new:
1167 1167
1168id: LANG_ALARM_MOD_KEYS 1168id: LANG_ALARM_MOD_KEYS
1169desc: Shown key functions in alarm menu (for the RTC alarm mod). 1169desc: Shown key functions in alarm menu (for the RTC alarm mod).
1170eng: "PLAY=Set OFF=Cancel" 1170eng: "PLAY=Set OFF=Cancel"
1171voice: "" 1171voice: ""
1172new: 1172new:
1173 1173
1174id: LANG_CREATE_PLAYLIST 1174id: LANG_CREATE_PLAYLIST
1175desc: Menu option for creating a playlist 1175desc: Menu option for creating a playlist
@@ -1253,7 +1253,7 @@ id: LANG_SETTINGS_LOADED2
1253desc: Feedback shown when a .cfg file is loaded 1253desc: Feedback shown when a .cfg file is loaded
1254eng: "Loaded" 1254eng: "Loaded"
1255voice: "" 1255voice: ""
1256new: 1256new:
1257 1257
1258id: LANG_FADE_ON_STOP 1258id: LANG_FADE_ON_STOP
1259desc: options menu to set fade on stop or pause 1259desc: options menu to set fade on stop or pause
@@ -1301,37 +1301,37 @@ id: LANG_SAVE_SETTINGS
1301desc: in system_settings_menu() 1301desc: in system_settings_menu()
1302eng: "Write .cfg file" 1302eng: "Write .cfg file"
1303voice: "Write configuration file" 1303voice: "Write configuration file"
1304new: 1304new:
1305 1305
1306id: LANG_SETTINGS_SAVED1 1306id: LANG_SETTINGS_SAVED1
1307desc: Feedback shown when a .cfg file is saved 1307desc: Feedback shown when a .cfg file is saved
1308eng: "Settings" 1308eng: "Settings"
1309voice: "" 1309voice: ""
1310new: 1310new:
1311 1311
1312id: LANG_SETTINGS_SAVED2 1312id: LANG_SETTINGS_SAVED2
1313desc: Feedback shown when a .cfg file is saved 1313desc: Feedback shown when a .cfg file is saved
1314eng: "Saved" 1314eng: "Saved"
1315voice: "" 1315voice: ""
1316new: 1316new:
1317 1317
1318id: LANG_VBRFIX_STOP_PLAY 1318id: LANG_VBRFIX_STOP_PLAY
1319desc: DEPRECATED 1319desc: DEPRECATED
1320eng: "" 1320eng: ""
1321voice: "" 1321voice: ""
1322new: 1322new:
1323 1323
1324id: LANG_VBRFIX_NOT_VBR 1324id: LANG_VBRFIX_NOT_VBR
1325desc: DEPRECATED 1325desc: DEPRECATED
1326eng: "" 1326eng: ""
1327voice: "" 1327voice: ""
1328new: 1328new:
1329 1329
1330id: LANG_VBRFIX 1330id: LANG_VBRFIX
1331desc: DEPRECATED 1331desc: DEPRECATED
1332eng: "" 1332eng: ""
1333voice: "" 1333voice: ""
1334new: 1334new:
1335 1335
1336id: LANG_INVERT_CURSOR 1336id: LANG_INVERT_CURSOR
1337desc: in settings_menu 1337desc: in settings_menu
@@ -1663,7 +1663,7 @@ id: LANG_CAR_ADAPTER_MODE
1663desc: Displayed for setting car adapter mode to on/off 1663desc: Displayed for setting car adapter mode to on/off
1664eng: "Car Adapter Mode" 1664eng: "Car Adapter Mode"
1665voice: "Car Adapter Mode" 1665voice: "Car Adapter Mode"
1666new: 1666new:
1667 1667
1668id: LANG_LINE_IN 1668id: LANG_LINE_IN
1669desc: in settings_menu 1669desc: in settings_menu
@@ -3234,8 +3234,8 @@ voice ""
3234new: 3234new:
3235 3235
3236id: LANG_ID3_NO_GAIN 3236id: LANG_ID3_NO_GAIN
3237desc: in browse_id3 3237desc: DEPRECATED
3238eng: "<No gain>" 3238eng: ""
3239voice "" 3239voice ""
3240new: 3240new:
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
56static const unsigned char usb_logo[] = { 61static const unsigned char usb_logo[] = {
@@ -1269,156 +1274,186 @@ bool shutdown_screen(void)
1269} 1274}
1270#endif 1275#endif
1271 1276
1272bool browse_id3(void) 1277int 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
1309bool 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