com.evolution.player.core.media
Class MediaInfo

java.lang.Object
  extended by com.evolution.player.core.media.MediaInfo
Direct Known Subclasses:
DownloadableMedia, LocalMediaInfo

public abstract class MediaInfo
extends java.lang.Object

A set of data about some media. This could be tag information stored in a MP3 file or information retrieved from a remote source.

Clients can implement.

Since:
0.1
See Also:
MediaInfoBuilder

Nested Class Summary
static class MediaInfo.MusicbrainzIdType
           
 
Constructor Summary
MediaInfo()
          Create a new media info.
 
Method Summary
static boolean canCreate(java.io.File file)
          True if a media info can be created for the given file.
static LocalMediaInfo create(java.io.File file)
          Create a media info from the given media file.
 boolean equals(java.lang.Object obj)
           
abstract  java.lang.String getAlbumName()
          The name of the album, if any.
abstract  java.lang.String getArtistName()
          The name of the artist, if any.
 java.lang.String getComment()
          The comment tag.
 MediaId getId()
          The global unique id of this media.
abstract  java.lang.String getMusicbrainzId(MediaInfo.MusicbrainzIdType type)
          The musicbrainz id of this media, if any.
abstract  java.lang.String getSongName()
          The name of the song, if any.
abstract  java.lang.String getTag(java.lang.String key)
          The value of the tag with the given key, if any.
abstract  int getTrackNumber()
          The number of the song on the album, if any.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MediaInfo

public MediaInfo()
Create a new media info.

Method Detail

canCreate

public static boolean canCreate(java.io.File file)
True if a media info can be created for the given file.

Parameters:
file - the media file
Returns:
true if create(File) will succeed

create

public static LocalMediaInfo create(java.io.File file)
Create a media info from the given media file. This returns null if and only if create(File) returns false for the same file.

Parameters:
file - the media file
Returns:
the media info or null

getId

public MediaId getId()
The global unique id of this media.

Returns:
the unique id for this media

getSongName

public abstract java.lang.String getSongName()
The name of the song, if any.

Returns:
the song name or null

getAlbumName

public abstract java.lang.String getAlbumName()
The name of the album, if any.

Returns:
the album name or null

getArtistName

public abstract java.lang.String getArtistName()
The name of the artist, if any.

Returns:
the artist name or null

getTrackNumber

public abstract int getTrackNumber()
The number of the song on the album, if any.

Returns:
the track number or -1

getMusicbrainzId

public abstract java.lang.String getMusicbrainzId(MediaInfo.MusicbrainzIdType type)
The musicbrainz id of this media, if any.

Parameters:
type - the kind of id to retrieve
Returns:
the musicbrainz id or null

getTag

public abstract java.lang.String getTag(java.lang.String key)
The value of the tag with the given key, if any.

Parameters:
key - the tag name
Returns:
the tag value or null

getComment

public java.lang.String getComment()
The comment tag.

Returns:
the comment of null

toString

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object