org.swhite.daap
Class Song

java.lang.Object
  extended byorg.swhite.daap.Song

public class Song
extends java.lang.Object

Created on Tuesday May 20, 2003

Author:
Steve White

Constructor Summary
Song(byte[] data)
          Constructor for Song.
 
Method Summary
 java.lang.String getAlbum()
          Returns the album name (daap tag asal).
 java.lang.String getArtist()
          Returns the artist name (daap tag asar).
 short getBeatsPerMinute()
          Returns the beats per minute (daap tag asbt).
 short getBitRate()
          Returns the bit rate (daap tag asbr).
 java.lang.String getComment()
          Returns the comment (daap tag ascm).
 java.lang.String getComposer()
          Returns the composer's name (daap tag ascp).
 byte getDataKind()
          Returns the data kind (daap tag asdk).
 java.util.Date getDateAdded()
          Returns the date the song was added (daap tag asda).
 java.util.Date getDateModified()
          Returns the date the song was last modified (daap tag asdm).
 java.lang.String getDescription()
          Returns the description (daap tag asdt).
 short getDiscCount()
          Returns the disc count (daap tag asdc).
 short getDiscNumber()
          Returns the disc number (daap tag asdn).
 java.lang.String getFormat()
          Returns the song format (daap tag asfm).
 java.lang.String getGenre()
          Returns the genre (daap tag asgn).
 int getItemID()
          Returns the item id (daap tag miid).
 byte getItemKind()
          Returns the item kind (daap tag mikd).
 java.lang.String getItemName()
          Returns the song's name (daap tag minm).
 java.lang.String getPersistentID()
          Returns the persistent id (daap tag mper).
 int getSampleRate()
          Returns the sample rate in Hz (daap tag assr).
 int getSize()
          Returns the size of the song in bytes (daap tag assz).
 int getTime()
          Returns the length of the song in milliseconds (daap tag astm).
 short getTrackCount()
          Returns the track count (daap tag astc).
 short getTrackNumber()
          Returns the track number (daap tag astn).
 byte getUserRating()
          Returns the user rating (daap tag asur).
 short getYear()
          Returns the year (daap tag asyr).
 boolean isDisabled()
          Returns whether or not the song is disabled (daap tag asdb).
 boolean isPartOfCompilation()
          Returns true if the song is part of a compilation (daap tag asco).
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Song

public Song(byte[] data)
     throws ParserException
Constructor for Song.

Parameters:
data - Raw daap data
Method Detail

getItemKind

public byte getItemKind()
Returns the item kind (daap tag mikd).

Returns:
byte

getAlbum

public java.lang.String getAlbum()
Returns the album name (daap tag asal).

Returns:
String

getArtist

public java.lang.String getArtist()
Returns the artist name (daap tag asar).

Returns:
String

isPartOfCompilation

public boolean isPartOfCompilation()
Returns true if the song is part of a compilation (daap tag asco).

Returns:
boolean

getComposer

public java.lang.String getComposer()
Returns the composer's name (daap tag ascp).

Returns:
String

getDiscCount

public short getDiscCount()
Returns the disc count (daap tag asdc).

Returns:
short

getDiscNumber

public short getDiscNumber()
Returns the disc number (daap tag asdn).

Returns:
short

getDataKind

public byte getDataKind()
Returns the data kind (daap tag asdk).

Returns:
byte

getFormat

public java.lang.String getFormat()
Returns the song format (daap tag asfm).

Returns:
A String, e.g. "mp3"

getGenre

public java.lang.String getGenre()
Returns the genre (daap tag asgn).

Returns:
String

getItemID

public int getItemID()
Returns the item id (daap tag miid). This is necessary to download the file.

Returns:
int

getDescription

public java.lang.String getDescription()
Returns the description (daap tag asdt).

Returns:
A String, e.g. "MPEG audio file", "Protected AAC audio file", "AAC audio file", "WAV audio file", "QuickTime movie file", "MPEG audio stream", "QuickTime movie url"

getItemName

public java.lang.String getItemName()
Returns the song's name (daap tag minm).

Returns:
String

getPersistentID

public java.lang.String getPersistentID()
Returns the persistent id (daap tag mper).

Returns:
String

isDisabled

public boolean isDisabled()
Returns whether or not the song is disabled (daap tag asdb).

Returns:
boolean

getSampleRate

public int getSampleRate()
Returns the sample rate in Hz (daap tag assr).

Returns:
int, e.g. 44100 for 44100 Hz

getSize

public int getSize()
Returns the size of the song in bytes (daap tag assz).

Returns:
int

getTime

public int getTime()
Returns the length of the song in milliseconds (daap tag astm).

Returns:
int

getTrackCount

public short getTrackCount()
Returns the track count (daap tag astc).

Returns:
short

getTrackNumber

public short getTrackNumber()
Returns the track number (daap tag astn).

Returns:
short

getUserRating

public byte getUserRating()
Returns the user rating (daap tag asur).

Returns:
byte. 20 = 1 star, 40 = 2 stars, 60 = 3 stars, 80 = 4 stars, 100 = 5 stars.

getYear

public short getYear()
Returns the year (daap tag asyr).

Returns:
short

getBeatsPerMinute

public short getBeatsPerMinute()
Returns the beats per minute (daap tag asbt).

Returns:
short

getBitRate

public short getBitRate()
Returns the bit rate (daap tag asbr).

Returns:
short, e.g. 256 for 256kbit/sec

getDateAdded

public java.util.Date getDateAdded()
Returns the date the song was added (daap tag asda).

Returns:
Date

getDateModified

public java.util.Date getDateModified()
Returns the date the song was last modified (daap tag asdm).

Returns:
Date

getComment

public java.lang.String getComment()
Returns the comment (daap tag ascm).

Returns:
A String, usually blank, or the name/version of the encoder that made the file (or the w4r3z group that distributed the file).

toString

public java.lang.String toString()