Klasse Playlist
java.lang.Object
info.u_team.music_player.musicplayer.playlist.Playlist
- Alle implementierten Schnittstellen:
info.u_team.music_player.lavaplayer.api.queue.ITrackQueue
public class Playlist
extends Object
implements info.u_team.music_player.lavaplayer.api.queue.ITrackQueue
This class represents a playlist. This list can be serialized or deserialized. After a serialization the tracks must
be loaded, because only the uris are saved.
IAudioTrack and IAudioTrackList can be added. Tracks can
be removed. Tracks can be moved in the order. Any changes to the serializable fields are saved-
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungadd(info.u_team.music_player.lavaplayer.api.audio.IAudioTrack track) Adds anIAudioTrackto the uri list and the loaded tracks.add(info.u_team.music_player.lavaplayer.api.audio.IAudioTrackList trackList) Adds anIAudioTrackListto the uri list and the loaded tracks if it has a valid uri and is not a search result.booleanintGets the size of uri entriesorg.apache.commons.lang3.tuple.Pair<LoadedTracks, info.u_team.music_player.lavaplayer.api.audio.IAudioTrack> org.apache.commons.lang3.tuple.Pair<LoadedTracks, info.u_team.music_player.lavaplayer.api.audio.IAudioTrack> Gets aCollectionofLoadedTracks.getName()Gets the name of this playlistinfo.u_team.music_player.lavaplayer.api.audio.IAudioTrackgetNext()booleanisEmpty()Returns true if the playlist is empty and don't contain any uris.booleanisLoaded()Is this playlist loadedvoidload()Loads this playlist.voidLoads this playlist.booleanmove(WrappedObject<String> uri, int value) Move the uri and loaded track in the list up or down.booleanremove(WrappedObject<String> uri) Removes an uri from the uri list and the loaded tracks.voidSets the name of this playlistvoidsetPlayable(LoadedTracks loadedTrack, info.u_team.music_player.lavaplayer.api.audio.IAudioTrack track) Sets the startLoadedTrackswith the containedIAudioTrackvoidSets the next track to null.booleanSkip the current song in theSkipdirectionvoidunload()Unloads this playlist and removes all loaded tracks.
-
Felddetails
-
name
-
uris
-
-
Konstruktordetails
-
Playlist
Create a new playlist object with a name- Parameter:
name- The playlist's name
-
-
Methodendetails
-
load
public void load()Loads this playlist. This will go through all uris and search withITrackSearchfor theIAudioTrackandIAudioTrackListforLoadedTracks. This method is async. -
load
Loads this playlist. This will go through all uris and search withITrackSearchfor theIAudioTrackandIAudioTrackListforLoadedTracks. This method is async. This method calls theRunnable.run()method when everything is loaded and the playlist was not loaded before.- Parameter:
runnable- A runnable that should be executed when the playlist is loaded
-
unload
public void unload()Unloads this playlist and removes all loaded tracks. -
isLoaded
public boolean isLoaded()Is this playlist loaded- Gibt zurück:
- Playlist loaded
-
add
Adds anIAudioTrackto the uri list and the loaded tracks. This playlist must be loaded.- Parameter:
track- The track that should be added- Gibt zurück:
- The
WrappedObjectwith the uri as a string
-
add
public WrappedObject<String> add(info.u_team.music_player.lavaplayer.api.audio.IAudioTrackList trackList) Adds anIAudioTrackListto the uri list and the loaded tracks if it has a valid uri and is not a search result. This playlist must be loaded.- Parameter:
trackList- The tracklist that should be added- Gibt zurück:
- The
WrappedObjectwith the uri as a string
-
remove
Removes an uri from the uri list and the loaded tracks. This playlist must be loaded.- Parameter:
uri- TheWrappedObjectwith the uri as a string- Gibt zurück:
- If the uri was removed
-
move
Move the uri and loaded track in the list up or down. This playlist must be loaded.- Parameter:
uri- TheWrappedObjectwith the uri as a stringvalue- Positive value to move the uri up the value, and the other way around for a negative value- Gibt zurück:
- If move was successful
-
setName
Sets the name of this playlist- Parameter:
name- Name
-
getName
Gets the name of this playlist- Gibt zurück:
- Name of this playlist
-
getEntrySize
public int getEntrySize()Gets the size of uri entries- Gibt zurück:
- Size of uri entries
-
getLoadedTracks
Gets aCollectionofLoadedTracks. Should only be used if this playlist is already loaded. This collection is immutable- Gibt zurück:
- Collection with all loaded tracks
-
isEmpty
public boolean isEmpty()Returns true if the playlist is empty and don't contain any uris.- Gibt zurück:
- true if empty
-
calculateNext
public boolean calculateNext()- Angegeben von:
calculateNextin Schnittstelleinfo.u_team.music_player.lavaplayer.api.queue.ITrackQueue
-
getNext
public info.u_team.music_player.lavaplayer.api.audio.IAudioTrack getNext()- Angegeben von:
getNextin Schnittstelleinfo.u_team.music_player.lavaplayer.api.queue.ITrackQueue
-
skip
Skip the current song in theSkipdirection- Parameter:
skip- Should be skipped forward or backward- Gibt zurück:
- If skip was executed
-
getFirstTrack
public org.apache.commons.lang3.tuple.Pair<LoadedTracks,info.u_team.music_player.lavaplayer.api.audio.IAudioTrack> getFirstTrack()Gets the first trackPairwithLoadedTracksandIAudioTrackin this playlist. Values in the pair might be null if there are no tracks.- Gibt zurück:
- Pair of
LoadedTracksandIAudioTrack. Can't be null, but elements can be null.
-
getLastTrack
public org.apache.commons.lang3.tuple.Pair<LoadedTracks,info.u_team.music_player.lavaplayer.api.audio.IAudioTrack> getLastTrack()Gets the last trackPairwithLoadedTracksandIAudioTrackin this playlist. Values in the pair might be null if there are no tracks.- Gibt zurück:
- Pair of
LoadedTracksandIAudioTrack. Can't be null, but elements can be null.
-
setPlayable
public void setPlayable(LoadedTracks loadedTrack, info.u_team.music_player.lavaplayer.api.audio.IAudioTrack track) Sets the startLoadedTrackswith the containedIAudioTrack- Parameter:
loadedTrack-LoadedTrackswhich must be in this playlisttrack-IAudioTrackwhich must be in the passed loadedTrack
-
setStopable
public void setStopable()Sets the next track to null. So the queue if playing will then be stopped.
-