|
YAACC - UPNP Client and Server
|
The app-wide Snapcast part, the counterpart of YxcMonitor.getShared(): the directory of servers, the manual server list, the mDNS discovery, and the receivers that join them.
More...


Public Member Functions | |
| SnapcastServerListModel | newServerListModel () |
| The server list of the settings: typed-in servers (validated strictly, at most 16), the ones the network or a selected group brought, and "remove", which also clears the remembered flag and the selected groups of the server. | |
| SnapcastFeedController | newFeedController (SnapcastGroupDevice group, SnapcastFeedController.Listener listener) |
| The controller that plays into a group (task 4.4). | |
| int | openFeedControllers () |
| How many feed controllers are not yet released and ended (the exit waits for them, bounded, so the groups get their streams back). | |
| ManualServers | getManualServers () |
| The manual servers (for the settings): the list is read again at every page start. | |
| void | pageStarted () |
| The receivers page is visible: connect to the listed servers, and discover if the setting is on. | |
| void | pageStopped () |
| A receivers page was hidden: the discovery stops with the last one, the connections close after the grace. | |
| DiscoveryGate.Lease | diagnosticsOpened () |
| The Snapcast server settings are open (task 11.6): with the switch on the scan runs while they are, so that the report shows a live scan. | |
| String | discoveryReport () |
| void | addChangeListener (SnapcastReceivers.ChangeListener listener) |
| void | removeChangeListener (SnapcastReceivers.ChangeListener listener) |
| SnapcastReceivers | getReceivers () |
| The receivers, for the code that controls a server (the player of a later group). | |
| List< SnapcastGroupDevice > | groups () |
| The groups of the servers that are listed, as of the last status of each server. | |
| SnapcastGroupDevice | findGroup (String receiverId) |
| boolean | isPending (String receiverId) |
| True for the id of a group whose server is listed but has not delivered its status yet (a cold start, or a connection that is still coming up): the group is not known, but it is not gone either. | |
| void | selectionChanged (Collection< String > receiverIds) |
| Remembers the servers of the selected groups, so that the selection survives a restart, and the server of the group the renderer plays into while its output is that group. | |
| void | wake (Collection< String > receiverIds) |
| Connects to the listed servers of the chosen groups. | |
Public Member Functions inherited from de.yaacc.snapcast.SnapcastGroupSource | |
Static Public Member Functions | |
| static synchronized SnapcastHub | peekShared () |
| The app-wide hub if it exists already, else null (the exit must not create it just to ask). | |
| static synchronized SnapcastHub | getShared (Context context) |
| The app-wide hub. | |
| static synchronized void | whenCreated (java.util.function.Consumer< SnapcastHub > listener) |
| Calls the listener now with the hub if it exists, and once when it is made if not. | |
| static void | forgetWhenCreated (java.util.function.Consumer< SnapcastHub > listener) |
Additional Inherited Members | |
Public Attributes inherited from de.yaacc.snapcast.SnapcastGroupSource | |
| SnapcastGroupSource | NONE |
| No groups; the default of a client that has no hub. | |
The app-wide Snapcast part, the counterpart of YxcMonitor.getShared(): the directory of servers, the manual server list, the mDNS discovery, and the receivers that join them.
It holds the application context only, and it does nothing until a page tells it to: pageStarted() (the receivers page is visible) opens the connections to the listed servers and, only when the setting SnapcastSettings#KEY_SUPPORT is on (default on), starts the discovery (and with it the multicast lock); pageStopped() stops the discovery at once and closes the connections after a grace period. The setting is read live (DiscoveryGate): switching it off stops the scan and drops the servers that only the scan knew, so with it off only the typed-in and the remembered servers are used.
This is the thin Android glue; every decision is in the classes it wires together, which are tested on the JVM.
| DiscoveryGate.Lease de.yaacc.snapcast.SnapcastHub.diagnosticsOpened | ( | ) |
The Snapcast server settings are open (task 11.6): with the switch on the scan runs while they are, so that the report shows a live scan.
Only the scan, not the connections of a receivers page. The caller closes the lease when its window goes away, on every path (dismiss, stop, destroy); closing it twice is harmless.

| SnapcastGroupDevice de.yaacc.snapcast.SnapcastHub.findGroup | ( | String | receiverId | ) |
snapcast:...), or null if it is not known (any more) Implements de.yaacc.snapcast.SnapcastGroupSource.

| List< SnapcastGroupDevice > de.yaacc.snapcast.SnapcastHub.groups | ( | ) |
The groups of the servers that are listed, as of the last status of each server.
Cheap: no network.
Implements de.yaacc.snapcast.SnapcastGroupSource.

| boolean de.yaacc.snapcast.SnapcastHub.isPending | ( | String | receiverId | ) |
True for the id of a group whose server is listed but has not delivered its status yet (a cold start, or a connection that is still coming up): the group is not known, but it is not gone either.
The caller keeps such an id in a stored selection instead of dropping it. False for a group that is known, for a server that is not listed (any more), for a server that answered without the group, and for anything that is not a group id.
Implements de.yaacc.snapcast.SnapcastGroupSource.

| SnapcastFeedController de.yaacc.snapcast.SnapcastHub.newFeedController | ( | SnapcastGroupDevice | group, |
| SnapcastFeedController.Listener | listener ) |
The controller that plays into a group (task 4.4).
The name of this phone in the stream name is the one the UPnP server announces (the same preference and default as YaaccUpnpServerService.getLocalServerName), so nothing new about the phone is disclosed to the Snapcast server and its controllers. The caller must release it when its player ends.

| void de.yaacc.snapcast.SnapcastHub.selectionChanged | ( | Collection< String > | receiverIds | ) |
Remembers the servers of the selected groups, so that the selection survives a restart, and the server of the group the renderer plays into while its output is that group.
Implements de.yaacc.snapcast.SnapcastGroupSource.
| void de.yaacc.snapcast.SnapcastHub.wake | ( | Collection< String > | receiverIds | ) |
Connects to the listed servers of the chosen groups.
Does not start the discovery (that is the page's).
Implements de.yaacc.snapcast.SnapcastGroupSource.

|
static |
Calls the listener now with the hub if it exists, and once when it is made if not.
The listener must be quick and must not call getShared; it is called with the hub class locked.