public class Playlist
extends java.lang.Object
implements info.u_team.music_player.lavaplayer.api.queue.ITrackQueue
IAudioTrack
and IAudioTrackList
can be added. Tracks can
be removed. Tracks can be moved in the order. Any changes to the serializable fields are savedModifier and Type | Field and Description |
---|---|
java.lang.String |
name |
java.util.ArrayList<WrappedObject<java.lang.String>> |
uris |
Constructor and Description |
---|
Playlist(java.lang.String name)
Create a new playlist object with a name
|
Modifier and Type | Method and Description |
---|---|
WrappedObject<java.lang.String> |
add(info.u_team.music_player.lavaplayer.api.audio.IAudioTrack track)
Adds an
IAudioTrack to the uri list and the loaded tracks. |
WrappedObject<java.lang.String> |
add(info.u_team.music_player.lavaplayer.api.audio.IAudioTrackList trackList)
Adds an
IAudioTrackList to the uri list and the loaded tracks if it has a valid uri and is not a search
result. |
boolean |
calculateNext() |
int |
getEntrySize()
Gets the size of uri entries
|
org.apache.commons.lang3.tuple.Pair<LoadedTracks,info.u_team.music_player.lavaplayer.api.audio.IAudioTrack> |
getFirstTrack()
|
java.util.Collection<LoadedTracks> |
getLoadedTracks()
Gets a
Collection of LoadedTracks . |
java.lang.String |
getName()
Gets the name of this playlist
|
info.u_team.music_player.lavaplayer.api.audio.IAudioTrack |
getNext() |
boolean |
isEmpty()
Returns true if the playlist is empty and don't contain any uris.
|
boolean |
isLoaded()
Is this playlist loaded
|
void |
load()
Loads this playlist.
|
void |
load(java.lang.Runnable runnable)
Loads this playlist.
|
boolean |
move(WrappedObject<java.lang.String> uri,
int value)
Move the uri and loaded track in the list up or down.
|
boolean |
remove(WrappedObject<java.lang.String> uri)
Removes an uri from the uri list and the loaded tracks.
|
void |
setName(java.lang.String name)
Sets the name of this playlist
|
void |
setPlayable(LoadedTracks loadedTrack,
info.u_team.music_player.lavaplayer.api.audio.IAudioTrack track)
Sets the start
LoadedTracks with the contained IAudioTrack |
void |
setStopable()
Sets the next track to null.
|
boolean |
skip(Skip skip)
Skip the current song in the
Skip direction |
void |
unload()
Unloads this playlist and removes all loaded tracks.
|
public java.lang.String name
public final java.util.ArrayList<WrappedObject<java.lang.String>> uris
public Playlist(java.lang.String name)
name
- The playlist's namepublic void load()
ITrackSearch
for the IAudioTrack
and IAudioTrackList
for LoadedTracks
. This method is async.public void load(java.lang.Runnable runnable)
ITrackSearch
for the IAudioTrack
and IAudioTrackList
for LoadedTracks
. This method is async. This method calls the
Runnable.run()
method when everything is loaded and the playlist was not loaded before.runnable
- A runnable that should be executed when the playlist is loadedpublic void unload()
public boolean isLoaded()
public WrappedObject<java.lang.String> add(info.u_team.music_player.lavaplayer.api.audio.IAudioTrack track)
IAudioTrack
to the uri list and the loaded tracks. This playlist must be loaded.track
- The track that should be addedWrappedObject
with the uri as a stringpublic WrappedObject<java.lang.String> add(info.u_team.music_player.lavaplayer.api.audio.IAudioTrackList trackList)
IAudioTrackList
to the uri list and the loaded tracks if it has a valid uri and is not a search
result. This playlist must be loaded.trackList
- The tracklist that should be addedWrappedObject
with the uri as a stringpublic boolean remove(WrappedObject<java.lang.String> uri)
uri
- The WrappedObject
with the uri as a stringpublic boolean move(WrappedObject<java.lang.String> uri, int value)
uri
- The WrappedObject
with the uri as a stringvalue
- Positive value to move the uri up the value, and the other way around for a negative valuepublic void setName(java.lang.String name)
name
- Namepublic java.lang.String getName()
public int getEntrySize()
public java.util.Collection<LoadedTracks> getLoadedTracks()
Collection
of LoadedTracks
. Should only be used if this playlist is already loaded. This
collection is immutablepublic boolean isEmpty()
public boolean calculateNext()
calculateNext
in interface info.u_team.music_player.lavaplayer.api.queue.ITrackQueue
public info.u_team.music_player.lavaplayer.api.audio.IAudioTrack getNext()
getNext
in interface info.u_team.music_player.lavaplayer.api.queue.ITrackQueue
public void setPlayable(LoadedTracks loadedTrack, info.u_team.music_player.lavaplayer.api.audio.IAudioTrack track)
LoadedTracks
with the contained IAudioTrack
loadedTrack
- LoadedTracks
which must be in this playlisttrack
- IAudioTrack
which must be in the passed loadedTrackpublic void setStopable()
public org.apache.commons.lang3.tuple.Pair<LoadedTracks,info.u_team.music_player.lavaplayer.api.audio.IAudioTrack> getFirstTrack()
Pair
with LoadedTracks
and IAudioTrack
in this playlist. Might be null
if there are no tracks.Pair
with LoadedTracks
as key and IAudioTrack
as value