using System; using System.Collections.Generic; using System.Linq; using System.Text; using Crestron.SimplSharp; using Crestron.SimplSharpPro; using Crestron.SimplSharpPro.DeviceSupport; using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Config; using Serilog.Events; namespace PepperDash.Essentials.Devices.Common { public class GenericSource : EssentialsDevice, IUiDisplayInfo, IRoutingSource, IRoutingOutputs, IUsageTracking { public uint DisplayUiType { get { return DisplayUiConstants.TypeNoControls; } } 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 public RoutingOutputPort AnyOut { get; private set; } public RoutingPortCollection OutputPorts { get; private set; } #endregion #region IUsageTracking Members public UsageTracking UsageTracker { get; set; } #endregion } public class GenericSourceFactory : EssentialsDeviceFactory { public GenericSourceFactory() { TypeNames = new List() { "genericsource" }; } 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); } } }