YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.snapcast.client.SnapcastClient Class Reference

The settings and the input of the client (a listen test of the phone as a Snapcast client). More...

Collaboration diagram for de.yaacc.snapcast.client.SnapcastClient:
Collaboration graph

Classes

enum  Locality
 Where the typed server is, as far as the text tells. More...
 
enum  Outcome
 What the input of the dialog turned out to be. More...
 
class  Request
 The checked input.
 

Static Public Member Functions

static Request check (String hostText, String latencyText)
 
static Integer parseWriteAhead (String text)
 
static ClientEngineConfig engineConfig (int writeAheadMs, boolean flacGuard)
 The configuration of the engine for a session of the test screen (the write-ahead is clamped, the guard as chosen).
 
static int clampWriteAhead (int value)
 
static Integer parseLatency (String text)
 
static boolean isEnabled (de.yaacc.snapcast.SnapcastSettings.BooleanSource source)
 
static boolean isSwitchedOn (de.yaacc.snapcast.SnapcastSettings.BooleanSource source)
 
static Locality localityOf (ServerEndpoint endpoint)
 
static String helloHostName (ServerEndpoint endpoint, String phoneName)
 The host name for the Hello: the name of the phone for a local server, a generic one for a public address.
 
static String helloHostName (java.net.InetAddress resolved, String phoneName)
 The host name for the Hello decided from the address the connection really uses (the result of the name lookup), not from the text that was typed: a dynamic DNS name or a form like 0x08.0x08.0x08.0x08 is a "name" for the parser and a public address for the platform (review S18 of Group 8).
 

Static Public Attributes

static final String KEY_ENABLED = "settings_snapcast_client"
 The key of the switch in the default preferences (also the name of its string resource).
 
static final boolean ENABLED_DEFAULT = false
 
static final String KEY_LAST_HOST = "snapcast_client_host"
 Remembered between uses; plain text on the phone like the server list.
 
static final String KEY_LAST_SERVER = "snapcast_client_last_server"
 The server the phone's client uses: the one it was last connected to, written when a session first reaches the connected state, when the user chooses a server on the card of the client, and when the listen test starts with a typed address.
 
static final String KEY_LAST_LATENCY = "snapcast_client_latency_ms"
 
static final String KEY_SECRET = "snapcast_client_secret"
 The per-installation secret of the Hello id, see SnapcastClientIdentity.
 
static final String KEY_LAST_ENDING = "snapcast_client_last_ending"
 Why and when the last session ended (written by the service, also when the whole app exits); read by the dialog.
 
static final String KEY_LAST_ENDING_AT = "snapcast_client_last_ending_at"
 
static final String KEY_LAST_ENDING_SEEN = "snapcast_client_last_ending_seen"
 Whether the user has seen the last ending (a boolean, true when missing).
 
static final String KEY_SWITCHED_ON = "settings_snapcast_client_switched_on"
 The one persisted state "the Snapcast client is switched on" (task 12C): set by the switch on the first page, the checkbox of the settings and the Start/Stop of the listen test, read by the restore at the start of the app.
 
static final boolean SWITCHED_ON_DEFAULT = false
 
static final String KEY_LAST_WRITE_AHEAD = "snapcast_client_write_ahead_ms"
 
static final String KEY_LAST_FLAC_GUARD = "snapcast_client_flac_guard"
 The "FLAC stall guard" check box of the test screen (default on).
 
static final int MIN_WRITE_AHEAD_MS = 40
 How far ahead of the playback position the output is kept filled (the deep-buffer output of a phone needs more than its 128 ms queued: 250 by default).
 
static final int MAX_WRITE_AHEAD_MS = 350
 
static final int DEFAULT_WRITE_AHEAD_MS = 250
 
static final int MIN_LATENCY_MS = -2000
 
static final int MAX_LATENCY_MS = 2000
 

Detailed Description

The settings and the input of the client (a listen test of the phone as a Snapcast client).

The option is off by default; with it off nothing of the client is reachable from the UI. Pure.

Member Function Documentation

◆ check()

static Request de.yaacc.snapcast.client.SnapcastClient.check ( String hostText,
String latencyText )
static
Parameters
hostTexthost[:port], strictly checked by ServerEndpoint#parse(String, int); no scheme, path or credentials
latencyTextwhole milliseconds, may be empty (0) or have a sign; a number outside the range is clamped

Referenced by de.yaacc.snapcast.client.SnapcastClientPower.chooseServer(), and de.yaacc.snapcast.client.SnapcastClientPower.offered().

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

◆ isEnabled()

static boolean de.yaacc.snapcast.client.SnapcastClient.isEnabled ( de.yaacc.snapcast.SnapcastSettings.BooleanSource source)
static
Returns
whether the option is on; off for no source, a missing value or a value that can not be read

◆ isSwitchedOn()

static boolean de.yaacc.snapcast.client.SnapcastClient.isSwitchedOn ( de.yaacc.snapcast.SnapcastSettings.BooleanSource source)
static
Returns
whether the client is switched on (the state that is restored); off for no source, a missing value or a value that can not be read

◆ parseLatency()

static Integer de.yaacc.snapcast.client.SnapcastClient.parseLatency ( String text)
static
Returns
the latency clamped to the range; 0 for empty text; null for text that is no whole number

Referenced by de.yaacc.snapcast.client.SnapcastClient.check().

Here is the caller graph for this function:

◆ parseWriteAhead()

static Integer de.yaacc.snapcast.client.SnapcastClient.parseWriteAhead ( String text)
static
Returns
the write-ahead clamped to 40..350; the default for empty text; null for text that is no whole number

Member Data Documentation

◆ KEY_LAST_ENDING_SEEN

final String de.yaacc.snapcast.client.SnapcastClient.KEY_LAST_ENDING_SEEN = "snapcast_client_last_ending_seen"
static

Whether the user has seen the last ending (a boolean, true when missing).

The service writes false with every ending; the switch, the checkbox or the dialog write true when they show it. An ending that is a failure and unseen keeps the restore at the start of the app from trying again blindly (SnapcastClientRestore).

◆ KEY_LAST_SERVER

final String de.yaacc.snapcast.client.SnapcastClient.KEY_LAST_SERVER = "snapcast_client_last_server"
static

The server the phone's client uses: the one it was last connected to, written when a session first reaches the connected state, when the user chooses a server on the card of the client, and when the listen test starts with a typed address.

Plain text on the phone like the server list; read through SnapcastClientServerChoice (validated, a damaged text is none).

Referenced by de.yaacc.snapcast.client.SnapcastClientPowers.currentServer(), and de.yaacc.snapcast.client.SnapcastClientPowers.currentServerIndex().

◆ KEY_SWITCHED_ON

final String de.yaacc.snapcast.client.SnapcastClient.KEY_SWITCHED_ON = "settings_snapcast_client_switched_on"
static

The one persisted state "the Snapcast client is switched on" (task 12C): set by the switch on the first page, the checkbox of the settings and the Start/Stop of the listen test, read by the restore at the start of the app.

Also the name of its string resource; a boolean, off by default.

Referenced by de.yaacc.snapcast.client.SnapcastClient.isSwitchedOn().


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