diff --git a/src/PepperDash.Essentials.Core/Devices/SourceListItem.cs b/src/PepperDash.Essentials.Core/Devices/SourceListItem.cs index 48d43c94..6de2f35d 100644 --- a/src/PepperDash.Essentials.Core/Devices/SourceListItem.cs +++ b/src/PepperDash.Essentials.Core/Devices/SourceListItem.cs @@ -1,128 +1,121 @@ - - -using System; -using System.Collections.Generic; -using Crestron.SimplSharp; -using Crestron.SimplSharp.CrestronIO; -using Crestron.SimplSharpPro; - -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; using PepperDash.Core; +using System.Collections.Generic; namespace PepperDash.Essentials.Core { - /// - /// - /// - public enum eSourceListItemType - { - Route, Off, Other, SomethingAwesomerThanThese - } + /// + /// + /// + public enum eSourceListItemType + { + Route, Off, Other, SomethingAwesomerThanThese + } - /// - /// Represents an item in a source list - can be deserialized into. - /// - public class SourceListItem - { - [JsonProperty("sourceKey")] - public string SourceKey { get; set; } + /// + /// Represents an item in a source list - can be deserialized into. + /// + public class SourceListItem + { + [JsonProperty("sourceKey")] + public string SourceKey { get; set; } - /// - /// Returns the source Device for this, if it exists in DeviceManager - /// - [JsonIgnore] - public Device SourceDevice - { - get - { - if (_SourceDevice == null) - _SourceDevice = DeviceManager.GetDeviceForKey(SourceKey) as Device; - return _SourceDevice; - } - } - Device _SourceDevice; + /// + /// Returns the source Device for this, if it exists in DeviceManager + /// + [JsonIgnore] + public Device SourceDevice + { + get + { + if (_SourceDevice == null) + _SourceDevice = DeviceManager.GetDeviceForKey(SourceKey) as Device; + return _SourceDevice; + } + } - /// - /// Gets either the source's Name or this AlternateName property, if - /// defined. If source doesn't exist, returns "Missing source" - /// - [JsonProperty("preferredName")] - public string PreferredName - { - get - { - if (string.IsNullOrEmpty(Name)) - { - if (SourceDevice == null) - return "---"; - return SourceDevice.Name; - } - return Name; - } - } + private Device _SourceDevice; - /// - /// A name that will override the source's name on the UI - /// - [JsonProperty("name")] - public string Name { get; set; } + /// + /// Gets either the source's Name or this AlternateName property, if + /// defined. If source doesn't exist, returns "Missing source" + /// + [JsonProperty("preferredName")] + public string PreferredName + { + get + { + if (string.IsNullOrEmpty(Name)) + { + if (SourceDevice == null) + return "---"; + return SourceDevice.Name; + } + return Name; + } + } + + /// + /// A name that will override the source's name on the UI + /// + [JsonProperty("name")] + public string Name { get; set; } /// /// Specifies and icon for the source list item /// [JsonProperty("icon")] - public string Icon { get; set; } + public string Icon { get; set; } /// /// Alternate icon /// [JsonProperty("altIcon")] - public string AltIcon { get; set; } + public string AltIcon { get; set; } /// /// Indicates if the item should be included in the source list /// [JsonProperty("includeInSourceList")] - public bool IncludeInSourceList { get; set; } + public bool IncludeInSourceList { get; set; } /// /// Used to specify the order of the items in the source list when displayed /// [JsonProperty("order")] - public int Order { get; set; } + public int Order { get; set; } /// /// The key of the device for volume control /// [JsonProperty("volumeControlKey")] - public string VolumeControlKey { get; set; } + public string VolumeControlKey { get; set; } /// /// The type of source list item /// [JsonProperty("type")] - [JsonConverter(typeof(StringEnumConverter))] - public eSourceListItemType Type { get; set; } + [JsonConverter(typeof(StringEnumConverter))] + public eSourceListItemType Type { get; set; } /// /// The list of routes to execute for this source list item /// [JsonProperty("routeList")] - public List RouteList { get; set; } + public List RouteList { get; set; } /// /// Indicates if this source should be disabled for sharing to the far end call participants via codec content /// [JsonProperty("disableCodecSharing")] - public bool DisableCodecSharing { get; set; } + public bool DisableCodecSharing { get; set; } /// /// Indicates if this source should be disabled for routing to a shared output /// [JsonProperty("disableRoutedSharing")] - public bool DisableRoutedSharing { get; set; } + public bool DisableRoutedSharing { get; set; } [JsonProperty("destinations")] public List Destinations { get; set; } @@ -156,10 +149,10 @@ namespace PepperDash.Essentials.Core [JsonProperty("disableSimpleRouting")] public bool DisableSimpleRouting { get; set; } - public SourceListItem() - { - Icon = "Blank"; - } + public SourceListItem() + { + Icon = "Blank"; + } public override string ToString() { @@ -167,23 +160,23 @@ namespace PepperDash.Essentials.Core } } - public class SourceRouteListItem - { - [JsonProperty("sourceKey")] - public string SourceKey { get; set; } + public class SourceRouteListItem + { + [JsonProperty("sourceKey")] + public string SourceKey { get; set; } [JsonProperty("sourcePortKey")] public string SourcePortKey { get; set; } - [JsonProperty("destinationKey")] - public string DestinationKey { get; set; } + [JsonProperty("destinationKey")] + public string DestinationKey { get; set; } [JsonProperty("destinationPortKey")] public string DestinationPortKey { get; set; } - [JsonProperty("type")] - public eRoutingSignalType Type { get; set; } - } + [JsonProperty("type")] + public eRoutingSignalType Type { get; set; } + } /// /// Defines the valid destination types for SourceListItems in a room @@ -193,8 +186,12 @@ namespace PepperDash.Essentials.Core defaultDisplay, leftDisplay, rightDisplay, - centerDisplay, + centerDisplay, programAudio, - codecContent + codecContent, + frontLeftDisplay, + frontRightDisplay, + rearLeftDisplay, + rearRightDisplay, } } \ No newline at end of file