|
YAACC - UPNP Client and Server
|
The volume of the YAACC renderer follows its output (task 9.1), decided at every call from the setting: More...


Classes | |
| interface | GroupSide |
| The group of a server: its facts (and wake), its level from the model, and the sends. More... | |
| class | Level |
| The volume and the mute flag of the group as of the model. | |
Public Member Functions | |
| OutputRoutedVolume (Supplier< Setting > settings, RendererVolume local, GroupSide group, Executor sender, SnapcastRendererOutput.Waiter waiter, MonotonicClock clock, Consumer< Problem > problems) | |
| int | getPercent () |
| boolean | isMuted () |
| int | peekPercent () |
As getPercent(), for the check that reports a change to the controllers (the RenderingControl event): it reads and never wakes a connection. | |
| boolean | peekMuted () |
As isMuted(), without waking anything; see peekPercent(). | |
| void | wakeNow () |
| A control point subscribed to the renderer's events (or the output was switched to a group while one is subscribed): wake the connection to the server of the group once, now, so that the state it is told is the group's. | |
| void | setPercent (int desired) |
| void | setMuted (boolean mute) |
Public Member Functions inherited from de.yaacc.upnp.server.renderingcontrol.RendererVolume | |
Static Public Attributes | |
| static final long | WAKE_INTERVAL_MILLIS = 20_000L |
| How often a read may wake the connection to the server. | |
The volume of the YAACC renderer follows its output (task 9.1), decided at every call from the setting:
No feedback. The path is one way. A set goes to the server; a change that the server reports updates the model, and whoever reports the state to the controllers (the RenderingControl event check, the OpenHome poll) only reads here. Nothing in the read path sets anything, so a volume change by the server can not cause another set.
The controller's own reads in group mode (getPercent, isMuted: Get calls, the OpenHome renderer's poll) wake the connection to the server of the group, at most once in WAKE_INTERVAL_MILLIS (the connection closes by itself after a grace period when nobody asks), and so does wakeNow for a new subscriber: a controller that asks for the volume sees the group's value without a play. The reads of the change check (peekPercent, peekMuted) never wake: the idle close of the link is itself a change event, and a wake from its check would open the link again every grace period for as long as a controller is subscribed. The last known level is kept for the group it belongs to and forgotten when another group is chosen. Pure Java; the group side, the sender, the clock and the problem report are the app's.
| de.yaacc.upnp.server.renderingcontrol.OutputRoutedVolume.OutputRoutedVolume | ( | Supplier< Setting > | settings, |
| RendererVolume | local, | ||
| GroupSide | group, | ||
| Executor | sender, | ||
| SnapcastRendererOutput.Waiter | waiter, | ||
| MonotonicClock | clock, | ||
| Consumer< Problem > | problems ) |
| settings | the setting as it is now (read at every call) |
| local | the system volume |
| sender | runs the sets, one at a time and in order (one daemon thread) |
| problems | told (on the sender thread) why a set was not sent; the app shows a toast |
| int de.yaacc.upnp.server.renderingcontrol.OutputRoutedVolume.getPercent | ( | ) |
Implements de.yaacc.upnp.server.renderingcontrol.RendererVolume.
| boolean de.yaacc.upnp.server.renderingcontrol.OutputRoutedVolume.isMuted | ( | ) |
| boolean de.yaacc.upnp.server.renderingcontrol.OutputRoutedVolume.peekMuted | ( | ) |
As isMuted(), without waking anything; see peekPercent().
Implements de.yaacc.upnp.server.renderingcontrol.RendererVolume.
| int de.yaacc.upnp.server.renderingcontrol.OutputRoutedVolume.peekPercent | ( | ) |
As getPercent(), for the check that reports a change to the controllers (the RenderingControl event): it reads and never wakes a connection.
A read that a change event made must not cause the next change event.
Implements de.yaacc.upnp.server.renderingcontrol.RendererVolume.
| void de.yaacc.upnp.server.renderingcontrol.OutputRoutedVolume.setMuted | ( | boolean | mute | ) |
| void de.yaacc.upnp.server.renderingcontrol.OutputRoutedVolume.setPercent | ( | int | desired | ) |
| desired | 0 to 100, other values are cut to it |
Implements de.yaacc.upnp.server.renderingcontrol.RendererVolume.

| void de.yaacc.upnp.server.renderingcontrol.OutputRoutedVolume.wakeNow | ( | ) |
A control point subscribed to the renderer's events (or the output was switched to a group while one is subscribed): wake the connection to the server of the group once, now, so that the state it is told is the group's.
Only this and the controller's own reads (getPercent, isMuted) wake; the check that a change event triggers (peekPercent) never does, or the idle close of the link would bring it back every 30 seconds.
Implements de.yaacc.upnp.server.renderingcontrol.RendererVolume.