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

The phone as a Snapcast client, for the listen test (task 8.1): a foreground service of type mediaPlayback that owns the SnapcastConnection, the ClientEngine and the output while a session runs. More...

Inheritance diagram for de.yaacc.snapcast.client.SnapcastClientService:
Inheritance graph
Collaboration diagram for de.yaacc.snapcast.client.SnapcastClientService:
Collaboration graph

Public Member Functions

IBinder onBind (Intent intent)
 
void onCreate ()
 
int onStartCommand (Intent intent, int flags, int startId)
 
void onDestroy ()
 

Static Public Member Functions

static void start (Context context, String hostText, int latencyMs)
 Starts a session.
 
static void start (Context context, String hostText, int latencyMs, int writeAheadMs)
 
static void start (Context context, String hostText, int latencyMs, int writeAheadMs, boolean flacGuard)
 
static void stop (Context context)
 Ends the session, if there is one.
 
static void setLatency (Context context, int latencyMs)
 Changes the manual latency of the running session.
 

Detailed Description

The phone as a Snapcast client, for the listen test (task 8.1): a foreground service of type mediaPlayback that owns the SnapcastConnection, the ClientEngine and the output while a session runs.

Lifetime. It is started by the app (the screen, the switch on the first page, the checkbox of the settings, the restore at the start of the app; all through SnapcastClientPower). The system never restarts it (START_NOT_STICKY, not exported) and it lives only while a session is on. A wake lock (partial, with a safety timeout of 8 hours, renewed while the session runs) and a Wi-Fi lock are taken at the start and released at every end: the stop button, an error of the connection or of the engine, the watchdog, and onDestroy. The notification is the standard one with a Stop action. No listener socket is opened; the phone connects out to the one server the user typed in, by an address resolved once.

Disclosure. The Hello carries the name of the phone as the UPnP server announces it, the program name, the generic words "Android" and "unknown", and an id derived from a secret of this installation (SnapcastClientIdentity): the same id for every server; the MAC is the fixed placeholder. Nothing from the server is written to the log.

Member Function Documentation

◆ start() [1/3]

static void de.yaacc.snapcast.client.SnapcastClientService.start ( Context context,
String hostText,
int latencyMs )
static

Starts a session.

Call from the UI (a foreground service may be started from there).

Referenced by de.yaacc.snapcast.client.SnapcastClientService.start(), and de.yaacc.snapcast.client.SnapcastClientService.start().

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

◆ start() [2/3]

static void de.yaacc.snapcast.client.SnapcastClientService.start ( Context context,
String hostText,
int latencyMs,
int writeAheadMs )
static
Parameters
writeAheadMshow far ahead of the playback position the output is kept filled (applied at the start only)
Here is the call graph for this function:

◆ start() [3/3]

static void de.yaacc.snapcast.client.SnapcastClientService.start ( Context context,
String hostText,
int latencyMs,
int writeAheadMs,
boolean flacGuard )
static
Parameters
flacGuardthe stall guard of the flac path (it only acts when the positions of the chunks are read from the FLAC frame headers; with this off nothing is ever filled)

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