First runtime database support, self repairing, only playcount works for now,

which is still rather crude; playcount gets increased even if the song started playback but was skipped... track rating should be trivial to add, autorating also works since its based on playcount.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6969 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michiel Van Der Kolk 2005-07-01 17:29:44 +00:00
parent 4ec80704d5
commit c735ed7914
11 changed files with 242 additions and 45 deletions

View file

@ -128,12 +128,13 @@ void showartist(int offset) {
void showrundb(int offset) {
fseek(fp2,offset,SEEK_SET);
fread(&RundbEntry,sizeof(struct RundbEntry),1,fp2);
RundbEntry.hash=BE32(RundbEntry.hash);
RundbEntry.playcount=BE32(RundbEntry.playcount);
RundbEntry.lastplayed=BE32(RundbEntry.lastplayed);
RundbEntry.rating=BE16(RundbEntry.rating);
RundbEntry.voladj=BE16(RundbEntry.voladj);
printf("Offset: 0x%x\nHash: 0x%x\nRating: %d\nVoladj: 0x%x\n",offset,RundbEntry.hash,RundbEntry.rating,RundbEntry.voladj);
RundbEntry.file=BE32(RundbEntry.file);
RundbEntry.hash=BE32(RundbEntry.hash);
RundbEntry.playcount=BE32(RundbEntry.playcount);
RundbEntry.lastplayed=BE32(RundbEntry.lastplayed);
RundbEntry.rating=BE16(RundbEntry.rating);
RundbEntry.voladj=BE16(RundbEntry.voladj);
printf("Offset: 0x%x\nFileEntry: 0x%x\nHash: 0x%x\nRating: %d\nVoladj: 0x%x\n",offset,RundbEntry.file,RundbEntry.hash,RundbEntry.rating,RundbEntry.voladj);
printf("Playcount: 0x%x\nLastplayed: %d\n",RundbEntry.playcount,RundbEntry.lastplayed);
}