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

A Snapcast group as a receiver of the receiver lists: a synthetic Cling Device that is never registered with Cling's registry (so it is never advertised and never searched for), modeled on UpnpClient.LocalDummyDevice. More...

Inheritance diagram for de.yaacc.snapcast.SnapcastGroupDevice:
Inheritance graph
Collaboration diagram for de.yaacc.snapcast.SnapcastGroupDevice:
Collaboration graph

Classes

class  Id
 A parsed receiver id.
 
class  Labels
 The texts the user sees; the app fills them from its string resources.
 

Public Member Functions

ServerKey getServerKey ()
 
String getGroupId ()
 
boolean isIdle ()
 True for the placeholder card of a YAACC server that no client has connected to: nothing to play to or to control, see SnapcastIdleGroup.
 
String getStreamId ()
 The stream the group plays when the snapshot was taken (an id of the server: display text).
 
int getClientCount ()
 
boolean isOffline ()
 True while the server's control connection is down; the group is the last one known.
 
String getDisplayString ()
 
DeviceDetails getDetails ()
 
Service[] getServices ()
 
Device[] getEmbeddedDevices ()
 
Device getRoot ()
 
Device findDevice (UDN udn)
 
Resource[] discoverResources (Namespace namespace)
 
Device newInstance (UDN arg0, UDAVersion arg1, DeviceType arg2, DeviceDetails arg3, org.fourthline.cling.model.meta.Icon[] arg4, Service[] arg5, List arg6) throws ValidationException
 
Service newInstance (ServiceType serviceType, ServiceId serviceId, URI uri, URI uri1, URI uri2, Action[] actions, StateVariable[] stateVariables) throws ValidationException
 
Device[] toDeviceArray (Collection collection)
 
Service[] newServiceArray (int i)
 
Service[] toServiceArray (Collection collection)
 
String toString ()
 No address or id in the text: counts only.
 
- Public Member Functions inherited from org.fourthline.cling.model.meta.Device< DI extends DeviceIdentity, D extends Device, S extends Service >
 Device (DI identity) throws ValidationException
 
 Device (DI identity, DeviceType type, DeviceDetails details, Icon[] icons, S[] services) throws ValidationException
 
 Device (DI identity, DeviceType type, DeviceDetails details, Icon[] icons, S[] services, D[] embeddedDevices) throws ValidationException
 
 Device (DI identity, UDAVersion version, DeviceType type, DeviceDetails details, Icon[] icons, S[] services, D[] embeddedDevices) throws ValidationException
 
DI getIdentity ()
 
UDAVersion getVersion ()
 
DeviceType getType ()
 
DeviceDetails getDetails (RemoteClientInfo info)
 
Icon[] getIcons ()
 
boolean hasIcons ()
 
boolean hasServices ()
 
boolean hasEmbeddedDevices ()
 
D getParentDevice ()
 
boolean isRoot ()
 
D[] findEmbeddedDevices ()
 
D[] findDevices (DeviceType deviceType)
 
D[] findDevices (ServiceType serviceType)
 
Icon[] findIcons ()
 
S[] findServices ()
 
S[] findServices (ServiceType serviceType)
 
S findService (ServiceId serviceId)
 
S findService (ServiceType serviceType)
 
ServiceType[] findServiceTypes ()
 
boolean isFullyHydrated ()
 
List< ValidationError > validate ()
 
boolean equals (Object o)
 
int hashCode ()
 
abstract D newInstance (UDN udn, UDAVersion version, DeviceType type, DeviceDetails details, Icon[] icons, S[] services, List< D > embeddedDevices) throws ValidationException
 
abstract S newInstance (ServiceType serviceType, ServiceId serviceId, URI descriptorURI, URI controlURI, URI eventSubscriptionURI, Action< S >[] actions, StateVariable< S >[] stateVariables) throws ValidationException
 
abstract D[] toDeviceArray (Collection< D > col)
 
abstract S[] toServiceArray (Collection< S > col)
 
- Public Member Functions inherited from org.fourthline.cling.model.Validatable

Static Public Member Functions

static SnapcastGroupDevice of (ServerKey serverKey, SnapcastGroup group, boolean offline, Labels labels, String serverName)
 Makes the device of a group.
 
