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
  • Felddetails

  • Konstruktordetails

    • Playlist

      public Playlist(String name)
      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 with ITrackSearch for the IAudioTrack and IAudioTrackList for LoadedTracks. This method is async.
    • load

      public void load(Runnable runnable)
      Loads this playlist. This will go through all uris and search with 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.
      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

      public WrappedObject<String> add(info.u_team.music_player.lavaplayer.api.audio.IAudioTrack track)
      Adds an IAudioTrack to the uri list and the loaded tracks. This playlist must be loaded.
      Parameter:
      track - The track that should be added
      Gibt zurück:
      The WrappedObject with the uri as a string
    • add

      public WrappedObject<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. This playlist must be loaded.
      Parameter:
      trackList - The tracklist that should be added
      Gibt zurück:
      The WrappedObject with the uri as a string
    • remove

      public boolean remove(WrappedObject<String> uri)
      Removes an uri from the uri list and the loaded tracks. This playlist must be loaded.
      Parameter:
      uri - The WrappedObject with the uri as a string
      Gibt zurück:
      If the uri was removed
    • move

      public boolean move(WrappedObject<String> uri, int value)
      Move the uri and loaded track in the list up or down. This playlist must be loaded.
      Parameter:
      uri - The WrappedObject with the uri as a string
      value - 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

      public void setName(String name)
      Sets the name of this playlist
      Parameter:
      name - Name
    • getName

      public String 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

      public Collection<LoadedTracks> getLoadedTracks()
      Gets a Collection of LoadedTracks. 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:
      calculateNext in Schnittstelle info.u_team.music_player.lavaplayer.api.queue.ITrackQueue
    • getNext

      public info.u_team.music_player.lavaplayer.api.audio.IAudioTrack getNext()
      Angegeben von:
      getNext in Schnittstelle info.u_team.music_player.lavaplayer.api.queue.ITrackQueue
    • skip

      public boolean skip(Skip skip)
      Skip the current song in the Skip direction
      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 track Pair with LoadedTracks and IAudioTrack in this playlist. Values in the pair might be null if there are no tracks.
      Gibt zurück:
      Pair of LoadedTracks and IAudioTrack. 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 track Pair with LoadedTracks and IAudioTrack in this playlist. Values in the pair might be null if there are no tracks.
      Gibt zurück:
      Pair of LoadedTracks and IAudioTrack. 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 start LoadedTracks with the contained IAudioTrack
      Parameter:
      loadedTrack - LoadedTracks which must be in this playlist
      track - IAudioTrack which 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.