void clearSwitcher(uint hdmiOutput) { CrestronConsole.Print("\nClearing the route\r\n"); DMOutput outputToClear = deskSwitcher.Outputs[hdmiOutput] as DMOutput; outputToClear.VideoOut = null; }
public void DMOutputChange(Switch device, DMOutputEventArgs args) { try { switch (args.EventId) { case DMOutputEventIds.VideoOutEventId: DMOutput output = switcherOutputs[args.Number] as DMOutput; if (output.VideoOutFeedback != null) { DMInput input = output.VideoOutFeedback as DMInput; DMPSVideoEvent(Convert.ToUInt16(output.Number), Convert.ToUInt16(input.Number), input.Name.StringValue); } else { DMPSVideoEvent(Convert.ToUInt16(output.Number), 0, ""); } break; case DMOutputEventIds.OutputDisabledEventId: CrestronConsole.PrintLine("HDMI1 Output Enabled Status is: " + hdmiOutput.HdmiOutputPort.OutputEnabledFeedback.BoolValue); DMPSHDMIChange(hdmiOutput.HdmiOutputPort.OutputEnabledFeedback.BoolValue); break; } } catch (Exception e) { CrestronConsole.PrintLine("Error in DMOUtputChange is: " + e); } }
public RoutingListItem AddItem(DMOutput output, bool holdOffSettingListSize) { var index = base.AddItem(output.Name.StringValue, output, holdOffSettingListSize); ((RoutingListItem)this[index]).Number = output.Number; this[index].Visible = !string.IsNullOrEmpty(output.Name.StringValue); return(this[index] as RoutingListItem); }
public DM_RMC_4K_100_C_1G(ICardInputOutputType SwitcherOutput) { DMOutput _DMOutput = SwitcherOutput as DMOutput; _DmRmc4K100C1G = new DmRmc4K100C1G(_DMOutput); IR = _DmRmc4K100C1G.IROutputPorts[1]; Com01 = new RS232OnlyTwoWaySerialDriver(_DmRmc4K100C1G.ComPorts[1]); HDMI_Out = new CECDevice(_DmRmc4K100C1G.StreamCec); Name = _DmRmc4K100C1G.Name; }
public DM_RMC_4KZ_100_C(ICardInputOutputType SwitcherOutput) { DMOutput _DMOutput = SwitcherOutput as DMOutput; _DmRmc4kz100C = new DmRmc4kz100C(_DMOutput); C2I_DMRMC100_4KZ_IR2 = _DmRmc4kz100C.IROutputPorts[1]; Com01 = new DMPS3TwoWaySerialDriver(_DmRmc4kz100C.ComPorts[1]); CEC_DM_In = new CECDevice(_DmRmc4kz100C.DmInputStreamCec); CEC_HDMI_Out = new CECDevice(_DmRmc4kz100C.HdmiOutput.StreamCec); HDCP_HDMI_Out = new HDMIOutputHDCP(_DmRmc4kz100C.HdmiOutput); }
void setSwitcher(uint hdmiInput, uint hdmiOuput, BasicTriList device) { CrestronConsole.Print("\nUsed {0} to Route HDMI {1} to Output {2}\r\n", device, hdmiInput, hdmiOuput); clearInterlock(11, 15, device); DMOutput outputToSend = deskSwitcher.Outputs[hdmiOuput] as DMOutput; outputToSend.VideoOut = deskSwitcher.Inputs[hdmiInput]; int selectedSource = (int)hdmiInput - 1; deskPanel.StringInput[11].StringValue = sources[selectedSource]; }
public void DMOutputChange(Switch device, DMOutputEventArgs args) { try { switch (args.EventId) { case DMOutputEventIds.AudioOutEventId: DMOutput output = programOut; //[args.Number] as DMOutput; if (output.AudioOutFeedback != null) { DMInput input = output.AudioOutFeedback as DMInput; AudioSourceChange(input.Number); } else { AudioSourceChange(0); } break; case DMOutputEventIds.MasterVolumeFeedBackEventId: AudioLevelChange(programOut.MasterVolumeFeedBack.UShortValue, programOut.MasterMuteOnFeedBack.BoolValue); break; case DMOutputEventIds.MasterMuteOnFeedBackEventId: AudioLevelChange(programOut.MasterVolumeFeedBack.UShortValue, programOut.MasterMuteOnFeedBack.BoolValue); break; case DMOutputEventIds.MasterMuteOffFeedBackEventId: AudioLevelChange(programOut.MasterVolumeFeedBack.UShortValue, programOut.MasterMuteOnFeedBack.BoolValue); break; case DMOutputEventIds.AmpPowerOnFeedBackEventId: AmpPowerChange(AmpPowerStatus); break; case DMOutputEventIds.AmpPowerOffFeedBackEventId: AmpPowerChange(AmpPowerStatus); break; case DMOutputEventIds.MonoOutputFeedBackEventId: AmpMixerChange(programOut.OutputMixer.MonoOutputFeedback.BoolValue); break; case DMOutputEventIds.StereoOutputFeedBackEventId: AmpMixerChange(programOut.OutputMixer.MonoOutputFeedback.BoolValue); break; } } catch (Exception e) { CrestronConsole.PrintLine("Error in DMAudioOutputChange is: " + e); } }
/// /// </summary> void Dmps_DMOutputChange(Switch device, DMOutputEventArgs args) { Debug.Console(2, this, "DMOutputChange Output: {0} EventId: {1}", args.Number, args.EventId.ToString()); var output = args.Number; DMOutput outputCard = Dmps.SwitcherOutputs[output] as DMOutput; if (args.EventId == DMOutputEventIds.VolumeEventId && VolumeControls.ContainsKey(output)) { VolumeControls[args.Number].VolumeEventFromChassis(); } else if (args.EventId == DMOutputEventIds.OnlineFeedbackEventId && OutputEndpointOnlineFeedbacks.ContainsKey(output)) { OutputEndpointOnlineFeedbacks[output].FireUpdate(); } else if (args.EventId == DMOutputEventIds.VideoOutEventId) { if (outputCard != null && outputCard.VideoOutFeedback != null) { Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, outputCard.VideoOutFeedback.Number, output); } if (VideoOutputFeedbacks.ContainsKey(output)) { VideoOutputFeedbacks[output].FireUpdate(); } if (OutputVideoRouteNameFeedbacks.ContainsKey(output)) { OutputVideoRouteNameFeedbacks[output].FireUpdate(); } } else if (args.EventId == DMOutputEventIds.AudioOutEventId) { if (outputCard != null && outputCard.AudioOutFeedback != null) { Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, outputCard.AudioOutFeedback.Number, output); } if (AudioOutputFeedbacks.ContainsKey(output)) { AudioOutputFeedbacks[output].FireUpdate(); } } else if (args.EventId == DMOutputEventIds.OutputNameEventId && OutputNameFeedbacks.ContainsKey(output)) { Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output); OutputNameFeedbacks[output].FireUpdate(); } }
// Methods public void DMVideoRoute(int inputNumber, int outputNumber) { try { DMOutput output = switcherOutputs[(uint)outputNumber] as DMOutput; if (inputNumber == 0) { output.VideoOut = null; } else { output.VideoOut = switcherInputs[(uint)inputNumber] as DMInput; } } catch (Exception e) { CrestronConsole.PrintLine("DmPSVideoRouting DMVideoRoute Error is: " + e); } }
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType sigType) { try { 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 output = Convert.ToUInt32(outputSelector); if (input <= Dmps.NumberOfSwitcherInputs && output <= Dmps.NumberOfSwitcherOutputs) { // Check to see if there's an off timer waiting on this and if so, cancel var key = new PortNumberType(output, sigType); if (input == 0) { StartOffTimer(key); } else if (key.Number > 0) { if (RouteOffTimers.ContainsKey(key)) { Debug.Console(2, this, "{0} cancelling route off due to new source", output); RouteOffTimers[key].Stop(); RouteOffTimers.Remove(key); } } DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput; DMOutput outCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput; //if (inCard != null) //{ // NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video) { //SystemControl.VideoEnter.BoolValue = true; if (outCard != null) { outCard.VideoOut = inCard; } } if ((sigType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio) { if (outCard != null) { outCard.AudioOut = inCard; } } if ((sigType | eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput) { if (outCard != null) { outCard.USBRoutedTo = inCard; } } if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) { if (inCard != null) { inCard.USBRoutedTo = outCard; } } //} //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) { Debug.Console(1, this, "Error executing switch: {0}", e); } }
/// <summary> /// Builds the appropriate ports and calls the appropriate add port method /// </summary> /// <param name="number"></param> /// <param name="outputCard"></param> public void AddOutputCard(uint number, DMOutput outputCard) { if (outputCard is Card.Dmps3HdmiOutput) { var hdmiOutputCard = outputCard as Card.Dmps3HdmiOutput; var cecPort = hdmiOutputCard.HdmiOutputPort; AddHdmiOutputPort(number, cecPort); return; } else if (outputCard is Card.Dmps3DmOutput) { var dmOutputCard = outputCard as Card.Dmps3DmOutput; var cecPort = dmOutputCard.DmOutputPort; AddDmOutputPort(number); return; } else if (outputCard is Card.Dmps3ProgramOutput) { AddAudioOnlyOutputPort(number, "Program"); var programOutput = new DmpsAudioOutputController(string.Format("processor-programAudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase); DeviceManager.AddDevice(programOutput); return; } else if (outputCard is Card.Dmps3AuxOutput) { if (outputCard.CardInputOutputType == eCardInputOutputType.Dmps3Aux1Output) { AddAudioOnlyOutputPort(number, "Aux1"); var aux1Output = new DmpsAudioOutputController(string.Format("processor-aux1AudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase); DeviceManager.AddDevice(aux1Output); } else if (outputCard.CardInputOutputType == eCardInputOutputType.Dmps3Aux2Output) { AddAudioOnlyOutputPort(number, "Aux2"); var aux2Output = new DmpsAudioOutputController(string.Format("processor-aux2AudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase); DeviceManager.AddDevice(aux2Output); } return; } else if (outputCard is Card.Dmps3CodecOutput) { if (number == (uint)CrestronControlSystem.eDmps300cOutputs.Codec1 || number == (uint)CrestronControlSystem.eDmps3200cOutputs.Codec1 || number == (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec1 || number == (uint)CrestronControlSystem.eDmps34K250COutputs.Codec1 || number == (uint)CrestronControlSystem.eDmps34K350COutputs.Codec1) { AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec1.ToString()); } else if (number == (uint)CrestronControlSystem.eDmps300cOutputs.Codec2 || number == (uint)CrestronControlSystem.eDmps3200cOutputs.Codec2 || number == (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec2 || number == (uint)CrestronControlSystem.eDmps34K250COutputs.Codec2 || number == (uint)CrestronControlSystem.eDmps34K350COutputs.Codec2) { AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec2.ToString()); } return; } else if (outputCard is Card.Dmps3DialerOutput) { AddAudioOnlyOutputPort(number, "Dialer"); return; } else if (outputCard is Card.Dmps3DigitalMixOutput) { if (number == (uint)CrestronControlSystem.eDmps34K250COutputs.Mix1 || number == (uint)CrestronControlSystem.eDmps34K300COutputs.Mix1 || number == (uint)CrestronControlSystem.eDmps34K350COutputs.Mix1) { AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps34K250COutputs.Mix1.ToString()); } if (number == (uint)CrestronControlSystem.eDmps34K250COutputs.Mix2 || number == (uint)CrestronControlSystem.eDmps34K300COutputs.Mix2 || number == (uint)CrestronControlSystem.eDmps34K350COutputs.Mix2) { AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps34K250COutputs.Mix2.ToString()); } return; } else if (outputCard is Card.Dmps3AecOutput) { AddAudioOnlyOutputPort(number, "Aec"); return; } else { Debug.Console(1, this, "Output Card is of a type not currently handled:", outputCard.CardInputOutputType.ToString()); } }
public DM_RMC_4KZ_100_C(ICardInputOutputType SwitcherOutput) { DMOutput _DMOutput = SwitcherOutput as DMOutput; _DmRmc4kz100C = new DmRmc4kz100C(_DMOutput); }
public DMInputOutputBase GetUsbRoute(DMOutput output) { return(output.USBRoutedToFeedback); }
public void RouteUsb(DMOutput output, DMInputOutputBase route) { output.USBRoutedTo = route; Chassis.USBEnter.Pulse(10); }