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

What the link sheet of a Snapcast group shows and what a selection in it means (11.3). More...

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

Classes

class  Change
 What a selection changes: the clients to add and the members to remove (server ids).
 
class  Choice
 One line of the sheet.
 
interface  Words
 The localized texts of the rows; the Android code backs them with string resources. More...
 

Static Public Member Functions

static List< Choice > of (SnapcastServerStatus status, String groupId, Words words)
 
static Change changeOf (List< Choice > shown, Collection< String > checked)
 What the user's selection changes against what the sheet showed.
 

Detailed Description

What the link sheet of a Snapcast group shows and what a selection in it means (11.3).

It is the pattern of the MusicCast link sheet: every client of the server is listed once, in one list ordered by name, and the members of this group are checked. Checking a client of another group moves it in, unchecking a member takes it out (it gets a group of its own, the server does that). Pure; the sheet only binds what is decided here.

What is disabled. The only member of a group is checked and disabled: Group.SetClients with an empty list would dissolve the group, so the last member can not leave. Nothing else is disabled: a client that is not connected can be linked and unlinked like any other (it is marked "offline").

What a selection changes. changeOf compares the selection with what the sheet showed: the clients that were not members and are checked are added, the members that are not checked any more are removed. Everything else (a client that joined the group after the sheet was opened) is left alone; SnapcastControls applies the change to the group as the server has it at that moment, never to the list of the snapshot.

Names come from the server: they are cleaned and cut (SnapcastMemberRows#MAX_NAME) and never an identity.

Member Function Documentation

◆ changeOf()

static Change de.yaacc.snapcast.ui.SnapcastLinkChoices.changeOf ( List< Choice > shown,
Collection< String > checked )
static

What the user's selection changes against what the sheet showed.

Parameters
shownthe list the sheet showed
checkedthe ids that are checked now (null: none); an id that was not shown is ignored

◆ of()

static List< Choice > de.yaacc.snapcast.ui.SnapcastLinkChoices.of ( SnapcastServerStatus status,
String groupId,
Words words )
static
Parameters
statusthe server's status; null gives an empty list
groupIdthe group the sheet is for
Returns
every client of the server, by name; empty when the group is not in the status
Here is the call graph for this function:

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