de.axelwernicke.mypod.ipod
Class Playcounts

java.lang.Object
  extended byde.axelwernicke.mypod.ipod.Playcounts

public class Playcounts
extends java.lang.Object

An Playcounts Database object is related to an playcounts file on an Apple iPod. All information are stored in a binary file, and is contained in tags. The set of tags contains Structure of play count files: Offset Meaning 0x00-03 "mhdp": header identifier 0x04-07 0x60: length of header 0x08-0b 0x10 or 0x0c: size of one entry in bytes (one entry is one song, 0x10 is for 2.0 firmware, 0x0c is for 1.3 firmware) 0x0c-0f number of entries (songs on iPod) 0x10-5f 0x00: dummy space Structure of each entry Entries start at 0x60 (or whatever is written in offxet 0x04 above) and are of length 0x10 (2.0 firmware) or 0x0c (1.3 firmware) Offset Meaning 0x00-0x03 number of times song has been played 0x04-0x07 mac-timestamp (number of seconds since GMT 0:00 1-Jan-1904) subtract 2,082,844,800 seconds to obtain Unix timestamp (number of seconds since GMT 0:00 1-Jan-1970) 0x08-0x0b 0x00 ??? 0x0c-0x0f star rating * 0x14 (only available with 2.0 firmware)

Author:
Axel Wernicke axelwernicke@users.sourceforge.net
See Also:
for more details

Constructor Summary
Playcounts()
           
 
Method Summary
 java.util.HashMap getEntryMap()
          Getter for property entryMap.
 int getTotalCount()
          Getter for property totalCount.
protected  boolean loadPlaycounts(ITunesDB iTunesDB)
          Loads loads the playcounts file and parses it
 void setEntryMap(java.util.HashMap entryMap)
          Setter for property entryMap.
 void setTotalCount(int totalCount)
          Setter for property totalCount.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Playcounts

public Playcounts()
Method Detail

loadPlaycounts

protected boolean loadPlaycounts(ITunesDB iTunesDB)
Loads loads the playcounts file and parses it

Parameters:
iTunesDB - to get file indices from

getTotalCount

public int getTotalCount()
Getter for property totalCount.

Returns:
Value of property totalCount.

setTotalCount

public void setTotalCount(int totalCount)
Setter for property totalCount.

Parameters:
totalCount - New value of property totalCount.

getEntryMap

public java.util.HashMap getEntryMap()
Getter for property entryMap.

Returns:
Value of property entryMap.

setEntryMap

public void setEntryMap(java.util.HashMap entryMap)
Setter for property entryMap.

Parameters:
entryMap - New value of property entryMap.