From b1e1e44041f7c078a8a1e4f31ab0cde03efd1b2a Mon Sep 17 00:00:00 2001 From: Michiel Van Der Kolk Date: Sun, 5 Jun 2005 23:00:42 +0000 Subject: [PATCH] Database v3 support.. works with the new format, new fields aren't getting used yet. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6573 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/searchengine/dbinterface.c | 5 ++++- apps/plugins/searchengine/dbinterface.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/plugins/searchengine/dbinterface.c b/apps/plugins/searchengine/dbinterface.c index fe3ff2dd45..c098079e35 100644 --- a/apps/plugins/searchengine/dbinterface.c +++ b/apps/plugins/searchengine/dbinterface.c @@ -25,7 +25,7 @@ #undef ARTISTENTRY_SIZE #undef FILERECORD2OFFSET -#define SONGENTRY_SIZE (rb->tagdbheader->songlen+12+rb->tagdbheader->genrelen+4) +#define SONGENTRY_SIZE (rb->tagdbheader->songlen+12+rb->tagdbheader->genrelen+12) #define FILEENTRY_SIZE (rb->tagdbheader->filelen+12) #define ALBUMENTRY_SIZE (rb->tagdbheader->albumlen+4+rb->tagdbheader->songarraylen*4) #define ARTISTENTRY_SIZE (rb->tagdbheader->artistlen+rb->tagdbheader->albumarraylen*4) @@ -103,6 +103,9 @@ void loadsongdata() { rb->read(*rb->tagdb_fd,currententry->genre,rb->tagdbheader->genrelen); currententry->bitrate=readshort(*rb->tagdb_fd); currententry->year=readshort(*rb->tagdb_fd); + currententry->playtime=readlong(*rb->tagdb_fd); + currententry->track=readshort(*rb->tagdb_fd); + currententry->samplerate=readshort(*rb->tagdb_fd); currententry->loadedsongdata=1; } diff --git a/apps/plugins/searchengine/dbinterface.h b/apps/plugins/searchengine/dbinterface.h index 6a33248166..98596aed2f 100644 --- a/apps/plugins/searchengine/dbinterface.h +++ b/apps/plugins/searchengine/dbinterface.h @@ -43,6 +43,9 @@ struct entry { long albumoffset; char *artistname; char *albumname; + long playtime; + short track; + short samplerate; }; extern struct entry *currententry;