|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.bc.webarts.widgets.PlayList
A simple class to encapsulate the storage of references to Ogg files in a Playlist style.
Field Summary | |
private java.util.Vector |
songs
This is the meat of the class; it holds OggFileRef objects.* |
private static java.lang.String |
SYSTEM_FILE_SEPERATOR
|
Constructor Summary | |
PlayList()
basic constructor to initialize things. |
|
PlayList(java.net.URL[] urls)
Constructor to get things init and load up an initial list of URLs * |
Method Summary | |
java.lang.String |
addSong(java.net.URL url)
Adds the specified song to the playlist. |
boolean |
contains(java.lang.String songName)
Tells you if the Playlist contains a certain song. |
javax.swing.JCheckBox |
createSongCheckBox(int index)
Creates and returns a small JCheckBox with the selected song name and a small checkbox indicating if the song is selected. |
javax.swing.JCheckBox |
createSongCheckBox(java.lang.String songName)
Creates and returns a small JCheckBox with the selected song name and a small checkbox indicating if the song is selected. |
javax.swing.JPanel |
createSongPanel(int index)
Creates and returns a small JPanel with the selected song name and a small checkbox indicating if the song is selected. |
javax.swing.JPanel |
createSongPanel(java.lang.String song)
Creates and returns a small JPanel with the selected song name and a small checkbox indicating if the song is selected. |
int |
findSong(java.lang.String songName)
Finds a song in the playlist and returns the index to it. |
int |
findSong(java.net.URL songUrl)
Finds a song in the playlist and returns the index to it. |
static java.lang.String[] |
getPlaylistArray(java.lang.String[] fileNames)
Parses the passed filenames looking for OGG files. |
java.util.Vector |
getPlaylistVector(java.lang.String fileName)
Parses the passed filename looking for OGG files. |
static java.util.Vector |
getPlaylistVector(java.lang.String[] fileNames)
Parses the passed filenames looking for OGG files. |
java.lang.String |
getSongName(int songIndex)
Gets the songName attribute of the selected Song object |
java.lang.String[] |
getSongNames()
Gets the songNames attribute of the PlayList object |
java.util.Vector |
getSongNamesVector()
Gets the songNamesVector attribute of the PlayList object |
java.net.URL |
getSongUrl(int songIndex)
Gets the URL attribute of the selected Song object |
protected java.net.URL[] |
getSongUrls()
Gets the songUrls attribute of the PlayList object |
java.net.URL |
getURL(java.lang.String songName)
Gets the uRL attribute of the PlayList object |
boolean |
isEmpty()
Checks to see if the list of songs in this playlist is empty. |
boolean |
isSongSelected(int songIndex)
Gets the songSelected attribute of the PlayList object |
boolean |
isSongSelected(java.lang.String songName)
Gets the songSelected attribute of the PlayList object |
void |
loadPlaylist(java.net.URL filenameURL)
Loads a playlist from the playlist file specified in the playListFilename_ field. |
private java.lang.String |
readline(java.io.InputStream is)
Reads a single line from the InputStream. |
boolean |
removeSong(java.lang.String songName)
Description of the Method |
void |
savePlaylistFile(java.lang.String filename)
Saves the playlist to the file specified in the playListFilename_ field. |
void |
selectSong(int songIndex,
boolean select)
Marks the OggFileRef as selected |
int |
size()
The number of entries in the PlayList. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.Vector songs
private static final java.lang.String SYSTEM_FILE_SEPERATOR
Constructor Detail |
public PlayList()
public PlayList(java.net.URL[] urls)
urls
- Description of the ParameterMethod Detail |
public java.util.Vector getSongNamesVector()
public java.lang.String[] getSongNames()
public java.lang.String getSongName(int songIndex)
songIndex
- The index for the songname to retrieve
public java.net.URL getSongUrl(int songIndex)
songIndex
- The index for the song to retrieve
protected java.net.URL[] getSongUrls()
public java.net.URL getURL(java.lang.String songName)
songName
- Description of the Parameter
public int findSong(java.lang.String songName)
songName
- The Songname to look for
public int findSong(java.net.URL songUrl)
public boolean contains(java.lang.String songName)
songName
- The Songname to look for
public boolean isEmpty()
public java.lang.String addSong(java.net.URL url)
url
- the specification for the song to add.
public static java.lang.String[] getPlaylistArray(java.lang.String[] fileNames)
fileNames
- an array containg files and/or dir names to parse for OGG
files.
public javax.swing.JCheckBox createSongCheckBox(java.lang.String songName)
songName
- Description of the Parameter
public javax.swing.JCheckBox createSongCheckBox(int index)
index
- the song num to look up
public javax.swing.JPanel createSongPanel(int index)
index
- the song num to look up
public javax.swing.JPanel createSongPanel(java.lang.String song)
song
- the song name to look up
public java.util.Vector getPlaylistVector(java.lang.String fileName)
fileName
- an String (a file or dir name) to parse for OGG files.
public int size()
public static java.util.Vector getPlaylistVector(java.lang.String[] fileNames)
fileNames
- an array containg files and/or dir names to parse for OGG
files.
public void selectSong(int songIndex, boolean select)
songIndex
- The song to selectselect
- for select or de-selectpublic boolean isSongSelected(java.lang.String songName)
songName
- Description of the Parameter
public boolean isSongSelected(int songIndex)
songIndex
- Description of the Parameter
public void loadPlaylist(java.net.URL filenameURL)
filenameURL
- the filename to use as the playlist - specified as a
URLprivate java.lang.String readline(java.io.InputStream is)
is
- Description of the Parameter
public void savePlaylistFile(java.lang.String filename)
[playlist] File1=H:\MP3s\U2\October\02 - I Fall Down.mp3 File2=H:\MP3s\Leonard Cohen\01 - Suzanne.mp3 NumberOfEntries=2
filename
- Description of the Parameterpublic boolean removeSong(java.lang.String songName)
songName
- Description of the Parameter
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |