YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.sendspin.control.ControllerHost Class Reference

The controller role of the server on the wire (issue #325, K15, spec controller-server.md): the sessions of the controllers that are connected, the state they are told when the app's playback changes and the commands they send. More...

Inheritance diagram for de.yaacc.sendspin.control.ControllerHost:
Inheritance graph
Collaboration diagram for de.yaacc.sendspin.control.ControllerHost:
Collaboration graph

Classes

class  Session
 One controller: its roles, the group it is on and what it was last told. More...
 

Public Member Functions

 ControllerHost (ControllerLogic logic, HubClock clock, BooleanSupplier unpairedAllowed, int maxSessions)
 
 ControllerHost (ControllerLogic logic, HubClock clock, BooleanSupplier unpairedAllowed, int maxSessions, ArtworkEncoder encoder)
 
boolean unpairedAllowed ()
 Whether a controller that is not paired may be served.
 
synchronized Session open (SecureChannel channel, SendspinMessages.ClientHello hello)
 
synchronized Session openDisplay (SecureChannel channel, SendspinMessages.ClientHello hello, java.util.function.Supplier< String > groupId)
 The display roles of a client that is a player too (metadata, artwork and colour, as far as it lists them): what its own group plays, told on the connection that the hub has with it.
 
boolean hasColorSessions ()
 True while a session with the colour role is open: the hub analyses the audio for the colours only then.
 
void refreshAll ()
 The app's playback changed: every controller is told what differs.
 
synchronized void close ()
 

Detailed Description

The controller role of the server on the wire (issue #325, K15, spec controller-server.md): the sessions of the controllers that are connected, the state they are told when the app's playback changes and the commands they send.

What a controller sees and what its commands do is ControllerLogic; the handshake, the pairing and the activation are the connection's (HubConnection). A change that the app does not announce is found by a poll every two seconds, but only while a controller is connected.

Constructor & Destructor Documentation

◆ ControllerHost() [1/2]

de.yaacc.sendspin.control.ControllerHost.ControllerHost ( ControllerLogic logic,
HubClock clock,
BooleanSupplier unpairedAllowed,
int maxSessions )
Parameters
unpairedAllowedthe setting that lets a device that is not paired use the phone (read at each connection)
maxSessionshow many controllers at most are served at once

◆ ControllerHost() [2/2]

de.yaacc.sendspin.control.ControllerHost.ControllerHost ( ControllerLogic logic,
HubClock clock,
BooleanSupplier unpairedAllowed,
int maxSessions,
ArtworkEncoder encoder )
Parameters
encodermakes the images of the artwork role; null: the role is not offered

Member Function Documentation

◆ open()

synchronized Session de.yaacc.sendspin.control.ControllerHost.open ( SecureChannel channel,
SendspinMessages.ClientHello hello )
Returns
the session of a controller with these roles, or null if there is no room or the host is closed

◆ openDisplay()

synchronized Session de.yaacc.sendspin.control.ControllerHost.openDisplay ( SecureChannel channel,
SendspinMessages.ClientHello hello,
java.util.function.Supplier< String > groupId )

The display roles of a client that is a player too (metadata, artwork and colour, as far as it lists them): what its own group plays, told on the connection that the hub has with it.

The player role and the group of the player are the connection's: this session sends no group/update and offers no commands.

Parameters
groupIdthe protocol id of the group of the player now (it changes when the player is linked or unlinked)
Returns
the session, or null if there is no room, the host is closed or the client lists none of the roles

◆ refreshAll()

void de.yaacc.sendspin.control.ControllerHost.refreshAll ( )

The app's playback changed: every controller is told what differs.

Safe to call from any thread (not blocking the caller).

Here is the call graph for this function:

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