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

The structure of the Snapcast settings (issue #330, the owner's decision of 2026-12-01), the same as the one of Sendspin: More...

Collaboration diagram for de.yaacc.snapcast.SnapcastSettings:
Collaboration graph

Classes

interface  BooleanSource
 Reads a boolean preference; SharedPreferences in the app. More...
 
interface  StringSource
 Reads a text preference; SharedPreferences in the app. More...
 

Static Public Member Functions

static String feedCodec (StringSource source, int sdkInt)
 
static String serverCodec (StringSource source, int sdkInt)
 
static boolean isSupportEnabled (BooleanSource source)
 
static boolean isSearchEnabled (BooleanSource source)
 
static boolean isSearchKey (String key)
 
static boolean isServicesOn (BooleanSource source)
 
static boolean serverRuns (BooleanSource source)
 
static boolean clientAllowed (BooleanSource source)
 
static boolean isRuleKey (String key)
 
static Map< String, Boolean > migration (BooleanSource source)
 What to write once for an install that has the older switches: the support is what "Play to Snapcast groups" was (on by default), and the services are on if the server or the client had been switched on (they keep running as they did).
 

Static Public Attributes

static final String KEY_SUPPORT = "settings_snapcast_enabled"
 The key of the support switch in the default preferences.
 
static final boolean SUPPORT_DEFAULT = true
 The default of the support switch: on.
 
static final String KEY_SERVICES = "settings_snapcast_services"
 The key of the services switch (the general one, also the switch on the first page).
 
static final boolean SERVICES_DEFAULT = false
 The default of the services switch: off.
 
static final String KEY_FEED_CODEC = "settings_snapcast_feed_codec"
 The key of the codec for the stream that the phone makes on a server it feeds (a list: FLAC, PCM, Opus where the device has it).
 
static final String KEY_SERVER_CODEC = "settings_snapcast_server_codec"
 The key of the codec of the streams of the phone's own server (the same list).
 
static final String LEGACY_KEY_PLAY = "settings_snapcast_play_experimental"
 The older switch "Play to Snapcast groups" (the name is historical: it was an experiment).
 
static final String KEY_MIGRATED = "snapcast_settings_structure"
 The key that says that an install has been moved to this structure.
 

Detailed Description

The structure of the Snapcast settings (issue #330, the owner's decision of 2026-12-01), the same as the one of Sendspin:

  • Snapcast support (KEY_SUPPORT, on by default): the app searches the network for Snapcast servers (mDNS, while a page that shows Snapcast is open), plays to their groups and controls them. The owner's decisions of 2026-11-14 and 2026-11-16 (search and play on by default) stand; announcements are not authenticated, so the summary of the switch says so. The one switch off for everything Snapcast.
  • Snapcast services (KEY_SERVICES, off by default): the general switch, also the one on the first page (offered while the support is on). It starts and ends the server and the client that are allowed below it.
  • Snapcast server (SnapcastServerSettings#KEY_ENABLED) and Snapcast client (SnapcastClient#KEY_ENABLED): the services this phone may run. The server runs (listens and announces itself) with support and services and its own switch; the client may connect with support and services and its own switch (serverRuns, clientAllowed). Whether the client is connected is the power button of its card (SnapcastClient#KEY_SWITCHED_ON).

The keys are the names of the string resources of the preference screen (a test pins them). A value that can not be read at all counts as off: when the choice of the user is unknown nothing is scanned, listened or sent. Pure.

Member Function Documentation

◆ clientAllowed()

static boolean de.yaacc.snapcast.SnapcastSettings.clientAllowed ( BooleanSource source)
static
Returns
whether the client of this phone may connect: support and services and the client switch
Here is the call graph for this function:

◆ feedCodec()

static String de.yaacc.snapcast.SnapcastSettings.feedCodec ( StringSource source,
int sdkInt )
static
Returns
the codec of the stream that the phone makes on a server it feeds: the choice if the device can do it, else FLAC

◆ isRuleKey()

static boolean de.yaacc.snapcast.SnapcastSettings.isRuleKey ( String key)
static
Returns
true if a change of this key can start or end the server or the client

Referenced by de.yaacc.snapcast.SnapcastServices.install().

Here is the caller graph for this function:

◆ isSearchEnabled()

static boolean de.yaacc.snapcast.SnapcastSettings.isSearchEnabled ( BooleanSource source)
static
Returns
whether the app searches the network for servers (and shows and plays to them): the support switch
Here is the call graph for this function:

◆ isSearchKey()

static boolean de.yaacc.snapcast.SnapcastSettings.isSearchKey ( String key)
static
Returns
true if a change of this key changes whether the app searches

◆ isServicesOn()

static boolean de.yaacc.snapcast.SnapcastSettings.isServicesOn ( BooleanSource source)
static
Returns
whether the services are on: the support is on and the services switch is on

Referenced by de.yaacc.snapcast.SnapcastSettings.clientAllowed(), de.yaacc.snapcast.SnapcastPower.isOn(), and de.yaacc.snapcast.SnapcastSettings.serverRuns().

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

◆ isSupportEnabled()

static boolean de.yaacc.snapcast.SnapcastSettings.isSupportEnabled ( BooleanSource source)
static
Returns
whether the support is on: the stored choice, SUPPORT_DEFAULT if none; false for no source or a value that can not be read

Referenced by de.yaacc.snapcast.SnapcastSettings.isSearchEnabled(), de.yaacc.snapcast.SnapcastSettings.isServicesOn(), and de.yaacc.snapcast.SnapcastPower.offered().

Here is the caller graph for this function:

◆ migration()

static Map< String, Boolean > de.yaacc.snapcast.SnapcastSettings.migration ( BooleanSource source)
static

What to write once for an install that has the older switches: the support is what "Play to Snapcast groups" was (on by default), and the services are on if the server or the client had been switched on (they keep running as they did).

Empty if the install was moved before, or if the choices can not be read.

Referenced by de.yaacc.snapcast.SnapcastServices.install().

Here is the caller graph for this function:

◆ serverCodec()

static String de.yaacc.snapcast.SnapcastSettings.serverCodec ( StringSource source,
int sdkInt )
static
Returns
the codec of the streams of the phone's own server: the choice if the device can do it, else FLAC

◆ serverRuns()

static boolean de.yaacc.snapcast.SnapcastSettings.serverRuns ( BooleanSource source)
static
Returns
whether the server of this phone runs: support and services and the server switch
Here is the call graph for this function:

Member Data Documentation

◆ LEGACY_KEY_PLAY

final String de.yaacc.snapcast.SnapcastSettings.LEGACY_KEY_PLAY = "settings_snapcast_play_experimental"
static

The older switch "Play to Snapcast groups" (the name is historical: it was an experiment).

Read only to move an install.

Referenced by de.yaacc.snapcast.SnapcastSettings.migration().


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