YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.upnp.server.renderingcontrol.SystemVolume Class Reference

The volume and the mute state of the music stream of the device: the one value the app's own volume controls (UpnpClient.setVolume/setMute), the renderer's RenderingControl service (SetVolume, SetMute, GetVolume, GetMute) and the hardware volume keys share. More...

Collaboration diagram for de.yaacc.upnp.server.renderingcontrol.SystemVolume:
Collaboration graph

Public Member Functions

 SystemVolume (Context context)
 
boolean isMuted ()
 
int getPercent ()
 
void setMuted (boolean mute)
 
void setPercent (int desired)
 

Static Public Member Functions

static void addChangeListener (Runnable listener)
 
static void removeChangeListener (Runnable listener)
 

Detailed Description

The volume and the mute state of the music stream of the device: the one value the app's own volume controls (UpnpClient.setVolume/setMute), the renderer's RenderingControl service (SetVolume, SetMute, GetVolume, GetMute) and the hardware volume keys share.

The volume is 0 to 100 (percent of the stream's range, rounded to the nearest step the stream has).

A change made through this class is told to the in-process listeners (addChangeListener), so a control point that is subscribed to the renderer hears about a change made in the app without waiting for the system's volume broadcast. Changes made elsewhere (hardware keys, the system's panel) are not seen here; SystemVolumeBroadcastWatcher catches those.

Member Function Documentation

◆ addChangeListener()

static void de.yaacc.upnp.server.renderingcontrol.SystemVolume.addChangeListener ( Runnable listener)
static
Parameters
listenercalled (on the thread that made the change) after a volume or mute change through setPercent or setMuted of any instance

◆ getPercent()

int de.yaacc.upnp.server.renderingcontrol.SystemVolume.getPercent ( )
Returns
the volume in the range of 0-100; 0 when the device has no audio manager

Referenced by de.yaacc.upnp.UpnpClient.getVolume().

Here is the caller graph for this function:

◆ isMuted()

boolean de.yaacc.upnp.server.renderingcontrol.SystemVolume.isMuted ( )
Returns
true if the music stream is muted; false when the device has no audio manager

Referenced by de.yaacc.upnp.UpnpClient.isMute().

Here is the caller graph for this function:

◆ setPercent()

void de.yaacc.upnp.server.renderingcontrol.SystemVolume.setPercent ( int desired)
Parameters
desiredthe volume in the range of 0-100, values outside of it are cut to it

Referenced by de.yaacc.upnp.UpnpClient.setVolume().

Here is the caller graph for this function:

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