diff options
author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2008-04-07 13:43:09 +0000 |
---|---|---|
committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2008-04-07 13:43:09 +0000 |
commit | 977069a41de8650e9ee2716ff04db6b5365384c6 (patch) | |
tree | d937ec01b354b8d7811029dfeab3f6b966e5f36b /apps | |
parent | 95f7b4db01804dec3f295161f10b23d19c305217 (diff) |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/gwps-common.c | 3 | ||||
-rw-r--r-- | 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); |