Exemplo n.º 1
0
        /// <summary>
        ///  Make a Crestron RMC and put it in here
        /// </summary>
        public DmRmc150SController(string key, string name, DmRmc150S rmc)
            : base(key, name, rmc)
        {
            _rmc = rmc;
            DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
                                        eRoutingPortConnectionType.DmCat, 0, this);
            HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
                                            eRoutingPortConnectionType.Hdmi, null, this);

            EdidManufacturerFeedback    = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
            EdidNameFeedback            = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
            EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
            EdidSerialNumberFeedback    = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);

            InputPorts = new RoutingPortCollection <RoutingInputPort> {
                DmIn
            };
            OutputPorts = new RoutingPortCollection <RoutingOutputPort> {
                HdmiOut
            };

            _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;

            // Set Ports for CEC
            HdmiOut.Port = _rmc.HdmiOutput;
        }
Exemplo n.º 2
0
        public IRSetTopBoxBase(string key, string name, IrOutputPortController portCont,
                               SetTopBoxPropertiesConfig props)
            : base(key, name)
        {
            IrPort = portCont;
            DeviceManager.AddDevice(portCont);

            HasPresets = props.HasPresets;
            HasDvr     = props.HasDvr;
            HasDpad    = props.HasDpad;
            HasNumeric = props.HasNumeric;

            HasKeypadAccessoryButton1     = true;
            KeypadAccessoryButton1Command = "Dash";
            KeypadAccessoryButton1Label   = "-";

            HasKeypadAccessoryButton2     = true;
            KeypadAccessoryButton2Command = "NumericEnter";
            KeypadAccessoryButton2Label   = "Enter";

            AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, null, this);
            AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
                                                eRoutingPortConnectionType.DigitalAudio, null, this);
            OutputPorts = new RoutingPortCollection <RoutingOutputPort> {
                AnyVideoOut, AnyAudioOut
            };
        }
Exemplo n.º 3
0
        /// <summary>
        ///  Make a Crestron RMC and put it in here
        /// </summary>
        public DmRmc4kScalerCDspController(string key, string name, DmRmc4kScalerCDsp rmc)
            : base(key, name, rmc)
        {
            Rmc  = rmc;
            DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                        eRoutingPortConnectionType.DmCat, 0, this);
            HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                            eRoutingPortConnectionType.Hdmi, null, this);
            BalancedAudioOut = new RoutingOutputPort(DmPortName.BalancedAudioOut, eRoutingSignalType.Audio,
                                                     eRoutingPortConnectionType.LineAudio, null, this);

            MuteFeedback        = new BoolFeedback(() => false);
            VolumeLevelFeedback = new IntFeedback("MainVolumeLevelFeedback", () =>
                                                  rmc.AudioOutput.VolumeFeedback.UShortValue);

            EdidManufacturerFeedback    = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
            EdidNameFeedback            = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
            EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
            EdidSerialNumberFeedback    = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);

            VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());

            Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
            Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;

            // Set Ports for CEC
            HdmiOut.Port = Rmc.HdmiOutput;
        }
        public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc)
            : base(key, name, rmc)
        {
            _rmc = rmc;
            DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
                                        eRoutingPortConnectionType.DmCat, 0, this);
            HdmiIn = new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
                                          eRoutingPortConnectionType.Hdmi, 0, this);
            HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
                                            eRoutingPortConnectionType.Hdmi, null, this);

            EdidManufacturerFeedback    = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
            EdidNameFeedback            = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
            EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
            EdidSerialNumberFeedback    = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);

            VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());

            InputPorts = new RoutingPortCollection <RoutingInputPort> {
                DmIn, HdmiIn
            };
            OutputPorts = new RoutingPortCollection <RoutingOutputPort> {
                HdmiOut
            };

            _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
            _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;

            // Set Ports for CEC
            HdmiOut.Port = _rmc.HdmiOutput;

            AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback));
        }
