Record Class Playback
java.lang.Object
java.lang.Record
lol.trq.orpheus.Playback
- Record Components:
sourceId- the source the session came fromsessionId- the session inside that sourceapp- the application behind the sessiontrack- what is playingstate- the playback statetimeline- where playback is and how it advancesshuffle- shuffle moderepeat- repeat modevolume- 0 to 1, or NaN when the source does not report itcontrols- the commands that work right nowcoverKey- the key of the cover image, or null when there is nonecoverUri- a remote cover location the library did not fetch, or null- whether the caller opted in to passing this data on to other peopledisplay- rules attached by the source
public record Playback(String sourceId, String sessionId, SourceApp app, Track track, PlaybackState state, Timeline timeline, Shuffle shuffle, Repeat repeat, double volume, Set<Control> controls, String coverKey, String coverUri, boolean shareable, DisplayRules display)
extends Record
What one session is playing at one instant. Immutable; a new one replaces it on every change.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPlayback(String sourceId, String sessionId, SourceApp app, Track track, PlaybackState state, Timeline timeline, Shuffle shuffle, Repeat repeat, double volume, Set<Control> controls, String coverKey, String coverUri, boolean shareable, DisplayRules display) Creates an instance of aPlaybackrecord class. -
Method Summary
Modifier and TypeMethodDescriptionapp()Returns the value of theapprecord component.booleanWhethercontrolworks for this session right now.controls()Returns the value of thecontrolsrecord component.coverKey()Returns the value of thecoverKeyrecord component.coverUri()Returns the value of thecoverUrirecord component.display()Returns the value of thedisplayrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanbooleanplaying()repeat()Returns the value of therepeatrecord component.booleansameSession(Playback other) Whether this snapshot andotherdescribe the same session.Returns the value of thesessionIdrecord component.booleanReturns the value of theshareablerecord component.shuffle()Returns the value of theshufflerecord component.sourceId()Returns the value of thesourceIdrecord component.state()Returns the value of thestaterecord component.timeline()Returns the value of thetimelinerecord component.final StringtoString()Returns a string representation of this record class.track()Returns the value of thetrackrecord component.doublevolume()Returns the value of thevolumerecord component.
-
Field Details
-
NONE
The snapshot when nothing is selected.
-
-
Constructor Details
-
Playback
public Playback(String sourceId, String sessionId, SourceApp app, Track track, PlaybackState state, Timeline timeline, Shuffle shuffle, Repeat repeat, double volume, Set<Control> controls, String coverKey, String coverUri, boolean shareable, DisplayRules display) Creates an instance of aPlaybackrecord class.- Parameters:
sourceId- the value for thesourceIdrecord componentsessionId- the value for thesessionIdrecord componentapp- the value for theapprecord componenttrack- the value for thetrackrecord componentstate- the value for thestaterecord componenttimeline- the value for thetimelinerecord componentshuffle- the value for theshufflerecord componentrepeat- the value for therepeatrecord componentvolume- the value for thevolumerecord componentcontrols- the value for thecontrolsrecord componentcoverKey- the value for thecoverKeyrecord componentcoverUri- the value for thecoverUrirecord componentshareable- the value for theshareablerecord componentdisplay- the value for thedisplayrecord component
-
-
Method Details
-
isPresent
public boolean isPresent() -
playing
public boolean playing() -
can
Whethercontrolworks for this session right now. -
sameSession
Whether this snapshot andotherdescribe the same session. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
sourceId
-
sessionId
-
app
-
track
-
state
-
timeline
-
shuffle
-
repeat
-
volume
-
controls
-
coverKey
-
coverUri
-
display
-