Added new interface IRoutingNumericFeedback

Added New Interface ITxRoutingWithFeedback

Added New Interface IRmcRoutingWithFeedback

Added new interface IRoutingNumericWithFeedback

Implemented new interfaces in applicable classes
This commit is contained in:
Trevor Payne
2020-10-30 14:00:05 -05:00
parent e573749aa0
commit 5fcafe0b38
14 changed files with 446 additions and 116 deletions

View File

@@ -111,10 +111,70 @@ namespace PepperDash.Essentials.Core
IntFeedback AudioVideoSourceNumericFeedback { get; } IntFeedback AudioVideoSourceNumericFeedback { get; }
} }
/// <summary>
/// Defines an IRmcRouting with a feedback event
/// </summary>
public interface ITxRoutingWithFeedback : ITxRouting, IRoutingNumericFeedback
{
}
/// <summary>
/// Defines an IRmcRouting with a feedback event
/// </summary>
public interface IRmcRoutingWithFeedback : IRmcRouting, IRoutingNumericFeedback
{
}
/// <summary> /// <summary>
/// Defines an IRoutingOutputs devices as being a source - the start of the chain /// Defines an IRoutingOutputs devices as being a source - the start of the chain
/// </summary> /// </summary>
public interface IRoutingSource : IRoutingOutputs public interface IRoutingSource : IRoutingOutputs
{ {
} }
/// <summary>
/// Defines an event structure for reporting output route data
/// </summary>
public interface IRoutingNumericFeedback : IKeyName
{
event EventHandler NumericSwitchChange;
void OnSwitchChange(RoutingNumericEventArgs e);
}
/// <summary>
/// Defines an IRoutingNumeric with a feedback event
/// </summary>
public interface IRoutingNumericWithFeedback : IRoutingNumeric, IRoutingNumericFeedback
{
}
public class RoutingNumericEventArgs : EventArgs
{
private readonly uint _output;
private readonly uint _input;
private readonly eRoutingSignalType _sigType;
public uint Output
{
get { return _output; }
}
public uint Input
{
get { return _input; }
}
public eRoutingSignalType SigType
{
get { return _sigType; }
}
public RoutingNumericEventArgs(uint output, uint input, eRoutingSignalType sigType)
{
_output = output;
_input = input;
_sigType = sigType;
}
}
} }

View File

@@ -17,7 +17,7 @@ using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.DM.AirMedia namespace PepperDash.Essentials.DM.AirMedia
{ {
[Description("Wrapper class for an AM-200 or AM-300")] [Description("Wrapper class for an AM-200 or AM-300")]
public class AirMediaController : CrestronGenericBridgeableBaseDevice, IRoutingNumeric, IIROutputPorts, IComPorts public class AirMediaController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, IIROutputPorts, IComPorts
{ {
public AmX00 AirMedia { get; private set; } public AmX00 AirMedia { get; private set; }
@@ -29,6 +29,9 @@ namespace PepperDash.Essentials.DM.AirMedia
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; } public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
public BoolFeedback IsInSessionFeedback { get; private set; } public BoolFeedback IsInSessionFeedback { get; private set; }
public IntFeedback ErrorFeedback { get; private set; } public IntFeedback ErrorFeedback { get; private set; }
public IntFeedback NumberOfUsersConnectedFeedback { get; set; } public IntFeedback NumberOfUsersConnectedFeedback { get; set; }
@@ -153,6 +156,16 @@ namespace PepperDash.Essentials.DM.AirMedia
SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback.JoinNumber]); SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback.JoinNumber]);
} }
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
void AirMedia_AirMediaChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args) void AirMedia_AirMediaChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
{ {
if (args.EventId == AirMediaInputSlot.AirMediaStatusFeedbackEventId) if (args.EventId == AirMediaInputSlot.AirMediaStatusFeedbackEventId)
@@ -172,7 +185,10 @@ namespace PepperDash.Essentials.DM.AirMedia
void DisplayControl_DisplayControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args) void DisplayControl_DisplayControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
{ {
if (args.EventId == AmX00.VideoOutFeedbackEventId) if (args.EventId == AmX00.VideoOutFeedbackEventId)
{
VideoOutFeedback.FireUpdate(); VideoOutFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoOutFeedback.UShortValue, eRoutingSignalType.AudioVideo));
}
else if (args.EventId == AmX00.EnableAutomaticRoutingFeedbackEventId) else if (args.EventId == AmX00.EnableAutomaticRoutingFeedbackEventId)
AutomaticInputRoutingEnabledFeedback.FireUpdate(); AutomaticInputRoutingEnabledFeedback.FireUpdate();
} }

