using Newtonsoft.Json; using PepperDash.Essentials.Core; namespace PepperDash.Essentials.Core { /// /// Represents a destination item in a routing system that can receive audio/video signals. /// Contains information about the destination device, its properties, and location settings. /// public class DestinationListItem { /// /// Gets or sets the key identifier for the sink device that this destination represents. /// [JsonProperty("sinkKey")] public string SinkKey { get; set; } private EssentialsDevice _sinkDevice; /// /// Gets the actual device instance for this destination. /// Lazily loads the device from the DeviceManager using the SinkKey. /// [JsonIgnore] public EssentialsDevice SinkDevice { get { return _sinkDevice ?? (_sinkDevice = DeviceManager.GetDeviceForKey(SinkKey) as EssentialsDevice); } } /// /// Gets the preferred display name for this destination. /// Returns the custom Name if set, otherwise returns the SinkDevice name, or "---" if no device is found. /// [JsonProperty("preferredName")] public string PreferredName { get { if (!string.IsNullOrEmpty(Name)) { return Name; } return SinkDevice == null ? "---" : SinkDevice.Name; } } /// /// Gets or sets the custom name for this destination. /// If set, this name will be used as the PreferredName instead of the device name. /// [JsonProperty("name")] public string Name { get; set; } /// /// Gets or sets a value indicating whether this destination should be included in destination lists. /// [JsonProperty("includeInDestinationList")] public bool IncludeInDestinationList { get; set; } /// /// Gets or sets the display order for this destination in lists. /// Lower values appear first in sorted lists. /// [JsonProperty("order")] public int Order { get; set; } /// /// Gets or sets the surface location identifier for this destination. /// Used to specify which surface or screen this destination is located on. /// [JsonProperty("surfaceLocation")] public int SurfaceLocation { get; set; } /// /// Gets or sets the vertical location position for this destination. /// Used for spatial positioning in multi-display configurations. /// [JsonProperty("verticalLocation")] public int VerticalLocation { get; set; } /// /// Gets or sets the horizontal location position for this destination. /// Used for spatial positioning in multi-display configurations. /// [JsonProperty("horizontalLocation")] public int HorizontalLocation { get; set; } /// /// Gets or sets the signal type that this destination can receive (Audio, Video, AudioVideo, etc.). /// [JsonProperty("sinkType")] public eRoutingSignalType SinkType { get; set; } /// /// Gets or sets a value indicating whether this destination is used for codec content sharing. /// [JsonProperty("isCodecContentDestination")] public bool isCodecContentDestination { get; set; } /// /// Gets or sets a value indicating whether this destination is used for program audio output. /// [JsonProperty("isProgramAudioDestination")] public bool isProgramAudioDestination { get; set; } /// /// Gets or sets a value indicating whether this destination supports USB connections. /// Indicates if the destination can handle USB functionality, such as USB signal routing or device connections. /// This property is used to determine compatibility with USB-based devices or systems. /// [JsonProperty("supportsUsb")] public bool SupportsUsb { get; set; } /// /// The key of the destination port associated with this destination item /// This is used to identify the specific port on the destination device that this item refers to for advanced routing /// [JsonProperty("destinationPortKey")] public string DestinationPortKey { get; set; } } }