forked from len0rd/rockbox
If dircache and database "load to ram" is enabled then get the id3 info from the database in the WPS playlist viewer for non buffered tracks
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25841 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0defb8483c
commit
49f2709a01
3 changed files with 17 additions and 3 deletions
|
|
@ -40,6 +40,7 @@
|
|||
#include "screen_access.h"
|
||||
#include "playlist.h"
|
||||
#include "audio.h"
|
||||
#include "tagcache.h"
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
#include "peakmeter.h"
|
||||
|
|
@ -198,10 +199,12 @@ static void draw_playlist_viewer_list(struct gui_wps *gwps,
|
|||
|
||||
struct mp3entry *pid3;
|
||||
char buf[MAX_PATH*2], tempbuf[MAX_PATH];
|
||||
char *filename;
|
||||
|
||||
gwps->display->set_viewport(viewer->vp);
|
||||
for(i=start_item; (i-start_item)<lines && i<=playlist_amount(); i++)
|
||||
{
|
||||
filename = playlist_peek(i-cur_playlist_pos);
|
||||
if (i == cur_playlist_pos)
|
||||
{
|
||||
pid3 = state->id3;
|
||||
|
|
@ -213,8 +216,15 @@ static void draw_playlist_viewer_list(struct gui_wps *gwps,
|
|||
#if CONFIG_CODEC == SWCODEC
|
||||
else if (i>cur_playlist_pos)
|
||||
{
|
||||
if (!audio_peek_track(&pid3, i-cur_playlist_pos))
|
||||
pid3 = NULL;
|
||||
#ifdef HAVE_TC_RAMCACHE
|
||||
if (tagcache_fill_tags(&viewer->tempid3, filename))
|
||||
{
|
||||
pid3 = &viewer->tempid3;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (!audio_peek_track(&pid3, i-cur_playlist_pos))
|
||||
pid3 = NULL;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
|
|
@ -224,7 +234,6 @@ static void draw_playlist_viewer_list(struct gui_wps *gwps,
|
|||
|
||||
int line = pid3 ? TRACK_HAS_INFO : TRACK_HAS_NO_INFO;
|
||||
int j = 0, cur_string = 0;
|
||||
char *filename = playlist_peek(i-cur_playlist_pos);
|
||||
unsigned int line_len = 0;
|
||||
buf[0] = '\0';
|
||||
while (j < viewer->lines[line].count && line_len < sizeof(buf))
|
||||
|
|
|
|||
|
|
@ -241,6 +241,9 @@ struct playlistviewer {
|
|||
struct viewport *vp;
|
||||
bool show_icons;
|
||||
int start_offset;
|
||||
#ifdef HAVE_TC_RAMCACHE
|
||||
struct mp3entry tempid3;
|
||||
#endif
|
||||
struct {
|
||||
enum wps_token_type tokens[MAX_PLAYLISTLINE_TOKENS];
|
||||
char strings[MAX_PLAYLISTLINE_STRINGS][MAX_PLAYLISTLINE_STRLEN];
|
||||
|
|
|
|||
|
|
@ -1618,6 +1618,8 @@ bool tagcache_fill_tags(struct mp3entry *id3, const char *filename)
|
|||
|
||||
entry = &hdr->indices[idx_id];
|
||||
|
||||
memset(id3, 0, sizeof(struct mp3entry));
|
||||
|
||||
id3->title = get_tag_string(entry, tag_title);
|
||||
id3->artist = get_tag_string(entry, tag_artist);
|
||||
id3->album = get_tag_string(entry, tag_album);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue