|
YAACC - UPNP Client and Server
|
Decides when mDNS discovery runs: only while at least one receivers page is visible and the setting SnapcastSettings#KEY_SUPPORT is on.
More...

Classes | |
| interface | Discovery |
The scan: SnapcastNsd in the app. More... | |
| class | Lease |
| One page of the gate, given back at most once. More... | |
Public Member Functions | |
| DiscoveryGate (BooleanSupplier enabled, Discovery discovery, Runnable onDisabled) | |
| synchronized void | pageStarted () |
| A receivers page became visible. | |
| synchronized void | pageStopped () |
| A receivers page was hidden. | |
| synchronized Lease | pageLease () |
| A holder that is not a receivers page but wants the scan while it is open (the server list window of the settings, task 11.6) takes a lease. | |
| synchronized void | settingChanged () |
| The setting changed (or may have): look at it again. | |
| synchronized boolean | isRunning () |
| True while the scan runs. | |
Decides when mDNS discovery runs: only while at least one receivers page is visible and the setting SnapcastSettings#KEY_SUPPORT is on.
The setting is read each time (not once at start), so a change shows live: switching it on while a page is open starts the scan, switching it off stops it at once and tells the directory to drop the servers that only the scan knew. Pure; the scan and the directory are behind small interfaces.
Thread safe. The callbacks are called with the gate's lock held (they are quick: the scan hands its work to the platform), so a start and a stop can never be reordered. Nothing calls back into the gate from them.
| de.yaacc.multiroom.discovery.DiscoveryGate.DiscoveryGate | ( | BooleanSupplier | enabled, |
| Discovery | discovery, | ||
| Runnable | onDisabled ) |
| enabled | reads the setting; a failure counts as off |
| onDisabled | called once each time the setting is found off after it was on (and at the first look): the directory forgets what the scan found |
| synchronized Lease de.yaacc.multiroom.discovery.DiscoveryGate.pageLease | ( | ) |
A holder that is not a receivers page but wants the scan while it is open (the server list window of the settings, task 11.6) takes a lease.
Closing it ends that page once: a second close, or a close after the holder was destroyed and closed on another path, can not take the count of another page, so the count can not go below what the other pages hold and can not stay up either.
Referenced by de.yaacc.fcast.discovery.FCastHub.diagnosticsOpened(), and de.yaacc.snapcast.SnapcastHub.diagnosticsOpened().

