private static void FeedbackPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs eventArgs) { FeedbackCollection feedBcCollection = (FeedbackCollection)eventArgs.NewValue; FeedbackControl feedbackControl = (FeedbackControl)dependencyObject; feedBcCollection.CollectionChanged += feedbackControl.Feedback_CollectionChanged; }
/// <summary> /// Constructor for Tesira DSP Dialer /// </summary> /// <param name="key">Unique Key</param> /// <param name="config">Component Config</param> /// <param name="parent">Parent Device</param> public TesiraDspDialer(string key, TesiraDialerControlBlockConfig config, TesiraDsp parent) : base(key, config.DialerInstanceTag, config.ControlStatusInstanceTag, config.Index, config.CallAppearance, parent, config.BridgeIndex) { Key = string.Format("{0}--Dialer{1}", parent.Key, key); Feedbacks = new FeedbackCollection <Feedback>(); DialStringFeedback = new StringFeedback(Key + "-DialStringFeedback", () => DialString); OffHookFeedback = new BoolFeedback(Key + "-OffHookFeedback", () => OffHookStatus); AutoAnswerFeedback = new BoolFeedback(Key + "-AutoAnswerFeedback", () => AutoAnswerState); DoNotDisturbFeedback = new BoolFeedback(Key + "-DoNotDisturbFeedback", () => DoNotDisturbState); CallerIdNumberFeedback = new StringFeedback(Key + "-CallerIDNumberFeedback", () => CallerIdNumber); CallerIdNameFeedback = new StringFeedback(Key + "-CallerIDNameFeedback", () => CallerIdName); IncomingCallFeedback = new BoolFeedback(Key + "-IncomingCallFeedback", () => IncomingCallState); CallStateFeedback = new IntFeedback(Key + "-CallStateFeedback", () => (int)CallStatusEnum); LastDialedFeedback = new StringFeedback(Key + "-LastDialedFeedback", () => LastDialed); NameFeedback = new StringFeedback(Key + "-NameFeedback", () => Name); DisplayNumberFeedback = new StringFeedback(Key + "-DisplayNumberFeedback", () => DisplayNumber); Feedbacks.Add(DialStringFeedback); Feedbacks.Add(OffHookFeedback); Feedbacks.Add(AutoAnswerFeedback); Feedbacks.Add(DoNotDisturbFeedback); Feedbacks.Add(CallerIdNumberFeedback); Feedbacks.Add(CallerIdNameFeedback); Feedbacks.Add(IncomingCallFeedback); Feedbacks.Add(CallStateFeedback); Feedbacks.Add(LastDialedFeedback); Feedbacks.Add(NameFeedback); Feedbacks.Add(DisplayNumberFeedback); parent.Feedbacks.AddRange(Feedbacks); Initialize(key, config); }
protected TesiraDspControlPoint(string instanceTag1, string instanceTag2, int index1, int index2, TesiraDsp parent, string key, string name, uint?bridgeIndex) : base(key, name) { BridgeIndex = bridgeIndex; Feedbacks = new FeedbackCollection <Feedback>(); InstanceTag1 = string.IsNullOrEmpty(instanceTag1) ? "" : instanceTag1; InstanceTag2 = string.IsNullOrEmpty(instanceTag2) ? "" : instanceTag2; Index1 = index1; Index2 = index2; Parent = parent; NameFeedback = new StringFeedback(key + "-NameFeedback", () => Name); }
/// <summary> /// Consturctor for base Tesira DSP Device /// </summary> /// <param name="key">Tesira DSP Device Key</param> /// <param name="name">Tesira DSP Device Friendly Name</param> /// <param name="comm">Device Communication Object</param> /// <param name="dc">Full device configuration object</param> public TesiraDsp(string key, string name, IBasicCommunication comm, DeviceConfig dc) : base(key, name) { _dc = dc; Debug.Console(0, this, "Made it to device constructor"); _commandQueue = new CrestronQueue(100); Communication = comm; var socket = comm as ISocketStatus; if (socket != null) { // This instance uses IP control socket.ConnectionChange += new EventHandler <GenericSocketStatusChageEventArgs>(socket_ConnectionChange); _isSerialComm = false; } else { // This instance uses RS-232 control _isSerialComm = true; } PortGather = new CommunicationGather(Communication, "\x0D\x0A"); PortGather.LineReceived += Port_LineReceived; CommandPassthruFeedback = new StringFeedback(() => DeviceRx); CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 20000, 120000, 300000, () => SendLine("SESSION set verbose false")); // Custom monitoring, will check the heartbeat tracker count every 20s and reset. Heartbeat sbould be coming in every 20s if subscriptions are valid DeviceManager.AddDevice(CommunicationMonitor); ControlPointList = new List <ISubscribedComponent>(); //Initialize Dictionaries Feedbacks = new FeedbackCollection <Feedback>(); Faders = new Dictionary <string, TesiraDspFaderControl>(); Presets = new Dictionary <string, TesiraDspPresets>(); Dialers = new Dictionary <string, TesiraDspDialer>(); Switchers = new Dictionary <string, TesiraDspSwitcher>(); States = new Dictionary <string, TesiraDspStateControl>(); Meters = new Dictionary <string, TesiraDspMeter>(); CrosspointStates = new Dictionary <string, TesiraDspCrosspointState>(); RoomCombiners = new Dictionary <string, TesiraDspRoomCombiner>(); CommunicationMonitor.StatusChange += CommunicationMonitor_StatusChange; CrestronConsole.AddNewConsoleCommand(SendLine, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(s => Communication.Connect(), "con" + Key, "", ConsoleAccessLevelEnum.AccessOperator); Feedbacks.Add(CommunicationMonitor.IsOnlineFeedback); Feedbacks.Add(CommandPassthruFeedback); //Start CommnicationMonitor in PostActivation phase AddPostActivationAction(() => { Communication.Connect(); if (_isSerialComm) { CommunicationMonitor.Start(); } }); CreateDspObjects(); }
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); //}); } }