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
This commit is contained in:
Michiel Van Der Kolk 2005-06-05 23:00:42 +00:00
parent 40efb12b8c
commit b1e1e44041
2 changed files with 7 additions and 1 deletions

View file

@ -25,7 +25,7 @@
#undef ARTISTENTRY_SIZE #undef ARTISTENTRY_SIZE
#undef FILERECORD2OFFSET #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 FILEENTRY_SIZE (rb->tagdbheader->filelen+12)
#define ALBUMENTRY_SIZE (rb->tagdbheader->albumlen+4+rb->tagdbheader->songarraylen*4) #define ALBUMENTRY_SIZE (rb->tagdbheader->albumlen+4+rb->tagdbheader->songarraylen*4)
#define ARTISTENTRY_SIZE (rb->tagdbheader->artistlen+rb->tagdbheader->albumarraylen*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); rb->read(*rb->tagdb_fd,currententry->genre,rb->tagdbheader->genrelen);
currententry->bitrate=readshort(*rb->tagdb_fd); currententry->bitrate=readshort(*rb->tagdb_fd);
currententry->year=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; currententry->loadedsongdata=1;
} }

View file

@ -43,6 +43,9 @@ struct entry {
long albumoffset; long albumoffset;
char *artistname; char *artistname;
char *albumname; char *albumname;
long playtime;
short track;
short samplerate;
}; };
extern struct entry *currententry; extern struct entry *currententry;