View File

@@ -21,12 +21,15 @@ namespace PepperDash.Essentials.DM
/// ///
/// </summary> /// </summary>
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")] [Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")]
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumeric public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
{ {
public DMChassisPropertiesConfig PropertiesConfig { get; set; } public DMChassisPropertiesConfig PropertiesConfig { get; set; }
public Switch Chassis { get; private set; } public Switch Chassis { get; private set; }
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
// Feedbacks for EssentialDM // Feedbacks for EssentialDM
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; } public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; } public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
@@ -907,6 +910,15 @@ namespace PepperDash.Essentials.DM
} }
} }
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
/// ///
/// </summary> /// </summary>
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args) void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
@@ -940,11 +952,15 @@ namespace PepperDash.Essentials.DM
} }
case DMOutputEventIds.VideoOutEventId: case DMOutputEventIds.VideoOutEventId:
{ {
if (Chassis.Outputs[output].VideoOutFeedback != null) if (Chassis.Outputs[output].VideoOutFeedback == null) return;
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output); Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output);
if (VideoOutputFeedbacks.ContainsKey(output)) if (VideoOutputFeedbacks.ContainsKey(output))
{
VideoOutputFeedbacks[output].FireUpdate(); VideoOutputFeedbacks[output].FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(output, Chassis.Outputs[output].VideoOutFeedback.Number, eRoutingSignalType.Video));
}
if (OutputVideoRouteNameFeedbacks.ContainsKey(output)) if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
OutputVideoRouteNameFeedbacks[output].FireUpdate(); OutputVideoRouteNameFeedbacks[output].FireUpdate();
@@ -953,11 +969,15 @@ namespace PepperDash.Essentials.DM
} }
case DMOutputEventIds.AudioOutEventId: case DMOutputEventIds.AudioOutEventId:
{ {
if (Chassis.Outputs[output].AudioOutFeedback != null) if (Chassis.Outputs[output].AudioOutFeedback == null) return;
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].AudioOutFeedback.Number, output); Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].AudioOutFeedback.Number, output);
if (AudioOutputFeedbacks.ContainsKey(output)) if (AudioOutputFeedbacks.ContainsKey(output))
{
AudioOutputFeedbacks[output].FireUpdate(); AudioOutputFeedbacks[output].FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(output, Chassis.Outputs[output].VideoOutFeedback.Number, eRoutingSignalType.Audio));
}
if (OutputAudioRouteNameFeedbacks.ContainsKey(output)) if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
OutputAudioRouteNameFeedbacks[output].FireUpdate(); OutputAudioRouteNameFeedbacks[output].FireUpdate();

View File

@@ -19,11 +19,14 @@ using Feedback = PepperDash.Essentials.Core.Feedback;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
public class DmpsRoutingController : EssentialsBridgeableDevice, IRoutingNumeric, IHasFeedback public class DmpsRoutingController : EssentialsBridgeableDevice, IRoutingNumericWithFeedback, IHasFeedback
{ {
public CrestronControlSystem Dmps { get; set; } public CrestronControlSystem Dmps { get; set; }
public ISystemControl SystemControl { get; private set; } public ISystemControl SystemControl { get; private set; }
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
// Feedbacks for EssentialDM // Feedbacks for EssentialDM
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; } public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; } public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
@@ -56,6 +59,16 @@ namespace PepperDash.Essentials.DM
/// </summary> /// </summary>
public string NoRouteText = ""; public string NoRouteText = "";
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
public static DmpsRoutingController GetDmpsRoutingController(string key, string name, public static DmpsRoutingController GetDmpsRoutingController(string key, string name,
DmpsRoutingPropertiesConfig properties) DmpsRoutingPropertiesConfig properties)
{ {
@@ -739,13 +752,15 @@ namespace PepperDash.Essentials.DM
} }
else if (args.EventId == DMOutputEventIds.VideoOutEventId) else if (args.EventId == DMOutputEventIds.VideoOutEventId)
{ {
if (outputCard != null && outputCard.VideoOutFeedback != null) if (outputCard == null || outputCard.VideoOutFeedback == null) return;
{
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, outputCard.VideoOutFeedback.Number, output); Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name,
} outputCard.VideoOutFeedback.Number, output);
if (VideoOutputFeedbacks.ContainsKey(output)) if (VideoOutputFeedbacks.ContainsKey(output))
{ {
VideoOutputFeedbacks[output].FireUpdate(); VideoOutputFeedbacks[output].FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(output, VideoOutputFeedbacks[output].UShortValue, eRoutingSignalType.Video));
} }
if (OutputVideoRouteNameFeedbacks.ContainsKey(output)) if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
{ {
@@ -754,13 +769,15 @@ namespace PepperDash.Essentials.DM
} }
else if (args.EventId == DMOutputEventIds.AudioOutEventId) else if (args.EventId == DMOutputEventIds.AudioOutEventId)
{ {
if (outputCard != null && outputCard.AudioOutFeedback != null) if (outputCard == null || outputCard.AudioOutFeedback == null) return;
{
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, outputCard.AudioOutFeedback.Number, output); Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name,
} outputCard.AudioOutFeedback.Number, output);
if (AudioOutputFeedbacks.ContainsKey(output)) if (AudioOutputFeedbacks.ContainsKey(output))
{ {
AudioOutputFeedbacks[output].FireUpdate(); AudioOutputFeedbacks[output].FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(output, AudioOutputFeedbacks[output].UShortValue, eRoutingSignalType.Audio));
} }
} }
else if (args.EventId == DMOutputEventIds.OutputNameEventId else if (args.EventId == DMOutputEventIds.OutputNameEventId

View File

@@ -16,11 +16,14 @@ using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.DM.Chassis namespace PepperDash.Essentials.DM.Chassis
{ {
[Description("Wrapper class for all HdMdNxM4E switchers")] [Description("Wrapper class for all HdMdNxM4E switchers")]
public class HdMdNxM4kEBridgeableController : CrestronGenericBridgeableBaseDevice, IRoutingInputsOutputs, IRoutingNumeric, IHasFeedback public class HdMdNxM4kEBridgeableController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, IHasFeedback
{ {
private HdMdNxM _Chassis; private HdMdNxM _Chassis;
private HdMd4x14kE _Chassis4x1; private HdMd4x14kE _Chassis4x1;
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
public Dictionary<uint, string> InputNames { get; set; } public Dictionary<uint, string> InputNames { get; set; }
public Dictionary<uint, string> OutputNames { get; set; } public Dictionary<uint, string> OutputNames { get; set; }
@@ -102,6 +105,15 @@ namespace PepperDash.Essentials.DM.Chassis
#region Methods #region Methods
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
public void EnableHdcp(uint port) public void EnableHdcp(uint port)
{ {
if (port > _Chassis.NumberOfInputs) return; if (port > _Chassis.NumberOfInputs) return;
@@ -328,8 +340,7 @@ namespace PepperDash.Essentials.DM.Chassis
void Chassis_OnlineStatusChange(Crestron.SimplSharpPro.GenericBase currentDevice, Crestron.SimplSharpPro.OnlineOfflineEventArgs args) void Chassis_OnlineStatusChange(Crestron.SimplSharpPro.GenericBase currentDevice, Crestron.SimplSharpPro.OnlineOfflineEventArgs args)
{ {
if (args.DeviceOnLine) if (!args.DeviceOnLine) return;
{
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++) for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
{ {
_Chassis.Inputs[i].Name.StringValue = InputNames[i]; _Chassis.Inputs[i].Name.StringValue = InputNames[i];
@@ -345,29 +356,25 @@ namespace PepperDash.Essentials.DM.Chassis
} }
} }
}
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args) void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
{ {
if (args.EventId == DMOutputEventIds.VideoOutEventId) if (args.EventId != DMOutputEventIds.VideoOutEventId) return;
for (var i = 0; i < VideoOutputRouteFeedbacks.Count; i++)
{ {
foreach (var item in VideoOutputRouteFeedbacks) VideoOutputRouteFeedbacks[i].FireUpdate();
{ OnSwitchChange(new RoutingNumericEventArgs((ushort)i, VideoOutputRouteFeedbacks[i].UShortValue, eRoutingSignalType.AudioVideo));
item.FireUpdate();
}
} }
} }
void Chassis_DMInputChange(Switch device, DMInputEventArgs args) void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
{ {
if (args.EventId == DMInputEventIds.VideoDetectedEventId) if (args.EventId != DMInputEventIds.VideoDetectedEventId) return;
{
foreach (var item in VideoInputSyncFeedbacks) foreach (var item in VideoInputSyncFeedbacks)
{ {
item.FireUpdate(); item.FireUpdate();
} }
} }
}
#endregion #endregion

View File

@@ -13,7 +13,7 @@ using PepperDash.Core;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
[Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")] [Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")]
public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRouting, public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRoutingWithFeedback,
IIROutputPorts, IComPorts, ICec IIROutputPorts, IComPorts, ICec
{ {
private readonly DmRmc4kzScalerC _rmc; private readonly DmRmc4kzScalerC _rmc;
@@ -31,6 +31,19 @@ namespace PepperDash.Essentials.DM
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; } public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc) public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc)
: base(key, name, rmc) : base(key, name, rmc)
{ {
@@ -55,12 +68,20 @@ namespace PepperDash.Essentials.DM
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange; _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange; _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
_rmc.OnlineStatusChange += _rmc_OnlineStatusChange;
// Set Ports for CEC // Set Ports for CEC
HdmiOut.Port = _rmc.HdmiOutput; HdmiOut.Port = _rmc.HdmiOutput;
AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback)); AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback));
} }
private void _rmc_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
AudioVideoSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, AudioVideoSourceNumericFeedback.UShortValue, eRoutingSignalType.AudioVideo));
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args) void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
{ {
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId || if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
@@ -72,6 +93,7 @@ namespace PepperDash.Essentials.DM
if (args.EventId == EndpointOutputStreamEventIds.SelectedSourceFeedbackEventId) if (args.EventId == EndpointOutputStreamEventIds.SelectedSourceFeedbackEventId)
{ {
AudioVideoSourceNumericFeedback.FireUpdate(); AudioVideoSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, AudioVideoSourceNumericFeedback.UShortValue, eRoutingSignalType.AudioVideo));
} }
} }

View File

@@ -17,7 +17,7 @@ namespace PepperDash.Essentials.DM
/// 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")] [Description("Wrapper class for DM-TX-200-C")]
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls public class DmTx200Controller : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx200C2G Tx { get; private set; } public DmTx200C2G Tx { get; private set; }
@@ -37,6 +37,19 @@ namespace PepperDash.Essentials.DM
public IntFeedback VgaBrightnessFeedback { get; protected set; } public IntFeedback VgaBrightnessFeedback { get; protected set; }
public IntFeedback VgaContrastFeedback { get; protected set; } public IntFeedback VgaContrastFeedback { get; protected set; }
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
/// </summary> /// </summary>
@@ -200,6 +213,9 @@ namespace PepperDash.Essentials.DM
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
} }
@@ -307,10 +323,12 @@ namespace PepperDash.Essentials.DM
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
break; break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId: case EndpointTransmitterBase.AudioSourceFeedbackEventId:
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
break; break;
} }
} }

View File

@@ -15,7 +15,7 @@ namespace PepperDash.Essentials.DM
/// 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")] [Description("Wrapper class for DM-TX-201-C")]
public class DmTx201CController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls public class DmTx201CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx201C Tx { get; private set; } public DmTx201C Tx { get; private set; }
@@ -36,6 +36,18 @@ namespace PepperDash.Essentials.DM
public IntFeedback VgaBrightnessFeedback { get; protected set; } public IntFeedback VgaBrightnessFeedback { get; protected set; }
public IntFeedback VgaContrastFeedback { get; protected set; } public IntFeedback VgaContrastFeedback { get; protected set; }
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
/// </summary> /// </summary>
@@ -197,7 +209,8 @@ namespace PepperDash.Essentials.DM
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
} }
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args) private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
@@ -323,10 +336,12 @@ namespace PepperDash.Essentials.DM
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
break; break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId: case EndpointTransmitterBase.AudioSourceFeedbackEventId:
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
break; break;
} }
} }

View File

@@ -15,7 +15,7 @@ namespace PepperDash.Essentials.DM
/// Controller class for all DM-TX-201S/F transmitters /// Controller class for all DM-TX-201S/F transmitters
/// </summary> /// </summary>
[Description("Wrapper class for DM-TX-201-S/F")] [Description("Wrapper class for DM-TX-201-S/F")]
public class DmTx201SController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls public class DmTx201SController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx201S Tx { get; private set; } public DmTx201S Tx { get; private set; }
@@ -36,6 +36,19 @@ namespace PepperDash.Essentials.DM
public IntFeedback VgaBrightnessFeedback { get; protected set; } public IntFeedback VgaBrightnessFeedback { get; protected set; }
public IntFeedback VgaContrastFeedback { get; protected set; } public IntFeedback VgaContrastFeedback { get; protected set; }
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
/// </summary> /// </summary>
@@ -197,7 +210,8 @@ namespace PepperDash.Essentials.DM
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
} }
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args) private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
@@ -323,10 +337,12 @@ namespace PepperDash.Essentials.DM
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
break; break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId: case EndpointTransmitterBase.AudioSourceFeedbackEventId:
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
break; break;
} }
} }

