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

The YXC calls of one device (the HTTP/JSON control API of Yamaha MusicCast devices) as methods that return small immutable values. More...

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

Public Member Functions

 YxcClient (YxcTransport transport)
 
YxcDeviceInfo getDeviceInfo () throws YxcException
 
YxcFeatures getFeatures () throws YxcException
 
YxcFuncStatus getFuncStatus () throws YxcException
 
YxcZoneStatus getZoneStatus (String zone) throws YxcException
 
YxcDistributionInfo getDistributionInfo () throws YxcException
 
YxcNameText getNameText () throws YxcException
 The names of zones, inputs and sound programs as the owner set them.
 
YxcPlayInfo getPlayInfo () throws YxcException
 
YxcTunerInfo getTunerPlayInfo () throws YxcException
 What the tuner plays; only meaningful while the zone input is the tuner.
 
void setPower (String zone, boolean on) throws YxcException
 
void setVolume (String zone, int volume) throws YxcException
 Sets the volume of a zone to a value of the device's own scale (0 to the max_volume of the status).
 
void setMute (String zone, boolean muted) throws YxcException
 
void setSoundProgram (String zone, String program) throws YxcException
 
void setSleep (String zone, int minutes) throws YxcException
 
void setEqualizerMode (String zone, String mode) throws YxcException
 
void setEqualizerBand (String zone, String band, int value) throws YxcException
 Sets one band of the equalizer.
 
void setLinkControl (String zone, String control) throws YxcException
 
void setLinkAudioDelay (String zone, String delay) throws YxcException
 
void setLinkAudioQuality (String zone, String mode) throws YxcException
 
void setInput (String zone, String inputId, String mode) throws YxcException
 
void setDimmer (int value) throws YxcException
 
void setAutoPowerStandby (boolean enabled) throws YxcException
 
void setPlayback (String playback) throws YxcException
 
void setRepeat (String mode) throws YxcException
 
void setShuffle (String mode) throws YxcException
 
void seekFm (boolean up) throws YxcException
 Starts the FM seek: the tuner scans up or down by itself until it finds a station (play info auto_scan).
 
void stepFm (boolean up) throws YxcException
 Steps the FM frequency by one step (50 kHz on the measured device); the tuner also switches to FM if it was on DAB.
 
void cancelFmScan () throws YxcException
 Stops an FM scan that is running; the tuner stays on the station it reached.
 
void setTunerBand (String band) throws YxcException
 
void stepDabService (boolean next) throws YxcException
 Switches the DAB tuner to the next or previous service.
 
List< YxcPresets.Entry > getNetPresets () throws YxcException
 The presets of the network source; the position in the list is the preset number.
 
List< YxcPresets.Entry > getRecentItems () throws YxcException
 The recently played radio stations and streaming entries (the tracks of UPnP servers are left out).
 
List< YxcPresets.Entry > getTunerPresets (String band) throws YxcException
 
void recallNetPreset (int number) throws YxcException
 
void recallRecentItem (int number) throws YxcException
 
void recallTunerPreset (String band, int number) throws YxcException
 
void setServerInfo (String groupId, String zone, YxcClientListAction action, List< String > clientIps) throws YxcException
 Makes the zone of this device the server of a group, or adds / removes clients of the group it serves.
 
void clearServerInfo () throws YxcException
 Ends the server role of this device; its group id returns to zeros.
 
void setClientInfo (String groupId, String zone, String serverIp) throws YxcException
 Makes a zone of this device a client of the group of a server.
 
void clearClientInfo () throws YxcException
 Ends the client role of this device; its group id returns to zeros.
 
void startDistribution (int num) throws YxcException
 
void stopDistribution () throws YxcException
 
void setGroupName (String name) throws YxcException
 

Static Public Attributes

static final int MAX_CLIENT_ADDRESSES = 64
 A sanity bound on the client addresses of one setServerInfo call, so that a request stays small.
 

Detailed Description

The YXC calls of one device (the HTTP/JSON control API of Yamaha MusicCast devices) as methods that return small immutable values.

Unlike the open-source libraries it checks every answer: an HTTP status outside 200..299 or a response_code other than 0 is a YxcException. Thread-safe if the transport is.

Member Function Documentation

◆ getTunerPresets()

List< YxcPresets.Entry > de.yaacc.yxc.YxcClient.getTunerPresets ( String band) throws YxcException
Parameters
bandfm or dab

Referenced by de.yaacc.yxc.YxcPresetActions.load(), and de.yaacc.yxc.YxcPresetActions.recall().

Here is the caller graph for this function:

◆ getZoneStatus()

YxcZoneStatus de.yaacc.yxc.YxcClient.getZoneStatus ( String zone) throws YxcException
Parameters
zonemain, zone2, zone3 or zone4

Referenced by de.yaacc.yxc.YxcSourceActions.perform(), de.yaacc.yxc.YxcVolumeAccess.readMute(), de.yaacc.yxc.YxcVolumeAccess.readPercent(), and de.yaacc.yxc.YxcPresetActions.recall().

Here is the caller graph for this function:

◆ recallNetPreset()

void de.yaacc.yxc.YxcClient.recallNetPreset ( int number) throws YxcException
Parameters
numberthe position in the list of getNetPresets() (1 to 100)

Referenced by de.yaacc.yxc.YxcPresetActions.recall().

Here is the caller graph for this function:

◆ recallRecentItem()

