docs: XML comments for Devices.Common

This commit is contained in:
Andrew Welker
2025-10-09 13:18:36 -05:00
parent a5d409e93a
commit f9d9df9d5c
115 changed files with 5772 additions and 4292 deletions

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharp;
using PepperDash.Core;
@@ -22,6 +21,9 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
/// </summary>
public RoutingInputPort AnyVideoIn { get; private set; }
/// <summary>
/// Gets the CurrentInputPort
/// </summary>
public RoutingInputPort CurrentInputPort => AnyVideoIn;
#region IRoutingInputs Members
@@ -33,6 +35,11 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
#endregion
/// <summary>
/// Initializes a new instance of the <see cref="BlueJeansPc"/> class
/// </summary>
/// <param name="key">The device key</param>
/// <param name="name">The device name</param>
public BlueJeansPc(string key, string name)
: base(key, name)
{
@@ -177,30 +184,12 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
}
SourceListItem _CurrentSourceInfo;
/// <summary>
/// Event fired when the current source changes
/// </summary>
public event SourceInfoChangeHandler CurrentSourceChange;
#endregion
}
/// <summary>
/// Represents a BlueJeansPcFactory
/// </summary>
public class BlueJeansPcFactory : EssentialsDeviceFactory<BlueJeansPc>
{
public BlueJeansPcFactory()
{
TypeNames = new List<string>() { "bluejeanspc" };
}
/// <summary>
/// BuildDevice method
/// </summary>
/// <inheritdoc />
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.LogMessage(LogEventLevel.Debug, "Factory Attempting to create new BlueJeansPc Device");
return new SoftCodec.BlueJeansPc(dc.Key, dc.Name);
}
}
}

View File

@@ -0,0 +1,35 @@
using System.Collections.Generic;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using Serilog.Events;
namespace PepperDash.Essentials.Devices.Common.SoftCodec
{
/// <summary>
/// Represents a BlueJeansPcFactory
/// </summary>
public class BlueJeansPcFactory : EssentialsDeviceFactory<BlueJeansPc>
{
/// <summary>
/// Initializes a new instance of the <see cref="BlueJeansPcFactory"/> class
/// </summary>
public BlueJeansPcFactory()
{
TypeNames = new List<string>() { "bluejeanspc" };
}
/// <summary>
/// BuildDevice method
/// </summary>
/// <inheritdoc />
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.LogMessage(LogEventLevel.Debug, "Factory Attempting to create new BlueJeansPc Device");
return new BlueJeansPc(dc.Key, dc.Name);
}
}
}

View File