View File

@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.DM
using eVst = DmTx401C.eSourceSelection; using eVst = DmTx401C.eSourceSelection;
[Description("Wrapper class for DM-TX-401-C")] [Description("Wrapper class for DM-TX-401-C")]
public class DmTx401CController : DmTxControllerBase, ITxRouting, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls public class DmTx401CController : DmTxControllerBase, ITxRoutingWithFeedback, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx401C Tx { get; private set; } public DmTx401C Tx { get; private set; }
@@ -43,6 +43,19 @@ namespace PepperDash.Essentials.DM
public IntFeedback VgaBrightnessFeedback { get; protected set; } public IntFeedback VgaBrightnessFeedback { get; protected set; }
public IntFeedback VgaContrastFeedback { get; protected set; } public IntFeedback VgaContrastFeedback { get; protected set; }
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
/// </summary> /// </summary>
@@ -118,6 +131,7 @@ namespace PepperDash.Essentials.DM
Tx.HdmiInput.InputStreamChange += HdmiInputStreamChangeEvent; Tx.HdmiInput.InputStreamChange += HdmiInputStreamChangeEvent;
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChangeEvent; Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChangeEvent;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange; Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange; tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
@@ -286,6 +300,17 @@ namespace PepperDash.Essentials.DM
Tx.AudioSource = (eVst)inputSelector; Tx.AudioSource = (eVst)inputSelector;
} }
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate();
AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue,
eRoutingSignalType.Video));
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue,
eRoutingSignalType.Audio));
}
void Tx_BaseEvent(GenericBase device, BaseEventArgs args) void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
{ {
var id = args.EventId; var id = args.EventId;
@@ -297,10 +322,12 @@ namespace PepperDash.Essentials.DM
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
break; break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId: case EndpointTransmitterBase.AudioSourceFeedbackEventId:
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
break; break;
} }
} }

View File

@@ -21,7 +21,7 @@ namespace PepperDash.Essentials.DM
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType; using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
[Description("Wrapper class for DM-TX-4K-202-C")] [Description("Wrapper class for DM-TX-4K-202-C")]
public class DmTx4k202CController : DmTxControllerBase, ITxRouting, IHasFeedback, public class DmTx4k202CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
IIROutputPorts, IComPorts IIROutputPorts, IComPorts
{ {
public DmTx4k202C Tx { get; private set; } public DmTx4k202C Tx { get; private set; }
@@ -39,6 +39,19 @@ namespace PepperDash.Essentials.DM
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; } public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; } public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; } //public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
//public override ushort HdcpSupportCapability { get; protected set; } //public override ushort HdcpSupportCapability { get; protected set; }
@@ -102,6 +115,8 @@ namespace PepperDash.Essentials.DM
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange +=Tx_OnlineStatusChange;
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback); VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback); AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
@@ -296,6 +311,17 @@ namespace PepperDash.Essentials.DM
} }
} }
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate();
AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue,
eRoutingSignalType.Video));
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue,
eRoutingSignalType.Audio));
}
void Tx_BaseEvent(GenericBase device, BaseEventArgs args) void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
{ {
var id = args.EventId; var id = args.EventId;
@@ -308,10 +334,12 @@ namespace PepperDash.Essentials.DM
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
break; break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId: case EndpointTransmitterBase.AudioSourceFeedbackEventId:
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
break; break;
} }
} }

View File

