mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 12:15:01 +00:00
Expanded the event to include RoutingPorts
Triggers for events are now based on FeedbackMatchObject
This commit is contained in:
@@ -17,8 +17,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
|
public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
|
||||||
{
|
{
|
||||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||||
|
|
||||||
@@ -258,13 +258,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMute.JoinNumber]);
|
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMute.JoinNumber]);
|
||||||
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]);
|
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]);
|
||||||
volumeDisplayWithFeedback.MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.VolumeMuteOff.JoinNumber]);
|
volumeDisplayWithFeedback.MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.VolumeMuteOff.JoinNumber]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class TwoWayDisplayBase : DisplayBase
|
public abstract class TwoWayDisplayBase : DisplayBase, IRoutingFeedback
|
||||||
{
|
{
|
||||||
public StringFeedback CurrentInputFeedback { get; private set; }
|
public StringFeedback CurrentInputFeedback { get; private set; }
|
||||||
|
|
||||||
@@ -293,7 +294,20 @@ namespace PepperDash.Essentials.Core
|
|||||||
Feedbacks.Add(CurrentInputFeedback);
|
Feedbacks.Add(CurrentInputFeedback);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> 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>
|
||||||
|
protected void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,14 +115,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines an IRmcRouting with a feedback event
|
/// Defines an IRmcRouting with a feedback event
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ITxRoutingWithFeedback : ITxRouting, IRoutingNumericFeedback
|
public interface ITxRoutingWithFeedback : ITxRouting
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines an IRmcRouting with a feedback event
|
/// Defines an IRmcRouting with a feedback event
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRmcRoutingWithFeedback : IRmcRouting, IRoutingNumericFeedback
|
public interface IRmcRoutingWithFeedback : IRmcRouting
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,45 +136,62 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines an event structure for reporting output route data
|
/// Defines an event structure for reporting output route data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRoutingNumericFeedback : IKeyName
|
public interface IRoutingFeedback : IKeyName
|
||||||
{
|
{
|
||||||
event EventHandler NumericSwitchChange;
|
event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
//void OnSwitchChange(RoutingNumericEventArgs e);
|
//void OnSwitchChange(RoutingNumericEventArgs e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines an IRoutingNumeric with a feedback event
|
/// Defines an IRoutingNumeric with a feedback event
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRoutingNumericWithFeedback : IRoutingNumeric, IRoutingNumericFeedback
|
public interface IRoutingNumericWithFeedback : IRoutingNumeric, IRoutingFeedback
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines an IRouting with a feedback event
|
||||||
|
/// </summary>
|
||||||
|
public interface IRoutingWithFeedback : IRouting, IRoutingFeedback
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public class RoutingNumericEventArgs : EventArgs
|
public class RoutingNumericEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
private readonly uint _output;
|
|
||||||
private readonly uint _input;
|
|
||||||
private readonly eRoutingSignalType _sigType;
|
|
||||||
|
|
||||||
public uint Output
|
public uint? Output { get; set; }
|
||||||
|
public uint? Input { get; set; }
|
||||||
|
|
||||||
|
public eRoutingSignalType SigType { get; set; }
|
||||||
|
public RoutingInputPort InputPort { get; set; }
|
||||||
|
public RoutingOutputPort OutputPort { get; set; }
|
||||||
|
|
||||||
|
public RoutingNumericEventArgs(uint output, uint input, eRoutingSignalType sigType) : this(output, input, null, null, sigType)
|
||||||
{
|
{
|
||||||
get { return _output; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint Input
|
public RoutingNumericEventArgs(RoutingOutputPort outputPort, RoutingInputPort inputPort,
|
||||||
|
eRoutingSignalType sigType)
|
||||||
|
: this(null, null, outputPort, inputPort, sigType)
|
||||||
{
|
{
|
||||||
get { return _input; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public eRoutingSignalType SigType
|
public RoutingNumericEventArgs()
|
||||||
|
: this(null, null, null, null, 0)
|
||||||
{
|
{
|
||||||
get { return _sigType; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoutingNumericEventArgs(uint output, uint input, eRoutingSignalType sigType)
|
public RoutingNumericEventArgs(uint? output, uint? input, RoutingOutputPort outputPort,
|
||||||
|
RoutingInputPort inputPort, eRoutingSignalType sigType)
|
||||||
{
|
{
|
||||||
_output = output;
|
OutputPort = outputPort;
|
||||||
_input = input;
|
InputPort = inputPort;
|
||||||
_sigType = sigType;
|
|
||||||
|
Output = output;
|
||||||
|
Input = input;
|
||||||
|
SigType = sigType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,8 +29,9 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> 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; }
|
||||||
@@ -46,6 +47,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
|
public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
|
||||||
: base(key, name, device)
|
: base(key, name, device)
|
||||||
{
|
{
|
||||||
|
|
||||||
AirMedia = device;
|
AirMedia = device;
|
||||||
|
|
||||||
DeviceConfig = dc;
|
DeviceConfig = dc;
|
||||||
@@ -56,21 +58,36 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this));
|
eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 0
|
||||||
|
});
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this));
|
eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 1
|
||||||
|
});
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this));
|
eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 2
|
||||||
|
});
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this));
|
eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 4
|
||||||
|
});
|
||||||
|
|
||||||
if (AirMedia is Am300)
|
if (AirMedia is Am300)
|
||||||
{
|
{
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this));
|
eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 3
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputPorts.Add(new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
OutputPorts.Add(new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||||
@@ -162,8 +179,9 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
}
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AirMedia_AirMediaChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
void AirMedia_AirMediaChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||||
@@ -187,13 +205,18 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
if (args.EventId == AmX00.VideoOutFeedbackEventId)
|
if (args.EventId == AmX00.VideoOutFeedbackEventId)
|
||||||
{
|
{
|
||||||
VideoOutFeedback.FireUpdate();
|
VideoOutFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoOutFeedback.UShortValue, eRoutingSignalType.AudioVideo));
|
|
||||||
|
var localInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (int) p.FeedbackMatchObject == VideoOutFeedback.UShortValue);
|
||||||
|
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoOutFeedback.UShortValue, OutputPorts.First(),
|
||||||
|
localInputPort, eRoutingSignalType.AudioVideo));
|
||||||
}
|
}
|
||||||
else if (args.EventId == AmX00.EnableAutomaticRoutingFeedbackEventId)
|
else if (args.EventId == AmX00.EnableAutomaticRoutingFeedbackEventId)
|
||||||
AutomaticInputRoutingEnabledFeedback.FireUpdate();
|
AutomaticInputRoutingEnabledFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HdmiIn_StreamChange(Crestron.SimplSharpPro.DeviceSupport.Stream stream, Crestron.SimplSharpPro.DeviceSupport.StreamEventArgs args)
|
void HdmiIn_StreamChange(Stream stream, Crestron.SimplSharpPro.DeviceSupport.StreamEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == DMInputEventIds.SourceSyncEventId)
|
if (args.EventId == DMInputEventIds.SourceSyncEventId)
|
||||||
HdmiVideoSyncDetectedFeedback.FireUpdate();
|
HdmiVideoSyncDetectedFeedback.FireUpdate();
|
||||||
|
|||||||
@@ -21,12 +21,15 @@ namespace PepperDash.Essentials.DM {
|
|||||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumeric
|
public class DmBladeChassisController : 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<RoutingNumericEventArgs> 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; }
|
||||||
@@ -287,6 +290,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>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AddHdmiInBladePorts(uint number, ICec cecPort) {
|
void AddHdmiInBladePorts(uint number, ICec cecPort) {
|
||||||
@@ -377,7 +389,10 @@ namespace PepperDash.Essentials.DM {
|
|||||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType) {
|
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType) {
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||||
|
};
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
@@ -385,19 +400,20 @@ namespace PepperDash.Essentials.DM {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds InputPort and sets Port as ICec object
|
/// Adds InputPort and sets Port as ICec object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, ICec cecPort) {
|
private void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType,
|
||||||
|
eRoutingPortConnectionType portType, ICec cecPort)
|
||||||
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||||
|
};
|
||||||
|
|
||||||
if (inputPort != null) {
|
if (cecPort != null)
|
||||||
if (cecPort != null)
|
inputPort.Port = cecPort;
|
||||||
inputPort.Port = cecPort;
|
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
|
||||||
else
|
|
||||||
Debug.Console(2, this, "inputPort is null");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -407,7 +423,10 @@ namespace PepperDash.Essentials.DM {
|
|||||||
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector) {
|
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector) {
|
||||||
var portKey = string.Format("{0}--{1}", cardName, portName);
|
var portKey = string.Format("{0}--{1}", cardName, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
|
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Outputs[(uint)selector]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -458,54 +477,84 @@ namespace PepperDash.Essentials.DM {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
private void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||||
{
|
{
|
||||||
var output = args.Number;
|
var output = args.Number;
|
||||||
|
|
||||||
switch (args.EventId) {
|
switch (args.EventId)
|
||||||
case DMOutputEventIds.VolumeEventId: {
|
{
|
||||||
if (VolumeControls.ContainsKey(output)) {
|
case DMOutputEventIds.VolumeEventId:
|
||||||
VolumeControls[args.Number].VolumeEventFromChassis();
|
{
|
||||||
}
|
if (VolumeControls.ContainsKey(output))
|
||||||
break;
|
{
|
||||||
|
VolumeControls[args.Number].VolumeEventFromChassis();
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.EndpointOnlineEventId: {
|
break;
|
||||||
Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. EndpointOnlineFeedback State: {1}", args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
}
|
||||||
if(Chassis.Outputs[output].Endpoint != null)
|
case DMOutputEventIds.EndpointOnlineEventId:
|
||||||
Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. Endpoint.IsOnline State: {1}", args.Number, Chassis.Outputs[output].Endpoint.IsOnline);
|
{
|
||||||
|
Debug.Console(2, this,
|
||||||
|
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. EndpointOnlineFeedback State: {1}",
|
||||||
|
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||||
|
if (Chassis.Outputs[output].Endpoint != null)
|
||||||
|
Debug.Console(2, this,
|
||||||
|
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. Endpoint.IsOnline State: {1}",
|
||||||
|
args.Number, Chassis.Outputs[output].Endpoint.IsOnline);
|
||||||
|
|
||||||
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.OnlineFeedbackEventId: {
|
case DMOutputEventIds.OnlineFeedbackEventId:
|
||||||
Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}", args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
{
|
||||||
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}",
|
||||||
break;
|
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||||
}
|
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||||
case DMOutputEventIds.VideoOutEventId: {
|
break;
|
||||||
if (Chassis.Outputs[output].VideoOutFeedback != null) {
|
}
|
||||||
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output);
|
case DMOutputEventIds.VideoOutEventId:
|
||||||
}
|
{
|
||||||
if (VideoOutputFeedbacks.ContainsKey(output)) {
|
|
||||||
VideoOutputFeedbacks[output].FireUpdate();
|
var inputNumber = Chassis.Outputs[output].VideoOutFeedback == null ? 0 : Chassis.Outputs[output].VideoOutFeedback.Number;
|
||||||
|
|
||||||
|
Debug.Console(2, this, "DMSwitchAudioVideo:{0} Routed Input:{1} Output:{2}'", this.Name,
|
||||||
|
inputNumber, output);
|
||||||
|
|
||||||
|
if (VideoOutputFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].VideoOutFeedback);
|
||||||
|
var localOutputPort =
|
||||||
|
OutputPorts.FirstOrDefault(p => (DMOutput) p.FeedbackMatchObject == Chassis.Outputs[output]);
|
||||||
|
|
||||||
|
|
||||||
|
VideoOutputFeedbacks[output].FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(output,
|
||||||
|
inputNumber,
|
||||||
|
localOutputPort,
|
||||||
|
localInputPort,
|
||||||
|
eRoutingSignalType.AudioVideo));
|
||||||
|
|
||||||
}
|
|
||||||
if (OutputVideoRouteNameFeedbacks.ContainsKey(output)) {
|
|
||||||
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.OutputNameEventId: {
|
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
||||||
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
{
|
||||||
OutputNameFeedbacks[output].FireUpdate();
|
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DMOutputEventIds.OutputNameEventId:
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
||||||
|
OutputNameFeedbacks[output].FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}",
|
||||||
|
args.Number, args.EventId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||||
|
|
||||||
public Switch Chassis { get; private set; }
|
public Switch Chassis { get; private set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
// Feedbacks for EssentialDM
|
// Feedbacks for EssentialDM
|
||||||
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
||||||
@@ -190,7 +190,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="chassis"></param>
|
/// <param name="chassis"></param>
|
||||||
public DmChassisController(string key, string name, DmMDMnxn chassis)
|
public DmChassisController(string key, string name, DmMDMnxn chassis)
|
||||||
: base(key, name, chassis)
|
: base(key, name, chassis)
|
||||||
{
|
{
|
||||||
|
|
||||||
Chassis = chassis;
|
Chassis = chassis;
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
@@ -740,7 +741,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||||
|
};
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
@@ -752,12 +756,15 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||||
|
}; ;
|
||||||
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
inputPort.Port = cecPort;
|
inputPort.Port = cecPort;
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -766,8 +773,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
|
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
|
||||||
{
|
{
|
||||||
var portKey = string.Format("{0}--{1}", cardName, portName);
|
var portKey = string.Format("{0}--{1}", cardName, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
|
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Outputs[(uint)selector]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -777,12 +787,15 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var portKey = string.Format("{0}--{1}", cardName, portName);
|
var portKey = string.Format("{0}--{1}", cardName, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
|
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Outputs[(uint)selector]
|
||||||
|
}; ;
|
||||||
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
outputPort.Port = cecPort;
|
outputPort.Port = cecPort;
|
||||||
|
|
||||||
OutputPorts.Add(outputPort);
|
OutputPorts.Add(outputPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -910,13 +923,15 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raise an event when the status of a switch object changes.
|
/// Raise an event when the status of a switch object changes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -951,15 +966,26 @@ namespace PepperDash.Essentials.DM
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.VideoOutEventId:
|
case DMOutputEventIds.VideoOutEventId:
|
||||||
{
|
{
|
||||||
if (Chassis.Outputs[output].VideoOutFeedback == null) return;
|
|
||||||
|
var inputNumber = Chassis.Outputs[output].VideoOutFeedback == null ? 0 : Chassis.
|
||||||
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output);
|
Outputs[output].VideoOutFeedback.Number;
|
||||||
|
|
||||||
|
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, inputNumber, output);
|
||||||
|
|
||||||
if (VideoOutputFeedbacks.ContainsKey(output))
|
if (VideoOutputFeedbacks.ContainsKey(output))
|
||||||
{
|
{
|
||||||
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].VideoOutFeedback);
|
||||||
|
var localOutputPort =
|
||||||
|
OutputPorts.FirstOrDefault(p => (DMOutput) p.FeedbackMatchObject == Chassis.Outputs[output]);
|
||||||
|
|
||||||
|
|
||||||
VideoOutputFeedbacks[output].FireUpdate();
|
VideoOutputFeedbacks[output].FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(output, Chassis.Outputs[output].VideoOutFeedback.Number, eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(output,
|
||||||
|
inputNumber,
|
||||||
|
localOutputPort,
|
||||||
|
localInputPort,
|
||||||
|
eRoutingSignalType.Video));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
||||||
@@ -969,19 +995,29 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
case DMOutputEventIds.AudioOutEventId:
|
case DMOutputEventIds.AudioOutEventId:
|
||||||
{
|
{
|
||||||
if (Chassis.Outputs[output].AudioOutFeedback == null) return;
|
var inputNumber = Chassis.Outputs[output].AudioOutFeedback == null ? 0 : Chassis.
|
||||||
|
Outputs[output].AudioOutFeedback.Number;
|
||||||
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, inputNumber, output);
|
||||||
|
|
||||||
if (AudioOutputFeedbacks.ContainsKey(output))
|
if (AudioOutputFeedbacks.ContainsKey(output))
|
||||||
{
|
{
|
||||||
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].AudioOutFeedback);
|
||||||
|
var localOutputPort =
|
||||||
|
OutputPorts.FirstOrDefault(p => (DMOutput)p.FeedbackMatchObject == Chassis.Outputs[output]);
|
||||||
|
|
||||||
|
|
||||||
AudioOutputFeedbacks[output].FireUpdate();
|
AudioOutputFeedbacks[output].FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(output, Chassis.Outputs[output].VideoOutFeedback.Number, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(output,
|
||||||
|
inputNumber,
|
||||||
|
localOutputPort,
|
||||||
|
localInputPort,
|
||||||
|
eRoutingSignalType.Audio));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
|
if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
|
||||||
OutputAudioRouteNameFeedbacks[output].FireUpdate();
|
OutputAudioRouteNameFeedbacks[output].FireUpdate();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.OutputNameEventId:
|
case DMOutputEventIds.OutputNameEventId:
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
public ISystemControl SystemControl { get; private set; }
|
public ISystemControl SystemControl { get; private set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
// Feedbacks for EssentialDM
|
// Feedbacks for EssentialDM
|
||||||
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
||||||
@@ -65,7 +65,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -74,6 +75,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
ISystemControl systemControl = null;
|
ISystemControl systemControl = null;
|
||||||
|
|
||||||
systemControl = Global.ControlSystem.SystemControl as ISystemControl;
|
systemControl = Global.ControlSystem.SystemControl as ISystemControl;
|
||||||
@@ -511,21 +513,26 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
AddInputPortWithDebug(number, string.Format("AirMediaIn{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Streaming);
|
AddInputPortWithDebug(number, string.Format("AirMediaIn{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Streaming);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds InputPort
|
/// Adds InputPort
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType)
|
private void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType,
|
||||||
{
|
eRoutingPortConnectionType portType)
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
{
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this)
|
||||||
InputPorts.Add(inputPort);
|
{
|
||||||
}
|
FeedbackMatchObject = Dmps.SwitcherInputs[cardNum]
|
||||||
|
};
|
||||||
|
;
|
||||||
|
|
||||||
|
InputPorts.Add(inputPort);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds InputPort and sets Port as ICec object
|
/// Adds InputPort and sets Port as ICec object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -533,13 +540,18 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Dmps.SwitcherInputs[cardNum]
|
||||||
|
};
|
||||||
|
;
|
||||||
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
inputPort.Port = cecPort;
|
inputPort.Port = cecPort;
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Builds the appropriate ports and calls the appropriate add port method
|
/// Builds the appropriate ports and calls the appropriate add port method
|
||||||
@@ -680,7 +692,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
|
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Dmps.SwitcherOutputs[cardNum]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -690,7 +705,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
|
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Dmps.SwitcherOutputs[cardNum]
|
||||||
|
};
|
||||||
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
outputPort.Port = cecPort;
|
outputPort.Port = cecPort;
|
||||||
@@ -752,15 +770,22 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
else if (args.EventId == DMOutputEventIds.VideoOutEventId)
|
else if (args.EventId == DMOutputEventIds.VideoOutEventId)
|
||||||
{
|
{
|
||||||
if (outputCard == null || outputCard.VideoOutFeedback == null) return;
|
if (outputCard == null) return;
|
||||||
|
|
||||||
|
var outputFeedbackIndex = outputCard.VideoOutFeedback == null ? 0 : outputCard.VideoOutFeedback.Number;
|
||||||
|
|
||||||
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name,
|
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name,
|
||||||
outputCard.VideoOutFeedback.Number, output);
|
outputFeedbackIndex, output);
|
||||||
|
|
||||||
if (VideoOutputFeedbacks.ContainsKey(output))
|
if (VideoOutputFeedbacks.ContainsKey(output))
|
||||||
{
|
{
|
||||||
|
var localInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DMInput) p.FeedbackMatchObject == outputCard.VideoOutFeedback);
|
||||||
|
var localOutputPort = OutputPorts.FirstOrDefault(p => (DMOutput) p.FeedbackMatchObject == outputCard);
|
||||||
|
|
||||||
VideoOutputFeedbacks[output].FireUpdate();
|
VideoOutputFeedbacks[output].FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(output, VideoOutputFeedbacks[output].UShortValue, eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(output, VideoOutputFeedbacks[output].UShortValue,
|
||||||
|
localOutputPort, localInputPort, eRoutingSignalType.Video));
|
||||||
}
|
}
|
||||||
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
||||||
{
|
{
|
||||||
@@ -769,6 +794,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
else if (args.EventId == DMOutputEventIds.AudioOutEventId)
|
else if (args.EventId == DMOutputEventIds.AudioOutEventId)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
if (outputCard == null || outputCard.AudioOutFeedback == null) return;
|
if (outputCard == null || outputCard.AudioOutFeedback == null) return;
|
||||||
|
|
||||||
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name,
|
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name,
|
||||||
@@ -779,6 +805,29 @@ namespace PepperDash.Essentials.DM
|
|||||||
AudioOutputFeedbacks[output].FireUpdate();
|
AudioOutputFeedbacks[output].FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(output, AudioOutputFeedbacks[output].UShortValue, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(output, AudioOutputFeedbacks[output].UShortValue, eRoutingSignalType.Audio));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (outputCard == null) return;
|
||||||
|
|
||||||
|
var outputFeedbackIndex = outputCard.AudioOutFeedback == null ? 0 : outputCard.VideoOutFeedback.Number;
|
||||||
|
|
||||||
|
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name,
|
||||||
|
outputFeedbackIndex, output);
|
||||||
|
|
||||||
|
if (AudioOutputFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
var localInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == outputCard.AudioOutFeedback);
|
||||||
|
var localOutputPort = OutputPorts.FirstOrDefault(p => (DMOutput)p.FeedbackMatchObject == outputCard);
|
||||||
|
|
||||||
|
AudioOutputFeedbacks[output].FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(output, AudioOutputFeedbacks[output].UShortValue,
|
||||||
|
localOutputPort, localInputPort, eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
OutputAudioRouteNameFeedbacks[output].FireUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (args.EventId == DMOutputEventIds.OutputNameEventId
|
else if (args.EventId == DMOutputEventIds.OutputNameEventId
|
||||||
&& OutputNameFeedbacks.ContainsKey(output))
|
&& OutputNameFeedbacks.ContainsKey(output))
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.DM.Chassis
|
|||||||
private HdMd4x14kE _Chassis4x1;
|
private HdMd4x14kE _Chassis4x1;
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> 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; }
|
||||||
@@ -73,26 +73,34 @@ namespace PepperDash.Essentials.DM.Chassis
|
|||||||
|
|
||||||
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
||||||
{
|
{
|
||||||
var inputName = InputNames[i];
|
var index = i;
|
||||||
_Chassis.Inputs[i].Name.StringValue = inputName;
|
var inputName = InputNames[index];
|
||||||
|
_Chassis.Inputs[index].Name.StringValue = inputName;
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(inputName, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(inputName, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, i, this));
|
eRoutingPortConnectionType.Hdmi, index, this)
|
||||||
VideoInputSyncFeedbacks.Add(new BoolFeedback(inputName, () => _Chassis.Inputs[i].VideoDetectedFeedback.BoolValue));
|
{
|
||||||
InputNameFeedbacks.Add(new StringFeedback(inputName, () => _Chassis.Inputs[i].Name.StringValue));
|
FeedbackMatchObject = _Chassis.HdmiInputs[index]
|
||||||
InputHdcpEnableFeedback.Add(new BoolFeedback(inputName, () => _Chassis.HdmiInputs[i].HdmiInputPort.HdcpSupportOnFeedback.BoolValue));
|
});
|
||||||
|
VideoInputSyncFeedbacks.Add(new BoolFeedback(inputName, () => _Chassis.Inputs[index].VideoDetectedFeedback.BoolValue));
|
||||||
|
InputNameFeedbacks.Add(new StringFeedback(inputName, () => _Chassis.Inputs[index].Name.StringValue));
|
||||||
|
InputHdcpEnableFeedback.Add(new BoolFeedback(inputName, () => _Chassis.HdmiInputs[index].HdmiInputPort.HdcpSupportOnFeedback.BoolValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint i = 1; i <= _Chassis.NumberOfOutputs; i++)
|
for (uint i = 1; i <= _Chassis.NumberOfOutputs; i++)
|
||||||
{
|
{
|
||||||
var outputName = OutputNames[i];
|
var index = i;
|
||||||
|
var outputName = OutputNames[index];
|
||||||
_Chassis.Outputs[i].Name.StringValue = outputName;
|
_Chassis.Outputs[i].Name.StringValue = outputName;
|
||||||
|
|
||||||
OutputPorts.Add(new RoutingOutputPort(outputName, eRoutingSignalType.AudioVideo,
|
OutputPorts.Add(new RoutingOutputPort(outputName, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, i, this));
|
eRoutingPortConnectionType.Hdmi, index, this)
|
||||||
VideoOutputRouteFeedbacks.Add(new IntFeedback(outputName, () => (int)_Chassis.Outputs[i].VideoOutFeedback.Number));
|
{
|
||||||
OutputNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[i].Name.StringValue));
|
FeedbackMatchObject = _Chassis.HdmiOutputs[index]
|
||||||
OutputRouteNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[i].VideoOutFeedback.NameFeedback.StringValue));
|
});
|
||||||
|
VideoOutputRouteFeedbacks.Add(new IntFeedback(outputName, () => (int)_Chassis.Outputs[index].VideoOutFeedback.Number));
|
||||||
|
OutputNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[index].Name.StringValue));
|
||||||
|
OutputRouteNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[index].VideoOutFeedback.NameFeedback.StringValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
_Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
|
_Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
|
||||||
@@ -111,8 +119,9 @@ namespace PepperDash.Essentials.DM.Chassis
|
|||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
}
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
public void EnableHdcp(uint port)
|
public void EnableHdcp(uint port)
|
||||||
{
|
{
|
||||||
@@ -362,8 +371,14 @@ namespace PepperDash.Essentials.DM.Chassis
|
|||||||
|
|
||||||
for (var i = 0; i < VideoOutputRouteFeedbacks.Count; i++)
|
for (var i = 0; i < VideoOutputRouteFeedbacks.Count; i++)
|
||||||
{
|
{
|
||||||
|
var index = i;
|
||||||
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == _Chassis.HdmiOutputs[(uint)index + 1].VideoOutFeedback);
|
||||||
|
var localOutputPort =
|
||||||
|
OutputPorts.FirstOrDefault(p => (DMOutput)p.FeedbackMatchObject == _Chassis.HdmiOutputs[(uint)index + 1]);
|
||||||
|
|
||||||
|
|
||||||
VideoOutputRouteFeedbacks[i].FireUpdate();
|
VideoOutputRouteFeedbacks[i].FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs((ushort)i, VideoOutputRouteFeedbacks[i].UShortValue, eRoutingSignalType.AudioVideo));
|
OnSwitchChange(new RoutingNumericEventArgs((ushort)i, VideoOutputRouteFeedbacks[i].UShortValue, localOutputPort, localInputPort, eRoutingSignalType.AudioVideo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raise an event when the status of a switch object changes.
|
/// Raise an event when the status of a switch object changes.
|
||||||
@@ -40,7 +40,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -49,9 +50,15 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
_rmc = rmc;
|
_rmc = rmc;
|
||||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.DmCat, 0, this);
|
eRoutingPortConnectionType.DmCat, 0, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 1
|
||||||
|
};
|
||||||
HdmiIn = new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
HdmiIn = new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, 0, this);
|
eRoutingPortConnectionType.Hdmi, 0, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 2
|
||||||
|
};
|
||||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, null, this);
|
eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
|
|
||||||
@@ -92,8 +99,12 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
if (args.EventId == EndpointOutputStreamEventIds.SelectedSourceFeedbackEventId)
|
if (args.EventId == EndpointOutputStreamEventIds.SelectedSourceFeedbackEventId)
|
||||||
{
|
{
|
||||||
|
var localInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (int)p.FeedbackMatchObject == AudioVideoSourceNumericFeedback.UShortValue);
|
||||||
|
|
||||||
|
|
||||||
AudioVideoSourceNumericFeedback.FireUpdate();
|
AudioVideoSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioVideoSourceNumericFeedback.UShortValue, eRoutingSignalType.AudioVideo));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioVideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputPort, eRoutingSignalType.AudioVideo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
@@ -38,7 +39,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raise an event when the status of a switch object changes.
|
/// Raise an event when the status of a switch object changes.
|
||||||
@@ -46,8 +47,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
}
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -98,14 +100,22 @@ namespace PepperDash.Essentials.DM
|
|||||||
public DmTx200Controller(string key, string name, DmTx200C2G tx)
|
public DmTx200Controller(string key, string name, DmTx200C2G tx)
|
||||||
: base(key, name, tx)
|
: base(key, name, tx)
|
||||||
{
|
{
|
||||||
Tx = tx;
|
Tx = tx;
|
||||||
|
|
||||||
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
DmTx200Base.eSourceSelection.Digital, this,
|
||||||
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
{
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Digital
|
||||||
|
};
|
||||||
|
|
||||||
|
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
||||||
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
@@ -208,15 +218,19 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection) p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection) p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
@@ -319,16 +333,18 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
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));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||||
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));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
|||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
@@ -37,7 +38,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raise an event when the status of a switch object changes.
|
/// Raise an event when the status of a switch object changes.
|
||||||
@@ -45,7 +46,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -101,14 +103,22 @@ namespace PepperDash.Essentials.DM
|
|||||||
public DmTx201CController(string key, string name, DmTx201C tx)
|
public DmTx201CController(string key, string name, DmTx201C tx)
|
||||||
: base(key, name, tx)
|
: base(key, name, tx)
|
||||||
{
|
{
|
||||||
Tx = tx;
|
Tx = tx;
|
||||||
|
|
||||||
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
DmTx200Base.eSourceSelection.Digital, this,
|
||||||
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
{
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Digital
|
||||||
|
};
|
||||||
|
|
||||||
|
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
||||||
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
@@ -202,17 +212,23 @@ namespace PepperDash.Essentials.DM
|
|||||||
VgaContrastFeedback.FireUpdate();
|
VgaContrastFeedback.FireUpdate();
|
||||||
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_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
switch (args.EventId)
|
switch (args.EventId)
|
||||||
@@ -325,25 +341,26 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
|||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
@@ -37,16 +38,18 @@ namespace PepperDash.Essentials.DM
|
|||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raise an event when the status of a switch object changes.
|
/// Raise an event when the status of a switch object changes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
}
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -105,11 +108,19 @@ namespace PepperDash.Essentials.DM
|
|||||||
Tx = tx;
|
Tx = tx;
|
||||||
|
|
||||||
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
DmTx200Base.eSourceSelection.Digital, this,
|
||||||
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Digital
|
||||||
|
};
|
||||||
|
|
||||||
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
@@ -207,12 +218,18 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
@@ -333,19 +350,20 @@ namespace PepperDash.Essentials.DM
|
|||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raise an event when the status of a switch object changes.
|
/// Raise an event when the status of a switch object changes.
|
||||||
@@ -52,8 +52,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
}
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -117,16 +118,28 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.HDMI, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.HDMI, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.HDMI
|
||||||
|
};
|
||||||
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
|
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.DisplayPort, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.DisplayPort, this,
|
||||||
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput));
|
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.DisplayPort
|
||||||
|
};
|
||||||
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.VGA, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.VGA, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.VGA
|
||||||
|
};
|
||||||
CompositeIn = new RoutingInputPortWithVideoStatuses(DmPortName.CompositeIn,
|
CompositeIn = new RoutingInputPortWithVideoStatuses(DmPortName.CompositeIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Composite
|
||||||
|
};
|
||||||
|
|
||||||
Tx.HdmiInput.InputStreamChange += HdmiInputStreamChangeEvent;
|
Tx.HdmiInput.InputStreamChange += HdmiInputStreamChangeEvent;
|
||||||
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChangeEvent;
|
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChangeEvent;
|
||||||
@@ -302,13 +315,16 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue,
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue,
|
|
||||||
eRoutingSignalType.Audio));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
@@ -319,18 +335,20 @@ namespace PepperDash.Essentials.DM
|
|||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
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));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
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));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoControls_ControlChange(object sender, GenericEventArgs args)
|
void VideoControls_ControlChange(object sender, GenericEventArgs args)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raise an event when the status of a switch object changes.
|
/// Raise an event when the status of a switch object changes.
|
||||||
@@ -48,8 +48,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
}
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||||
@@ -93,108 +94,121 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public DmTx4k202CController(string key, string name, DmTx4k202C tx)
|
|
||||||
: base(key, name, tx)
|
public DmTx4k202CController(string key, string name, DmTx4k202C tx)
|
||||||
{
|
: base(key, name, tx)
|
||||||
Tx = tx;
|
{
|
||||||
|
Tx = tx;
|
||||||
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
||||||
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
{
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
|
FeedbackMatchObject = eVst.Hdmi1
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
};
|
||||||
() => ActualActiveVideoInput.ToString());
|
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||||
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
||||||
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
|
||||||
|
{
|
||||||
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
FeedbackMatchObject = eVst.Hdmi2
|
||||||
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
};
|
||||||
|
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
|
() => ActualActiveVideoInput.ToString());
|
||||||
Tx.OnlineStatusChange +=Tx_OnlineStatusChange;
|
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
|
||||||
|
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
||||||
|
|
||||||
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
|
||||||
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
|
|
||||||
HdcpStateFeedback =
|
VideoSourceNumericFeedback = new IntFeedback(() => (int) Tx.VideoSourceFeedback);
|
||||||
new IntFeedback(
|
|
||||||
() =>
|
AudioSourceNumericFeedback = new IntFeedback(() => (int) Tx.AudioSourceFeedback);
|
||||||
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
|
|
||||||
? (int) tx.HdmiInputs[1].HdcpCapabilityFeedback
|
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability",
|
||||||
: (int) tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
() => (int) tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability",
|
||||||
|
() => (int) tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||||
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
|
||||||
|
HdcpStateFeedback =
|
||||||
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
new IntFeedback(
|
||||||
|
() =>
|
||||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
|
||||||
{
|
? (int) tx.HdmiInputs[1].HdcpCapabilityFeedback
|
||||||
HdcpActiveFeedbackFunc = () =>
|
: (int) tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||||
(ActualActiveVideoInput == eVst.Hdmi1
|
|
||||||
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
|
||||||
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
|
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool) tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
||||||
|
|
||||||
HdcpStateFeedbackFunc = () =>
|
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool) tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
if (ActualActiveVideoInput == eVst.Hdmi1)
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
|
{
|
||||||
if (ActualActiveVideoInput == eVst.Hdmi2)
|
HdcpActiveFeedbackFunc = () =>
|
||||||
return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
|
(ActualActiveVideoInput == eVst.Hdmi1
|
||||||
return "";
|
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
||||||
},
|
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||||
|
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||||
VideoResolutionFeedbackFunc = () =>
|
|
||||||
{
|
HdcpStateFeedbackFunc = () =>
|
||||||
if (ActualActiveVideoInput == eVst.Hdmi1)
|
{
|
||||||
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
|
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||||
if (ActualActiveVideoInput == eVst.Hdmi2)
|
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
|
||||||
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
|
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||||
return "";
|
return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
|
||||||
},
|
return "";
|
||||||
VideoSyncFeedbackFunc = () =>
|
},
|
||||||
(ActualActiveVideoInput == eVst.Hdmi1
|
|
||||||
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
VideoResolutionFeedbackFunc = () =>
|
||||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
{
|
||||||
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||||
|
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
|
||||||
};
|
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||||
|
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
|
||||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
return "";
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
},
|
||||||
|
VideoSyncFeedbackFunc = () =>
|
||||||
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
(ActualActiveVideoInput == eVst.Hdmi1
|
||||||
eRoutingPortConnectionType.DmCat, null, this);
|
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||||
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||||
eRoutingPortConnectionType.Hdmi, null, this);
|
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||||
|
|
||||||
|
};
|
||||||
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
|
||||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this,
|
||||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
|
combinedFuncs);
|
||||||
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback);
|
|
||||||
|
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
// Set Ports for CEC
|
eRoutingPortConnectionType.DmCat, null, this);
|
||||||
HdmiIn1.Port = Tx.HdmiInputs[1];
|
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut,
|
||||||
HdmiIn2.Port = Tx.HdmiInputs[2];
|
eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
HdmiLoopOut.Port = Tx.HdmiOutput;
|
eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
DmOut.Port = Tx.DmOutput;
|
|
||||||
}
|
|
||||||
|
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
||||||
|
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||||
|
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||||
|
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback,
|
||||||
|
HdmiIn2HdcpCapabilityFeedback,
|
||||||
|
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback);
|
||||||
|
|
||||||
|
// Set Ports for CEC
|
||||||
|
HdmiIn1.Port = Tx.HdmiInputs[1];
|
||||||
|
HdmiIn2.Port = Tx.HdmiInputs[2];
|
||||||
|
HdmiLoopOut.Port = Tx.HdmiOutput;
|
||||||
|
DmOut.Port = Tx.DmOutput;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
// Link up all of these damned events to the various RoutingPorts via a helper handler
|
// Link up all of these damned events to the various RoutingPorts via a helper handler
|
||||||
@@ -313,35 +327,39 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue,
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
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;
|
||||||
{
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
var id = args.EventId;
|
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
switch (id)
|
||||||
|
{
|
||||||
switch (id)
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
{
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raise an event when the status of a switch object changes.
|
/// Raise an event when the status of a switch object changes.
|
||||||
@@ -55,8 +55,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
}
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -108,13 +109,24 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi1
|
||||||
|
};
|
||||||
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi2
|
||||||
|
};
|
||||||
|
|
||||||
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Vga
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
@@ -404,33 +416,40 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue,
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
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;
|
||||||
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
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));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
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));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
@@ -36,7 +37,7 @@ 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
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raise an event when the status of a switch object changes.
|
/// Raise an event when the status of a switch object changes.
|
||||||
@@ -44,8 +45,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
}
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -87,14 +89,21 @@ namespace PepperDash.Essentials.DM
|
|||||||
public DmTx4kz202CController(string key, string name, DmTx4kz202C tx)
|
public DmTx4kz202CController(string key, string name, DmTx4kz202C tx)
|
||||||
: base(key, name, tx)
|
: base(key, name, tx)
|
||||||
{
|
{
|
||||||
Tx = tx;
|
Tx = tx;
|
||||||
|
|
||||||
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
|
||||||
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
{
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
FeedbackMatchObject = eVst.Hdmi1
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
|
};
|
||||||
|
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||||
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
||||||
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi2
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
@@ -299,39 +308,42 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue,
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
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;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
@@ -41,7 +42,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raise an event when the status of a switch object changes.
|
/// Raise an event when the status of a switch object changes.
|
||||||
@@ -49,7 +50,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
if (NumericSwitchChange != null) NumericSwitchChange(this, e);
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -96,13 +98,22 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi1
|
||||||
|
};
|
||||||
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
|
||||||
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi2
|
||||||
|
};
|
||||||
|
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DisplayPort, eVst.DisplayPort, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DisplayPort, eVst.DisplayPort, this,
|
||||||
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput));
|
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.DisplayPort
|
||||||
|
};
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
@@ -309,35 +320,42 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue,
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
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;
|
||||||
switch (id)
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
{
|
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
switch (id)
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
{
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -20,10 +20,12 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SamsungMDC : TwoWayDisplayBase, IBasicVolumeWithFeedback, ICommunicationMonitor, IInputDisplayPort1, IInputDisplayPort2,
|
public class SamsungMDC : TwoWayDisplayBase, IBasicVolumeWithFeedback, ICommunicationMonitor, IInputDisplayPort1, IInputDisplayPort2,
|
||||||
IInputHdmi1, IInputHdmi2, IInputHdmi3, IInputHdmi4, IBridgeAdvanced
|
IInputHdmi1, IInputHdmi2, IInputHdmi3, IInputHdmi4, IBridgeAdvanced
|
||||||
{
|
{
|
||||||
public IBasicCommunication Communication { get; private set; }
|
public IBasicCommunication Communication { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
|
|
||||||
@@ -324,7 +326,10 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
_IsMuted = newMute;
|
_IsMuted = newMute;
|
||||||
MuteFeedback.FireUpdate();
|
MuteFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -335,7 +340,8 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
if (newInput != null && newInput != _CurrentInputPort)
|
if (newInput != null && newInput != _CurrentInputPort)
|
||||||
{
|
{
|
||||||
_CurrentInputPort = newInput;
|
_CurrentInputPort = newInput;
|
||||||
CurrentInputFeedback.FireUpdate();
|
CurrentInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(null, _CurrentInputPort, eRoutingSignalType.AudioVideo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user