YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.sendspin.client.DisplayRoles Class Reference

What a client with the display roles shows (issue #325, task 11.5): the metadata (title, artist, album, progress; a scheduled update is applied when its time has come), the artwork (the album image) and the color (colours derived from the audio). More...

Collaboration diagram for de.yaacc.sendspin.client.DisplayRoles:
Collaboration graph

Public Member Functions

synchronized void accept (ControllerMessages.ServerState state, long serverNowMicros, boolean metadataActive, boolean colorActive)
 A server/state arrived: its metadata and color objects, for the roles that are active.
 
synchronized ControllerMessages.Metadata metadata (long serverNowMicros)
 
synchronized ControllerMessages.Metadata pendingMetadata (long serverNowMicros)
 
synchronized long positionMs (long serverNowMicros)
 The position in the current track in milliseconds, or -1 if the server reports none.
 
synchronized ControllerMessages.Color color (long serverNowMicros)
 The colours to show at this time: a scheduled update whose time has come is applied first; null if there are none.
 
synchronized void startArtwork (List< ControllerMessages.ArtworkChannel > channels)
 
synchronized void endArtwork ()
 
synchronized boolean onArtworkMessage (int id, byte[] body, long serverNowMicros) throws ProtocolException
 
synchronized byte[] artwork (long serverNowMicros)
 The album image now (JPEG or PNG bytes), or null.
 
synchronized long artworkVersion (long serverNowMicros)
 Increases whenever the image changes, so that a display decodes it again only then.
 
synchronized void clear (boolean keepMetadata, boolean keepArtwork, boolean keepColor)
 Forgets what a role showed when the server takes that role away.
 

Static Public Member Functions

static List< String > roles (boolean showMetadata, boolean showArtwork, boolean showColor)
 

Static Public Attributes

static final String METADATA = "metadata@v1"
 
static final String ARTWORK = "artwork@v1"
 
static final String COLOR = "color@v1"
 
static final String ARTWORK_FORMAT = "jpeg"
 The one artwork channel this client asks for: the album image, JPEG, a square the server scales to fit and pads with black.
 
static final int ARTWORK_SIZE = 512
 

Detailed Description

What a client with the display roles shows (issue #325, task 11.5): the metadata (title, artist, album, progress; a scheduled update is applied when its time has come), the artwork (the album image) and the color (colours derived from the audio).

The state of one server connection, locked by its own monitor: the connection thread writes it, a display reads it.

The roles a client offers are chosen by its operator (see roles); this class holds the state of the roles that are active.

Member Function Documentation

◆ onArtworkMessage()

synchronized boolean de.yaacc.sendspin.client.DisplayRoles.onArtworkMessage ( int id,
byte[] body,
long serverNowMicros ) throws ProtocolException
Returns
true if the image changed; a malformed message is a protocol error (the specification: the connection ends)
Here is the call graph for this function:

◆ roles()

static List< String > de.yaacc.sendspin.client.DisplayRoles.roles ( boolean showMetadata,
boolean showArtwork,
boolean showColor )
static
Returns
the display roles of the given choices, in the order the roles are listed in client/hello

Referenced by de.yaacc.sendspin.client.DisplayRoles.roles().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: