mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
got it all working
This commit is contained in:
@@ -818,74 +818,94 @@ namespace PepperDash.Essentials.DM
|
|||||||
Debug.Console(2, this, "Attempting a DM route from input {0} to output {1} {2}", inputSelector, outputSelector, sigType);
|
Debug.Console(2, this, "Attempting a DM route from input {0} to output {1} {2}", inputSelector, outputSelector, sigType);
|
||||||
|
|
||||||
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) ||
|
||||||
// Check to see if there's an off timer waiting on this and if so, cancel
|
((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput);
|
||||||
var key = new PortNumberType(output, sigType);
|
|
||||||
if (input == 0)
|
if ((input <= Dmps.NumberOfSwitcherInputs && output <= Dmps.NumberOfSwitcherOutputs &&
|
||||||
{
|
sigTypeIsUsbOrVideo) ||
|
||||||
StartOffTimer(key);
|
(input <= Dmps.NumberOfSwitcherInputs + 5 && output <= Dmps.NumberOfSwitcherOutputs &&
|
||||||
}
|
(sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio))
|
||||||
else if (key.Number > 0)
|
{
|
||||||
{
|
// Check to see if there's an off timer waiting on this and if so, cancel
|
||||||
if (RouteOffTimers.ContainsKey(key))
|
var key = new PortNumberType(output, sigType);
|
||||||
{
|
if (input == 0)
|
||||||
Debug.Console(2, this, "{0} cancelling route off due to new source", output);
|
{
|
||||||
RouteOffTimers[key].Stop();
|
StartOffTimer(key);
|
||||||
RouteOffTimers.Remove(key);
|
}
|
||||||
}
|
else if (key.Number > 0)
|
||||||
}
|
{
|
||||||
|
if (RouteOffTimers.ContainsKey(key))
|
||||||
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
{
|
||||||
|
Debug.Console(2, this, "{0} cancelling route off due to new source", output);
|
||||||
|
RouteOffTimers[key].Stop();
|
||||||
|
RouteOffTimers.Remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DMOutput dmOutputCard = 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)
|
||||||
{
|
{
|
||||||
//SystemControl.VideoEnter.BoolValue = true;
|
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
if (dmOutputCard != null)
|
//SystemControl.VideoEnter.BoolValue = true;
|
||||||
dmOutputCard.VideoOut = dmInputCard;
|
if (dmOutputCard != null)
|
||||||
}
|
dmOutputCard.VideoOut = dmInputCard;
|
||||||
|
}
|
||||||
if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
|
||||||
{
|
if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||||
if (dmOutputCard != null)
|
{
|
||||||
try
|
DMInput dmInputCard = null;
|
||||||
{
|
if (input <= Dmps.NumberOfSwitcherInputs)
|
||||||
dmOutputCard.AudioOut = dmInputCard;
|
{
|
||||||
}
|
dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
catch (NotSupportedException)
|
}
|
||||||
{
|
|
||||||
dmOutputCard.AudioOutSource = (eDmps34KAudioOutSource) input;
|
if (dmOutputCard != null)
|
||||||
}
|
try
|
||||||
}
|
{
|
||||||
|
dmOutputCard.AudioOut = dmInputCard;
|
||||||
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
}
|
||||||
{
|
catch (NotSupportedException)
|
||||||
if (dmOutputCard != null)
|
{
|
||||||
dmOutputCard.USBRoutedTo = dmInputCard;
|
Debug.Console(1, this, "Routing input {0} audio to output {1}",
|
||||||
}
|
(eDmps34KAudioOutSource) input, (CrestronControlSystem.eDmps34K350COutputs) output);
|
||||||
|
|
||||||
if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
dmOutputCard.AudioOutSource = (eDmps34KAudioOutSource) input;
|
||||||
{
|
}
|
||||||
if (dmInputCard != null)
|
}
|
||||||
dmInputCard.USBRoutedTo = dmOutputCard;
|
|
||||||
}
|
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
||||||
//}
|
{
|
||||||
//else
|
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
//{
|
if (dmOutputCard != null)
|
||||||
// Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector);
|
dmOutputCard.USBRoutedTo = dmInputCard;
|
||||||
//}
|
}
|
||||||
|
|
||||||
}
|
if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
||||||
else
|
{
|
||||||
{
|
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
Debug.Console(1, this, "Unable to execute route from input {0} to output {1}", inputSelector, outputSelector);
|
if (dmInputCard != null)
|
||||||
}
|
dmInputCard.USBRoutedTo = dmOutputCard;
|
||||||
|
}
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector);
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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