YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.snapcast.SnapcastRendererSources Class Reference

The source list of the app's own OpenHome renderer with the Snapcast groups in it (task 12.5), decided without Android. More...

Collaboration diagram for de.yaacc.snapcast.SnapcastRendererSources:
Collaboration graph

Classes

class  Entry
 One source of the list.
 
class  GroupRef
 A known group: its receiver id and its name (display text).
 
enum  Kind
 What a source is. More...
 
class  Labels
 The texts of the app that the list needs.
 
class  SendspinRef
 A known Sendspin player or group leader: its receiver id and its name (display text).
 
class  Snapshot
 The list a controller is told and the index of the current source.
 
class  Target
 What choosing a source means for the output setting.
 

Static Public Member Functions

static Snapshot build (SnapcastRendererOutput.Setting setting, List< GroupRef > groups, Labels labels)
 The list for the setting and the groups known now.
 
static Snapshot build (SnapcastRendererOutput.Setting setting, List< GroupRef > groups, List< SendspinRef > sendspin, Labels labels)
 The list for the setting, the Snapcast groups and the Sendspin players and groups known now.
 
static String sendspinTokenOf (String receiverId)
 The system name of a Sendspin source: sendspin- and 16 hexadecimal characters of a hash of the receiver id.
 
static String tokenOf (String receiverId)
 The token a controller can use as the system name of a group: snapcast- and 16 hexadecimal characters of a hash of the receiver id.
 

Static Public Attributes

static final int MAX_GROUPS = 16
 The most groups listed.
 
static final int MAX_SENDSPIN = 16
 The most Sendspin players and groups listed.
 
static final int MAX_NAME = 96
 The longest name of a source (the group's own name is at most 64 characters, the device adds a suffix).
 

Detailed Description

The source list of the app's own OpenHome renderer with the Snapcast groups in it (task 12.5), decided without Android.

An OpenHome controller sees the renderer's Product service: a list of sources and the index of the current one. Here the list is this device (the one source of before, with the same names) followed by one source per known Snapcast group, and the current one is what the output setting of the renderer says (Group 9, SnapcastRendererOutput): the list is only another way to read and to write that one setting, never a second truth.

  • Order and names. This device is index 0. The groups follow ordered by their cleaned name (ignoring case), then by id, so the same groups always give the same list. Names are display text from a server: the callers hand in cleaned text and it is cleaned and cut again here (SnapcastDisplayText); an empty one gets the label; equal names are told apart by a number (Kitchen, Kitchen (2)).
  • Ids. A group's receiver id (snapcast:<server key>:<group id>) holds the address of the server, so it is never in a text a controller sees. A source carries it only in the mapping of this class; the controller gets the name and an opaque SystemName token (tokenOf, a hash that stays the same for the same group while the list changes).
  • Limit. At most {@value MAX_GROUPS} groups. The group that is chosen is always in the list (it takes the place of the last one); a chosen group that is not known now (its server is gone or has not answered since the app started), and a group mode with no group chosen, is shown as one placeholder source that is the current one and can not be chosen: both settings always show the same state, also when it is not a good one.
  • Type. Every source is of the type Playlist (a controller can queue on all of them).

Pure Java. Immutable results.

Member Function Documentation

◆ build() [1/2]

static Snapshot de.yaacc.snapcast.SnapcastRendererSources.build ( SnapcastRendererOutput.Setting setting,
List< GroupRef > groups,
Labels labels )
static

The list for the setting and the groups known now.

Parameters
settingthe renderer's output setting; null counts as this device
groupsthe known groups; null for none. Entries with an id that is not canonical, or that repeat one, are left out
labelsthe texts of the app; null only when no group is listed and none is chosen

Referenced by de.yaacc.snapcast.SnapcastRendererSources.build(), and de.yaacc.upnp.server.openhome.RendererOutputSources.snapshot().

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

◆ build() [2/2]

static Snapshot de.yaacc.snapcast.SnapcastRendererSources.build ( SnapcastRendererOutput.Setting setting,
List< GroupRef > groups,
List< SendspinRef > sendspin,
Labels labels )
static

The list for the setting, the Snapcast groups and the Sendspin players and groups known now.

This device is first, then the Snapcast groups, then the Sendspin sources (named Sendspin: <name>, ordered by name, at most {@value MAX_SENDSPIN}; the chosen one is always listed), then a placeholder for a chosen group or Sendspin target that is not known now.

Here is the call graph for this function:

◆ tokenOf()

static String de.yaacc.snapcast.SnapcastRendererSources.tokenOf ( String receiverId)
static

The token a controller can use as the system name of a group: snapcast- and 16 hexadecimal characters of a hash of the receiver id.

It is the same for the same group whatever else is in the list, and tells nothing about the server.

Referenced by de.yaacc.snapcast.SnapcastRendererSources.build(), and de.yaacc.snapcast.SnapcastRendererSources.sendspinTokenOf().

Here is the caller graph for this function:

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