|
YAACC - UPNP Client and Server
|
The volume of a group, which the server does not have: the average of the members' percentages. More...

Static Public Member Functions | |
| static Map< String, Integer > | levels (SnapcastGroup group) |
| The members that play now (connected ones), in the order of the group, by id. | |
| static int | average (Map< String, Integer > levels) |
| static Map< String, Integer > | apply (Map< String, Integer > start, int delta) |
Moves every member by delta points. | |
| static Map< String, Integer > | target (Map< String, Integer > start, int newAverage) |
| Sets the group to a new average: the members move by the difference between the new and the current average. | |
| static Map< String, Integer > | changes (Map< String, Integer > start, Map< String, Integer > current, int newAverage) |
| The members to set for a new group average, as a drag needs it: the targets are calculated from the levels at the start of the drag (so the steps do not add up and every member can return to its own level), and only the members whose target differs from their current level are returned. | |
The volume of a group, which the server does not have: the average of the members' percentages.
Setting a new group volume moves every member by the same number of points, so the members keep their relative levels. A member that would pass 0 or 100 stops there, and the points that did not fit are shared by the members that still have room (repeated until everything is placed or everyone is at the edge), so the average still reaches the wanted value where the scale allows. The mute flag is not part of the calculation: a muted member moves with the others and stays muted (the caller keeps its flag). Pure.
Style and idea as de.yaacc.yxc.YxcGroupVolume: compute from the levels at the start of a drag, not from the last step, and dragging back restores every member's own level.
|
static |
Moves every member by delta points.
| start | the levels when the move began |
| delta | the change in percentage points (negative: down) |
delta times the number of members, as far as the scale allows Referenced by de.yaacc.snapcast.control.GroupVolume.target().

|
static |
Referenced by de.yaacc.snapcast.feed.SnapcastFeedController.getVolume(), de.yaacc.snapcast.ui.SnapcastRowText.of(), and de.yaacc.snapcast.control.GroupVolume.target().


|
static |
The members to set for a new group average, as a drag needs it: the targets are calculated from the levels at the start of the drag (so the steps do not add up and every member can return to its own level), and only the members whose target differs from their current level are returned.
A member that is not in both maps (it left or joined meanwhile, or went offline) is not touched.
| start | the levels when the drag began, see levels |
| current | the levels now |
| newAverage | clamped into 0..100 |
start Referenced by de.yaacc.snapcast.control.SnapcastOperations.setGroupVolume().


|
static |
Sets the group to a new average: the members move by the difference between the new and the current average.
| newAverage | clamped into 0..100 |
Referenced by de.yaacc.snapcast.control.GroupVolume.changes().

