Exemple #1
0
        ///
        /// </summary>
        void Dmps_DMOutputChange(Switch device, DMOutputEventArgs args)
        {
            Debug.Console(2, this, "DMOutputChange Output: {0} EventId: {1}", args.Number, args.EventId.ToString());

            var output = args.Number;

            DMOutput outputCard = Dmps.SwitcherOutputs[output] as DMOutput;

            if (args.EventId == DMOutputEventIds.VolumeEventId &&
                VolumeControls.ContainsKey(output))
            {
                VolumeControls[args.Number].VolumeEventFromChassis();
            }
            else if (args.EventId == DMOutputEventIds.OnlineFeedbackEventId &&
                     OutputEndpointOnlineFeedbacks.ContainsKey(output))
            {
                OutputEndpointOnlineFeedbacks[output].FireUpdate();
            }
            else if (args.EventId == DMOutputEventIds.VideoOutEventId)
            {
                if (outputCard != null && outputCard.VideoOutFeedback != null)
                {
                    Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, outputCard.VideoOutFeedback.Number, output);
                }
                if (VideoOutputFeedbacks.ContainsKey(output))
                {
                    VideoOutputFeedbacks[output].FireUpdate();
                }
                if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
                {
                    OutputVideoRouteNameFeedbacks[output].FireUpdate();
                }
            }
            else if (args.EventId == DMOutputEventIds.AudioOutEventId)
            {
                if (outputCard != null && outputCard.AudioOutFeedback != null)
                {
                    Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, outputCard.AudioOutFeedback.Number, output);
                }
                if (AudioOutputFeedbacks.ContainsKey(output))
                {
                    AudioOutputFeedbacks[output].FireUpdate();
                }
            }
            else if (args.EventId == DMOutputEventIds.OutputNameEventId &&
                     OutputNameFeedbacks.ContainsKey(output))
            {
                Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
                OutputNameFeedbacks[output].FireUpdate();
            }
        }
        ///
        /// </summary>
        void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
        {
            var output = args.Number;

            switch (args.EventId)
            {
            case DMOutputEventIds.VolumeEventId:
            {
                if (VolumeControls.ContainsKey(output))
                {
                    VolumeControls[args.Number].VolumeEventFromChassis();
                }

                break;
            }

            case DMOutputEventIds.EndpointOnlineEventId:
            {
                Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. State: {1}", args.Number,
                              Chassis.Outputs[output].EndpointOnlineFeedback);
                OutputEndpointOnlineFeedbacks[output].FireUpdate();
                break;
            }

            case DMOutputEventIds.OnlineFeedbackEventId:
            {
                Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}", args.Number,
                              Chassis.Outputs[output].EndpointOnlineFeedback);
                OutputEndpointOnlineFeedbacks[output].FireUpdate();
                break;
            }

            case DMOutputEventIds.VideoOutEventId:
            {
                if (Chassis.Outputs[output].VideoOutFeedback != null)
                {
                    Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output);
                }

                if (VideoOutputFeedbacks.ContainsKey(output))
                {
                    VideoOutputFeedbacks[output].FireUpdate();
                }

                if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
                {
                    OutputVideoRouteNameFeedbacks[output].FireUpdate();
                }

                break;
            }

            case DMOutputEventIds.AudioOutEventId:
            {
                if (Chassis.Outputs[output].AudioOutFeedback != null)
                {
                    Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].AudioOutFeedback.Number, output);
                }

                if (AudioOutputFeedbacks.ContainsKey(output))
                {
                    AudioOutputFeedbacks[output].FireUpdate();
                }

                if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
                {
                    OutputAudioRouteNameFeedbacks[output].FireUpdate();
                }

                break;
            }

            case DMOutputEventIds.OutputNameEventId:
            {
                Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
                OutputNameFeedbacks[output].FireUpdate();
                break;
            }

            case DMOutputEventIds.UsbRoutedToEventId:
            {
                Debug.Console(2, this, "DM Output {0} UsbRoutedToEventId", args.Number);
                UsbOutputRoutedToFeebacks[args.Number].FireUpdate();
                break;
            }

            case DMOutputEventIds.DisabledByHdcpEventId:
            {
                Debug.Console(2, this, "DM Output {0} DisabledByHdcpEventId", args.Number);
                OutputDisabledByHdcpFeedbacks[args.Number].FireUpdate();
                break;
            }

            default:
            {
                Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}", args.Number, args.EventId);
                break;
            }
            }
        }