mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 12:15:01 +00:00
feat: adds additional dm input/output event cases to event handlers
This commit is contained in:
@@ -88,7 +88,7 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
var audioDevice = new HdPsXxxOutputAudioController(Key, item.Number, _chassis);
|
var audioDevice = new HdPsXxxOutputAudioController(Key, item.Number, _chassis);
|
||||||
Debug.Console(2, this, "Adding HdPsXxxOutputAudioController '{0}' for output '{1}'", audioDevice.Key, item.Number);
|
Debug.Console(2, this, "Adding HdPsXxxOutputAudioController '{0}' for output '{1}'", audioDevice.Key, item.Number);
|
||||||
DeviceManager.AddDevice(audioDevice);
|
DeviceManager.AddDevice(audioDevice);
|
||||||
}
|
}
|
||||||
foreach (var item in _chassis.AnalogAuxiliaryMixer)
|
foreach (var item in _chassis.AnalogAuxiliaryMixer)
|
||||||
{
|
{
|
||||||
var audioDevice = new HdPsXxxAnalogAuxMixerController(Key, item.MixerNumber, _chassis);
|
var audioDevice = new HdPsXxxAnalogAuxMixerController(Key, item.MixerNumber, _chassis);
|
||||||
@@ -111,7 +111,7 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
Debug.Console(1, this, "Failed to setup inputs, properties are null");
|
Debug.Console(1, this, "Failed to setup inputs, properties are null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// iterate through HDMI inputs
|
// iterate through HDMI inputs
|
||||||
foreach (var item in _chassis.HdmiInputs)
|
foreach (var item in _chassis.HdmiInputs)
|
||||||
{
|
{
|
||||||
@@ -124,7 +124,7 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
|
|
||||||
input.Name.StringValue = name;
|
input.Name.StringValue = name;
|
||||||
|
|
||||||
InputNameFeedbacks.Add(new StringFeedback(index.ToString(CultureInfo.InvariantCulture),
|
InputNameFeedbacks.Add(new StringFeedback(index.ToString(CultureInfo.InvariantCulture),
|
||||||
() => InputNames[index]));
|
() => InputNames[index]));
|
||||||
|
|
||||||
var port = new RoutingInputPort(key, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, input, this)
|
var port = new RoutingInputPort(key, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, input, this)
|
||||||
@@ -134,10 +134,10 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
Debug.Console(1, this, "Adding Input port: {0} - {1}", port.Key, name);
|
Debug.Console(1, this, "Adding Input port: {0} - {1}", port.Key, name);
|
||||||
InputPorts.Add(port);
|
InputPorts.Add(port);
|
||||||
|
|
||||||
InputHdcpEnableFeedback.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture),
|
InputHdcpEnableFeedback.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture),
|
||||||
() => input.InputPort.HdcpSupportOnFeedback.BoolValue));
|
() => input.InputPort.HdcpSupportOnFeedback.BoolValue));
|
||||||
|
|
||||||
VideoInputSyncFeedbacks.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture),
|
VideoInputSyncFeedbacks.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture),
|
||||||
() => input.VideoDetectedFeedback.BoolValue));
|
() => input.VideoDetectedFeedback.BoolValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,13 +147,13 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
var input = item;
|
var input = item;
|
||||||
var index = item.Number;
|
var index = item.Number;
|
||||||
var key = string.Format("dmLiteIn{0}", index);
|
var key = string.Format("dmLiteIn{0}", index);
|
||||||
var name = string.IsNullOrEmpty(InputNames[index])
|
var name = string.IsNullOrEmpty(InputNames[index])
|
||||||
? string.Format("DM Input {0}", index)
|
? string.Format("DM Input {0}", index)
|
||||||
: InputNames[index];
|
: InputNames[index];
|
||||||
|
|
||||||
input.Name.StringValue = name;
|
input.Name.StringValue = name;
|
||||||
|
|
||||||
InputNameFeedbacks.Add(new StringFeedback(index.ToString(CultureInfo.InvariantCulture),
|
InputNameFeedbacks.Add(new StringFeedback(index.ToString(CultureInfo.InvariantCulture),
|
||||||
() => InputNames[index]));
|
() => InputNames[index]));
|
||||||
|
|
||||||
var port = new RoutingInputPort(key, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, input, this)
|
var port = new RoutingInputPort(key, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, input, this)
|
||||||
@@ -163,10 +163,10 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
Debug.Console(0, this, "Adding Input port: {0} - {1}", port.Key, name);
|
Debug.Console(0, this, "Adding Input port: {0} - {1}", port.Key, name);
|
||||||
InputPorts.Add(port);
|
InputPorts.Add(port);
|
||||||
|
|
||||||
InputHdcpEnableFeedback.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture),
|
InputHdcpEnableFeedback.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture),
|
||||||
() => input.InputPort.HdcpSupportOnFeedback.BoolValue));
|
() => input.InputPort.HdcpSupportOnFeedback.BoolValue));
|
||||||
|
|
||||||
VideoInputSyncFeedbacks.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture),
|
VideoInputSyncFeedbacks.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture),
|
||||||
() => input.VideoDetectedFeedback.BoolValue));
|
() => input.VideoDetectedFeedback.BoolValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,10 +186,10 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
{
|
{
|
||||||
var output = item;
|
var output = item;
|
||||||
var index = item.Number;
|
var index = item.Number;
|
||||||
var name = string.IsNullOrEmpty(OutputNames[index])
|
var name = string.IsNullOrEmpty(OutputNames[index])
|
||||||
? string.Format("Port {0}", index)
|
? string.Format("Port {0}", index)
|
||||||
: OutputNames[index];
|
: OutputNames[index];
|
||||||
|
|
||||||
output.Name.StringValue = name;
|
output.Name.StringValue = name;
|
||||||
|
|
||||||
var hdmiKey = string.Format("hdmiOut{0}", index);
|
var hdmiKey = string.Format("hdmiOut{0}", index);
|
||||||
@@ -209,11 +209,11 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
};
|
};
|
||||||
Debug.Console(1, this, "Adding Port port: {0} - {1}", dmLitePort.Key, name);
|
Debug.Console(1, this, "Adding Port port: {0} - {1}", dmLitePort.Key, name);
|
||||||
OutputPorts.Add(dmLitePort);
|
OutputPorts.Add(dmLitePort);
|
||||||
|
|
||||||
OutputRouteNameFeedback.Add(new StringFeedback(index.ToString(CultureInfo.InvariantCulture),
|
|
||||||
() => output.VideoOutFeedback.NameFeedback.StringValue));
|
|
||||||
|
|
||||||
VideoOutputRouteFeedbacks.Add(new IntFeedback(index.ToString(CultureInfo.InvariantCulture),
|
OutputRouteNameFeedback.Add(new StringFeedback(index.ToString(CultureInfo.InvariantCulture),
|
||||||
|
() => output.VideoOutFeedback.NameFeedback.StringValue));
|
||||||
|
|
||||||
|
VideoOutputRouteFeedbacks.Add(new IntFeedback(index.ToString(CultureInfo.InvariantCulture),
|
||||||
() => output.VideoOutFeedback == null ? 0 : (int)output.VideoOutFeedback.Number));
|
() => output.VideoOutFeedback == null ? 0 : (int)output.VideoOutFeedback.Number));
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -352,8 +352,8 @@ Selector: {4}
|
|||||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||||
{
|
{
|
||||||
var input = inputSelector as HdPsXxxInput;
|
var input = inputSelector as HdPsXxxInput;
|
||||||
var output = outputSelector as HdPsXxxOutput;
|
var output = outputSelector as HdPsXxxOutput;
|
||||||
|
|
||||||
Debug.Console(2, this, "ExecuteSwitch: input={0}, output={1}", input, output);
|
Debug.Console(2, this, "ExecuteSwitch: input={0}, output={1}", input, output);
|
||||||
|
|
||||||
if (output == null)
|
if (output == null)
|
||||||
@@ -456,24 +456,58 @@ Selector: {4}
|
|||||||
// _chassis input change event
|
// _chassis input change event
|
||||||
private void _chassis_InputChange(Switch device, DMInputEventArgs args)
|
private void _chassis_InputChange(Switch device, DMInputEventArgs args)
|
||||||
{
|
{
|
||||||
var eventId = args.EventId;
|
switch (args.EventId)
|
||||||
|
|
||||||
switch (eventId)
|
|
||||||
{
|
{
|
||||||
|
case DMInputEventIds.RemoteTransmitterDetectedEventId:
|
||||||
|
{
|
||||||
|
// signal found on HD-PSXxx > Inputs > Inputs DM Lite X
|
||||||
|
Debug.Console(2, this, "{0} DM Input Event ID {1}-RemoteTransmitterDetected | Number {2}",
|
||||||
|
device.ToString(), args.EventId, args.Number);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DMInputEventIds.SourceSyncEventId:
|
||||||
|
{
|
||||||
|
// signal found on HD-PSXxx > Inputs > HDMI/DM Lite X
|
||||||
|
Debug.Console(1, this, "{0} DM Input Event ID {1}-SourceSync | Number {2}: Updating VideoInputSyncFeedbacks",
|
||||||
|
device.ToString(), args.EventId, args.Number);
|
||||||
|
|
||||||
|
var input = args.Number;
|
||||||
|
|
||||||
|
var feedback = VideoInputSyncFeedbacks[(int)input];
|
||||||
|
if (feedback == null) return;
|
||||||
|
|
||||||
|
feedback.FireUpdate();
|
||||||
|
|
||||||
|
//foreach (var item in VideoInputSyncFeedbacks)
|
||||||
|
//{
|
||||||
|
// item.FireUpdate();
|
||||||
|
//}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case DMInputEventIds.VideoDetectedEventId:
|
case DMInputEventIds.VideoDetectedEventId:
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Event ID {0}: Updating VideoInputSyncFeedbacks", eventId);
|
Debug.Console(1, this, "{0} DM Input Event ID {1}-VideoDetected | Number {2}: Updating VideoInputSyncFeedbacks",
|
||||||
foreach (var item in VideoInputSyncFeedbacks)
|
device.ToString(), args.EventId, args.Number);
|
||||||
{
|
|
||||||
item.FireUpdate();
|
var input = args.Number;
|
||||||
}
|
|
||||||
|
var feedback = VideoInputSyncFeedbacks[(int) input];
|
||||||
|
if (feedback == null) return;
|
||||||
|
|
||||||
|
feedback.FireUpdate();
|
||||||
|
|
||||||
|
//foreach (var item in VideoInputSyncFeedbacks)
|
||||||
|
//{
|
||||||
|
// item.FireUpdate();
|
||||||
|
//}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMInputEventIds.InputNameFeedbackEventId:
|
case DMInputEventIds.InputNameFeedbackEventId:
|
||||||
case DMInputEventIds.InputNameEventId:
|
case DMInputEventIds.InputNameEventId:
|
||||||
case DMInputEventIds.NameFeedbackEventId:
|
case DMInputEventIds.NameFeedbackEventId:
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Event ID {0}: Updating name feedbacks", eventId);
|
Debug.Console(1, this, "{0} DM Input Event ID {1}-Name | Number {2}: Updating name feedbacks",
|
||||||
|
device.ToString(), args.EventId, args.Number);
|
||||||
|
|
||||||
var input = args.Number;
|
var input = args.Number;
|
||||||
var name = _chassis.HdmiInputs[input].NameFeedback.StringValue;
|
var name = _chassis.HdmiInputs[input].NameFeedback.StringValue;
|
||||||
@@ -483,7 +517,8 @@ Selector: {4}
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Uhandled DM Input Event ID {0}", eventId);
|
Debug.Console(1, this, "{0} DM Input Event ID {1} | Number {2}: Uhandled",
|
||||||
|
device.ToString(), args.EventId, args.Number);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -491,33 +526,50 @@ Selector: {4}
|
|||||||
OnDmInputChange(args);
|
OnDmInputChange(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// _chassis output change event
|
// _chassis output change event
|
||||||
private void _chassis_OutputChange(Switch device, DMOutputEventArgs args)
|
private void _chassis_OutputChange(Switch device, DMOutputEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId != DMOutputEventIds.VideoOutEventId) return;
|
switch (args.EventId)
|
||||||
|
{
|
||||||
|
case DMOutputEventIds.VideoOutEventId:
|
||||||
|
{
|
||||||
|
var output = args.Number;
|
||||||
|
|
||||||
var output = args.Number;
|
var input = _chassis.HdmiDmLiteOutputs[output].VideoOutFeedback == null
|
||||||
|
? 0
|
||||||
|
: _chassis.HdmiDmLiteOutputs[output].VideoOutFeedback.Number;
|
||||||
|
|
||||||
var input = _chassis.HdmiDmLiteOutputs[output].VideoOutFeedback == null
|
var outputName = OutputNames[output];
|
||||||
? 0
|
|
||||||
: _chassis.HdmiDmLiteOutputs[output].VideoOutFeedback.Number;
|
|
||||||
|
|
||||||
var outputName = OutputNames[output];
|
var feedback = VideoOutputRouteFeedbacks[outputName];
|
||||||
|
if (feedback == null) return;
|
||||||
|
|
||||||
var feedback = VideoOutputRouteFeedbacks[outputName];
|
var inputPort = InputPorts.FirstOrDefault(
|
||||||
if (feedback == null) return;
|
p => p.FeedbackMatchObject == _chassis.HdmiDmLiteOutputs[output].VideoOutFeedback);
|
||||||
|
|
||||||
var inputPort = InputPorts.FirstOrDefault(
|
var outputPort = OutputPorts.FirstOrDefault(
|
||||||
p => p.FeedbackMatchObject == _chassis.HdmiDmLiteOutputs[output].VideoOutFeedback);
|
p => p.FeedbackMatchObject == _chassis.HdmiDmLiteOutputs[output]);
|
||||||
|
|
||||||
var outputPort = OutputPorts.FirstOrDefault(
|
feedback.FireUpdate();
|
||||||
p => p.FeedbackMatchObject == _chassis.HdmiDmLiteOutputs[output]);
|
|
||||||
|
|
||||||
feedback.FireUpdate();
|
OnSwitchChange(new RoutingNumericEventArgs(output, input, outputPort, inputPort, eRoutingSignalType.AudioVideo));
|
||||||
|
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(
|
break;
|
||||||
output, input, outputPort, inputPort, eRoutingSignalType.AudioVideo));
|
}
|
||||||
|
case DMOutputEventIds.RemoteReceiverDetectedEventId:
|
||||||
|
{
|
||||||
|
// signal found on HD-PSXxx > Output[s] > Output [X] > DM Lite [X]
|
||||||
|
Debug.Console(2, this, "{0} DM Output Event Id {1} | Number:{2} | Index {3}: RemoteRecevierDetectedEventId",
|
||||||
|
device.ToString(), args.EventId, args.Number, args.Index);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "{0} DM Output Event Id {1} | Number:{2} | Index:{3}: Unhandled",
|
||||||
|
device.ToString(), args.EventId, args.Number, args.Index);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -543,9 +595,9 @@ Selector: {4}
|
|||||||
#region Factory
|
#region Factory
|
||||||
|
|
||||||
|
|
||||||
public class HdSp401ControllerFactory : EssentialsDeviceFactory<HdPsXxxController>
|
public class HdPsXxxControllerFactory : EssentialsDeviceFactory<HdPsXxxController>
|
||||||
{
|
{
|
||||||
public HdSp401ControllerFactory()
|
public HdPsXxxControllerFactory()
|
||||||
{
|
{
|
||||||
TypeNames = new List<string> { "hdps401", "hdps402", "hdps621", "hdps622" };
|
TypeNames = new List<string> { "hdps401", "hdps402", "hdps621", "hdps622" };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user