@@ -1,10 +1,7 @@
using Newtonsoft.Json;
using System.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using Serilog.Events;
using System.Collections.Generic;
using System.Linq;
namespace PepperDash.Essentials.Devices.Common.SoftCodec
{
@@ -18,7 +15,8 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
/// <summary>
/// Gets or sets the CurrentInputPort
/// </summary>
public RoutingInputPort CurrentInputPort {
public RoutingInputPort CurrentInputPort
{
get => _currentInputPort;
set
{
@@ -28,19 +26,25 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
}
}
/// <summary>
/// Initializes a new instance of the <see cref="GenericSoftCodec"/> class
/// </summary>
/// <param name="key">The device key</param>
/// <param name="name">The device name</param>
/// <param name="props">The device properties</param>
public GenericSoftCodec(string key, string name, GenericSoftCodecProperties props) : base(key, name)
{
InputPorts = new RoutingPortCollection<RoutingInputPort>();
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
for(var i = 1; i <= props.OutputCount; i++)
for (var i = 1; i <= props.OutputCount; i++)
{
var outputPort = new RoutingOutputPort($"output{i}", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, null, this);
OutputPorts.Add(outputPort);
}
for(var i = 1; i<= props.ContentInputCount; i++)
for (var i = 1; i <= props.ContentInputCount; i++)
{
var inputPort = new RoutingInputPort($"contentInput{i}", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, $"contentInput{i}", this);
@@ -52,7 +56,7 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
return;
}
for(var i = 1; i <=props.CameraInputCount; i++)
for (var i = 1; i <= props.CameraInputCount; i++)
{
var cameraPort = new RoutingInputPort($"cameraInput{i}", eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, $"cameraInput{i}", this);
@@ -72,7 +76,11 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
/// <summary>
/// Gets or sets the CurrentSourceInfoKey
/// </summary>
public string CurrentSourceInfoKey { get ; set; }
public string CurrentSourceInfoKey { get; set; }
/// <summary>
/// Gets or sets the CurrentSourceInfo
/// </summary>
public SourceListItem CurrentSourceInfo
{
get
@@ -97,7 +105,14 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
SourceListItem _CurrentSourceInfo;
/// <summary>
/// Event fired when the current source changes
/// </summary>
public event SourceInfoChangeHandler CurrentSourceChange;
/// <summary>
/// Event fired when the input changes
/// </summary>
public event InputChangedEventHandler InputChanged;
/// <summary>
@@ -107,7 +122,7 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
{
var inputPort = InputPorts.FirstOrDefault(p => p.Selector == inputSelector);
if(inputPort == null)
if (inputPort == null)
{
Debug.LogMessage(LogEventLevel.Warning, "No input port found for selector {inputSelector}", inputSelector);
return;
@@ -116,58 +131,4 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
CurrentInputPort = inputPort;
}
}
/// <summary>
/// Represents a GenericSoftCodecProperties
/// </summary>
public class GenericSoftCodecProperties
{
[JsonProperty("hasCameraInputs")]
/// <summary>
/// Gets or sets the HasCameraInputs
/// </summary>
public bool HasCameraInputs { get; set; }
[JsonProperty("cameraInputCount")]
/// <summary>
/// Gets or sets the CameraInputCount
/// </summary>
public int CameraInputCount { get; set; }
[JsonProperty("contentInputCount")]
/// <summary>
/// Gets or sets the ContentInputCount
/// </summary>
public int ContentInputCount { get; set; }
[JsonProperty("contentOutputCount")]
/// <summary>
/// Gets or sets the OutputCount
/// </summary>
public int OutputCount { get; set; }
}
/// <summary>
/// Represents a GenericSoftCodecFactory
/// </summary>
public class GenericSoftCodecFactory: EssentialsDeviceFactory<GenericSoftCodec>
{
public GenericSoftCodecFactory()
{
TypeNames = new List<string> { "genericsoftcodec" };
}
/// <summary>
/// BuildDevice method
/// </summary>
/// <inheritdoc />
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.LogMessage(LogEventLevel.Debug, "Attempting to create new Generic SoftCodec Device");
var props = dc.Properties.ToObject<GenericSoftCodecProperties>();
return new GenericSoftCodec(dc.Key, dc.Name, props);
}
}
}

View File

@@ -0,0 +1,35 @@
using System.Collections.Generic;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using Serilog.Events;
namespace PepperDash.Essentials.Devices.Common.SoftCodec
{
/// <summary>
/// Represents a GenericSoftCodecFactory
/// </summary>
public class GenericSoftCodecFactory : EssentialsDeviceFactory<GenericSoftCodec>
{
/// <summary>
/// Initializes a new instance of the <see cref="GenericSoftCodecFactory"/> class
/// </summary>
public GenericSoftCodecFactory()
{
TypeNames = new List<string> { "genericsoftcodec" };
}
/// <summary>
/// BuildDevice method
/// </summary>
/// <inheritdoc />
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.LogMessage(LogEventLevel.Debug, "Attempting to create new Generic SoftCodec Device");
var props = dc.Properties.ToObject<GenericSoftCodecProperties>();
return new GenericSoftCodec(dc.Key, dc.Name, props);
}
}
}

View File

@@ -0,0 +1,34 @@
using Newtonsoft.Json;
namespace PepperDash.Essentials.Devices.Common.SoftCodec
{
/// <summary>
/// Represents a GenericSoftCodecProperties
/// </summary>
public class GenericSoftCodecProperties
{
/// <summary>
/// Gets or sets the HasCameraInputs
/// </summary>
[JsonProperty("hasCameraInputs")]
public bool HasCameraInputs { get; set; }
/// <summary>
/// Gets or sets the CameraInputCount
/// </summary>
[JsonProperty("cameraInputCount")]
public int CameraInputCount { get; set; }
/// <summary>
/// Gets or sets the ContentInputCount
/// </summary>
[JsonProperty("contentInputCount")]
public int ContentInputCount { get; set; }
/// <summary>
/// Gets or sets the OutputCount
/// </summary>
[JsonProperty("contentOutputCount")]
public int OutputCount { get; set; }
}
}