Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        // Properties

        //Constructors
        public dmpsVideoRouting(Crestron.SimplSharpPro.CrestronCollection <ICardInputOutputType> SwitcherInputs,
                                Crestron.SimplSharpPro.CrestronCollection <ICardInputOutputType> SwitcherOutputs, Dmps3SystemControl Device,
                                Crestron.SimplSharpPro.DM.Cards.Card.Dmps3HdmiOutput HDMIOutput,
                                Crestron.SimplSharpPro.DM.Cards.Card.Dmps3DmInput DMInput)
        {
            try
            {
                switcherInputs  = SwitcherInputs;
                switcherOutputs = SwitcherOutputs;
                _device         = (Dmps3SystemControl)Device;
                _device.FrontPanelPassword.StringValue = "1111";
                for (uint i = 1; i <= switcherInputs.Count; i++)
                {
                    DMInput test = switcherInputs[i] as DMInput;
                    test.Name.StringValue = sourceName[i - 1];
                }
                hdmiOutput = HDMIOutput;
                dmInput    = DMInput;
                hdmiOutput.HdmiOutputPort.OutputDisable();
            }
            catch (Exception e)
            {
                CrestronConsole.PrintLine("DMPsVideo Constructor error is: " + e);
            }
        }
Esempio n. 3
0
        public RoutingListItem AddItem(DMInput input, bool holdOffSettingListSize)
        {
            var index = base.AddItem(input.Name.StringValue, input, holdOffSettingListSize);

            ((RoutingListItem)this[index]).Number = input.Number;
            this[index].Visible = !string.IsNullOrEmpty(input.Name.StringValue);
            return(this[index] as RoutingListItem);
        }
