1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Hardeep Sidhu 2003-01-04 07:18:10 +00:00
parent 96a6874ac4
commit 6e9ba06717

View file

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