|
YAACC - UPNP Client and Server
|
Remembers the servers that hold a selected Snapcast group, so that the selection survives an app restart even when the server was only discovered (a typed-in server is remembered by the manual list). More...

Public Member Functions | |
| SnapcastSelectedServers (StringStore storage, SnapcastDirectory directory) | |
| void | restore () |
| Lists the remembered servers in the directory (at start-up, before anything else asks for a group). | |
| List< ServerEndpoint > | list () |
| void | selectionChanged (Collection< String > receiverIds) |
| The selection changed: remember the listed servers that hold a selected group, forget the others. | |
| void | forget (ServerKey key) |
| Forgets one server: its endpoint leaves the store and its remembered flag goes. | |
Remembers the servers that hold a selected Snapcast group, so that the selection survives an app restart even when the server was only discovered (a typed-in server is remembered by the manual list).
Without it the directory is empty after a restart, the group could not be resolved, and the stored selection would be dropped before the receivers page had a chance to discover the server again.
What is stored is the same plain text as the manual list: one host:port per line, an address that was seen on the network and passed the range filter, nothing else (no service name, no group id, no credentials). It is read strictly (every line is parsed again and filtered again, at most {@value SnapcastDirectory.MAX_SERVERS}), and handed to the directory as remembered servers, which the directory lists without any scan. A server leaves the store as soon as no selected group refers to it. Pure Java; the storage is injected. Thread safe.
| void de.yaacc.snapcast.SnapcastSelectedServers.forget | ( | ServerKey | key | ) |
Forgets one server: its endpoint leaves the store and its remembered flag goes.
For "remove server" when the stored selection can not be read; the other remembered servers are left alone.

| List< ServerEndpoint > de.yaacc.snapcast.SnapcastSelectedServers.list | ( | ) |
| void de.yaacc.snapcast.SnapcastSelectedServers.selectionChanged | ( | Collection< String > | receiverIds | ) |
The selection changed: remember the listed servers that hold a selected group, forget the others.
A manual server is left to the manual list.
| receiverIds | the ids of the selected receivers (any kind; only snapcast: ids count); may be null |
