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

Who may play when several servers are connected to the phone: the rules of the specification, section "Multiple servers (server-initiated)". More...

Collaboration diagram for de.yaacc.sendspin.player.PlayerArbiter:
Collaboration graph

Classes

class  Conn
 A connection as the rules see it.
 
class  Verdict
 What the rules decide.
 

Public Member Functions

 PlayerArbiter (int cap)
 
Verdict decide (Conn activating, Set< String > declared, List< Conn > admitted, boolean provisional, String lastPlayback)
 

Static Public Attributes

static final String PLAYBACK = "playback"
 
static final String PAIRING = "pairing"
 

Detailed Description

Who may play when several servers are connected to the phone: the rules of the specification, section "Multiple servers (server-initiated)".

A connection is provisional until its first server/activate; every activation is arbitrated. An activation conflicts with an admitted connection that already holds an activity it declares (playback or pairing); at the cap of admitted connections, a provisional one conflicts with the admitted connections that have no activity (and is rejected if there is none). Ranks: playback above pairing above nothing. The activation wins against a connection when it ranks higher or equal; a connection with a pairing attempt in progress is never displaced; with nothing on both sides it wins only as the last-playback server. It is admitted if it wins against every conflict, and then displaces them.

One rule that is not in the specification (the owner's decision, 2026-11-25): an unpaired server can not displace a paired one on an equal rank (a server on the Wi-Fi that was never paired must not take the music from the server the user paired); it still wins against a paired connection that has a lower rank, and against any unpaired one. Pure.

Constructor & Destructor Documentation

◆ PlayerArbiter()

de.yaacc.sendspin.player.PlayerArbiter.PlayerArbiter ( int cap)
Parameters
caphow many connections the phone admits at once

Member Function Documentation

◆ decide()

Verdict de.yaacc.sendspin.player.PlayerArbiter.decide ( Conn activating,
Set< String > declared,
List< Conn > admitted,
boolean provisional,
String lastPlayback )
Parameters
activatingthe connection that activates
declaredthe activities its activation declares
admittedthe connections that are admitted now (the activating one is left out of the comparison if it is among them)
provisionaltrue if the activating connection is not admitted yet
lastPlaybackthe server_id of the last-playback server, or null

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