From 977069a41de8650e9ee2716ff04db6b5365384c6 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Mon, 7 Apr 2008 13:43:09 +0000 Subject: Bring the WPS playlist index display into sync with the track being played by using the index field of the ID3 info struct instead of directly asking the playlist code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17018 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/gwps-common.c | 3 +-- apps/playback.c | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index f2b444f7da..0ec0f6490c 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c @@ -824,8 +824,7 @@ static char *get_token_value(struct gui_wps *gwps, return playlist_name(NULL, buf, buf_size); case WPS_TOKEN_PLAYLIST_POSITION: - snprintf(buf, buf_size, "%d", - playlist_get_display_index()); + snprintf(buf, buf_size, "%d", id3->index + 1); return buf; case WPS_TOKEN_PLAYLIST_SHUFFLE: diff --git a/apps/playback.c b/apps/playback.c index 8fa94468fb..4d00eda013 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -585,6 +585,7 @@ struct mp3entry* audio_current_track(void) strncpy(temp_id3.path, p, sizeof(temp_id3.path)-1); temp_id3.title = &temp_id3.path[0]; + temp_id3.index = playlist_get_display_index() - 1 + wps_offset; return &temp_id3; } @@ -1622,8 +1623,10 @@ static bool audio_load_track(int offset, bool start_play) { if (get_metadata(&id3, fd, trackname)) { + id3.index = playlist_get_display_index() + last_peek_offset - 1; + send_event(PLAYBACK_EVENT_TRACK_BUFFER, &id3); - + tracks[track_widx].id3_hid = bufalloc(&id3, sizeof(struct mp3entry), TYPE_ID3); -- cgit v1.2.3