RemoteRenderer.kt
38 lines · 1.7 KB
Changed in: 0.5.0
| 1 | package dev.stave.domain.model |
| 2 | |
| 3 | /** |
| 4 | * A UPnP/DLNA MediaRenderer discovered on the LAN that advertises an AVTransport |
| 5 | * service — the kind of device we can DRIVE playback on, as opposed to a |
| 6 | * [MediaServer] which is the kind we BROWSE content from. |
| 7 | * |
| 8 | * Members include any other Earhorn instance with "LAN broadcast" enabled |
| 9 | * (recognizable by [isEarhorn]) plus third-party renderers like BubbleUPnP's |
| 10 | * receiver, Linn/Naim streamers, gmediarender, OpenHome-friendly speakers, etc. |
| 11 | * |
| 12 | * Keyed by [udn] — stable across IP changes and process restarts on the remote |
| 13 | * side because each renderer persists its own UDN (see [dev.stave.upnp.renderer. |
| 14 | * EarhornRendererService] for our equivalent). |
| 15 | */ |
| 16 | data class RemoteRenderer( |
| 17 | val udn: String, |
| 18 | val friendlyName: String, |
| 19 | val manufacturer: String?, |
| 20 | val modelName: String?, |
| 21 | val modelDescription: String?, |
| 22 | val baseUrl: String, |
| 23 | val iconUrl: String? = null, |
| 24 | ) { |
| 25 | /** |
| 26 | * True if this renderer was advertised by another Earhorn instance — used |
| 27 | * for badging in the picker UI so "Earhorn on a room-laptop" reads as a |
| 28 | * peer of "this Earhorn" rather than as a generic third-party device. |
| 29 | * |
| 30 | * Detection is by manufacturer string set in [dev.stave.upnp.renderer. |
| 31 | * EarhornMediaRendererDevice.build]. If we ever rename or expand to other |
| 32 | * branded variants, update both ends together — the check is naïve string |
| 33 | * match, no model-number lookup. |
| 34 | */ |
| 35 | val isEarhorn: Boolean |
| 36 | get() = manufacturer?.equals("Faveat Software", ignoreCase = true) == true || |
| 37 | modelName?.contains("Earhorn", ignoreCase = true) == true |
| 38 | } |


