Modifier and Type | Field and Description |
---|---|
private Vector |
songs
This is the meat of the class; it holds OggFileRef objects.
|
private static String |
SYSTEM_FILE_SEPERATOR
Description of the Field
|
Constructor and Description |
---|
PlayList()
basic constructor to initialize things
|
PlayList(URL[] urls)
Constructor to get things init and load up an initial list of URLs *
|
Modifier and Type | Method and Description |
---|---|
String |
addSong(URL url)
Adds the specified song to the playlist.
|
boolean |
contains(String songName)
Tells you if the Playlist contains a certain song.
|
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.
|
JCheckBox |
createSongCheckBox(String songName)
Creates and returns a small JCheckBox with the selected song name and a
small checkbox indicating if the song is selected.
|
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.
|
JPanel |
createSongPanel(String song)
Creates and returns a small JPanel with the selected song name and a small
checkbox indicating if the song is selected.
|
void |
deSelectAllSongs()
De-Selects ALL OggFileRef
|
void |
deSelectSong(int songIndex,
boolean select)
De-Selects the spec'd OggFileRef
|
int |
findSong(String songName)
Finds a song in the playlist and returns the index to it.
|
int |
findSong(URL songUrl)
Finds a song in the playlist and returns the index to it.
|
int |
findSongByHash(String artistAlbumTrackTitle)
Finds a song in the playlist by its song ArtistAlbumTrackTitle and returns the index to it.
|
int |
findSongByNumHash(String artistAlbumTrackNum)
Finds a song in the playlist by its song ArtistAlbumTrackNum and returns the index to it.
|
int |
findSongByTitle(String songTitle)
Finds a song in the playlist by its song title and returns the index to it.
|
static String[] |
getPlaylistArray(String[] fileNames)
Parses the passed filenames looking for OGG files.
|
Vector |
getPlaylistVector(String fileName)
Parses the passed filename looking for OGG files.
|
static Vector |
getPlaylistVector(String[] fileNames)
Parses the passed filenames looking for OGG files.
|
static Vector |
getPlaylistVector(URL playlistURL)
Parses the passed URL as a plylist looking for OGG files.
|
String |
getSongAlbum(int songIndex)
Gets the ALBUM information from an Ogg Vorbis reference.
|
String |
getSongArtist(int songIndex)
Gets the ARTIST information from an Ogg Vorbis reference.
|
long |
getSongBitrate(int songIndex)
Gets the Average Bitrate information from an Ogg Vorbis reference.
|
int |
getSongChannels(int songIndex)
Gets the Channels information from an Ogg Vorbis reference.
|
String |
getSongFileName(int songIndex)
Gets the song file Name attribute of the selected Song object
|
String[] |
getSongFileNames()
Gets the songNames attribute of the PlayList object
|
String[] |
getSongHashes()
Gets an array of the song hashes consisting of the songs ArtistAlbumTrackTitle.
|
String[] |
getSongHashes(int maxSize)
Gets an array of the song hashes consisting of the songs ArtistAlbumTrackTitle starting at position 0 in the Playlist..
|
String[] |
getSongHashes(int startSpot,
int maxSize)
Gets an array of the song hashes consisting of the songs ArtistAlbumTrackTitle.
|
String |
getSongInfo(int songIndex)
Gets the information from an Ogg Vorbis reference in a nice, humanly-readable format.
|
String |
getSongName(int songIndex)
Gets the song Name Comment attribute of the selected Song object or the filename
|
Vector |
getSongNamesVector()
Gets the songNamesVector attribute of the PlayList object
|
String[] |
getSongNumHashes()
Gets an array of the song hashes consisting of the songs ArtistAlbumTrackNum.
|
String[] |
getSongNumHashes(int startSpot,
int maxSize)
Gets an array of the song hashes consisting of the songs ArtistAlbumTrackNum.
|
String |
getSongTitle(int songIndex)
Gets the TITLE information from an Ogg Vorbis reference.
|
String[] |
getSongTitles()
Gets an array of the song titles.
|
URL |
getSongUrl(int songIndex)
Gets the URL attribute of the selected Song object
|
protected URL[] |
getSongUrls()
Gets the songUrls attribute of the PlayList object
|
int |
getTrackNumber(int songIndex)
Gets the TrackNumber information from an Ogg Vorbis reference.
|
URL |
getURL(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(String songName)
Gets the songSelected attribute of the PlayList object
|
void |
loadPlaylist(URL filenameURL)
Loads a playlist from the playlist file specified in the playListFilename_
field.
|
private static String |
readline(InputStream is)
Reads a single line from the InputStream.
|
boolean |
removeSong(String songName)
Description of the Method
|
void |
saveFavourites(String filename)
Saves the favourites selected in the playlist to the file specified in the playListFilename_ field.
|
void |
savePlaylistFile(String filename)
Saves the playlist to the file specified in the playListFilename_ field.
|
void |
selectAllSongs()
Selects ALL OggFileRef
|
void |
selectSong(int songIndex,
boolean select)
Marks the OggFileRef as selected
|
void |
setArtist(int songIndex,
String name)
Sets the song Artist comment of the selected Song object
|
void |
setSongName(int songIndex,
String name)
Sets the song Name comment of the selected Song object
|
void |
setTitle(int songIndex,
String name)
Sets the song Name comment of the selected Song object
|
int |
size()
The number of entries in the PlayList.
|
void |
sortSongs()
Sorts the Playlist Alphabetically.
|
void |
sortSongsByArtistAlbum()
Sorts the Playlist Alphabetically by its artist Then Album deaults to sortSongsByArtistAlbumTrackTitle().
|
void |
sortSongsByArtistAlbumTrackNum()
Sorts the Playlist Alphabetically by its artistAlbumTTrackNum.
|
void |
sortSongsByArtistAlbumTrackTitle()
Sorts the Playlist Alphabetically by its artistAlbumTrackTitle.
|
void |
sortSongsByFilename()
Sorts the Playlist Alphabetically by its filenames.
|
void |
sortSongsBySongTitle()
Sorts the Playlist Alphabetically by its song titles.
|
private static final String SYSTEM_FILE_SEPERATOR
public PlayList()
public static String[] getPlaylistArray(String[] fileNames)
fileNames
- an array containg files and/or dir names to parse for
OGG files.public static Vector getPlaylistVector(String[] fileNames)
fileNames
- an array containg files and/or dir names to parse for
OGG files.public static Vector getPlaylistVector(URL playlistURL)
playlistURL
- a URL pointing at a playlist file.private static String readline(InputStream is)
is
- Description of the Parameterpublic Vector getSongNamesVector()
public String[] getSongFileNames()
public String[] getSongTitles()
public String[] getSongHashes()
public String[] getSongHashes(int maxSize)
maxSize
- is the number of songs to process in this callpublic String[] getSongHashes(int startSpot, int maxSize)
startSpot
- is the starting position in the songs Vectorto start the retireval atmaxSize
- is the number of songs to process in this callpublic String[] getSongNumHashes()
public String[] getSongNumHashes(int startSpot, int maxSize)
startSpot
- is the starting position in the songs Vectorto start the retireval atmaxSize
- is the number of songs to process in this callpublic String getSongName(int songIndex)
songIndex
- The index for the songname to retrievepublic String getSongFileName(int songIndex)
songIndex
- The index for the songname to retrievepublic void setSongName(int songIndex, String name)
songIndex
- The index for the songname to retrievename
- The name to setpublic void setTitle(int songIndex, String name)
songIndex
- The index for the songname to retrievename
- The name to setpublic void setArtist(int songIndex, String name)
songIndex
- The index for the songname to retrievename
- The name to setpublic URL getSongUrl(int songIndex)
songIndex
- The index for the song to retrieveprotected URL[] getSongUrls()
public URL getURL(String songName)
songName
- Description of the Parameterpublic void sortSongs()
public void sortSongsByFilename()
public void sortSongsBySongTitle()
public void sortSongsByArtistAlbumTrackTitle()
public void sortSongsByArtistAlbumTrackNum()
public void sortSongsByArtistAlbum()
public int findSong(String songName)
songName
- The Songname to look forpublic int findSongByTitle(String songTitle)
songName
- The Songname to look forpublic int findSongByHash(String artistAlbumTrackTitle)
ArtistAlbumTrackTitle
- The ArtistAlbumTrackTitle hash to look forpublic int findSongByNumHash(String artistAlbumTrackNum)
ArtistAlbumTrackTitle
- The ArtistAlbumTrackNum hash to look forpublic int findSong(URL songUrl)
songUrl
- Description of the Parameterpublic boolean contains(String songName)
songName
- The Songname to look forpublic boolean isEmpty()
public String addSong(URL url)
url
- the specification for the song to add.public JCheckBox createSongCheckBox(String songName)
songName
- Description of the Parameterpublic JCheckBox createSongCheckBox(int index)
index
- the song num to look uppublic JPanel createSongPanel(int index)
index
- the song num to look uppublic JPanel createSongPanel(String song)
song
- the song name to look uppublic Vector getPlaylistVector(String fileName)
fileName
- an String (a file or dir name) to parse for OGG files.public int size()
public void selectAllSongs()
public void deSelectAllSongs()
public void deSelectSong(int songIndex, boolean select)
songIndex
- The song to selectselect
- for select or de-selectpublic void selectSong(int songIndex, boolean select)
songIndex
- The song to selectselect
- for select or de-selectpublic String getSongInfo(int songIndex)
songIndex
- The song to selectpublic int getSongChannels(int songIndex)
songIndex
- The song to selectpublic long getSongBitrate(int songIndex)
songIndex
- The song to selectpublic String getSongAlbum(int songIndex)
songIndex
- The song to selectpublic String getSongArtist(int songIndex)
songIndex
- The song to selectpublic int getTrackNumber(int songIndex)
songIndex
- The song to selectpublic String getSongTitle(int songIndex)
songIndex
- The song to selectpublic boolean isSongSelected(String songName)
songName
- Description of the Parameterpublic boolean isSongSelected(int songIndex)
songIndex
- Description of the Parameterpublic void loadPlaylist(URL filenameURL)
filenameURL
- the filename to use as the playlist - specified as a
URLpublic void savePlaylistFile(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 void saveFavourites(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(String songName)
songName
- Description of the ParameterWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses