net.sourceforge.atunes.kernel.handlers
Class AudioScrobblerServiceHandler

java.lang.Object
  extended by net.sourceforge.atunes.kernel.handlers.AudioScrobblerServiceHandler
All Implemented Interfaces:
AudioScrobblerListener

public class AudioScrobblerServiceHandler
extends java.lang.Object
implements AudioScrobblerListener

The Class AudioScrobblerServiceHandler.


Method Summary
 void clear()
          Clear.
 void clearCaches()
           Clears the caches (AudioScrobbler & lyrics cache) Deletes as many files in the cache directories as possible.
 AudioScrobblerAlbum getAlbum()
          Gets the album.
 void getAlbumCover(AudioFile file)
          Gets the album cover.
 java.util.List<AudioScrobblerAlbum> getAlbums()
          Gets the albums.
 java.util.Map<AudioFile,java.lang.String> getGenresForFiles(java.util.List<AudioFile> files)
          Gets the genres for files.
static AudioScrobblerServiceHandler getInstance()
          Gets the single instance of AudioScrobblerServiceHandler.
 java.lang.String getLastAlbumRetrieved()
          Gets the last album retrieved.
 java.lang.String getLastArtistRetrieved()
          Gets the last artist retrieved.
 java.util.Map<AudioFile,java.lang.String> getTitlesForFiles(java.util.List<AudioFile> files)
          Returns a hash of files with its songs titles.
 java.util.List<java.lang.String> getTrackNamesForAlbum(java.lang.String artistName, java.lang.String albumName)
          Gets the track names for album.
 void notifyAlbumCoverRetrieved(AudioFile file, java.awt.Image image1)
          Used to update cover on Full Screen.
 void notifyAlbumRetrieved(AudioObject file, long id)
          Notify album retrieved.
 void notifyArtistImage(java.awt.Image img, long id)
          Notify artist image.
 void notifyCoverRetrieved(AudioScrobblerAlbum alb, java.awt.Image cover, long id)
          Notify cover retrieved.
 void notifyFinishGetSimilarArtist(AudioScrobblerArtist a, java.awt.Image img, long id)
          Notify finish get similar artist.
 void notifyLyricsRetrieved(AudioObject audioObject, java.lang.String lyrics, long id)
          Notify lyrics retrieved.
 void notifyPodcast(PodcastFeedEntry podcast, long id)
          Notify podcast.
 void notifyRadio(Radio radio, long id)
          Notify radio.
 void notifyStartRetrievingArtistImages(long id)
          Notify start retrieving artist images.
 void notifyStartRetrievingCovers(long id)
          Notify start retrieving covers.
 void notifyWikiInfoRetrieved(java.lang.String wikiText, java.lang.String wikiURL, long id)
          Notify wiki info retrieved.
 void retrieveInfo(AudioObject audioObject)
          Retrieve info.
 void savePicture(java.awt.Image img, AudioFile file, long id)
          Save picture.
 void setAlbum(AudioScrobblerAlbum album, long id)
          Sets the album.
 void setAlbums(java.util.List<AudioScrobblerAlbum> albums, long id)
          Sets the albums.
 void setImage(java.awt.Image image, long id)
          Sets the image.
 void setLastAlbumRetrieved(java.lang.String lastAlbumRetrieved, long id)
          Sets the last album retrieved.
 void setLastArtistRetrieved(java.lang.String lastArtistRetrieved, long id)
          Sets the last artist retrieved.
 void submitSong(AudioFile file, long secondsPlayed)
          Submit song.
 void updateService(ProxyBean proxy, java.lang.String user, java.lang.String password)
          Update service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static AudioScrobblerServiceHandler getInstance()
Gets the single instance of AudioScrobblerServiceHandler.

Returns:
single instance of AudioScrobblerServiceHandler

clear

public void clear()
Clear.


clearCaches

public void clearCaches()

Clears the caches (AudioScrobbler & lyrics cache)

Deletes as many files in the cache directories as possible. Files that are currently used by aTunes won't be deleted.


getAlbum

public AudioScrobblerAlbum getAlbum()
Gets the album.

Returns:
the album

getAlbumCover

public void getAlbumCover(AudioFile file)
Gets the album cover.

Parameters:
file - the file

getAlbums

public java.util.List<AudioScrobblerAlbum> getAlbums()
Description copied from interface: AudioScrobblerListener
Gets the albums.

Specified by:
getAlbums in interface AudioScrobblerListener
Returns:
the albums

getGenresForFiles

public java.util.Map<AudioFile,java.lang.String> getGenresForFiles(java.util.List<AudioFile> files)
Gets the genres for files.

Parameters:
files - the files
Returns:
the genres for files

getLastAlbumRetrieved

public java.lang.String getLastAlbumRetrieved()
Gets the last album retrieved.

Returns:
the last album retrieved

getLastArtistRetrieved

public java.lang.String getLastArtistRetrieved()
Gets the last artist retrieved.

Returns:
the last artist retrieved

getTitlesForFiles

public java.util.Map<AudioFile,java.lang.String> getTitlesForFiles(java.util.List<AudioFile> files)
Returns a hash of files with its songs titles.

Parameters:
files - the files
Returns:
the titles for files

getTrackNamesForAlbum

public java.util.List<java.lang.String> getTrackNamesForAlbum(java.lang.String artistName,
                                                              java.lang.String albumName)
Gets the track names for album.

Parameters:
artistName - the artist name
albumName - the album name
Returns:
the track names for album

notifyAlbumCoverRetrieved

public void notifyAlbumCoverRetrieved(AudioFile file,
                                      java.awt.Image image1)
Used to update cover on Full Screen.

Parameters:
file - the file
image1 - the image1

notifyAlbumRetrieved

public void notifyAlbumRetrieved(AudioObject file,
                                 long id)
Description copied from interface: AudioScrobblerListener
Notify album retrieved.

Specified by:
notifyAlbumRetrieved in interface AudioScrobblerListener
Parameters:
file - the file
id - the id

notifyArtistImage

public void notifyArtistImage(java.awt.Image img,
                              long id)
Description copied from interface: AudioScrobblerListener
Notify artist image.

Specified by:
notifyArtistImage in interface AudioScrobblerListener
Parameters:
img - the img
id - the id

notifyCoverRetrieved

public void notifyCoverRetrieved(AudioScrobblerAlbum alb,
                                 java.awt.Image cover,
                                 long id)
Description copied from interface: AudioScrobblerListener
Notify cover retrieved.

Specified by:
notifyCoverRetrieved in interface AudioScrobblerListener
Parameters:
alb - the album
cover - the cover
id - the id

notifyFinishGetSimilarArtist

public void notifyFinishGetSimilarArtist(AudioScrobblerArtist a,
                                         java.awt.Image img,
                                         long id)
Description copied from interface: AudioScrobblerListener
Notify finish get similar artist.

Specified by:
notifyFinishGetSimilarArtist in interface AudioScrobblerListener
Parameters:
a - the a
img - the img
id - the id

notifyLyricsRetrieved

public void notifyLyricsRetrieved(AudioObject audioObject,
                                  java.lang.String lyrics,
                                  long id)
Notify lyrics retrieved.

Parameters:
audioObject - the audio object
lyrics - the lyrics
id - the id

notifyPodcast

public void notifyPodcast(PodcastFeedEntry podcast,
                          long id)
Notify podcast.

Parameters:
podcast - the podcast
id - the id

notifyRadio

public void notifyRadio(Radio radio,
                        long id)
Notify radio.

Parameters:
radio - the radio
id - the id

notifyStartRetrievingArtistImages

public void notifyStartRetrievingArtistImages(long id)
Description copied from interface: AudioScrobblerListener
Notify start retrieving artist images.

Specified by:
notifyStartRetrievingArtistImages in interface AudioScrobblerListener
Parameters:
id - the id

notifyStartRetrievingCovers

public void notifyStartRetrievingCovers(long id)
Description copied from interface: AudioScrobblerListener
Notify start retrieving covers.

Specified by:
notifyStartRetrievingCovers in interface AudioScrobblerListener
Parameters:
id - the id

notifyWikiInfoRetrieved

public void notifyWikiInfoRetrieved(java.lang.String wikiText,
                                    java.lang.String wikiURL,
                                    long id)
Description copied from interface: AudioScrobblerListener
Notify wiki info retrieved.

Specified by:
notifyWikiInfoRetrieved in interface AudioScrobblerListener
Parameters:
wikiText - the wiki text
wikiURL - the wiki url
id - the id

retrieveInfo

public void retrieveInfo(AudioObject audioObject)
Retrieve info.

Parameters:
audioObject - the audio object

savePicture

public void savePicture(java.awt.Image img,
                        AudioFile file,
                        long id)
Description copied from interface: AudioScrobblerListener
Save picture.

Specified by:
savePicture in interface AudioScrobblerListener
Parameters:
img - the img
file - the file
id - the id

setAlbum

public void setAlbum(AudioScrobblerAlbum album,
                     long id)
Description copied from interface: AudioScrobblerListener
Sets the album.

Specified by:
setAlbum in interface AudioScrobblerListener
Parameters:
album - the album
id - the id

setAlbums

public void setAlbums(java.util.List<AudioScrobblerAlbum> albums,
                      long id)
Description copied from interface: AudioScrobblerListener
Sets the albums.

Specified by:
setAlbums in interface AudioScrobblerListener
Parameters:
albums - the album
id - the id

setImage

public void setImage(java.awt.Image image,
                     long id)
Description copied from interface: AudioScrobblerListener
Sets the image.

Specified by:
setImage in interface AudioScrobblerListener
Parameters:
image - the img
id - the id

setLastAlbumRetrieved

public void setLastAlbumRetrieved(java.lang.String lastAlbumRetrieved,
                                  long id)
Description copied from interface: AudioScrobblerListener
Sets the last album retrieved.

Specified by:
setLastAlbumRetrieved in interface AudioScrobblerListener
Parameters:
lastAlbumRetrieved - the album
id - the id

setLastArtistRetrieved

public void setLastArtistRetrieved(java.lang.String lastArtistRetrieved,
                                   long id)
Description copied from interface: AudioScrobblerListener
Sets the last artist retrieved.

Specified by:
setLastArtistRetrieved in interface AudioScrobblerListener
Parameters:
lastArtistRetrieved - the artist
id - the id

submitSong

public void submitSong(AudioFile file,
                       long secondsPlayed)
Submit song.

Parameters:
file - the file
secondsPlayed - the seconds played

updateService

public void updateService(ProxyBean proxy,
                          java.lang.String user,
                          java.lang.String password)
Update service.

Parameters:
proxy - the proxy
user - the user
password - the password


Copyright © 2006-2008 The aTunes Team. All Rights Reserved.