public class PlayList extends Object
| Modifier and Type | Field and Description |
|---|---|
static FileChooserFilter |
PLAYLIST_FILE_FILTER |
static FileChooserFilter |
PLAYLIST_SAVE_FILE_FILTER |
static String[] |
SUPPORTEDPLAYLISTS |
static String[] |
SUPPORTEDSAVELISTS |
| Constructor and Description |
|---|
PlayList(ArrayList<PlayListEntry> entries,
boolean shuffle,
boolean repeat) |
PlayList(boolean shuffle,
boolean repeat)
Constructor for PlayList
|
PlayList(File[] files,
boolean shuffle,
boolean repeat)
Constructor for PlayList
|
PlayList(String[] fileNames,
boolean shuffle,
boolean repeat)
Constructor for PlayList
|
PlayList(URL[] urls,
boolean shuffle,
boolean repeat)
Constructor for PlayList
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAllAt(int indexAt,
PlayList newPlaylist) |
void |
addEntry(PlayListEntry newPlaylistEntry) |
void |
addPlaylistChangedListener(PlaylistChangedListener listener) |
void |
addSelectedElement(int index) |
static PlayList |
createFromFile(File f,
boolean shuffle,
boolean repeat)
reads a Playlist from a file
|
static PlayList |
createFromFile(String fileName,
boolean shuffle,
boolean repeat)
reads a Playlist from a file
|
static PlayList |
createFromFile(URL url,
boolean shuffle,
boolean repeat)
reads a playlist from a file
|
static PlayList |
createNewListWithFile(File file,
boolean shuffle,
boolean repeat)
will create a playlists with the given file
if the file represents a playlist, it will get expanded
|
static PlayList |
createNewListWithFile(URL url,
boolean shuffle,
boolean repeat)
will create a playlists with the given file
if the file represents a playlist, it will get expanded
|
static PlayList |
createNewListWithFiles(File[] file,
boolean shuffle,
boolean repeat)
will create a playlists with the given files
if a file represents a playlist, it will get expanded
|
static PlayList |
createNewListWithFiles(URL[] url,
boolean shuffle,
boolean repeat)
will create a playlists with the given files
if a file represents a playlist, it will get expanded
|
void |
doShuffle() |
void |
fireActiveElementChanged(PlayListEntry oldElement,
PlayListEntry newEntry) |
void |
fireSelectedElementChanged(PlayListEntry oldElement,
PlayListEntry newEntry) |
PlayListEntry[] |
getAllEntries() |
PlayListEntry |
getCurrentEntry()
Retrieve the current playlist entry
if no (more) entries are set this will return null
|
PlayListEntry |
getEntry(int index) |
static String |
getFileChooserDescription() |
static String |
getFileChooserSaveDescription() |
Iterator<PlayListEntry> |
getIterator() |
URL |
getLoadedFromURL() |
PlayListEntry[] |
getSelectedEntries() |
boolean |
hasNext() |
boolean |
hasPrevious() |
int |
indexOf(PlayListEntry entry) |
static boolean |
isPlaylistFile(String fileName) |
static boolean |
isPlaylistFile(URL fileURL) |
boolean |
isRepeat() |
void |
move(int fromIndex,
int toIndex) |
boolean |
next()
set index to next element or return false, if
end is reached.
|
boolean |
previous()
set index to prev element and wrap around
|
void |
remove(int fromIndex) |
void |
removePlaylistChangedListener(PlaylistChangedListener listener) |
void |
savePlayListTo(File f)
Saves the current playlist to a File
|
void |
savePlayListTo(String fileName)
Saves the current playlist to a File
|
PlayListEntry |
setCurrentElement(int index) |
void |
setCurrentElementByTimeIndex(long timeIndex)
set the current Element by timeIndex
This Method refers to the starttimeIndex and Duration of each entry
The index is searched in the current entrie's file
|
void |
setRepeat(boolean repeat) |
void |
setSelectedElement(int index) |
void |
setSelectedElements(int fromIndex,
int toIndex) |
int |
size() |
void |
toggleSelectedElement(int index) |
String |
toString() |
public static String[] SUPPORTEDPLAYLISTS
public static FileChooserFilter PLAYLIST_FILE_FILTER
public static String[] SUPPORTEDSAVELISTS
public static FileChooserFilter PLAYLIST_SAVE_FILE_FILTER
public PlayList(boolean shuffle,
boolean repeat)
public PlayList(ArrayList<PlayListEntry> entries, boolean shuffle, boolean repeat)
entries - shuffle - public PlayList(File[] files, boolean shuffle, boolean repeat)
public PlayList(String[] fileNames, boolean shuffle, boolean repeat)
public PlayList(URL[] urls, boolean shuffle, boolean repeat)
public void addPlaylistChangedListener(PlaylistChangedListener listener)
public void removePlaylistChangedListener(PlaylistChangedListener listener)
public void fireActiveElementChanged(PlayListEntry oldElement, PlayListEntry newEntry)
public void fireSelectedElementChanged(PlayListEntry oldElement, PlayListEntry newEntry)
public boolean isRepeat()
public void setRepeat(boolean repeat)
repeat - the repeat to setpublic void doShuffle()
public PlayListEntry[] getAllEntries()
public PlayListEntry getCurrentEntry()
public PlayListEntry getEntry(int index)
index - public PlayListEntry setCurrentElement(int index)
index - public void setCurrentElementByTimeIndex(long timeIndex)
timeIndex - public PlayListEntry[] getSelectedEntries()
public void addSelectedElement(int index)
index - public void toggleSelectedElement(int index)
index - public void setSelectedElement(int index)
index - (-1 means deselect any!)public void setSelectedElements(int fromIndex,
int toIndex)
fromIndex - toIndex - public boolean next()
public boolean previous()
public boolean hasNext()
public boolean hasPrevious()
public int size()
public int indexOf(PlayListEntry entry)
public void addAllAt(int indexAt,
PlayList newPlaylist)
public void addEntry(PlayListEntry newPlaylistEntry)
public void move(int fromIndex,
int toIndex)
public void remove(int fromIndex)
public URL getLoadedFromURL()
public void savePlayListTo(File f) throws IOException
f - IOExceptionpublic void savePlayListTo(String fileName) throws IOException
fileName - IOExceptionpublic static PlayList createNewListWithFiles(URL[] url, boolean shuffle, boolean repeat)
url - shuffle - public static PlayList createNewListWithFile(URL url, boolean shuffle, boolean repeat)
url - shuffle - public static PlayList createNewListWithFiles(File[] file, boolean shuffle, boolean repeat)
file - shuffle - public static PlayList createNewListWithFile(File file, boolean shuffle, boolean repeat)
file - shuffle - public static PlayList createFromFile(URL url, boolean shuffle, boolean repeat) throws IOException
url - IOExceptionpublic static PlayList createFromFile(File f, boolean shuffle, boolean repeat) throws IOException
f - shuffle - IOExceptionpublic static PlayList createFromFile(String fileName, boolean shuffle, boolean repeat) throws IOException
fileName - IOExceptionpublic static boolean isPlaylistFile(URL fileURL)
fileURL - public static boolean isPlaylistFile(String fileName)
fileName - public static String getFileChooserDescription()
public static String getFileChooserSaveDescription()
public Iterator<PlayListEntry> getIterator()
public String toString()
toString in class ObjectObject.toString()Copyright © 2014. All rights reserved.