Exemplo n.º 5
0
 public GenericSource(string key, string name)
     : base(key, name)
 {
     AnyOut = new RoutingOutputPort(RoutingPortNames.AnyOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                    eRoutingPortConnectionType.Hdmi, null, this);
     OutputPorts = new RoutingPortCollection <RoutingOutputPort> {
         AnyOut
     };
 }
Exemplo n.º 6
0
 public Laptop(string key, string name)
     : base(key, name)
 {
     IconName           = "Laptop";
     HasPowerOnFeedback = new BoolFeedback("HasPowerFeedback",
                                           () => this.GetVideoStatuses() != VideoStatusOutputs.NoStatus);
     OutputPorts = new RoutingPortCollection <RoutingOutputPort>();
     OutputPorts.Add(AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                         eRoutingPortConnectionType.None, 0, this));
 }
Exemplo n.º 7
0
        /// <summary>
        ///  Make a Crestron RMC and put it in here
        /// </summary>
        public DmRmcX100CController(string key, string name, DmRmc100C rmc)
            : base(key, name, rmc)
        {
            Rmc  = rmc;
            DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                        eRoutingPortConnectionType.DmCat, 0, this);
            HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                            eRoutingPortConnectionType.Hdmi, null, this);

            // Set Ports for CEC
            HdmiOut.Port = Rmc; // Unique case, this class has no HdmiOutput port and ICec is implemented on the receiver class itself
        }
Exemplo n.º 8
0
        public Roku2(string key, string name, IrOutputPortController portCont)
            : base(key, name)
        {
            IrPort = portCont;
            DeviceManager.AddDevice(portCont);;

            HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                            eRoutingPortConnectionType.Hdmi, null, this);
            OutputPorts = new RoutingPortCollection <RoutingOutputPort> {
                HdmiOut
            };
        }
Exemplo n.º 9
0
        public DmTx4k100Controller(string key, string name, DmTx4K100C1G tx)
            : base(key, name, tx)
        {
            Tx = tx;

            HdmiIn = new RoutingInputPort(DmPortName.HdmiIn1,
                                          eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this);

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

            // Set Ports for CEC
            HdmiIn.Port = Tx;
        }
Exemplo n.º 10
0
        /// <summary>
        /// Adds OutputPort and sets Port as ICec object
        /// </summary>
        void AddOutputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector, ICec cecPort)
        {
            var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);

            Debug.Console(2, this, "Adding output port '{0}'", portKey);
            var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);

            if (cecPort != null)
            {
                outputPort.Port = cecPort;
            }

            OutputPorts.Add(outputPort);
        }
Exemplo n.º 11
0
        /// <summary>
        ///
        /// </summary>
        public MockVC(DeviceConfig config)
            : base(config)
        {
            PropertiesConfig = JsonConvert.DeserializeObject <VideoCodec.MockVcPropertiesConfig>(config.Properties.ToString());

            CodecInfo = new MockCodecInfo();

            // Get favoritesw
            if (PropertiesConfig.Favorites != null)
            {
                CallFavorites           = new CodecCallFavorites();
                CallFavorites.Favorites = PropertiesConfig.Favorites;
            }

            DirectoryBrowseHistory = new List <CodecDirectory>();

            // Debug helpers
            MuteFeedback.OutputChange            += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted);
            PrivacyModeIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Privacy={0}", _PrivacyModeIsOn);
            SharingSourceFeedback.OutputChange   += (o, a) => Debug.Console(1, this, "SharingSource={0}", _SharingSource);
            VolumeLevelFeedback.OutputChange     += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel);

            CurrentDirectoryResultIsNotDirectoryRoot = new BoolFeedback(() => DirectoryBrowseHistory.Count > 0);

            CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate();

            CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, 0, this);
            InputPorts.Add(CodecOsdIn);
            HdmiIn1 = new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, 1, this);
            InputPorts.Add(HdmiIn1);
            HdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, 2, this);
            InputPorts.Add(HdmiIn2);
            HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, null, this);
            OutputPorts.Add(HdmiOut);

            CallHistory = new CodecCallHistory();
            for (int i = 0; i < 10; i++)
            {
                var call = new CodecCallHistory.CallHistoryEntry();
                call.Name   = "Call " + i;
                call.Number = i + "@call.com";
                CallHistory.RecentCalls.Add(call);
            }
            // eventually fire history event here

            SetupCameras();

            SetIsReady();
        }
        public HDBaseTRxController(string key, string name, HDRx3CB rmc)
            : base(key, name, rmc)
        {
            DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
                                        eRoutingPortConnectionType.DmCat, 0, this);
            HDBaseTSink = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
                                                eRoutingPortConnectionType.Hdmi, null, this)
            {
                Port = Rmc
            };

            InputPorts = new RoutingPortCollection <RoutingInputPort> {
                DmIn
            };
            OutputPorts = new RoutingPortCollection <RoutingOutputPort> {
                HDBaseTSink
            };
        }
