summaryrefslogtreecommitdiff
path: root/apps/wps.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-19 08:30:48 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-19 08:30:48 +0000
commitcaec53c0d1a4d3870fb89fb7bf23507224fccb55 (patch)
tree394982033c12607f1778fe18d65d66d5a583968e /apps/wps.c
parente4c1667979b9c320b1e24acb6c5db84711b3862e (diff)
downloadrockbox-caec53c0d1a4d3870fb89fb7bf23507224fccb55.tar.gz
rockbox-caec53c0d1a4d3870fb89fb7bf23507224fccb55.zip
next-song support added to WPS, using new tags, and killed some trailing
whitespace git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4643 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/wps.c')
-rw-r--r--apps/wps.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/apps/wps.c b/apps/wps.c
index 858a93c934..18de01956c 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -54,6 +54,7 @@ bool keys_locked = false;
54static bool ff_rewind = false; 54static bool ff_rewind = false;
55static bool paused = false; 55static bool paused = false;
56static struct mp3entry* id3 = NULL; 56static struct mp3entry* id3 = NULL;
57static struct mp3entry* nid3 = NULL;
57static char current_track_path[MAX_PATH+1]; 58static char current_track_path[MAX_PATH+1];
58 59
59#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD) 60#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
@@ -383,11 +384,11 @@ static bool ffwd_rew(int button)
383 } 384 }
384 385
385 if(wps_time_countup == false) 386 if(wps_time_countup == false)
386 wps_refresh(id3, -ff_rewind_count, 387 wps_refresh(id3, nid3, -ff_rewind_count,
387 WPS_REFRESH_PLAYER_PROGRESS | 388 WPS_REFRESH_PLAYER_PROGRESS |
388 WPS_REFRESH_DYNAMIC); 389 WPS_REFRESH_DYNAMIC);
389 else 390 else
390 wps_refresh(id3, ff_rewind_count, 391 wps_refresh(id3, nid3, ff_rewind_count,
391 WPS_REFRESH_PLAYER_PROGRESS | 392 WPS_REFRESH_PLAYER_PROGRESS |
392 WPS_REFRESH_DYNAMIC); 393 WPS_REFRESH_DYNAMIC);
393 394
@@ -423,7 +424,7 @@ static bool ffwd_rew(int button)
423 424
424 /* let mpeg thread update id3->elapsed before calling wps_refresh */ 425 /* let mpeg thread update id3->elapsed before calling wps_refresh */
425 yield(); 426 yield();
426 wps_refresh(id3, 0, WPS_REFRESH_ALL); 427 wps_refresh(id3, nid3, 0, WPS_REFRESH_ALL);
427 return usb; 428 return usb;
428} 429}
429 430
@@ -436,17 +437,18 @@ static bool update(void)
436 { 437 {
437 lcd_stop_scroll(); 438 lcd_stop_scroll();
438 id3 = mpeg_current_track(); 439 id3 = mpeg_current_track();
439 if (wps_display(id3)) 440 nid3 = mpeg_next_track();
441 if (wps_display(id3, nid3))
440 retcode = true; 442 retcode = true;
441 else 443 else
442 wps_refresh(id3, 0, WPS_REFRESH_ALL); 444 wps_refresh(id3, nid3, 0, WPS_REFRESH_ALL);
443 445
444 if (id3) 446 if (id3)
445 memcpy(current_track_path, id3->path, sizeof(current_track_path)); 447 memcpy(current_track_path, id3->path, sizeof(current_track_path));
446 } 448 }
447 449
448 if (id3) 450 if (id3)
449 wps_refresh(id3, 0, WPS_REFRESH_NON_STATIC); 451 wps_refresh(id3, nid3, 0, WPS_REFRESH_NON_STATIC);
450 452
451 status_draw(false); 453 status_draw(false);
452 454
@@ -632,7 +634,7 @@ int wps_show(void)
632 bool exit = false; 634 bool exit = false;
633 bool update_track = false; 635 bool update_track = false;
634 636
635 id3 = NULL; 637 id3 = nid3 = NULL;
636 current_track_path[0] = '\0'; 638 current_track_path[0] = '\0';
637 639
638#ifdef HAVE_LCD_CHARCELLS 640#ifdef HAVE_LCD_CHARCELLS
@@ -650,10 +652,11 @@ int wps_show(void)
650 if(mpeg_status() & MPEG_STATUS_PLAY) 652 if(mpeg_status() & MPEG_STATUS_PLAY)
651 { 653 {
652 id3 = mpeg_current_track(); 654 id3 = mpeg_current_track();
655 nid3 = mpeg_next_track();
653 if (id3) { 656 if (id3) {
654 if (wps_display(id3)) 657 if (wps_display(id3, nid3))
655 return 0; 658 return 0;
656 wps_refresh(id3, 0, WPS_REFRESH_ALL); 659 wps_refresh(id3, nid3, 0, WPS_REFRESH_ALL);
657 660
658 memcpy(current_track_path, id3->path, sizeof(current_track_path)); 661 memcpy(current_track_path, id3->path, sizeof(current_track_path));
659 } 662 }
@@ -703,7 +706,7 @@ int wps_show(void)
703 sleep(1); 706 sleep(1);
704 707
705 if (TIME_AFTER(current_tick, next_refresh)) { 708 if (TIME_AFTER(current_tick, next_refresh)) {
706 wps_refresh(id3, 0, WPS_REFRESH_PEAK_METER); 709 wps_refresh(id3, nid3, 0, WPS_REFRESH_PEAK_METER);
707 next_refresh = current_tick + HZ / peak_meter_fps; 710 next_refresh = current_tick + HZ / peak_meter_fps;
708 } 711 }
709 } 712 }
@@ -712,12 +715,12 @@ int wps_show(void)
712 /* In energy saver mode the cpu may sleep a 715 /* In energy saver mode the cpu may sleep a
713 little bit while waiting for buttons */ 716 little bit while waiting for buttons */
714 else { 717 else {
715 for (i = 0; i < 4; i++) { 718 for (i = 0; i < 4; i++) {
716 button = button_get_w_tmo(HZ / peak_meter_fps); 719 button = button_get_w_tmo(HZ / peak_meter_fps);
717 if (button != 0) { 720 if (button != 0) {
718 break; 721 break;
719 } 722 }
720 wps_refresh(id3, 0, WPS_REFRESH_PEAK_METER); 723 wps_refresh(id3, nid3, 0, WPS_REFRESH_PEAK_METER);
721 } 724 }
722 } 725 }
723 } 726 }
@@ -1008,7 +1011,7 @@ int wps_show(void)
1008 1011
1009 if (restore) { 1012 if (restore) {
1010 restore = false; 1013 restore = false;
1011 if (wps_display(id3)) 1014 if (wps_display(id3, nid3))
1012 { 1015 {
1013 /* set dir browser to current playing song */ 1016 /* set dir browser to current playing song */
1014 if (global_settings.browse_current && 1017 if (global_settings.browse_current &&
@@ -1019,7 +1022,7 @@ int wps_show(void)
1019 } 1022 }
1020 1023
1021 if (id3) 1024 if (id3)
1022 wps_refresh(id3, 0, WPS_REFRESH_NON_STATIC); 1025 wps_refresh(id3, nid3, 0, WPS_REFRESH_NON_STATIC);
1023 } 1026 }
1024 if(button != BUTTON_NONE) 1027 if(button != BUTTON_NONE)
1025 lastbutton = button; 1028 lastbutton = button;