예제 #1
0
        public DmTx4kz302CController(string key, string name, DmTx4kz302C 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]));
            DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
                                                                  eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DisplayPort, eVst.DisplayPort, this,
                                                                  VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput));
            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.DisplayPortInput.VideoAttributes.GetVideoResolutionString());
                    }
                    return("");
                },
                VideoSyncFeedbackFunc = () =>
                                        (ActualActiveVideoInput == eVst.Hdmi1 &&
                                         tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == eVst.Hdmi2 &&
                                         tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == eVst.Vga &&
                                         tx.DisplayPortInput.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;
        }
예제 #2
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;
        }