@@ -21,7 +21,7 @@ namespace PepperDash.Essentials.DM
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType; using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
[Description("Wrapper class for DM-TX-4K-302-C")] [Description("Wrapper class for DM-TX-4K-302-C")]
public class DmTx4k302CController : DmTxControllerBase, ITxRouting, IHasFeedback, public class DmTx4k302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx4k302C Tx { get; private set; } public DmTx4k302C Tx { get; private set; }
@@ -46,6 +46,19 @@ namespace PepperDash.Essentials.DM
public IntFeedback VgaBrightnessFeedback { get; protected set; } public IntFeedback VgaBrightnessFeedback { get; protected set; }
public IntFeedback VgaContrastFeedback { get; protected set; } public IntFeedback VgaContrastFeedback { get; protected set; }
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
/// </summary> /// </summary>
@@ -110,6 +123,8 @@ namespace PepperDash.Essentials.DM
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange; Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback); VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback); AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
@@ -387,6 +402,16 @@ namespace PepperDash.Essentials.DM
break; break;
} }
} }
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate();
AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue,
eRoutingSignalType.Video));
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue,
eRoutingSignalType.Audio));
}
void Tx_BaseEvent(GenericBase device, BaseEventArgs args) void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
{ {
@@ -397,10 +422,12 @@ namespace PepperDash.Essentials.DM
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
break; break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId: case EndpointTransmitterBase.AudioSourceFeedbackEventId:
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
break; break;
} }
} }

View File

@@ -1,4 +1,5 @@
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using System;
//using Crestron.SimplSharpPro.DeviceSupport; //using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
@@ -14,7 +15,7 @@ namespace PepperDash.Essentials.DM
using eVst = eX02VideoSourceType; using eVst = eX02VideoSourceType;
using eAst = eX02AudioSourceType; using eAst = eX02AudioSourceType;
public class DmTx4kz202CController : DmTxControllerBase, ITxRouting, public class DmTx4kz202CController : DmTxControllerBase, ITxRoutingWithFeedback,
IIROutputPorts, IComPorts IIROutputPorts, IComPorts
{ {
public DmTx4kz202C Tx { get; private set; } public DmTx4kz202C Tx { get; private set; }
@@ -34,6 +35,19 @@ namespace PepperDash.Essentials.DM
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; } //public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
//public override ushort HdcpSupportCapability { get; protected set; } //public override ushort HdcpSupportCapability { get; protected set; }
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
@@ -89,6 +103,7 @@ namespace PepperDash.Essentials.DM
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent; Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent; Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback); VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
@@ -284,6 +299,18 @@ namespace PepperDash.Essentials.DM
} }
} }
private void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate();
AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue,
eRoutingSignalType.Video));
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue,
eRoutingSignalType.Audio));
}
void Tx_BaseEvent(GenericBase device, BaseEventArgs args) void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
{ {
var id = args.EventId; var id = args.EventId;
@@ -297,10 +324,12 @@ namespace PepperDash.Essentials.DM
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
break; break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId: case EndpointTransmitterBase.AudioSourceFeedbackEventId:
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
break; break;
} }
} }

View File

@@ -1,4 +1,5 @@
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using System;
//using Crestron.SimplSharpPro.DeviceSupport; //using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
@@ -16,7 +17,7 @@ namespace PepperDash.Essentials.DM
[Description("Wrapper class for DM-TX-4K-Z-302-C")] [Description("Wrapper class for DM-TX-4K-Z-302-C")]
public class DmTx4kz302CController : DmTxControllerBase, ITxRouting, IHasFeedback, public class DmTx4kz302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
IIROutputPorts, IComPorts IIROutputPorts, IComPorts
{ {
public DmTx4kz302C Tx { get; private set; } public DmTx4kz302C Tx { get; private set; }
@@ -39,6 +40,18 @@ namespace PepperDash.Essentials.DM
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; } //public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
//public override ushort HdcpSupportCapability { get; protected set; } //public override ushort HdcpSupportCapability { get; protected set; }
//IroutingNumericEvent
public event EventHandler NumericSwitchChange;
/// <summary>
/// Raise an event when the status of a switch object changes.
/// </summary>
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
public void OnSwitchChange(RoutingNumericEventArgs e)
{
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
}
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
/// </summary> /// </summary>
@@ -97,6 +110,7 @@ namespace PepperDash.Essentials.DM
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent; Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChange; Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChange;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback); VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback); AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
@@ -295,6 +309,18 @@ namespace PepperDash.Essentials.DM
} }
} }
private void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate();
AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue,
eRoutingSignalType.Video));
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue,
eRoutingSignalType.Audio));
}
void Tx_BaseEvent(GenericBase device, BaseEventArgs args) void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
{ {
var id = args.EventId; var id = args.EventId;
@@ -304,10 +330,12 @@ namespace PepperDash.Essentials.DM
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
break; break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId: case EndpointTransmitterBase.AudioSourceFeedbackEventId:
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
break; break;
} }
} }