summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-05-06 09:22:55 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-05-06 09:22:55 +0000
commit49f2709a01f6ea6230804c0787785b0f5569ca02 (patch)
tree7619ba1afc878b37c189f01f2fbb6797546427bf /apps
parent0defb8483c817f18f5ee118bdfb48bc8910b523e (diff)
downloadrockbox-49f2709a01f6ea6230804c0787785b0f5569ca02.tar.gz
rockbox-49f2709a01f6ea6230804c0787785b0f5569ca02.tar.bz2
rockbox-49f2709a01f6ea6230804c0787785b0f5569ca02.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_display.c15
-rw-r--r--apps/gui/skin_engine/wps_internals.h3
-rw-r--r--apps/tagcache.c2
3 files changed, 17 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 4d7b264efa..0d7824aaf6 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -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))
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index edfae68e84..211d9a13ee 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -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];
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 0d06d8f563..1efb7a8625 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -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);