YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.yxc.YxcGroupVolume Class Reference

The group volume of a server and its clients. More...

Collaboration diagram for de.yaacc.yxc.YxcGroupVolume:
Collaboration graph

Classes

interface  Reader
 Reads the volume of one device in percent of its scale; -1 when it can not be read. More...
 

Static Public Member Functions

static Map< String, Integer > levels (Collection< YxcDeviceSnapshot > members)
 
static Map< String, Integer > readLevels (Collection< String > udns, Reader reader, ExecutorService executor, long timeoutMillis)
 Reads the members' volumes in parallel, so a member that does not answer holds nobody else up; a member that is not answered within the time is left out.
 
static int average (Map< String, Integer > levels)
 
static Map< String, Integer > apply (Map< String, Integer > start, int delta)
 

Detailed Description

The group volume of a server and its clients.

The devices do not pass the volume on by themselves (measured on real devices), so the app does: the slider shows the average of the members' volumes (in percent of each device's own scale), and while it is dragged every member is moved by the same number of percentage points from where it was when the drag began, clamped to 0..100 for each device. Moving from the start values (not from the last step) means dragging back restores every member's own level, also after a member was clamped. Pure.

Member Function Documentation

◆ apply()

static Map< String, Integer > de.yaacc.yxc.YxcGroupVolume.apply ( Map< String, Integer > start,
int delta )
static
Parameters
startthe levels when the drag began
deltahow far the slider moved from its start position, in percentage points (negative: down)
Returns
the level for each member, every one clamped to 0..100

◆ average()

static int de.yaacc.yxc.YxcGroupVolume.average ( Map< String, Integer > levels)
static
Returns
the average in percent, rounded; -1 when there are no levels
Here is the call graph for this function:

◆ levels()

static Map< String, Integer > de.yaacc.yxc.YxcGroupVolume.levels ( Collection< YxcDeviceSnapshot > members)
static
Returns
the volume of each member in percent of its own scale, in the order given; members that report no volume (not read yet, unreachable) are left out

Referenced by de.yaacc.yxc.YxcGroupVolume.average().

Here is the caller graph for this function:

◆ readLevels()

static Map< String, Integer > de.yaacc.yxc.YxcGroupVolume.readLevels ( Collection< String > udns,
Reader reader,
ExecutorService executor,
long timeoutMillis )
static

Reads the members' volumes in parallel, so a member that does not answer holds nobody else up; a member that is not answered within the time is left out.

The values come from the devices themselves (never from stored events).


The documentation for this class was generated from the following file: