|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.bff.javampd.MPDPlaylist
public class MPDPlaylist
MPDPlaylist represents a playlist controller to a MPD server. To obtain
an instance of the class you must use the getMPDPlaylist method from
the MPD connection class. This class does not have a public constructor
(singleton model) so the object must be obtained from the connection object.
| Method Summary | |
|---|---|
void |
addDirectory(java.lang.String dir)
Adds a directory of songs to the playlist. |
void |
addPlaylistChangeListener(PlaylistChangeListener pcl)
Adds a PlaylistChangeListener to this object to receive
PlaylistChangeEvents. |
boolean |
addSong(MPDSong song)
Adds a MPDSong to the playlist. |
boolean |
addSongs(java.util.List<MPDSong> songList)
Adds a List of MPDSongs to the playlist. |
boolean |
clearPlaylist()
Removes all songs from the playlist. |
void |
deletePlaylist(java.lang.String playlistName)
Deletes the playlist from the MPD server. |
protected void |
firePlaylistChangeEvent(int id)
Sends the appropriate PlaylistChangeEvent to all registered
PlaylistChangeListener. |
MPDSong |
getCurrentSong()
Returns the current song. |
java.util.List<MPDSong> |
getSongList()
Returns the list of songs in the playlist. |
int |
getVersion()
Returns the playlist version. |
void |
loadPlaylist(java.lang.String playlistName)
Loads the songs in the given playlist to the current playlist. |
void |
move(MPDSong song,
int to)
Moves the desired song to the given position in the playlist. |
void |
removePlaylistStatusChangedListener(PlaylistChangeListener pcl)
Removes a PlaylistChangeListener from this object. |
boolean |
removeSong(MPDSong song)
Removes a MPDSong from the playlist. |
boolean |
savePlaylist(java.lang.String playlistName)
Saves the current playlist as the passed playlist name. |
void |
shuffle()
Shuffles the songs in the playlist. |
void |
swap(MPDSong song1,
MPDSong song2)
Swaps the given two songs in the playlist. |
java.lang.String |
toString()
Returns the string representation of this playlist. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void addPlaylistChangeListener(PlaylistChangeListener pcl)
PlaylistChangeListener to this object to receive
PlaylistChangeEvents.
pcl - the PlaylistChangeListener to addpublic void removePlaylistStatusChangedListener(PlaylistChangeListener pcl)
PlaylistChangeListener from this object.
pcl - the PlaylistChangeListener to removeprotected void firePlaylistChangeEvent(int id)
PlaylistChangeEvent to all registered
PlaylistChangeListener.
id - the event id to send
public void loadPlaylist(java.lang.String playlistName)
throws MPDConnectionException,
MPDPlaylistException
playlistName - the playlist name
MPDPlaylistException - if the MPD responded with an error
MPDConnectionException - if there is a problem sending the command
public boolean addSong(MPDSong song)
throws MPDConnectionException,
MPDPlaylistException
MPDSong to the playlist.
song - the song to add
MPDPlaylistException - if the MPD responded with an error
MPDConnectionException - if there is a problem sending the command
public boolean addSongs(java.util.List<MPDSong> songList)
throws MPDConnectionException,
MPDPlaylistException
List of MPDSongs to the playlist.
songList - the list of songs to add
MPDPlaylistException - if the MPD responded with an error
MPDConnectionException - if there is a problem sending the command
public void addDirectory(java.lang.String dir)
throws MPDConnectionException,
MPDPlaylistException
dir - the directory to add
MPDPlaylistException - if the MPD responded with an error
MPDConnectionException - if there is a problem sending the command
public boolean removeSong(MPDSong song)
throws MPDConnectionException,
MPDPlaylistException
MPDSong from the playlist.
song - the song to remove
MPDPlaylistException - if the MPD responded with an error
MPDConnectionException - if there is a problem sending the command
public MPDSong getCurrentSong()
throws MPDConnectionException,
MPDPlaylistException
MPDPlaylistException - if the MPD responded with an error
MPDConnectionException - if there is a problem sending the command
public boolean clearPlaylist()
throws MPDConnectionException,
MPDPlaylistException
MPDPlaylistException - if the MPD responded with an error
MPDConnectionException - if there is a problem sending the command
public void deletePlaylist(java.lang.String playlistName)
throws MPDConnectionException,
MPDPlaylistException
playlistName - the playlist to delete
MPDPlaylistException - if the MPD responded with an error
MPDConnectionException - if there is a problem sending the command
public void move(MPDSong song,
int to)
throws MPDConnectionException,
MPDPlaylistException
song - the song to moveto - the position to move the song to
MPDPlaylistException - if the MPD responded with an error
MPDConnectionException - if there is a problem sending the command
public void shuffle()
throws MPDConnectionException,
MPDPlaylistException
MPDPlaylistException - if the MPD responded with an error
MPDConnectionException - if there is a problem sending the command
public void swap(MPDSong song1,
MPDSong song2)
throws MPDConnectionException,
MPDPlaylistException
song1 - first song to swapsong2 - second song to swap
MPDPlaylistException - if the MPD responded with an error
MPDConnectionException - if there is a problem sending the command
public boolean savePlaylist(java.lang.String playlistName)
throws MPDConnectionException,
MPDPlaylistException
playlistName - the playlist name for the playlist
MPDPlaylistException - if the MPD responded with an error
MPDConnectionException - if there is a problem sending the commandpublic int getVersion()
public java.util.List<MPDSong> getSongList()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||