void de.yaacc.yxc.YxcClient.recallRecentItem ( int number) throws YxcException
Parameters
numberthe position in the list of getRecentItems() as the device lists it (1 to 100)

Referenced by de.yaacc.yxc.YxcPresetActions.recall().

Here is the caller graph for this function:

◆ recallTunerPreset()

void de.yaacc.yxc.YxcClient.recallTunerPreset ( String band,
int number ) throws YxcException
Parameters
bandfm or dab; the tuner switches to that band

Referenced by de.yaacc.yxc.YxcPresetActions.recall().

Here is the caller graph for this function:

◆ setClientInfo()

void de.yaacc.yxc.YxcClient.setClientInfo ( String groupId,
String zone,
String serverIp ) throws YxcException

Makes a zone of this device a client of the group of a server.

The zone goes as a list, the server as a string. The device refuses this while it is a server itself.

◆ setDimmer()

void de.yaacc.yxc.YxcClient.setDimmer ( int value) throws YxcException
Parameters
valuethe display brightness, inside the dimmer range of the system features (-1 is automatic where listed)

Referenced by de.yaacc.yxc.YxcSettingsWriter.setDimmer().

Here is the caller graph for this function:

◆ setEqualizerBand()

void de.yaacc.yxc.YxcClient.setEqualizerBand ( String zone,
String band,
int value ) throws YxcException

Sets one band of the equalizer.

Parameters
bandlow, mid or high

Referenced by de.yaacc.yxc.YxcSettingsWriter.setEqualizerBand().

Here is the caller graph for this function:

◆ setEqualizerMode()

void de.yaacc.yxc.YxcClient.setEqualizerMode ( String zone,
String mode ) throws YxcException
Parameters
modean id from the zone's equalizer_mode_list

◆ setGroupName()

void de.yaacc.yxc.YxcClient.setGroupName ( String name) throws YxcException
Parameters
nameUTF-8, at most 128 bytes; empty selects the default name

Referenced by de.yaacc.yxc.YxcGroupService.rename().

Here is the caller graph for this function:

◆ setInput()

void de.yaacc.yxc.YxcClient.setInput ( String zone,
String inputId,
String mode ) throws YxcException
Parameters
modethe mode word, empty for none (the open-source clients send the parameter empty)

Referenced by de.yaacc.yxc.YxcPresetActions.recall(), and de.yaacc.yxc.YxcSettingsWriter.setInput().

Here is the caller graph for this function:

◆ setLinkAudioDelay()

void de.yaacc.yxc.YxcClient.setLinkAudioDelay ( String zone,
String delay ) throws YxcException
Parameters
delayan id from the zone's link_audio_delay_list

◆ setLinkAudioQuality()

void de.yaacc.yxc.YxcClient.setLinkAudioQuality ( String zone,
String mode ) throws YxcException
Parameters
modean id from the zone's link_audio_quality_list

◆ setLinkControl()

void de.yaacc.yxc.YxcClient.setLinkControl ( String zone,
String control ) throws YxcException
Parameters
controlan id from the zone's link_control_list

◆ setPlayback()

void de.yaacc.yxc.YxcClient.setPlayback ( String playback) throws YxcException
Parameters
playbackplay, pause, stop, previous or next

◆ setRepeat()

void de.yaacc.yxc.YxcClient.setRepeat ( String mode) throws YxcException
Parameters
modea value of the play info's repeat_available: off, one or all

◆ setServerInfo()

void de.yaacc.yxc.YxcClient.setServerInfo ( String groupId,
String zone,
YxcClientListAction action,
List< String > clientIps ) throws YxcException

Makes the zone of this device the server of a group, or adds / removes clients of the group it serves.

Parameters
groupId32 hex digits
zonethe zone that serves the group
clientIpsone to MAX_CLIENT_ADDRESSES addresses of the other devices

◆ setShuffle()

void de.yaacc.yxc.YxcClient.setShuffle ( String mode) throws YxcException
Parameters
modea value of the play info's shuffle_available: off or on

◆ setSleep()

void de.yaacc.yxc.YxcClient.setSleep ( String zone,
int minutes ) throws YxcException
Parameters
minutes0 (off), 30, 60, 90 or 120

Referenced by de.yaacc.yxc.YxcSettingsWriter.setSleep().

Here is the caller graph for this function:

◆ setSoundProgram()

void de.yaacc.yxc.YxcClient.setSoundProgram ( String zone,
String program ) throws YxcException
Parameters
programan id from the zone's sound_program_list

◆ setTunerBand()

void de.yaacc.yxc.YxcClient.setTunerBand ( String band) throws YxcException
Parameters
bandfm or dab: the tuner changes its band (the zone input stays the tuner)

◆ setVolume()

void de.yaacc.yxc.YxcClient.setVolume ( String zone,
int volume ) throws YxcException

Sets the volume of a zone to a value of the device's own scale (0 to the max_volume of the status).

The devices of a group keep their own volumes, so this changes only this device.

◆ startDistribution()

void de.yaacc.yxc.YxcClient.startDistribution ( int num) throws YxcException
Parameters
numthe distribution number (what the device does with it is not known; see docs/tech.md)

Member Data Documentation

◆ MAX_CLIENT_ADDRESSES

final int de.yaacc.yxc.YxcClient.MAX_CLIENT_ADDRESSES = 64
static

A sanity bound on the client addresses of one setServerInfo call, so that a request stays small.

The limit of a device is distribution.client_max of its features (9 or 19 on devices seen); the group service checks it.


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