Exemplo n.º 13
0
        /// <summary>
        ///  Make a Crestron RMC and put it in here
        /// </summary>
        public DmRmcX100CController(string key, string name, DmRmc100C rmc)
            : base(key, name, rmc)
        {
            _rmc = rmc;
            DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
                                        eRoutingPortConnectionType.DmCat, 0, this);
            HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
                                            eRoutingPortConnectionType.Hdmi, null, this)
            {
                Port = _rmc
            };

            InputPorts = new RoutingPortCollection <RoutingInputPort> {
                DmIn
            };
            OutputPorts = new RoutingPortCollection <RoutingOutputPort> {
                HdmiOut
            };
        }
Exemplo n.º 14
0
        public DmDge200CController(string key, string name, DmDge200C device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
            : base(key, name, device, dc, props)
        {
            _dge = device;

            DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
                                        eRoutingPortConnectionType.DmCat, 0, this);
            HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
                                            eRoutingPortConnectionType.Hdmi, null, this);


            InputPorts = new RoutingPortCollection <RoutingInputPort> {
                DmIn
            };
            OutputPorts = new RoutingPortCollection <RoutingOutputPort> {
                HdmiOut
            };

            // Set Ports for CEC
            HdmiOut.Port = _dge.HdmiOut;;
        }
Exemplo n.º 15
0
        /// <summary>
        ///  Make a Crestron RMC and put it in here
        /// </summary>
        public DmRmc150SController(string key, string name, DmRmc150S rmc)
            : base(key, name, rmc)
        {
            Rmc  = rmc;
            DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                        eRoutingPortConnectionType.DmCat, 0, this);
            HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                            eRoutingPortConnectionType.Hdmi, null, this);

            EdidManufacturerFeedback    = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
            EdidNameFeedback            = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
            EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
            EdidSerialNumberFeedback    = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);

            //VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());

            //Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
            Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;

            // Set Ports for CEC
            HdmiOut.Port = Rmc.HdmiOutput;
        }
Exemplo n.º 16
0
        public IRBlurayBase(string key, string name, IrOutputPortController portCont)
            : base(key, name)
        {
            IrPort = portCont;
            DeviceManager.AddDevice(portCont);

            HasKeypadAccessoryButton1     = true;
            KeypadAccessoryButton1Command = "Clear";
            KeypadAccessoryButton1Label   = "Clear";

            HasKeypadAccessoryButton2     = true;
            KeypadAccessoryButton2Command = "NumericEnter";
            KeypadAccessoryButton2Label   = "Enter";

            PowerIsOnFeedback = new BoolFeedback(() => _PowerIsOn);

            HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                            eRoutingPortConnectionType.Hdmi, null, this);
            AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
                                                eRoutingPortConnectionType.DigitalAudio, null, this);
            OutputPorts = new RoutingPortCollection <RoutingOutputPort> {
                HdmiOut, AnyAudioOut
            };
        }
Exemplo n.º 17
0
        public DmTx4k302CController(string key, string name, DmTx4k302C tx)
            : base(key, name, tx)
        {
            Tx = tx;

            HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
                                                            eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
                                                            VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
            HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
                                                            eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
                                                            VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
            VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
                                                          eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this,
                                                          VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
            ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
                                                          () => ActualActiveVideoInput.ToString());

            Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
            Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
            Tx.BaseEvent += Tx_BaseEvent;

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

            HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () =>
            {
                return((int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
            });

            HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () =>
            {
                return((int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
            });

            HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;


            var combinedFuncs = new VideoStatusFuncsWrapper
            {
                HdcpActiveFeedbackFunc = () =>
                                         (ActualActiveVideoInput == eVst.Hdmi1 &&
                                          tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue) ||
                                         (ActualActiveVideoInput == eVst.Hdmi2 &&
                                          tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),

                HdcpStateFeedbackFunc = () =>
                {
                    if (ActualActiveVideoInput == eVst.Hdmi1)
                    {
                        return(tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString());
                    }
                    if (ActualActiveVideoInput == eVst.Hdmi2)
                    {
                        return(tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString());
                    }
                    return("");
                },

                VideoResolutionFeedbackFunc = () =>
                {
                    if (ActualActiveVideoInput == eVst.Hdmi1)
                    {
                        return(tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString());
                    }
                    if (ActualActiveVideoInput == eVst.Hdmi2)
                    {
                        return(tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString());
                    }
                    if (ActualActiveVideoInput == eVst.Vga)
                    {
                        return(tx.VgaInput.VideoAttributes.GetVideoResolutionString());
                    }
                    return("");
                },
                VideoSyncFeedbackFunc = () =>
                                        (ActualActiveVideoInput == eVst.Hdmi1 &&
                                         tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == eVst.Hdmi2 &&
                                         tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == eVst.Vga &&
                                         tx.VgaInput.SyncDetectedFeedback.BoolValue)
            };

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

            DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                          eRoutingPortConnectionType.DmCat, null, this);
            HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, null, this);


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

            // Set Ports for CEC
            HdmiIn1.Port     = Tx.HdmiInputs[1];
            HdmiIn2.Port     = Tx.HdmiInputs[2];
            HdmiLoopOut.Port = Tx.HdmiOutput;
            DmOut.Port       = Tx.DmOutput;
        }
Exemplo n.º 18
0
        public DmTx4k302CController(string key, string name, DmTx4k302C tx)
            : base(key, name, tx)
        {
            Tx = tx;

            HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
                                                            eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
                                                            VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
            HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
                                                            eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
                                                            VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
            VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
                                                          eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this,
                                                          VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
            ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
                                                          () => ActualActiveVideoInput.ToString());

            Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
            Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
            Tx.VgaInput.InputStreamChange      += VgaInputOnInputStreamChange;
            Tx.BaseEvent += Tx_BaseEvent;

            VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
            AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);

            HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);

            HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);

            HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;

            Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);

            Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);

            VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);

            FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);

            VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
            VgaContrastFeedback   = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);

            tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);


            var combinedFuncs = new VideoStatusFuncsWrapper
            {
                HdcpActiveFeedbackFunc = () =>
                                         (ActualActiveVideoInput == eVst.Hdmi1 &&
                                          tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue) ||
                                         (ActualActiveVideoInput == eVst.Hdmi2 &&
                                          tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),

                HdcpStateFeedbackFunc = () =>
                {
                    if (ActualActiveVideoInput == eVst.Hdmi1)
                    {
                        return(tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString());
                    }
                    return(ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : "");
                },

                VideoResolutionFeedbackFunc = () =>
                {
                    if (ActualActiveVideoInput == eVst.Hdmi1)
                    {
                        return(tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString());
                    }
                    if (ActualActiveVideoInput == eVst.Hdmi2)
                    {
                        return(tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString());
                    }
                    return(ActualActiveVideoInput == eVst.Vga ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "");
                },
                VideoSyncFeedbackFunc = () =>
                                        (ActualActiveVideoInput == eVst.Hdmi1 &&
                                         tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == eVst.Hdmi2 &&
                                         tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == eVst.Vga &&
                                         tx.VgaInput.SyncDetectedFeedback.BoolValue)
            };

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

            DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                          eRoutingPortConnectionType.DmCat, null, this);
            HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, null, this);


            AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
                              AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
                              AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
                              AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
                              Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, VgaVideoSyncFeedback);

            // Set Ports for CEC
            HdmiIn1.Port     = Tx.HdmiInputs[1];
            HdmiIn2.Port     = Tx.HdmiInputs[2];
            HdmiLoopOut.Port = Tx.HdmiOutput;
            DmOut.Port       = Tx.DmOutput;
        }
Exemplo n.º 19
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        /// <param name="name"></param>
        /// <param name="tx"></param>
        public DmTx401CController(string key, string name, DmTx401C tx)
            : base(key, name, tx)
        {
            Tx = tx;

            HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
                                                           eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.HDMI, this,
                                                           VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
            DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
                                                                  eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.DisplayPort, this,
                                                                  VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput));
            VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
                                                          eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.VGA, this,
                                                          VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
            CompositeIn = new RoutingInputPortWithVideoStatuses(DmPortName.CompositeIn,
                                                                eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this,
                                                                VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));

            Tx.BaseEvent += Tx_BaseEvent;

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

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

            HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
            {
                if (tx.HdmiInput.HdpcSupportOnFeedback.BoolValue)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            });

            HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;

            var combinedFuncs = new VideoStatusFuncsWrapper
            {
                HdcpActiveFeedbackFunc = () =>
                                         (ActualVideoInput == eVst.HDMI &&
                                          tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue) ||
                                         (ActualVideoInput == eVst.DisplayPort &&
                                          tx.DisplayPortInput.VideoAttributes.HdcpActiveFeedback.BoolValue),

                HdcpStateFeedbackFunc = () =>
                {
                    if (ActualVideoInput == eVst.HDMI)
                    {
                        return(tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString());
                    }
                    if (ActualVideoInput == eVst.DisplayPort)
                    {
                        return(tx.DisplayPortInput.VideoAttributes.HdcpStateFeedback.ToString());
                    }
                    return("");
                },

                VideoResolutionFeedbackFunc = () =>
                {
                    if (ActualVideoInput == eVst.HDMI)
                    {
                        return(tx.HdmiInput.VideoAttributes.GetVideoResolutionString());
                    }
                    if (ActualVideoInput == eVst.DisplayPort)
                    {
                        return(tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString());
                    }
                    if (ActualVideoInput == eVst.VGA)
                    {
                        return(tx.VgaInput.VideoAttributes.GetVideoResolutionString());
                    }
                    if (ActualVideoInput == eVst.Composite)
                    {
                        return(tx.CvbsInput.VideoAttributes.GetVideoResolutionString());
                    }
                    return("");
                },
                VideoSyncFeedbackFunc = () =>
                                        (ActualVideoInput == eVst.HDMI &&
                                         tx.HdmiInput.SyncDetectedFeedback.BoolValue) ||
                                        (ActualVideoInput == eVst.DisplayPort &&
                                         tx.DisplayPortInput.SyncDetectedFeedback.BoolValue) ||
                                        (ActualVideoInput == eVst.VGA &&
                                         tx.VgaInput.SyncDetectedFeedback.BoolValue) ||
                                        (ActualVideoInput == eVst.Composite &&
                                         tx.CvbsInput.SyncDetectedFeedback.BoolValue)
            };

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

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

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

            // Set Ports for CEC
            DisplayPortIn.Port = Tx.DisplayPortInput;
            HdmiIn.Port        = Tx.HdmiInput;
            DmOut.Port         = Tx.DmOutput;
        }
Exemplo n.º 20
0
        public HdMdxxxCEController(string key, string name, HdMdxxxCE txRxPair)
            : base(key, name, txRxPair)
        {
            TxRxPair = txRxPair;

            RemoteEndDetectedFeedback = new BoolFeedback(() => TxRxPair.RemoteEndDetectedOnFeedback.BoolValue);

            AutoRouteOnFeedback = new BoolFeedback(() => TxRxPair.TransmitterAutoModeOnFeedback.BoolValue);

            PriorityRoutingOnFeedback = new BoolFeedback(() => TxRxPair.PriorityRoutingOnFeedback.BoolValue);

            InputOnScreenDisplayEnabledFeedback = new BoolFeedback(() => TxRxPair.OnScreenDisplayEnabledFeedback.BoolValue);

            InputPorts = new RoutingPortCollection <RoutingInputPort>();

            SyncDetectedFeedbacks = new Dictionary <uint, BoolFeedback>();

            // Add the HDMI input port on the receiver
            InputPorts.Add(new RoutingInputPort(DmPortName.Hdmi, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, 1, this));

            SyncDetectedFeedbacks.Add(1, new BoolFeedback(() => TxRxPair.HdmiInputs[1].VideoDetectedFeedback.BoolValue));

            if (txRxPair is HdMd400CE)
            {
                InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                    eRoutingPortConnectionType.Hdmi, 2, this));
                SyncDetectedFeedbacks.Add(2, new BoolFeedback(() => TxRxPair.HdmiInputs[2].VideoDetectedFeedback.BoolValue));

                InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                    eRoutingPortConnectionType.Hdmi, 3, this));
                SyncDetectedFeedbacks.Add(3, new BoolFeedback(() => TxRxPair.HdmiInputs[3].VideoDetectedFeedback.BoolValue));

                InputPorts.Add(new RoutingInputPort(DmPortName.VgaIn, eRoutingSignalType.Video | eRoutingSignalType.Audio,
                                                    eRoutingPortConnectionType.Vga, 4, this));
                SyncDetectedFeedbacks.Add(4, new BoolFeedback(() => TxRxPair.VgaInputs[1].VideoDetectedFeedback.BoolValue));

                // Set Ports for CEC
                InputPorts[DmPortName.HdmiIn1].Port = TxRxPair.HdmiInputs[1];
                InputPorts[DmPortName.HdmiIn2].Port = TxRxPair.HdmiInputs[2];
            }
            else if (txRxPair is HdMd300CE)
            {
                InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                    eRoutingPortConnectionType.Hdmi, 2, this));
                SyncDetectedFeedbacks.Add(2, new BoolFeedback(() => TxRxPair.HdmiInputs[2].VideoDetectedFeedback.BoolValue));

                InputPorts.Add(new RoutingInputPort(DmPortName.VgaIn, eRoutingSignalType.Video | eRoutingSignalType.Audio,
                                                    eRoutingPortConnectionType.Vga, 3, this));
                SyncDetectedFeedbacks.Add(3, new BoolFeedback(() => TxRxPair.VgaInputs[1].VideoDetectedFeedback.BoolValue));

                // Set Ports for CEC
                InputPorts[DmPortName.HdmiIn].Port = TxRxPair.HdmiInputs[1];
            }
            else if (txRxPair is HdMd200CE || txRxPair is HdMd200C1GE)
            {
                InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                    eRoutingPortConnectionType.Hdmi, 2, this));
                SyncDetectedFeedbacks.Add(2, new BoolFeedback(() => TxRxPair.HdmiInputs[2].VideoDetectedFeedback.BoolValue));

                // Set Ports for CEC
                InputPorts[DmPortName.HdmiIn].Port = TxRxPair.HdmiInputs[1];
            }

            //ToRx = new RoutingOutputPort(DmPortName.ToTx, eRoutingSignalType.Audio | eRoutingSignalType.Video,
            //    eRoutingPortConnectionType.DmCat, null, this);

            //FromTx = new RoutingInputPort(DmPortName.FromTx, eRoutingSignalType.Audio | eRoutingSignalType.Video,
            //    eRoutingPortConnectionType.DmCat, null, this);

            HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                            eRoutingPortConnectionType.Hdmi, null, this);

            OutputPorts[DmPortName.HdmiOut].Port = TxRxPair.HdmiOutputs[1];

            TxRxPair.DMInputChange  += new DMInputEventHandler(TxRxPair_DMInputChange);
            TxRxPair.DMOutputChange += new DMOutputEventHandler(TxRxPair_DMOutputChange);
            TxRxPair.DMSystemChange += new DMSystemEventHandler(TxRxPair_DMSystemChange);

            VideoSourceFeedback = new IntFeedback(() => (int)TxRxPair.HdmiOutputs[1].VideoOutFeedback.Number);
        }
