|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.gui.mp3.PlayList
This class encapsulates the abstraction of a mp3 playlist (.m3u). This class IS thread-safe.
Constructor Summary | |
PlayList(java.lang.String filename)
Creates a PlayList accessible from the given filename. |
Method Summary | |
int |
addSong(java.io.File newEntry)
Adds a song to the playlist. |
int |
addSong(java.lang.String filename)
Adds a song to the playlist. |
void |
deleteSong(int index)
Deletes a song from the playlist. |
int |
getCurrSongIndex()
Get the index of the currently 'playing' file. |
int |
getIndexOfSong(java.io.File in)
Get the current index of the referenced song File; returns -1 if that song is not in this Playlist. |
java.io.File |
getNextSong()
For your convenience, this method can be called repeatedly to get the next song to play. |
int |
getNumSongs()
Get the total number of songs in current playlist, including those that were recently added. |
java.io.File |
getSong(int index)
Get a reference to the File at the indicated index in the playlist. |
boolean |
isShuffled()
Returns whether the songs should be 'shuffled'. |
static void |
main(java.lang.String[] argv)
|
void |
save()
Call this when you want to save the contents of the playlist. |
void |
setBackwardsMode()
If you want the next call to getNextSong() to return the previous song that was 'played', call this method. |
int |
setCurrSongIndex(int index)
Set the index of the currently 'playing' file. |
void |
sortByName()
Sort the playlist by name, toggling between ascending and descending orders. |
void |
toggleShuffle()
Toggles 'shuffled' mode for playing songs. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PlayList(java.lang.String filename) throws java.lang.Exception
java.lang.Exception
- Thrown if input filename is an invalid m3u file.Method Detail |
public int getCurrSongIndex()
public int setCurrSongIndex(int index)
public void setBackwardsMode()
public boolean isShuffled()
public void toggleShuffle()
public void save() throws java.lang.Exception
java.lang.Exception
- Throw when save failed.public int getNumSongs()
public int addSong(java.lang.String filename)
public void deleteSong(int index)
public int addSong(java.io.File newEntry)
public java.io.File getNextSong()
public java.io.File getSong(int index)
public int getIndexOfSong(java.io.File in)
public void sortByName()
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |