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)
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;
static bool ff_rewind = false;
static bool paused = false;
static struct mp3entry* id3 = NULL;
+static char current_track_path[MAX_PATH+1];
#ifdef HAVE_PLAYER_KEYPAD
void player_change_volume(int button)
@@ -420,6 +421,9 @@ static bool update(void)
retcode = true;
else
wps_refresh(id3, 0, WPS_REFRESH_ALL);
+
+ if (id3)
+ memcpy(current_track_path, id3->path, sizeof(current_track_path));
}
if (id3)
@@ -428,7 +432,7 @@ static bool update(void)
status_draw();
/* save resume data */
- if ( id3 &&
+ if ( id3 &&
global_settings.resume &&
global_settings.resume_offset != id3->offset ) {
DEBUGF("R%X,%X (%X)\n", global_settings.resume_offset,
@@ -644,6 +648,7 @@ int wps_show(void)
bool restore = false;
id3 = NULL;
+ current_track_path[0] = '\0';
#ifdef HAVE_LCD_CHARCELLS
status_set_audio(true);
@@ -664,7 +669,10 @@ int wps_show(void)
if (wps_display(id3))
return 0;
wps_refresh(id3, 0, WPS_REFRESH_ALL);
+
+ memcpy(current_track_path, id3->path, sizeof(current_track_path));
}
+
restore = true;
}
@@ -753,8 +761,9 @@ int wps_show(void)
lcd_stop_scroll();
/* set dir browser to current playing song */
- if (global_settings.browse_current && id3)
- set_current_file(id3->path);
+ if (global_settings.browse_current &&
+ current_track_path[0] != '\0')
+ set_current_file(current_track_path);
return 0;
#ifdef HAVE_RECORDER_KEYPAD
@@ -888,8 +897,9 @@ int wps_show(void)
lcd_stop_scroll();
/* set dir browser to current playing song */
- if (global_settings.browse_current && id3)
- set_current_file(id3->path);
+ if (global_settings.browse_current &&
+ current_track_path[0] != '\0')
+ set_current_file(current_track_path);
mpeg_stop();
status_set_playmode(STATUS_STOP);
@@ -902,7 +912,14 @@ int wps_show(void)
case BUTTON_NONE: /* Timeout */
if (update())
+ {
+ /* set dir browser to current playing song */
+ if (global_settings.browse_current &&
+ current_track_path[0] != '\0')
+ set_current_file(current_track_path);
+
return 0;
+ }
break;
}
@@ -912,7 +929,15 @@ int wps_show(void)
if (restore) {
restore = false;
if (wps_display(id3))
+ {
+ /* set dir browser to current playing song */
+ if (global_settings.browse_current &&
+ current_track_path[0] != '\0')
+ set_current_file(current_track_path);
+
return 0;
+ }
+
if (id3)
wps_refresh(id3, 0, WPS_REFRESH_NON_STATIC);
}