using System.Collections.Generic; using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Config; using Serilog.Events; namespace PepperDash.Essentials.Devices.Common { /// /// Represents a GenericSource /// public class GenericSource : EssentialsDevice, IUiDisplayInfo, IRoutingSource, IUsageTracking { /// /// Gets or sets the DisplayUiType /// public uint DisplayUiType { get { return DisplayUiConstants.TypeNoControls; } } /// /// Initializes a new instance of the GenericSource class /// /// The device key /// The device name public GenericSource(string key, string name) : base(key, name) { AnyOut = new RoutingOutputPort(RoutingPortNames.AnyOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, null, this); OutputPorts = new RoutingPortCollection { AnyOut }; } #region IRoutingOutputs Members /// /// Gets or sets the AnyOut /// public RoutingOutputPort AnyOut { get; private set; } /// /// Gets or sets the OutputPorts /// public RoutingPortCollection OutputPorts { get; private set; } #endregion #region IUsageTracking Members /// /// Gets or sets the UsageTracker /// public UsageTracking UsageTracker { get; set; } #endregion } /// /// Represents a GenericSourceFactory /// public class GenericSourceFactory : EssentialsDeviceFactory { /// /// Initializes a new instance of the GenericSourceFactory class /// public GenericSourceFactory() { TypeNames = new List() { "genericsource" }; } /// /// BuildDevice method /// /// public override EssentialsDevice BuildDevice(DeviceConfig dc) { Debug.LogMessage(LogEventLevel.Debug, "Factory Attempting to create new Generic Source Device"); return new GenericSource(dc.Key, dc.Name); } } }