summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorHardeep Sidhu <dyp@pobox.com>2003-01-04 07:18:10 +0000
committerHardeep Sidhu <dyp@pobox.com>2003-01-04 07:18:10 +0000
commit6e9ba067179f3545a0ed3d5b730648555164cc12 (patch)
tree177733c50b6032e72c57469a1e2dc502192a8f0a /apps
parent96a6874ac419defb2f24a789c4d16a54d7430080 (diff)
downloadrockbox-6e9ba067179f3545a0ed3d5b730648555164cc12.tar.gz
rockbox-6e9ba067179f3545a0ed3d5b730648555164cc12.zip
Store the current track pathname so follow playlist is respected at end of playlist.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3037 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/wps.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/apps/wps.c b/apps/wps.c
index c64933910a..73c68d0d4d 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -50,6 +50,7 @@ bool keys_locked = false;
50static bool ff_rewind = false; 50static bool ff_rewind = false;
51static bool paused = false; 51static bool paused = false;
52static struct mp3entry* id3 = NULL; 52static struct mp3entry* id3 = NULL;
53static char current_track_path[MAX_PATH+1];
53 54
54#ifdef HAVE_PLAYER_KEYPAD 55#ifdef HAVE_PLAYER_KEYPAD
55void player_change_volume(int button) 56void player_change_volume(int button)
@@ -420,6 +421,9 @@ static bool update(void)
420 retcode = true; 421 retcode = true;
421 else 422 else
422 wps_refresh(id3, 0, WPS_REFRESH_ALL); 423 wps_refresh(id3, 0, WPS_REFRESH_ALL);
424
425 if (id3)
426 memcpy(current_track_path, id3->path, sizeof(current_track_path));
423 } 427 }
424 428
425 if (id3) 429 if (id3)
@@ -428,7 +432,7 @@ static bool update(void)
428 status_draw(); 432 status_draw();
429 433
430 /* save resume data */ 434 /* save resume data */
431 if ( id3 && 435 if ( id3 &&
432 global_settings.resume && 436 global_settings.resume &&
433 global_settings.resume_offset != id3->offset ) { 437 global_settings.resume_offset != id3->offset ) {
434 DEBUGF("R%X,%X (%X)\n", global_settings.resume_offset, 438 DEBUGF("R%X,%X (%X)\n", global_settings.resume_offset,
@@ -644,6 +648,7 @@ int wps_show(void)
644 bool restore = false; 648 bool restore = false;
645 649
646 id3 = NULL; 650 id3 = NULL;
651 current_track_path[0] = '\0';
647 652
648#ifdef HAVE_LCD_CHARCELLS 653#ifdef HAVE_LCD_CHARCELLS
649 status_set_audio(true); 654 status_set_audio(true);
@@ -664,7 +669,10 @@ int wps_show(void)
664 if (wps_display(id3)) 669 if (wps_display(id3))
665 return 0; 670 return 0;
666 wps_refresh(id3, 0, WPS_REFRESH_ALL); 671 wps_refresh(id3, 0, WPS_REFRESH_ALL);
672
673 memcpy(current_track_path, id3->path, sizeof(current_track_path));
667 } 674 }
675
668 restore = true; 676 restore = true;
669 } 677 }
670 678
@@ -753,8 +761,9 @@ int wps_show(void)
753 lcd_stop_scroll(); 761 lcd_stop_scroll();
754 762
755 /* set dir browser to current playing song */ 763 /* set dir browser to current playing song */
756 if (global_settings.browse_current && id3) 764 if (global_settings.browse_current &&
757 set_current_file(id3->path); 765 current_track_path[0] != '\0')
766 set_current_file(current_track_path);
758 767
759 return 0; 768 return 0;
760#ifdef HAVE_RECORDER_KEYPAD 769#ifdef HAVE_RECORDER_KEYPAD
@@ -888,8 +897,9 @@ int wps_show(void)
888 lcd_stop_scroll(); 897 lcd_stop_scroll();
889 898
890 /* set dir browser to current playing song */ 899 /* set dir browser to current playing song */
891 if (global_settings.browse_current && id3) 900 if (global_settings.browse_current &&
892 set_current_file(id3->path); 901 current_track_path[0] != '\0')
902 set_current_file(current_track_path);
893 903
894 mpeg_stop(); 904 mpeg_stop();
895 status_set_playmode(STATUS_STOP); 905 status_set_playmode(STATUS_STOP);
@@ -902,7 +912,14 @@ int wps_show(void)
902 912
903 case BUTTON_NONE: /* Timeout */ 913 case BUTTON_NONE: /* Timeout */
904 if (update()) 914 if (update())
915 {
916 /* set dir browser to current playing song */
917 if (global_settings.browse_current &&
918 current_track_path[0] != '\0')
919 set_current_file(current_track_path);
920
905 return 0; 921 return 0;
922 }
906 break; 923 break;
907 } 924 }
908 925
@@ -912,7 +929,15 @@ int wps_show(void)
912 if (restore) { 929 if (restore) {
913 restore = false; 930 restore = false;
914 if (wps_display(id3)) 931 if (wps_display(id3))
932 {
933 /* set dir browser to current playing song */
934 if (global_settings.browse_current &&
935 current_track_path[0] != '\0')
936 set_current_file(current_track_path);
937
915 return 0; 938 return 0;
939 }
940
916 if (id3) 941 if (id3)
917 wps_refresh(id3, 0, WPS_REFRESH_NON_STATIC); 942 wps_refresh(id3, 0, WPS_REFRESH_NON_STATIC);
918 } 943 }