Exemplo n.º 21
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        /// <param name="name"></param>
        /// <param name="tx"></param>
        public DmTx200Controller(string key, string name, DmTx200C2G tx)
            : base(key, name, tx)
        {
            Tx = tx;

            HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
                                                              eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
                                                              VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
            VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
                                                             eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
                                                             VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));

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

            Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent);
            Tx.BaseEvent          += Tx_BaseEvent;
            Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);

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

            HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
            {
                if (tx.HdmiInput.HdpcSupportOnFeedback.BoolValue)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            });

            HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;

            var combinedFuncs = new VideoStatusFuncsWrapper
            {
                HdcpActiveFeedbackFunc = () =>
                                         (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital &&
                                          tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),

                HdcpStateFeedbackFunc = () =>
                {
                    if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
                    {
                        return(tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString());
                    }
                    return("");
                },

                VideoResolutionFeedbackFunc = () =>
                {
                    if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
                    {
                        return(tx.HdmiInput.VideoAttributes.GetVideoResolutionString());
                    }
                    if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog)
                    {
                        return(tx.VgaInput.VideoAttributes.GetVideoResolutionString());
                    }
                    return("");
                },
                VideoSyncFeedbackFunc = () =>
                                        (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital &&
                                         tx.HdmiInput.SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog &&
                                         tx.VgaInput.SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto &&
                                         (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
            };

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

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

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

            // Set Ports for CEC
            HdmiInput.Port = Tx.HdmiInput;
            VgaInput.Port  = Tx.VgaInput;
            DmOutput.Port  = Tx.DmOutput;
        }
Exemplo n.º 22
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="key">key for special device</param>
 public DummyRoutingInputsDevice(string key) : base(key)
 {
     AudioVideoOutputPort = new RoutingOutputPort("internal", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.BackplaneOnly,
                                                  null, this, true);
 }
Exemplo n.º 23
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        /// <param name="name"></param>
        /// <param name="tx"></param>
        public DmTx201SController(string key, string name, DmTx201S tx)
            : base(key, name, tx)
        {
            Tx = tx;

            HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
                                                              eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
                                                              VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
            VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
                                                             eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
                                                             VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));

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

            Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
            Tx.VgaInput.InputStreamChange  += VgaInputOnInputStreamChange;
            Tx.BaseEvent          += Tx_BaseEvent;
            Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);

            VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);

            AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);

            HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
                                                           (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0));

            HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);

            VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);

            FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);

            VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);

            VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);

            tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;

            HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;

            var combinedFuncs = new VideoStatusFuncsWrapper
            {
                HdcpActiveFeedbackFunc = () =>
                                         (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital &&
                                          tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),

                HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ?
                                        tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",

                VideoResolutionFeedbackFunc = () =>
                {
                    if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
                    {
                        return(tx.HdmiInput.VideoAttributes.GetVideoResolutionString());
                    }
                    return(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ?
                           tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "");
                },

                VideoSyncFeedbackFunc = () =>
                                        (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital &&
                                         tx.HdmiInput.SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog &&
                                         tx.VgaInput.SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto &&
                                         (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
            };

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

            DmOutput    = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this);
            HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, null, this);

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

            // Set Ports for CEC
            HdmiInput.Port   = Tx.HdmiInput;
            VgaInput.Port    = Tx.VgaInput;
            HdmiLoopOut.Port = Tx.HdmiOutput;
            DmOutput.Port    = Tx.DmOutput;
        }
