sk.baka.ambient.lrc.lyrdb
Class LyrdbTrack

java.lang.Object
  extended by sk.baka.ambient.lrc.lyrdb.LyrdbTrack

public final class LyrdbTrack
extends Object

An immutable LyrDB track as returned by the LyrDB search.

Author:
Martin Vysny

Field Summary
 String artist
          artist
 String displayableString
          A displayable string
 String id
          the LyrDB id.
 String trackName
          The track name.
 
Constructor Summary
LyrdbTrack(String id, String trackName, String artist)
          Creates new track.
 
Method Summary
static LyrdbTrack fromSearchLine(String line)
          Parses the result line and returns the track.
 URL getKaraokeURL()
          Returns URL of the karaoke file for this track.
static List<LyrdbTrack> search(TrackMetadataBean track, boolean relevantOnly)
          Search for a karaoke files for given track.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public final String id
the LyrDB id.


trackName

public final String trackName
The track name.


artist

public final String artist
artist


displayableString

public final String displayableString
A displayable string

Constructor Detail

LyrdbTrack

public LyrdbTrack(String id,
                  String trackName,
                  String artist)
Creates new track.

Parameters:
id - the LyrDB id.
trackName - the track name.
artist - artist
Method Detail

fromSearchLine

public static LyrdbTrack fromSearchLine(String line)
Parses the result line and returns the track.

Parameters:
line - the line to parse
Returns:
non-null track instance or null if the line was not in a correct format.

getKaraokeURL

public URL getKaraokeURL()
                  throws MalformedURLException
Returns URL of the karaoke file for this track.

Returns:
the karaoke URL.
Throws:
MalformedURLException

search

public static List<LyrdbTrack> search(TrackMetadataBean track,
                                      boolean relevantOnly)
                               throws IOException
Search for a karaoke files for given track. Fetches results synchronously from the Internet.

Parameters:
track - search for lyrics for this track.
relevantOnly - if true then only the most relevant results are returned.
Returns:
list of tracks, never null.
Throws:
IOException - if i/o error occurs.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2008. All Rights Reserved.