mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
Merge pull request #472 from PepperDash/hotfix/DMPS-Routing-issues
Hotfix/dmps routing issues
This commit is contained in:
@@ -367,9 +367,18 @@ namespace PepperDash.Essentials.DM
|
|||||||
});
|
});
|
||||||
AudioOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
|
AudioOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
|
||||||
{
|
{
|
||||||
if (outputCard.AudioOutFeedback != null) { return (ushort)outputCard.AudioOutFeedback.Number; }
|
try
|
||||||
return 0;
|
{
|
||||||
;
|
if (outputCard.AudioOutFeedback != null)
|
||||||
|
{
|
||||||
|
return (ushort) outputCard.AudioOutFeedback.Number;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (NotSupportedException)
|
||||||
|
{
|
||||||
|
return (ushort) outputCard.AudioOutSourceFeedback;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
|
OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
|
||||||
@@ -770,22 +779,13 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
else if (args.EventId == DMOutputEventIds.VideoOutEventId)
|
else if (args.EventId == DMOutputEventIds.VideoOutEventId)
|
||||||
{
|
{
|
||||||
if (outputCard == null) return;
|
if (outputCard != null && outputCard.VideoOutFeedback != null)
|
||||||
|
{
|
||||||
var outputFeedbackIndex = outputCard.VideoOutFeedback == null ? 0 : outputCard.VideoOutFeedback.Number;
|
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, outputCard.VideoOutFeedback.Number, output);
|
||||||
|
}
|
||||||
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name,
|
|
||||||
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,
|
|
||||||
localOutputPort, localInputPort, eRoutingSignalType.Video));
|
|
||||||
}
|
}
|
||||||
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
||||||
{
|
{
|
||||||
@@ -794,43 +794,33 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
else if (args.EventId == DMOutputEventIds.AudioOutEventId)
|
else if (args.EventId == DMOutputEventIds.AudioOutEventId)
|
||||||
{
|
{
|
||||||
/*
|
try
|
||||||
if (outputCard == null || outputCard.AudioOutFeedback == null) return;
|
|
||||||
|
|
||||||
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name,
|
|
||||||
outputCard.AudioOutFeedback.Number, output);
|
|
||||||
|
|
||||||
if (AudioOutputFeedbacks.ContainsKey(output))
|
|
||||||
{
|
{
|
||||||
AudioOutputFeedbacks[output].FireUpdate();
|
if (outputCard != null && outputCard.AudioOutFeedback != null)
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(output, AudioOutputFeedbacks[output].UShortValue, eRoutingSignalType.Audio));
|
{
|
||||||
|
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name,
|
||||||
|
outputCard.AudioOutFeedback.Number, output);
|
||||||
|
}
|
||||||
|
if (AudioOutputFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
AudioOutputFeedbacks[output].FireUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
catch (NotSupportedException)
|
||||||
|
|
||||||
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 =
|
if (outputCard != null)
|
||||||
InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == outputCard.AudioOutFeedback);
|
{
|
||||||
var localOutputPort = OutputPorts.FirstOrDefault(p => (DMOutput)p.FeedbackMatchObject == outputCard);
|
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", Name,
|
||||||
|
outputCard.AudioOutSourceFeedback, output);
|
||||||
AudioOutputFeedbacks[output].FireUpdate();
|
}
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(output, AudioOutputFeedbacks[output].UShortValue,
|
if (AudioOutputFeedbacks.ContainsKey(output))
|
||||||
localOutputPort, localInputPort, eRoutingSignalType.Audio));
|
{
|
||||||
}
|
AudioOutputFeedbacks[output].FireUpdate();
|
||||||
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))
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
||||||
OutputNameFeedbacks[output].FireUpdate();
|
OutputNameFeedbacks[output].FireUpdate();
|
||||||
@@ -861,7 +851,14 @@ namespace PepperDash.Essentials.DM
|
|||||||
var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
|
var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
|
||||||
var output = Convert.ToUInt32(outputSelector);
|
var output = Convert.ToUInt32(outputSelector);
|
||||||
|
|
||||||
if (input <= Dmps.NumberOfSwitcherInputs && output <= Dmps.NumberOfSwitcherOutputs)
|
var sigTypeIsUsbOrVideo = ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video) ||
|
||||||
|
((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) ||
|
||||||
|
((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput);
|
||||||
|
|
||||||
|
if ((input <= Dmps.NumberOfSwitcherInputs && output <= Dmps.NumberOfSwitcherOutputs &&
|
||||||
|
sigTypeIsUsbOrVideo) ||
|
||||||
|
(input <= Dmps.NumberOfSwitcherInputs + 5 && output <= Dmps.NumberOfSwitcherOutputs &&
|
||||||
|
(sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio))
|
||||||
{
|
{
|
||||||
// Check to see if there's an off timer waiting on this and if so, cancel
|
// Check to see if there's an off timer waiting on this and if so, cancel
|
||||||
var key = new PortNumberType(output, sigType);
|
var key = new PortNumberType(output, sigType);
|
||||||
@@ -879,37 +876,55 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
|
||||||
DMOutput outCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput;
|
DMOutput dmOutputCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput;
|
||||||
|
|
||||||
//if (inCard != null)
|
//if (inCard != null)
|
||||||
//{
|
//{
|
||||||
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
||||||
if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||||
{
|
{
|
||||||
|
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
|
//SystemControl.VideoEnter.BoolValue = true;
|
||||||
|
if (dmOutputCard != null)
|
||||||
|
dmOutputCard.VideoOut = dmInputCard;
|
||||||
|
}
|
||||||
|
|
||||||
//SystemControl.VideoEnter.BoolValue = true;
|
if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||||
if (outCard != null)
|
{
|
||||||
outCard.VideoOut = inCard;
|
DMInput dmInputCard = null;
|
||||||
|
if (input <= Dmps.NumberOfSwitcherInputs)
|
||||||
|
{
|
||||||
|
dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sigType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
if (dmOutputCard != null)
|
||||||
{
|
try
|
||||||
if (outCard != null)
|
{
|
||||||
outCard.AudioOut = inCard;
|
dmOutputCard.AudioOut = dmInputCard;
|
||||||
}
|
}
|
||||||
|
catch (NotSupportedException)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Routing input {0} audio to output {1}",
|
||||||
|
(eDmps34KAudioOutSource) input, (CrestronControlSystem.eDmps34K350COutputs) output);
|
||||||
|
|
||||||
if ((sigType | eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
dmOutputCard.AudioOutSource = (eDmps34KAudioOutSource) input;
|
||||||
{
|
}
|
||||||
if (outCard != null)
|
}
|
||||||
outCard.USBRoutedTo = inCard;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
||||||
{
|
{
|
||||||
if (inCard != null)
|
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
inCard.USBRoutedTo = outCard;
|
if (dmOutputCard != null)
|
||||||
}
|
dmOutputCard.USBRoutedTo = dmInputCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
||||||
|
{
|
||||||
|
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
|
if (dmInputCard != null)
|
||||||
|
dmInputCard.USBRoutedTo = dmOutputCard;
|
||||||
|
}
|
||||||
//}
|
//}
|
||||||
//else
|
//else
|
||||||
//{
|
//{
|
||||||
@@ -919,7 +934,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Unable to execute route from input {0} to output {1}", inputSelector, outputSelector);
|
Debug.Console(1, this, "Unable to execute route from input {0} to output {1}", inputSelector,
|
||||||
|
outputSelector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|||||||
Reference in New Issue
Block a user