//factory to prevent duplicate instansiations.
        public static DMPS4K150C_VGA_Input GetVGAInput(ControlSystem ControlSystem, ControlSystem.eDmps34K150CInputs Input)
        {
            if (TestInputRange(Input))
            {
                switch (Input)
                {
                case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Vga1:
                    return(VGAInput1 ?? (VGAInput1 = new DMPS4K150C_VGA_Input(ControlSystem, Input)));

                case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Vga2:
                    return(VGAInput2 ?? (VGAInput2 = new DMPS4K150C_VGA_Input(ControlSystem, Input)));

                case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Vga3:
                    return(VGAInput3 ?? (VGAInput3 = new DMPS4K150C_VGA_Input(ControlSystem, Input)));

                case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Vga4:
                    return(VGAInput4 ?? (VGAInput4 = new DMPS4K150C_VGA_Input(ControlSystem, Input)));

                default:
                    return(null);
                }
            }
            else
            {
                throw new IndexOutOfRangeException();
            }
        }
Esempio n. 2
0
        private DMPS4K150C_DM_Input(ControlSystem ControlSystem, ControlSystem.eDmps34K150CInputs Input)
        {
            this.DMInputPort = Input.ToString();;


            TestControlSystemType.isDMPS4K150C(ControlSystem, "This Module is for a DMPS4K150C Control System");

            _ControlSystem = ControlSystem;
            _SwitcherInput = DMPS4K150C_SwitcherInput.GetDMPS4K150C_SwitcherInput(_ControlSystem);
            DMInput        = _ControlSystem.SwitcherInputs[(uint)Input] as Card.Dmps3DmInput;

            switch (Input)
            {
            case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Dm1:
                _SwitcherInput.DM1InputChanged += new DMPS4K150C_SwitcherInput.SwitcherInputEventHandler(_SwitcherInput_DM1InputChanged);
                break;

            case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Dm2:
                _SwitcherInput.DM2InputChanged += new DMPS4K150C_SwitcherInput.SwitcherInputEventHandler(_SwitcherInput_DM2InputChanged);
                break;

            default:
                break;
            }

            DMInput.DmInputPort.VideoAttributes.AttributeChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoAttributes_AttributeChange);
        }
 private static bool TestInputRange(ControlSystem.eDmps34K150CInputs Input)
 {
     if (Input >= ControlSystem.eDmps34K150CInputs.Vga1 && Input <= ControlSystem.eDmps34K150CInputs.Vga4)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 4
0
        //factory to prevent duplicate instansiations.
        public static DMPS4K150C_DM_Input GetDMInput(ControlSystem ControlSystem, ControlSystem.eDmps34K150CInputs Input)
        {
            if (TestInputRange(Input))
            {
                switch (Input)
                {
                case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Dm1:
                    return(DMInput1 ?? (DMInput1 = new DMPS4K150C_DM_Input(ControlSystem, Input)));

                case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Dm2:
                    return(DMInput2 ?? (DMInput2 = new DMPS4K150C_DM_Input(ControlSystem, Input)));

                default:
                    return(null);
                }
            }
            else
            {
                throw new IndexOutOfRangeException();
            }
        }
        private DMPS4K150C_VGA_Input(ControlSystem ControlSystem, ControlSystem.eDmps34K150CInputs Input)
        {
            this.VgaInputPort = Input.ToString();;


            TestControlSystemType.isDMPS4K150C(ControlSystem, "This Module is for a DMPS4K150C Control System");

            _ControlSystem = ControlSystem;
            _SwitcherInput = DMPS4K150C_SwitcherInput.GetDMPS4K150C_SwitcherInput(_ControlSystem);
            VGAInput       = _ControlSystem.SwitcherInputs[(uint)Input] as Card.Dmps3VgaInput;

            switch (Input)
            {
            case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Vga1:
                _SwitcherInput.VGA1InputChanged += new DMPS4K150C_SwitcherInput.SwitcherInputEventHandler(_SwitcherInput_VGA1InputChanged);
                break;

            case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Vga2:
                _SwitcherInput.VGA2InputChanged += new DMPS4K150C_SwitcherInput.SwitcherInputEventHandler(_SwitcherInput_VGA2InputChanged);
                break;

            case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Vga3:
                _SwitcherInput.VGA3InputChanged += new DMPS4K150C_SwitcherInput.SwitcherInputEventHandler(_SwitcherInput_VGA3InputChanged);
                break;

            case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Vga4:
                _SwitcherInput.VGA4InputChanged += new DMPS4K150C_SwitcherInput.SwitcherInputEventHandler(_SwitcherInput_VGA4InputChanged);
                break;

            default:
                break;
            }

            VGAInput.VgaInputPort.VideoAttributes.AttributeChange += new GenericEventHandler(VideoAttributes_AttributeChange);
            VGAInput.VgaInputPort.VideoControls.ControlChange     += new GenericEventHandler(VideoControls_ControlChange);
        }
        private DMPS4K150C_HDMI_Input(ControlSystem ControlSystem, ControlSystem.eDmps34K150CInputs Input)
        {
            this.HDMIInputPort = Input.ToString();;


            TestControlSystemType.isDMPS4K150C(ControlSystem, "This Module is for a DMPS4K150C Control System");

            _ControlSystem = ControlSystem;
            _SwitcherInput = DMPS4K150C_SwitcherInput.GetDMPS4K150C_SwitcherInput(_ControlSystem);
            HDMIInput      = _ControlSystem.SwitcherInputs[(uint)Input] as Card.Dmps3HdmiInputWithoutAnalogAudio;

            switch (Input)
            {
            case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Hdmi1:
                _SwitcherInput.HDMI1InputChanged += new DMPS4K150C_SwitcherInput.SwitcherInputEventHandler(_SwitcherInput_HDMI1InputChanged);
                break;

            case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Hdmi2:
                _SwitcherInput.HDMI2InputChanged += new DMPS4K150C_SwitcherInput.SwitcherInputEventHandler(_SwitcherInput_HDMI2InputChanged);
                break;

            case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Hdmi3:
                _SwitcherInput.HDMI3InputChanged += new DMPS4K150C_SwitcherInput.SwitcherInputEventHandler(_SwitcherInput_HDMI3InputChanged);
                break;

            case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Hdmi4:
                _SwitcherInput.HDMI4InputChanged += new DMPS4K150C_SwitcherInput.SwitcherInputEventHandler(_SwitcherInput_HDMI4InputChanged);
                break;

            default:
                break;
            }

            HDMIInput.HdmiInputPort.VideoAttributes.AttributeChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoAttributes_AttributeChange);
            HDMIInput.HdmiInputPort.StreamCec.CecChange             += new CecChangeEventHandler(StreamCec_CecChange);
        }