EARHORNMUSIC UPnP · Android TV · Phones · Android Auto · GNU/Linux
Release 0.5.0

RemoteRenderer.kt

35 lines · 1.5 KB

Changed in: 0.5.0

1package dev.stave.domain.model
2
3/**
4 * A UPnP/DLNA MediaRenderer discovered on the LAN that advertises an AVTransport service.
5 * Keyed by [udn] (Unique Device Name) for stability across IP changes — same idiom as
6 * [MediaServer].
7 *
8 * Surfaced by [dev.stave.upnp.UpnpServiceHolder.renderers]. The renderer-mesh feature
9 * uses this both as the picker's option list (Settings → Active renderer) and as the
10 * target descriptor passed into the remote-renderer adapter when the user chooses a
11 * non-local renderer to drive.
12 */
13data class RemoteRenderer(
14 val udn: String,
15 val friendlyName: String,
16 val manufacturer: String?,
17 val modelName: String?,
18 val modelDescription: String?,
19 val baseUrl: String,
20 val iconUrl: String? = null,
21) {
22 /**
23 * Detects sibling Earhorn instances on the LAN — i.e. other Earhorn renderers
24 * broadcasting via the mesh-broadcast feature on desktop, phone, or TV. The
25 * picker UI shows an "Earhorn" badge on these to distinguish them from generic
26 * UPnP renderers (BubbleUPnP, Kazoo, JRiver, etc.).
27 *
28 * Recognition is by the manufacturer string Earhorn advertises in its UPnP
29 * device description ("Faveat Software"), with a fallback to the model name
30 * containing "Earhorn" in case the manufacturer string ever drifts.
31 */
32 val isEarhorn: Boolean
33 get() = manufacturer?.contains("Faveat Software", ignoreCase = true) == true ||
34 modelName?.contains("Earhorn", ignoreCase = true) == true
35}