static String idOf (ServerKey serverKey, String groupId)
 The receiver id of a group.
 
static boolean isSnapcastId (String id)
 True for text that starts like a group id (it may still be malformed; parseId decides).
 
static Id parseId (String id)
 Reads a receiver id from the right.
 

Static Public Attributes

static final String ID_PREFIX = "snapcast:"
 The prefix of every receiver id of a group.
 

Additional Inherited Members

- Protected Member Functions inherited from org.fourthline.cling.model.meta.Device< DI extends DeviceIdentity, D extends Device, S extends Service >
D find (UDN udn, D current)
 
Collection< D > findEmbeddedDevices (D current)
 
Collection< D > find (DeviceType deviceType, D current)
 
Collection< D > find (ServiceType serviceType, D current)
 
Collection< S > findServices (ServiceType serviceType, ServiceId serviceId, D current)
 
- Protected Attributes inherited from org.fourthline.cling.model.meta.Device< DI extends DeviceIdentity, D extends Device, S extends Service >
final S[] services
 
final D[] embeddedDevices
 
- Package Functions inherited from org.fourthline.cling.model.meta.Device< DI extends DeviceIdentity, D extends Device, S extends Service >

Detailed Description

A Snapcast group as a receiver of the receiver lists: a synthetic Cling Device that is never registered with Cling's registry (so it is never advertised and never searched for), modeled on UpnpClient.LocalDummyDevice.

It has no services (the code that looks for AVTransport, RenderingControl or OpenHome services finds none and treats it like the phone's own dummy device), and no root. It is an immutable snapshot of the group at one moment; two snapshots of one group are equal (the identity is the id), so a renamed group is the same receiver.

The id is snapcast:<server key>:<group id>. The server key is the control endpoint and contains colons (host:port, an IPv6 literal in brackets with colons inside), so the id is parsed from the right: the group id is what follows the last colon, and the rest after the prefix must be a canonical server key (ServerKey#parse). A group id from the server is accepted only when it is 1 to 64 characters of letters, digits, _ and - (the ids of a snapserver are UUIDs); a group with another id is not made into a device, so a hostile server can not forge an ambiguous id.

The name is the group's name, else the first member's name (its set name, else its host name; never its id, which is a MAC address), else the generic label, cut at 64 characters, plus " (Snapcast)" (the product name), a marker when the server is offline, and @<server>: the name of the server, so that the same client on two servers is two different entries of the lists. Names come from the server: they are display text and are cleaned with SnapcastDisplayText before they get here; they are never an identity.

Member Function Documentation

◆ discoverResources()

Resource[] de.yaacc.snapcast.SnapcastGroupDevice.discoverResources ( Namespace namespace)

◆ findDevice()

Device de.yaacc.snapcast.SnapcastGroupDevice.findDevice ( UDN udn)

◆ getDetails()

◆ getDisplayString()

String de.yaacc.snapcast.SnapcastGroupDevice.getDisplayString ( )

◆ getEmbeddedDevices()

Device[] de.yaacc.snapcast.SnapcastGroupDevice.getEmbeddedDevices ( )

◆ getRoot()

◆ getServices()

Service[] de.yaacc.snapcast.SnapcastGroupDevice.getServices ( )

◆ newServiceArray()

Service[] de.yaacc.snapcast.SnapcastGroupDevice.newServiceArray ( int i)

◆ of()

static SnapcastGroupDevice de.yaacc.snapcast.SnapcastGroupDevice.of ( ServerKey serverKey,
SnapcastGroup group,
boolean offline,
Labels labels,
String serverName )
static

Makes the device of a group.

Parameters
offlinetrue while the control connection to the server is down (the group is the last one known)
serverNamethe name of the server as the list shows it (the name from the network, else its address); the same client on two servers is told apart by it. Null or blank: the name has no server part.
Returns
the device, or null when the group's id is not safe to put into a receiver id

◆ parseId()

static Id de.yaacc.snapcast.SnapcastGroupDevice.parseId ( String id)
static

◆ toString()

String de.yaacc.snapcast.SnapcastGroupDevice.toString ( )

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