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

What the row of a Snapcast group says. More...

Collaboration diagram for de.yaacc.snapcast.ui.SnapcastRowText:
Collaboration graph

Classes

class  Row
 The state of one row: the text and what the controls of the row show.
 
interface  Words
 The localized words; the Android code backs them with string resources. More...
 

Static Public Member Functions

static Row of (SnapcastGroup group, SnapcastServerStatus status, boolean online, String endpoint, Words words)
 
static String endpointOf (String receiverId)
 The endpoint of the server that a group's receiver id names, for a row whose server is no longer listed (the endpoint is always shown, security review S20).
 

Detailed Description

What the row of a Snapcast group says.

Pure; the localized words come in through Words, so the composition is tested without Android (the same idea as YxcRowText for MusicCast rows).

The text has two lines. The first names the endpoint of the server: a hostile server can name its group like a legitimate one, and the endpoint is the one thing it cannot copy (security review S20). It comes first because the row clips its text at the end (three lines): what the server controls, the facts, is what gets cut, never the endpoint (W2). The second line holds the facts of the group: the stream (cut to {@value MAX_STREAM_NAME} characters), how many clients are connected, the group volume (the average of the connected members) and a "muted" marker. Two markers explain what is wrong: "server unreachable" (the control connection is down; the row shows the last known state and is not removed, so a short outage does not make the group flicker out of the list and out of the stored selection) and "stream unavailable" (the group's stream is not in the server's list, or the server has switched it off).

Everything that comes from the server (the stream name) goes through SnapcastDisplayText first: it is display text, never an identity.

Member Function Documentation

◆ endpointOf()

static String de.yaacc.snapcast.ui.SnapcastRowText.endpointOf ( String receiverId)
static

The endpoint of the server that a group's receiver id names, for a row whose server is no longer listed (the endpoint is always shown, security review S20).

Returns
host:port, or the empty string when the id is no well-formed group id

◆ of()

static Row de.yaacc.snapcast.ui.SnapcastRowText.of ( SnapcastGroup group,
SnapcastServerStatus status,
boolean online,
String endpoint,
Words words )
static
Parameters
groupthe group, or null when the status of the server no longer has it
statusthe last status read from the server (the group's stream is looked up in it)
onlinewhether the control connection is up
endpointthe server's endpoint as text (host:port); our own text, still cleaned before it is shown
Here is the call graph for this function:

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