org.biffle.cliff.pearl
Class FileInfo

java.lang.Object
  |
  +--org.biffle.cliff.pearl.FileInfo

public class FileInfo
extends java.lang.Object

Wrapper for a file metainfo properties file.


Field Summary
protected  PropSet props
           
 
Constructor Summary
FileInfo(java.lang.String text)
          Creates a new FileInfo object based on property text from the device.
 
Method Summary
 java.lang.String getAlbum()
          Returns a song's album source.
 java.lang.String getArtist()
          Returns a song's artist.
 int getBitrate()
          Returns the bitrate of an audio file, in kilobits per second.
 java.lang.String getCodec()
          Returns the short name of the codec used for this file.
 long getCreationTime()
          Returns the time the file was created on the device, as a Unix-style timestamp.
 long getDuration()
          Returns the play time of the file in milliseconds.
 int getFID()
          Returns the unique File ID (FID) for the file.
 long getFIDGeneration()
          Returns the time this FID was allocated as a Unix-style timestamp.
 java.lang.String getGenre()
          Returns a song's recorded genre.
 long getLastPlayTime()
          Returns the time the file was last played (all the way through), as a Unix-style timestamp.
 long getMarked()
          Returns the 'Marked for Attention' flag.
 long getOffset()
          Returns the 'offset' field.
 long getOptions()
          Returns the 'options' field, which is a bitmask of flags, most of which are unknown.
 long getPlayCount()
          Returns the number of times a song has been played all the way through.
 long getPlayCountLimit()
          Returns the maximum number of times a song can be played all the way through (a technique for DRM restriction), or zero if the song is unrestricted.
 byte[] getProfile()
          Returns the waveform profile of a song as a byte array.
 java.lang.String getProfilerVersion()
          Returns the version of the profiling algorithm that was used to generate the waveform profile (getProfile()), RMS (getRMS()), and standard deviation (getStdDev()).
 java.lang.String getRID()
          Returns the file's RID, a hash of three segments of the file.
 long getRMS()
          Returns the file's mean 'loudness', as computed by the root-mean-square algorithm.
 long getSampleRate()
          Returns the sample rate the decoded PCM stream for a song.
 long getSize()
          Returns the size of the file in bytes.
 long getStdDev()
          Returns the song's standard deviation from the mean loudness given by getRMS().
 java.lang.String getString(java.lang.String key)
           
 java.lang.String getTitle()
          Returns a song's title.
 long getTrackNumber()
          Returns the song's track number on the source album.
 long getTrailer()
          Returns the 'trailer' field.
 java.lang.String getType()
          Returns the file type.
 long getYear()
          Returns the 'year' field from the song's metadata.
 boolean isBitrateVariable()
          Determines whether a file is encoded with Variable BitRate encoding (true) or Constant BitRate encoding (false).
 void setString(java.lang.String key, java.lang.String value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

props

protected PropSet props
Constructor Detail

FileInfo

public FileInfo(java.lang.String text)
Creates a new FileInfo object based on property text from the device.

Method Detail

getTitle

public java.lang.String getTitle()
Returns a song's title. For non-audio files, this is the name of the file.


getArtist

public java.lang.String getArtist()
Returns a song's artist. For non-audio files, this is null.


getAlbum

public java.lang.String getAlbum()
Returns a song's album source. For non-audio files, this is null.


getGenre

public java.lang.String getGenre()
Returns a song's recorded genre. For non-audio files, this is null.


getTrackNumber

public long getTrackNumber()
Returns the song's track number on the source album. For non-audio files, this is present and is always 0.


getYear

public long getYear()
Returns the 'year' field from the song's metadata.


getBitrate

public int getBitrate()
Returns the bitrate of an audio file, in kilobits per second. For non-audio files, this field is defined but meaningless, and seems to generally be 128. If an error occurs somewhere in the bitrate retrieval, this function returns zero.


isBitrateVariable

public boolean isBitrateVariable()
Determines whether a file is encoded with Variable BitRate encoding (true) or Constant BitRate encoding (false).


getCodec

public java.lang.String getCodec()
Returns the short name of the codec used for this file. For audio files, this is a recognizeable name such as "mp3", "wave", or "ogg". For non-audio files, this returns "taxi", a reference to the Rio Taxi file transfer software.


getDuration

public long getDuration()
Returns the play time of the file in milliseconds.


getSampleRate

public long getSampleRate()
Returns the sample rate the decoded PCM stream for a song.


getCreationTime

public long getCreationTime()
Returns the time the file was created on the device, as a Unix-style timestamp.


getLastPlayTime

public long getLastPlayTime()
Returns the time the file was last played (all the way through), as a Unix-style timestamp.


getFID

public int getFID()
Returns the unique File ID (FID) for the file.


getFIDGeneration

public long getFIDGeneration()
Returns the time this FID was allocated as a Unix-style timestamp.


getSize

public long getSize()
Returns the size of the file in bytes.


getMarked

public long getMarked()
Returns the 'Marked for Attention' flag. This flag can be set for a file by Rio Media Manager Lite, among other apps.


getOffset

public long getOffset()
Returns the 'offset' field. The exact purpose of this field is unknown, but I suspect it may contain the byte offset into the file where the actual audio data starts. If true, this is a sort of cheat-sheet to simplify gapless playback, and is (imho) quite wise.


getOptions

public long getOptions()
Returns the 'options' field, which is a bitmask of flags, most of which are unknown. 0123456701234567 X (2048): Bad Track


getPlayCount

public long getPlayCount()
Returns the number of times a song has been played all the way through.


getPlayCountLimit

public long getPlayCountLimit()
Returns the maximum number of times a song can be played all the way through (a technique for DRM restriction), or zero if the song is unrestricted.


getProfile

public byte[] getProfile()
Returns the waveform profile of a song as a byte array. The exact format of the byte array is not yet known.


getProfilerVersion

public java.lang.String getProfilerVersion()
Returns the version of the profiling algorithm that was used to generate the waveform profile (getProfile()), RMS (getRMS()), and standard deviation (getStdDev()).


getRID

public java.lang.String getRID()
Returns the file's RID, a hash of three segments of the file.


getRMS

public long getRMS()
Returns the file's mean 'loudness', as computed by the root-mean-square algorithm.


getStdDev

public long getStdDev()
Returns the song's standard deviation from the mean loudness given by getRMS().


getTrailer

public long getTrailer()
Returns the 'trailer' field. The use of this field is unknown.


getType

public java.lang.String getType()
Returns the file type. Known types include "tune" (for an audio file), "taxi" (for a stored non-audio file), and "playlist" (for a, well, playlist).


getString

public java.lang.String getString(java.lang.String key)

setString

public void setString(java.lang.String key,
                      java.lang.String value)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object