YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.openhome.OhRemote Class Reference

Controls the playlist of an OpenHome device: the device owns the queue, this class reads it, edits it and starts the playback. More...

Collaboration diagram for de.yaacc.openhome.OhRemote:
Collaboration graph

Classes

interface  Sleeper
 Waits; replaced in tests. More...
 
class  State
 What the device says it is doing.
 
class  Track
 A track to put into the queue.
 

Public Member Functions

 OhRemote (OhControl control)
 
 OhRemote (OhControl control, Sleeper sleeper)
 
void prepare () throws OhControlException
 Wakes the device from standby and switches it to its playlist source.
 
List< OhSources.Source > sources () throws OhControlException
 
boolean standby () throws OhControlException
 
void setStandby (boolean standby) throws OhControlException
 Puts the device into standby or wakes it (without waiting for it, see selectSource for that).
 
int currentSourceIndex () throws OhControlException
 
void selectSource (int index) throws OhControlException
 Switches the device to the source (a device in standby is woken up first).
 
int tracksMax () throws OhControlException
 
List< Long > idArray () throws OhControlException
 
List< OhQueue.Entry > queue () throws OhControlException
 The tracks of the queue; only the ones not seen before are read from the device.
 
long insert (long afterId, Track track) throws OhControlException
 
List< Long > append (List< Track > tracks) throws OhControlException
 Puts the tracks at the end of the queue, one after the other.
 
List< Long > replace (List< Track > tracks) throws OhControlException
 Empties the queue and puts the tracks in, at most MAX_TRACKS of them.
 
long moveTrack (long id, long afterId) throws OhControlException
 Puts a track at another place of the queue: behind the track afterId (0 for the start).
 
void deleteId (long id) throws OhControlException
 
void deleteAll () throws OhControlException
 
void play () throws OhControlException
 
void pause () throws OhControlException
 
void stop () throws OhControlException
 
void next () throws OhControlException
 
void previous () throws OhControlException
 
void seekId (long id) throws OhControlException
 
void seekIndex (long index) throws OhControlException
 
void seekSecondAbsolute (long second) throws OhControlException
 
void setRepeat (boolean repeat) throws OhControlException
 
void setShuffle (boolean shuffle) throws OhControlException
 
int volumePercent () throws OhControlException
 
boolean muted () throws OhControlException
 
void setVolumePercent (int percent) throws OhControlException
 
void setMute (boolean mute) throws OhControlException
 
State readBrief () throws OhControlException
 Reads what the device does.
 
State readState () throws OhControlException
 

Static Public Attributes

static final int MAX_TRACKS = OhQueue.DEFAULT_TRACKS_MAX
 The most tracks of a device's queue the app takes in.
 

Detailed Description

Controls the playlist of an OpenHome device: the device owns the queue, this class reads it, edits it and starts the playback.

Written against OhControl, so it knows nothing about Cling or Android. Not thread safe: use it from one thread.

Member Function Documentation

◆ append()

List< Long > de.yaacc.openhome.OhRemote.append ( List< Track > tracks) throws OhControlException

Puts the tracks at the end of the queue, one after the other.

The queue holds at most MAX_TRACKS tracks: what does not fit is left out (as is everything after a track the device refuses because it is full).

Returns
the ids of the tracks that were put in

Referenced by de.yaacc.player.OpenHomePlayer.addItems().

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

◆ currentSourceIndex()

int de.yaacc.openhome.OhRemote.currentSourceIndex ( ) throws OhControlException
Returns
the index of the source the device is on, -1 if it does not say

◆ idArray()

List< Long > de.yaacc.openhome.OhRemote.idArray ( ) throws OhControlException
Returns
the ids of the queue in play order; a device with more tracks than the apps takes in is cut off

Referenced by de.yaacc.openhome.OhRemote.append(), and de.yaacc.openhome.OhRemote.queue().

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

◆ insert()

long de.yaacc.openhome.OhRemote.insert ( long afterId,
Track track ) throws OhControlException
Returns
the id of the new track

Referenced by de.yaacc.openhome.OhRemote.moveTrack().

Here is the caller graph for this function:

◆ moveTrack()

long de.yaacc.openhome.OhRemote.moveTrack ( long id,
long afterId ) throws OhControlException

Puts a track at another place of the queue: behind the track afterId (0 for the start).

A device with Playlist version 2 has an action for it; with version 1 the track is inserted at the new place and the old entry is deleted, which gives it a new id (a track that plays is better left alone then).

Returns
the id of the track after the move

Referenced by de.yaacc.player.OpenHomePlayer.moveInPlayOrder().

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

◆ muted()

boolean de.yaacc.openhome.OhRemote.muted ( ) throws OhControlException
Returns
true if the device is muted

◆ prepare()

void de.yaacc.openhome.OhRemote.prepare ( ) throws OhControlException

Wakes the device from standby and switches it to its playlist source.

Waits (a few seconds) for a device that wakes slowly.

Exceptions
OhControlExceptionwhen the device has no playlist source or does not answer
Here is the call graph for this function:

◆ readBrief()

State de.yaacc.openhome.OhRemote.readBrief ( ) throws OhControlException

Reads what the device does.

A service the device does not answer leaves its part of the state as it was empty. The transport state and the current track only (two calls): for a status line of a device that this app does not control. volume, seconds and the like stay at their defaults.

Here is the call graph for this function:

◆ replace()

List< Long > de.yaacc.openhome.OhRemote.replace ( List< Track > tracks) throws OhControlException

Empties the queue and puts the tracks in, at most MAX_TRACKS of them.

Returns
their ids

Referenced by de.yaacc.player.OpenHomePlayer.setItems().

Here is the caller graph for this function:

◆ sources()

List< OhSources.Source > de.yaacc.openhome.OhRemote.sources ( ) throws OhControlException
Returns
the sources of the device in the order of its list (the position is the index to select it with)
Here is the call graph for this function:

◆ standby()

boolean de.yaacc.openhome.OhRemote.standby ( ) throws OhControlException
Returns
true if the device is in standby (a device that does not say is taken as awake)

Referenced by de.yaacc.openhome.OhRemote.setStandby().

Here is the caller graph for this function:

◆ volumePercent()

int de.yaacc.openhome.OhRemote.volumePercent ( ) throws OhControlException
Returns
the volume of the device in percent
Here is the call graph for this function:

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