Esempio n. 4
0
        /// <summary>
        /// Builds the appropriate ports aand callst the appropreate add port method
        /// </summary>
        /// <param name="number"></param>
        /// <param name="inputCard"></param>
        public void AddInputCard(uint number, DMInput inputCard)
        {
            if (inputCard is Card.Dmps3HdmiInputWithoutAnalogAudio)
            {
                var hdmiInputCard = inputCard as Card.Dmps3HdmiInputWithoutAnalogAudio;

                var cecPort = hdmiInputCard.HdmiInputPort;

                AddInputPortWithDebug(number, string.Format("HdmiIn{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, cecPort);
            }
            else if (inputCard is Card.Dmps3HdmiInput)
            {
                var hdmiInputCard = inputCard as Card.Dmps3HdmiInput;

                var cecPort = hdmiInputCard.HdmiInputPort;

                AddInputPortWithDebug(number, string.Format("HdmiIn{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, cecPort);
                AddInputPortWithDebug(number, string.Format("HudioIn{1}", number), eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
            }
            else if (inputCard is Card.Dmps3HdmiVgaInput)
            {
                var hdmiVgaInputCard = inputCard as Card.Dmps3HdmiVgaInput;

                DmpsInternalVirtualHdmiVgaInputController inputCardController = new DmpsInternalVirtualHdmiVgaInputController(Key +
                                                                                                                              string.Format("-HdmiVgaIn{0}", number), string.Format("InternalInputController-{0}", number), hdmiVgaInputCard);

                DeviceManager.AddDevice(inputCardController);

                AddInputPortWithDebug(number, string.Format("HdmiVgaIn{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.BackplaneOnly);
            }
            else if (inputCard is Card.Dmps3HdmiVgaBncInput)
            {
                var hdmiVgaBncInputCard = inputCard as Card.Dmps3HdmiVgaBncInput;

                DmpsInternalVirtualHdmiVgaBncInputController inputCardController = new DmpsInternalVirtualHdmiVgaBncInputController(Key +
                                                                                                                                    string.Format("-HdmiVgaBncIn{0}", number), string.Format("InternalInputController-{0}", number), hdmiVgaBncInputCard);

                DeviceManager.AddDevice(inputCardController);

                AddInputPortWithDebug(number, string.Format("HdmiVgaBncIn{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.BackplaneOnly);
            }
            else if (inputCard is Card.Dmps3DmInput)
            {
                var hdmiInputCard = inputCard as Card.Dmps3DmInput;

                var cecPort = hdmiInputCard.DmInputPort;

                AddInputPortWithDebug(number, string.Format("DmIn{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, cecPort);
            }
            else if (inputCard is Card.Dmps3AirMediaInput)
            {
                var airMediaInputCard = inputCard as Card.Dmps3AirMediaInput;

                AddInputPortWithDebug(number, string.Format("AirMediaIn{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Streaming);
            }
        }
        public DM_TX_4K_100_C_1G(ICardInputOutputType SwitcherInput)
        {
            DMInput _DMInput = SwitcherInput as DMInput;

            _DmTx4K100C1G = new DmTx4K100C1G(_DMInput);
            IR            = _DmTx4K100C1G.IROutputPorts[1];
            Com01         = new RS232OnlyTwoWaySerialDriver(_DmTx4K100C1G.ComPorts[1]);
            HDMI_In       = new CECDevice(_DmTx4K100C1G.StreamCec);
            Name          = _DmTx4K100C1G.Name;
        }
Esempio n. 6
0
        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);
            }
        }
Esempio n. 7
0
        public void DMInputChange(Switch device, DMInputEventArgs args)
        {
            switch (args.EventId)
            {
            case DMInputEventIds.SourceSyncEventId:
                try
                {
                    DMPSDmInputChange(dmInput.DmInputPort.SyncDetectedFeedback.BoolValue);
                }
                catch (Exception e)
                {
                    CrestronConsole.PrintLine("Error in Source Sync Feedback Event is: " + e);
                }

                break;

            case DMInputEventIds.VideoDetectedEventId:
                DMInput input2 = switcherInputs[args.Number] as DMInput;
                DMPSVideoSyncChange(input2.VideoDetectedFeedback.BoolValue);
                break;
            }
        }
Esempio n. 8
0
        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);
            }
        }
Esempio n. 9
0
        public DmpsInternalVirtualHdmiVgaInputController(string key, string name, DMInput inputCard)
            : base(key, name)
        {
            Feedbacks = new FeedbackCollection <Feedback>();

            if (inputCard is Card.Dmps3HdmiVgaInput)
            {
                InputCard = inputCard as Card.Dmps3HdmiVgaInput;

                HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi,
                                                               eDmps3InputVideoSource.Hdmi, this, VideoStatusHelper.GetHdmiInputStatusFuncs(InputCard.HdmiInputPort));
                VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
                                                              eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eDmps3InputVideoSource.Vga, this,
                                                              VideoStatusHelper.GetVgaInputStatusFuncs(InputCard.VgaInputPort));
                AudioIn = new RoutingInputPort(DmPortName.AudioIn, eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio,
                                               eDmps3InputAudioSource.Analog, this);

                if (InputCard.HdmiInputPort.HdcpSupportedLevelFeedback == eHdcpSupportedLevel.Hdcp2xSupport)
                {
                    HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
                }
                else if (InputCard.HdmiInputPort.HdcpSupportedLevelFeedback == eHdcpSupportedLevel.Hdcp1xSupport)
                {
                    HdcpSupportCapability = eHdcpCapabilityType.Hdcp1xSupport;
                }

                var combinedFuncs = new VideoStatusFuncsWrapper
                {
                    HdcpActiveFeedbackFunc = () =>
                                             (ActualVideoInput == eDmps3InputVideoSource.Hdmi &&
                                              InputCard.HdmiInputPort.VideoAttributes.HdcpActiveFeedback.BoolValue),

                    HdcpStateFeedbackFunc = () =>
                    {
                        if (ActualVideoInput == eDmps3InputVideoSource.Hdmi)
                        {
                            return(InputCard.HdmiInputPort.VideoAttributes.HdcpStateFeedback.ToString());
                        }
                        return("");
                    },

                    VideoResolutionFeedbackFunc = () =>
                    {
                        if (ActualVideoInput == eDmps3InputVideoSource.Hdmi)
                        {
                            return(InputCard.HdmiInputPort.VideoAttributes.GetVideoResolutionString());
                        }
                        if (ActualVideoInput == eDmps3InputVideoSource.Vga)
                        {
                            return(InputCard.VgaInputPort.VideoAttributes.GetVideoResolutionString());
                        }
                        return("");
                    },
                    VideoSyncFeedbackFunc = () =>
                                            (ActualVideoInput == eDmps3InputVideoSource.Hdmi &&
                                             InputCard.HdmiInputPort.SyncDetectedFeedback.BoolValue) ||
                                            (ActualVideoInput == eDmps3InputVideoSource.Vga &&
                                             InputCard.VgaInputPort.SyncDetectedFeedback.BoolValue),

                    HasVideoStatusFunc = () =>
                                         (ActualVideoInput == eDmps3InputVideoSource.Hdmi &&
                                          HdmiIn.VideoStatus.HasVideoStatusFeedback.BoolValue) ||
                                         (ActualVideoInput == eDmps3InputVideoSource.Vga &&
                                          VgaIn.VideoStatus.HasVideoStatusFeedback.BoolValue)
                };

                AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
                                                                      eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, eDmps3InputVideoSource.Auto, this, combinedFuncs);

                ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput", () => ActualVideoInput.ToString());

                VideoSourceNumericFeedback = new IntFeedback(() =>
                {
                    return((int)InputCard.VideoSourceFeedback);
                });
                AudioSourceNumericFeedback = new IntFeedback(() =>
                {
                    return((int)InputCard.AudioSourceFeedback);
                });

                HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
                {
                    if (InputCard.HdmiInputPort.HdcpSupportOnFeedback.BoolValue)
                    {
                        return(1);
                    }
                    else
                    {
                        return(0);
                    }
                });

                // Set Ports for CEC
                HdmiIn.Port = InputCard.HdmiInputPort;

                VirtualDmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.None, null, this);

                AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
                                  AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
                                  AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
                                  AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback);

                //AddPostActivationAction(() =>
                //{
                // Link up all of these damned events to the various RoutingPorts via a helper handler
                InputCard.HdmiInputPort.InputOutput.BaseDevice.BaseEvent += (o, a) => FowardInputStreamChange(HdmiIn, a.EventId);
                InputCard.HdmiInputPort.VideoAttributes.AttributeChange  += (o, a) => ForwardVideoAttributeChange(HdmiIn, a.EventId);

                InputCard.VgaInputPort.InputOutput.BaseDevice.BaseEvent += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
                InputCard.VgaInputPort.VideoAttributes.AttributeChange  += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
                //});
            }
        }
Esempio n. 10
0
 public DMInputOutputBase GetUsbRoute(DMInput input)
 {
     return(input.USBRoutedToFeedback);
 }
Esempio n. 11
0
 public void RouteUsb(DMInput input, DMInputOutputBase route)
 {
     input.USBRoutedTo = route;
     Chassis.USBEnter.Pulse(10);
 }
 private void SelectInput(DMInput input)
 {
     _selectedInput = input;
     _inputList.SetSelectedItem(input);
     _updateFeedbackEvent.Set();
 }