Modifier and Type | Field and Description |
---|---|
static String |
DATA_DESCRIPTOR |
static String |
NAME_DESCRIPTOR |
static String |
PLAYBACK_MODE_DESCRIPTOR |
static String |
POSITION_DESCRIPTOR |
static String |
QUEUE_DESCRIPTOR |
Constructor and Description |
---|
Playlist(List<TrackInfo> queue) |
Playlist(List<TrackInfo> queue,
String name,
List<PlaybackMode> playbackModes,
int position) |
Playlist(List<TrackInfo> queue,
String name,
List<PlaybackMode> playbackModes,
int position,
String data) |
Playlist(String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
HashMap<String,Object> |
export()
exports the Playlist to a HashMap
|
TrackInfo |
getCurrent()
returns the current played track or null
|
Optional<String> |
getData()
returns the associated data (not really specified, specified by implementation)
|
Optional<String> |
getName()
gets the name (optional)
|
List<PlaybackMode> |
getPlaybackModes()
retruns the active PlaybackModes
|
int |
getPosition()
returns the current position
|
List<TrackInfo> |
getQueue()
returns the queue
|
int |
hashCode() |
static Optional<Playlist> |
importResource(ResourceModel resourceModel)
constructs (if no errors were found) the Playlist from the Resource
|
Playlist |
nextTrack()
creates a new Playlist, with the next Track as head (or an illegal position if it is the last!!)
|
Playlist |
setNewPosition(int position)
creates a new Playlist, with the specified position
|
Playlist |
shuffle()
Shuffles the playlist and returns the shuffled playlist, so the original stays intact.
|
Playlist |
update(TrackInfo old,
TrackInfo newTrackInfo)
updates the TrackInfo-Object
|
boolean |
verify(Capabilities capabilities)
returns true if all the active playbackModes are supported
|
public static final String QUEUE_DESCRIPTOR
public static final String POSITION_DESCRIPTOR
public static final String NAME_DESCRIPTOR
public static final String PLAYBACK_MODE_DESCRIPTOR
public static final String DATA_DESCRIPTOR
public Playlist(List<TrackInfo> queue, String name, List<PlaybackMode> playbackModes, int position)
public TrackInfo getCurrent()
public int getPosition()
public Optional<String> getName()
playlist doesn't need to have a name
public List<PlaybackMode> getPlaybackModes()
public Optional<String> getData()
public Playlist nextTrack()
public Playlist setNewPosition(int position)
position
- the position to set topublic Playlist update(TrackInfo old, TrackInfo newTrackInfo)
old
- the old TrackInfonewTrackInfo
- the new TrackInfopublic Playlist shuffle()
public boolean verify(Capabilities capabilities)
capabilities
- the Capabilities to match againstpublic static Optional<Playlist> importResource(ResourceModel resourceModel)
resourceModel
- the resourceModel to import fromCopyright © 2016. All rights reserved.