Exemplo n.º 24
0
        public DmpsInternalVirtualHdmiVgaBncInputController(string key, string name, Card.Dmps3HdmiVgaBncInput inputCard)
            : base(key, name, inputCard)
        {
            InputCard = inputCard;

            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));
            BncIn = new RoutingInputPortWithVideoStatuses(DmPortName.BncIn, eRoutingSignalType.Video, eRoutingPortConnectionType.Component,
                                                          eDmps3InputVideoSource.Bnc, this, VideoStatusHelper.GetBncInputStatusFuncs(InputCard.BncInputPort));
            SpdifIn = new RoutingInputPort(DmPortName.SpdifIn, eRoutingSignalType.Audio, eRoutingPortConnectionType.DigitalAudio,
                                           eDmps3InputAudioSource.Spdif, 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());
                    }
                    if (ActualVideoInput == eDmps3InputVideoSource.Bnc)
                    {
                        return(InputCard.BncInputPort.VideoAttributes.GetVideoResolutionString());
                    }
                    return("");
                },
                VideoSyncFeedbackFunc = () =>
                                        (ActualVideoInput == eDmps3InputVideoSource.Hdmi &&
                                         InputCard.HdmiInputPort.SyncDetectedFeedback.BoolValue) ||
                                        (ActualVideoInput == eDmps3InputVideoSource.Vga &&
                                         InputCard.VgaInputPort.SyncDetectedFeedback.BoolValue) ||
                                        (ActualVideoInput == eDmps3InputVideoSource.Bnc &&
                                         InputCard.BncInputPort.VideoDetectedFeedback.BoolValue),

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

            AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
                                                                  eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, 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);

            InputCard.BncInputPort.InputOutput.BaseDevice.BaseEvent += (o, a) => FowardInputStreamChange(HdmiIn, a.EventId);
            InputCard.BncInputPort.VideoAttributes.AttributeChange  += (o, a) => ForwardVideoAttributeChange(HdmiIn, a.EventId);
            //});
        }
Exemplo n.º 25
0
        /// <summary>
        /// Returns the appropriate tie line for either a card-based device or
        /// regular device with ports on-device.
        /// </summary>
        /// <returns>null if config data does not match ports, cards or devices</returns>
        public TieLine GetTieLine()
        {
            Debug.Console(0, "Build TieLine: {0}", this);
            // Get the source device
            var sourceDev = DeviceManager.GetDeviceForKey(SourceKey) as IRoutingOutputs;

            if (sourceDev == null)
            {
                LogError("Routable source not found");
                return(null);
            }

            // Get the destination device
            var destDev = DeviceManager.GetDeviceForKey(DestinationKey) as IRoutingInputs;

            if (destDev == null)
            {
                LogError("Routable destination not found");
                return(null);
            }

            //Get the source port
            RoutingOutputPort sourceOutputPort = null;

            //// If it's a card-based device, get the card and then the source port
            //if (sourceDev is ICardPortsDevice)
            //{
            //    if (SourceCard == null)
            //    {
            //        LogError("Card missing from source device config");
            //        return null;
            //    }
            //    sourceOutputPort = (sourceDev as ICardPortsDevice).GetChildOutputPort(SourceCard, SourcePort);
            //    if (sourceOutputPort == null)
            //    {
            //        LogError("Source card does not contain port");
            //        return null;
            //    }
            //}
            //// otherwise it's a normal port device, get the source port
            //else
            //{
            sourceOutputPort = sourceDev.OutputPorts[SourcePort];
            if (sourceOutputPort == null)
            {
                LogError("Source does not contain port");
                return(null);
            }
            //}


            //Get the Destination port
            RoutingInputPort destinationInputPort = null;

            //// If it's a card-based device, get the card and then the Destination port
            //if (destDev is ICardPortsDevice)
            //{
            //    if (DestinationCard == null)
            //    {
            //        LogError("Card missing from destination device config");
            //        return null;
            //    }
            //    destinationInputPort = (destDev as ICardPortsDevice).GetChildInputPort(DestinationCard, DestinationPort);
            //    if (destinationInputPort == null)
            //    {
            //        LogError("Destination card does not contain port");
            //        return null;
            //    }
            //}
            //// otherwise it's a normal port device, get the Destination port
            //else
            //{
            destinationInputPort = destDev.InputPorts[DestinationPort];
            if (destinationInputPort == null)
            {
                LogError("Destination does not contain port");
                return(null);
            }
            //}

            return(new TieLine(sourceOutputPort, destinationInputPort));
        }