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

What yaacc knows about one device that speaks the protocol, for the receiver row: power, input, volume, group role and what plays. More...

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

Public Member Functions

YxcDeviceState unreachable ()
 The device did not answer; what it said before is dropped except the group, which is kept for the row.
 
YxcDeviceState withZone (YxcZoneStatus status)
 
YxcDeviceState withDistribution (YxcDistributionInfo info)
 
YxcDeviceState withPlayInfo (YxcPlayInfo info)
 
YxcDeviceState withTunerInfo (YxcTunerInfo info)
 
YxcDeviceState withEvent (YxcEvent event)
 Applies what an event says directly (power, volume, mute, input of the zone).
 
boolean isReachable ()
 
String getPower ()
 
boolean isPowerOn ()
 
String getInput ()
 
String getInputText ()
 
boolean isLinkInput ()
 
Integer getVolume ()
 
Integer getMaxVolume ()
 
Boolean getMute ()
 
boolean isStuckClient ()
 True for a device that left its group but still reports the client role: the group id is zeros and the input is the link input.
 
YxcDistributionInfo.Role getRole ()
 
String getGroupName ()
 
int getClientCount ()
 
String getGroupId ()
 
List< String > getClientAddresses ()
 
YxcPlayInfo getPlayInfo ()
 
YxcDeviceState withCapabilities (YxcSourceCapabilities caps)
 
YxcSourceCapabilities getCapabilities ()
 
YxcTunerInfo getTuner ()
 
String getPlayback ()
 
String getArtist ()
 
String getTrack ()
 
boolean sameForRow (YxcDeviceState other)
 Whether the receiver row would look the same: power, input, group, reachability and the now playing line.
 
boolean equals (Object o)
 
int hashCode ()
 
String toString ()
 Names and tracks are not part of the text, so a log line does not carry them.
 

Static Public Member Functions

static YxcDeviceState unknown ()
 Nothing known yet: not reachable, role unknown.
 

Static Public Attributes

static final String MAIN_ZONE = "main"
 The zone the row shows; further zones come with the settings screen.
 

Detailed Description

What yaacc knows about one device that speaks the protocol, for the receiver row: power, input, volume, group role and what plays.

Immutable; every with... method returns a new state, so a listener can compare two states with equals to see whether anything changed. Built from the answers of the device (withZone, withDistribution, withPlayInfo) and from events (withEvent).

Member Function Documentation

◆ getCapabilities()

YxcSourceCapabilities de.yaacc.yxc.YxcDeviceState.getCapabilities ( )
Returns
the bands and preset counts of the sources, null until the features were read

Referenced by de.yaacc.yxc.YxcSourceControls.available().

Here is the caller graph for this function:

◆ getClientAddresses()

List< String > de.yaacc.yxc.YxcDeviceState.getClientAddresses ( )
Returns
the addresses a server lists as its clients (empty for any other role: a client's own list says nothing useful, see docs/tech.md)

Referenced by de.yaacc.yxc.YxcGroupDirectory.clientsOf(), and de.yaacc.yxc.YxcDeviceState.sameForRow().

Here is the caller graph for this function:

◆ getClientCount()

int de.yaacc.yxc.YxcDeviceState.getClientCount ( )
Returns
the number of clients of a server, 0 for other roles

◆ getGroupId()

String de.yaacc.yxc.YxcDeviceState.getGroupId ( )
Returns
the id of the group the device is in, null when it is in none. Used to find the other members; it is not shown.

Referenced by de.yaacc.yxc.YxcGroupDirectory.clientsOf(), and de.yaacc.yxc.YxcGroupDirectory.serverOf().

Here is the caller graph for this function:

◆ getGroupName()

String de.yaacc.yxc.YxcDeviceState.getGroupName ( )
Returns
the name of the group the device is in, null when it is in none or the name is not known

◆ getInputText()

String de.yaacc.yxc.YxcDeviceState.getInputText ( )
Returns
the name the device gives the input, null when it did not (or the input changed by an event since)

◆ getPlayback()

String de.yaacc.yxc.YxcDeviceState.getPlayback ( )
Returns
play, pause, stop (the words of the device) or null
Here is the call graph for this function:

◆ getPlayInfo()

YxcPlayInfo de.yaacc.yxc.YxcDeviceState.getPlayInfo ( )
Returns
the play info of the network source, null if none was read

Referenced by de.yaacc.yxc.YxcSourceControls.available(), and de.yaacc.yxc.YxcNowPlaying.describe().

Here is the caller graph for this function:

◆ getPower()

String de.yaacc.yxc.YxcDeviceState.getPower ( )
Returns
on, standby (the words of the device) or null when unknown

◆ getTuner()

YxcTunerInfo de.yaacc.yxc.YxcDeviceState.getTuner ( )
Returns
the play info of the tuner, null if none was read (only read while the input is the tuner)

Referenced by de.yaacc.yxc.YxcSourceControls.available(), and de.yaacc.yxc.YxcNowPlaying.describe().

Here is the caller graph for this function:

◆ isStuckClient()

boolean de.yaacc.yxc.YxcDeviceState.isStuckClient ( )

True for a device that left its group but still reports the client role: the group id is zeros and the input is the link input.

It stays so until the input is set to something else (docs/tech.md), so it needs a "leave".

Referenced by de.yaacc.yxc.YxcLinkCandidates.actionsFor(), and de.yaacc.yxc.YxcLinkCandidates.forServer().

Here is the caller graph for this function:

◆ sameForRow()

boolean de.yaacc.yxc.YxcDeviceState.sameForRow ( YxcDeviceState other)

Whether the receiver row would look the same: power, input, group, reachability and the now playing line.

Volume and mute are kept in the state but not shown, and the play time is not part of the line, so a change of those alone does not need a redraw.

Referenced by de.yaacc.yxc.YxcMonitor.refreshGroupInfoNow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ withCapabilities()

YxcDeviceState de.yaacc.yxc.YxcDeviceState.withCapabilities ( YxcSourceCapabilities caps)
Parameters
capswhat the device says about its sources (read once), null to forget

Referenced by de.yaacc.yxc.YxcSourceActions.perform().

Here is the caller graph for this function:

◆ withEvent()

YxcDeviceState de.yaacc.yxc.YxcDeviceState.withEvent ( YxcEvent event)

Applies what an event says directly (power, volume, mute, input of the zone).

Flags that say "read again" are not applied here, see YxcEventPlan.

◆ withPlayInfo()

YxcDeviceState de.yaacc.yxc.YxcDeviceState.withPlayInfo ( YxcPlayInfo info)
Parameters
infothe play info, or null when the device has none (the row then shows no title)

Referenced by de.yaacc.yxc.YxcSourceActions.perform().

Here is the caller graph for this function:

◆ withTunerInfo()

YxcDeviceState de.yaacc.yxc.YxcDeviceState.withTunerInfo ( YxcTunerInfo info)
Parameters
infothe tuner play info, or null when the device has none or the input is not the tuner

Referenced by de.yaacc.yxc.YxcSourceActions.perform().

Here is the caller graph for this function:

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