mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-10 18:24:50 +00:00
Combining repos
This commit is contained in:
60
Essentials DM/Essentials_DM/IDmHdmiInputExtensions.cs
Normal file
60
Essentials DM/Essentials_DM/IDmHdmiInputExtensions.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public static class IBasicDmInputExtensions
|
||||
{
|
||||
public static VideoStatusFuncsWrapper GetVideoStatusFuncsWrapper(this IBasicDMInput input)
|
||||
{
|
||||
var va = (input as IVideoAttributesEnhanced).VideoAttributes;
|
||||
return new VideoStatusFuncsWrapper
|
||||
{
|
||||
HasVideoStatusFunc = () => true,
|
||||
HdcpActiveFeedbackFunc = () => va.HdcpActiveFeedback.BoolValue,
|
||||
HdcpStateFeedbackFunc = () => va.HdcpStateFeedback.ToString(),
|
||||
VideoResolutionFeedbackFunc = () =>
|
||||
{
|
||||
var h = va.HorizontalResolutionFeedback.UShortValue;
|
||||
var v = va.VerticalResolutionFeedback.UShortValue;
|
||||
if (h == 0 || v == 0)
|
||||
return "---";
|
||||
return h + "x" + v;
|
||||
},
|
||||
VideoSyncFeedbackFunc = () => input.SyncDetectedFeedback.BoolValue
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class IEndpointHdmiInputExtensions
|
||||
{
|
||||
public static VideoStatusFuncsWrapper GetVideoStatusFuncsWrapper(this Crestron.SimplSharpPro.DM.Endpoints.EndpointHdmiInput input)
|
||||
{
|
||||
var va = (input as IVideoAttributesEnhanced).VideoAttributes;
|
||||
return new VideoStatusFuncsWrapper
|
||||
{
|
||||
HasVideoStatusFunc = () => true,
|
||||
HdcpActiveFeedbackFunc = () => va.HdcpActiveFeedback.BoolValue,
|
||||
HdcpStateFeedbackFunc = () => va.HdcpStateFeedback.ToString(),
|
||||
VideoResolutionFeedbackFunc = () =>
|
||||
{
|
||||
var h = va.HorizontalResolutionFeedback.UShortValue;
|
||||
var v = va.VerticalResolutionFeedback.UShortValue;
|
||||
if (h == 0 || v == 0)
|
||||
return "---";
|
||||
return h + "x" + v;
|
||||
},
|
||||
VideoSyncFeedbackFunc = () => input.SyncDetectedFeedback.BoolValue
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user