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

Volume and mute of the devices that speak the protocol, through their own interface. More...

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

Classes

interface  ClientSource
 Where the clients of the devices come from; the monitor in the app. More...
 
interface  StateSource
 The last known state of a device, without any network access. More...
 

Public Member Functions

 YxcVolumeAccess (ClientSource clients, StateSource states, BooleanSupplier onMainThread, Executor writer)
 
boolean handles (String udn)
 
int readPercent (String udn)
 
Boolean readMute (String udn)
 
void setPercent (String udn, int percent)
 Sets the volume from a percentage; returns at once, the latest value of a device is the one that is sent.
 
void setMute (String udn, boolean muted)
 Sets the mute state; returns at once.
 

Static Public Member Functions

static synchronized YxcVolumeAccess getShared ()
 The access of the app, on the shared monitor.
 

Detailed Description

Volume and mute of the devices that speak the protocol, through their own interface.

The generic UPnP volume control of such a device does not change the volume while the device is in a group (measured by the owner), the device's own setVolume does, and it changes only that device. The row's slider is a percentage: it maps onto the device's own scale from 0 to its max_volume.

Reads block (they run on the reader threads of the rows). Writes return at once: the last value of a device wins while an earlier one is still on its way, so a drag on the slider does not queue up requests.

Constructor & Destructor Documentation

◆ YxcVolumeAccess()

de.yaacc.yxc.YxcVolumeAccess.YxcVolumeAccess ( ClientSource clients,
StateSource states,
BooleanSupplier onMainThread,
Executor writer )
Parameters
stateswhere the last known state comes from, used instead of a read on the main thread
onMainThreadwhether the calling thread is the main thread, where no network access is allowed (the media session asks the player for its volume there)

Referenced by de.yaacc.yxc.YxcVolumeAccess.getShared().

Here is the caller graph for this function:

Member Function Documentation

◆ handles()

boolean de.yaacc.yxc.YxcVolumeAccess.handles ( String udn)
Returns
whether the device speaks the protocol (so that the row uses this instead of the UPnP controls)

◆ readMute()

Boolean de.yaacc.yxc.YxcVolumeAccess.readMute ( String udn)
Returns
the mute state, null if it can not be read; on the main thread the last known state answers
Here is the call graph for this function:

◆ readPercent()

int de.yaacc.yxc.YxcVolumeAccess.readPercent ( String udn)
Returns
the volume as a percentage of the device's scale, -1 if it can not be read. On the main thread nothing is read from the network: the last known state answers.
Here is the call graph for this function:

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