mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 20:24:57 +00:00
Updated DmTx201SController
Added Decription Attribute to 200 and both 201 classes
This commit is contained in:
@@ -15,7 +15,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description("Wrapper class for DM-TX-200-C Endpoint")]
|
||||||
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx200C2G Tx { get; private set; }
|
public DmTx200C2G Tx { get; private set; }
|
||||||
|
|||||||
@@ -1,29 +1,23 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using Crestron.SimplSharpPro;
|
||||||
using System.Linq;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using System.Text;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
|
||||||
using Crestron.SimplSharpPro.DM;
|
using PepperDash.Core;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
using PepperDash.Essentials.Core;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
|
||||||
using PepperDash.Essentials.Core;
|
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.DM.Config;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
// using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description("Wrapper class for DM-TX-201-C Endpoint")]
|
||||||
public class DmTx201CController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
public class DmTx201CController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx201C Tx { get; private set; } // uses the 201S class as it is the base class for the 201C
|
public DmTx201C Tx { get; private set; }
|
||||||
|
|
||||||
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
||||||
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
@@ -12,18 +8,16 @@ using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
|||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.DM.Config;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
// using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
/// Controller class for all DM-TX-201S/F transmitters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DmTx201SController : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
[Description("Wrapper class for DM-TX-201-S/F Endpoint")]
|
||||||
|
public class DmTx201SController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx201S Tx { get; private set; } // uses the 201S class as it is the base class for the 201C
|
public DmTx201S Tx { get; private set; }
|
||||||
|
|
||||||
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
||||||
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
||||||
@@ -107,43 +101,29 @@ namespace PepperDash.Essentials.DM
|
|||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent);
|
Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
|
||||||
|
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
|
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() =>
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
{
|
|
||||||
return (int)Tx.VideoSourceFeedback;
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||||
});
|
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() =>
|
|
||||||
{
|
|
||||||
return (int)Tx.AudioSourceFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
||||||
{
|
(tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0));
|
||||||
if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiVideoSyncFeedback = new BoolFeedback(() =>
|
HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
VgaVideoSyncFeedback = new BoolFeedback(() =>
|
VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||||
|
|
||||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||||
|
|
||||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||||
|
|
||||||
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
|
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||||
|
|
||||||
@@ -153,21 +133,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||||
|
|
||||||
HdcpStateFeedbackFunc = () =>
|
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ?
|
||||||
{
|
tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
|
||||||
return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
|
|
||||||
return "";
|
|
||||||
},
|
|
||||||
|
|
||||||
VideoResolutionFeedbackFunc = () =>
|
VideoResolutionFeedbackFunc = () =>
|
||||||
{
|
{
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
||||||
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog)
|
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ?
|
||||||
return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
|
tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||||
return "";
|
|
||||||
},
|
},
|
||||||
|
|
||||||
VideoSyncFeedbackFunc = () =>
|
VideoSyncFeedbackFunc = () =>
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||||
@@ -203,13 +179,14 @@ namespace PepperDash.Essentials.DM
|
|||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
VgaBrightnessFeedback.FireUpdate();
|
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
||||||
}
|
VgaBrightnessFeedback.FireUpdate();
|
||||||
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
|
break;
|
||||||
{
|
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||||
VgaContrastFeedback.FireUpdate();
|
VgaContrastFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,6 +198,19 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
|
{
|
||||||
|
switch (args.EventId)
|
||||||
|
{
|
||||||
|
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
|
||||||
|
FreeRunEnabledFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
|
VgaVideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
|
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
|
||||||
@@ -235,7 +225,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
|
|
||||||
if (HdmiVideoSyncFeedback != null)
|
if (HdmiVideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
@@ -255,14 +245,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="enable"></param>
|
/// <param name="enable"></param>
|
||||||
public void SetFreeRunEnabled(bool enable)
|
public void SetFreeRunEnabled(bool enable)
|
||||||
{
|
{
|
||||||
if (enable)
|
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -331,38 +314,38 @@ namespace PepperDash.Essentials.DM
|
|||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------ incomplete -----------------------------------------
|
|
||||||
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||||
|
|
||||||
if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||||
}
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
|
break;
|
||||||
{
|
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
else if (args.EventId == EndpointInputStreamEventIds.FreeRunFeedbackEventId)
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
{
|
VgaVideoSyncFeedback.FireUpdate();
|
||||||
FreeRunEnabledFeedback.FireUpdate();
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -370,11 +353,12 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||||
{
|
{
|
||||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
return;
|
||||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
|
||||||
}
|
}
|
||||||
|
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||||
|
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user