mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
feat: Adds basic CamerLists config structure and CameraListItems class
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Linq;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using PepperDash.Essentials.Core.Devices;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Config
|
namespace PepperDash.Essentials.Core.Config
|
||||||
{
|
{
|
||||||
@@ -28,6 +29,9 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
[JsonProperty("audioControlPointLists")]
|
[JsonProperty("audioControlPointLists")]
|
||||||
public Dictionary<string, AudioControlPointListItem> AudioControlPointLists { get; set; }
|
public Dictionary<string, AudioControlPointListItem> AudioControlPointLists { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("cameraLists")]
|
||||||
|
public Dictionary<string, Dictionary<string, CameraListItem>> CameraLists { get; set; }
|
||||||
|
|
||||||
[JsonProperty("tieLines")]
|
[JsonProperty("tieLines")]
|
||||||
public List<TieLineConfig> TieLines { get; set; }
|
public List<TieLineConfig> TieLines { get; set; }
|
||||||
|
|
||||||
|
|||||||
76
src/PepperDash.Essentials.Core/Devices/CameraListItem.cs
Normal file
76
src/PepperDash.Essentials.Core/Devices/CameraListItem.cs
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Devices
|
||||||
|
{
|
||||||
|
public class CameraListItem
|
||||||
|
{
|
||||||
|
[JsonProperty("deviceKey")]
|
||||||
|
public string DeviceKey { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the source Device for this, if it exists in DeviceManager
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public Device CameraDevice
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_cameraDevice == null)
|
||||||
|
_cameraDevice = DeviceManager.GetDeviceForKey(DeviceKey) as Device;
|
||||||
|
return _cameraDevice;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Device _cameraDevice;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets either the source's Name or this AlternateName property, if
|
||||||
|
/// defined. If source doesn't exist, returns "Missing source"
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("preferredName")]
|
||||||
|
public string PreferredName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(Name))
|
||||||
|
{
|
||||||
|
if (CameraDevice == null)
|
||||||
|
return "---";
|
||||||
|
return CameraDevice.Name;
|
||||||
|
}
|
||||||
|
return Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A name that will override the source's name on the UI
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("name")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Specifies and icon for the source list item
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("icon")]
|
||||||
|
public string Icon { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Alternate icon
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("altIcon", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
public string AltIcon { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates if the item should be included in the user facing list
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("includeInUserList")]
|
||||||
|
public bool IncludeInUserList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used to specify the order of the items in the source list when displayed
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("order")]
|
||||||
|
public int Order { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -193,6 +193,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
defaultDisplay,
|
defaultDisplay,
|
||||||
leftDisplay,
|
leftDisplay,
|
||||||
rightDisplay,
|
rightDisplay,
|
||||||
|
centerDisplay,
|
||||||
programAudio,
|
programAudio,
|
||||||
codecContent
|
codecContent
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user