summaryrefslogtreecommitdiffstats
path: root/tools/testdbv2.c
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-07-01 17:29:44 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-07-01 17:29:44 +0000
commitc735ed79142a0260fc05d58cb0672e5d1720a26a (patch)
tree3fd67eb9fb598e9b8bc0c3003ec3bf037379ebb4 /tools/testdbv2.c
parent4ec80704d5f34a167d45db7539f47b12cc23c59e (diff)
downloadrockbox-c735ed79142a0260fc05d58cb0672e5d1720a26a.tar.gz
rockbox-c735ed79142a0260fc05d58cb0672e5d1720a26a.tar.bz2
rockbox-c735ed79142a0260fc05d58cb0672e5d1720a26a.zip
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
Diffstat (limited to 'tools/testdbv2.c')
-rw-r--r--tools/testdbv2.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/testdbv2.c b/tools/testdbv2.c
index 60cdcc77f5..c80043763c 100644
--- a/tools/testdbv2.c
+++ b/tools/testdbv2.c
@@ -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);
}