public static void LinkActions(this IDvr dev, MobileControlSystemController controller) { var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key); controller.AddAction(prefix + "dvrlist", new PressAndHoldAction(dev.DvrList)); controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record)); }
public static void LinkActions(this IPower dev, MobileControlSystemController controller) { var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key); controller.AddAction(prefix + "powerOn", new Action(dev.PowerOn)); controller.AddAction(prefix + "powerOff", new Action(dev.PowerOff)); controller.AddAction(prefix + "powerToggle", new Action(dev.PowerToggle)); }
public static void LinkActions(this IColor dev, MobileControlSystemController controller) { var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key); controller.AddAction(prefix + "red", new PressAndHoldAction(dev.Red)); controller.AddAction(prefix + "green", new PressAndHoldAction(dev.Green)); controller.AddAction(prefix + "yellow", new PressAndHoldAction(dev.Yellow)); controller.AddAction(prefix + "blue", new PressAndHoldAction(dev.Blue)); }
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController) { appServerController.AddAction(MessagePath + "/fullStatus", new Action(() => { SendRoutingFullMessageObject(EISC.GetString(JoinStart + StringJoin.CurrentSource)); })); appServerController.AddAction(MessagePath + "/source", new Action <SourceSelectMessageContent>(c => { EISC.SetString(JoinStart + StringJoin.CurrentSource, c.SourceListItem); })); }
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController) { appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendAtcFullMessageObject)); appServerController.AddAction(MessagePath + "/dial", new Action <string>(s => Codec.Dial(s))); appServerController.AddAction(MessagePath + "/endCallById", new Action <string>(s => { var call = GetCallWithId(s); if (call != null) { Codec.EndCall(call); } })); appServerController.AddAction(MessagePath + "/endAllCalls", new Action(Codec.EndAllCalls)); appServerController.AddAction(MessagePath + "/dtmf", new Action <string>(s => Codec.SendDtmf(s))); appServerController.AddAction(MessagePath + "/rejectById", new Action <string>(s => { var call = GetCallWithId(s); if (call != null) { Codec.RejectCall(call); } })); appServerController.AddAction(MessagePath + "/acceptById", new Action <string>(s => { var call = GetCallWithId(s); if (call != null) { Codec.AcceptCall(call); } })); }
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController) { appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendRoutingFullMessageObject)); appServerController.AddAction(MessagePath + "/source", new Action <SourceSelectMessageContent>(c => { RoutingDevice.RunRouteAction(c.SourceListItem, c.SourceListKey); })); var sinkDevice = RoutingDevice as IRoutingSinkNoSwitching; if (sinkDevice != null) { sinkDevice.CurrentSourceChange += new SourceInfoChangeHandler((o, a) => { SendRoutingFullMessageObject(); }); } }
public static void LinkActions(this ITransport dev, MobileControlSystemController controller) { var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key); controller.AddAction(prefix + "play", new PressAndHoldAction(dev.Play)); controller.AddAction(prefix + "pause", new PressAndHoldAction(dev.Pause)); controller.AddAction(prefix + "stop", new PressAndHoldAction(dev.Stop)); controller.AddAction(prefix + "prevTrack", new PressAndHoldAction(dev.ChapPlus)); controller.AddAction(prefix + "nextTrack", new PressAndHoldAction(dev.ChapMinus)); controller.AddAction(prefix + "rewind", new PressAndHoldAction(dev.Rewind)); controller.AddAction(prefix + "ffwd", new PressAndHoldAction(dev.FFwd)); controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record)); }
public static void LinkActions(this IDPad dev, MobileControlSystemController controller) { var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key); controller.AddAction(prefix + "up", new PressAndHoldAction(dev.Up)); controller.AddAction(prefix + "down", new PressAndHoldAction(dev.Down)); controller.AddAction(prefix + "left", new PressAndHoldAction(dev.Left)); controller.AddAction(prefix + "right", new PressAndHoldAction(dev.Right)); controller.AddAction(prefix + "select", new PressAndHoldAction(dev.Select)); controller.AddAction(prefix + "menu", new PressAndHoldAction(dev.Menu)); controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit)); }
public static void LinkActions(this IChannel dev, MobileControlSystemController controller) { var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key); controller.AddAction(prefix + "chanUp", new PressAndHoldAction(dev.ChannelUp)); controller.AddAction(prefix + "chanDown", new PressAndHoldAction(dev.ChannelDown)); controller.AddAction(prefix + "lastChan", new PressAndHoldAction(dev.LastChannel)); controller.AddAction(prefix + "guide", new PressAndHoldAction(dev.Guide)); controller.AddAction(prefix + "info", new PressAndHoldAction(dev.Info)); controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit)); }
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController) { appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendCameraFullMessageObject)); var ptzCamera = Camera as IHasCameraPtzControl; if (ptzCamera != null) { // Need to evaluate how to pass through these P&H actions. Need a method that takes a bool maybe? AppServerController.AddAction(MessagePath + "/cameraUp", new PressAndHoldAction((b) => { if (b) { ptzCamera.TiltUp(); } else { ptzCamera.TiltStop(); } })); AppServerController.AddAction(MessagePath + "/cameraDown", new PressAndHoldAction((b) => { if (b) { ptzCamera.TiltDown(); } else { ptzCamera.TiltStop(); } })); AppServerController.AddAction(MessagePath + "/cameraLeft", new PressAndHoldAction((b) => { if (b) { ptzCamera.PanLeft(); } else { ptzCamera.PanStop(); } })); AppServerController.AddAction(MessagePath + "/cameraRight", new PressAndHoldAction((b) => { if (b) { ptzCamera.PanRight(); } else { ptzCamera.PanStop(); } })); AppServerController.AddAction(MessagePath + "/cameraZoomIn", new PressAndHoldAction((b) => { if (b) { ptzCamera.ZoomIn(); } else { ptzCamera.ZoomStop(); } })); AppServerController.AddAction(MessagePath + "/cameraZoomOut", new PressAndHoldAction((b) => { if (b) { ptzCamera.ZoomOut(); } else { ptzCamera.ZoomStop(); } })); } if (Camera is IHasCameraAutoMode) { appServerController.AddAction(MessagePath + "/cameraModeAuto", new Action((Camera as IHasCameraAutoMode).CameraAutoModeOn)); appServerController.AddAction(MessagePath + "/cameraModeManual", new Action((Camera as IHasCameraAutoMode).CameraAutoModeOff)); } if (Camera is IPower) { appServerController.AddAction(MessagePath + "/cameraModeOff", new Action((Camera as IPower).PowerOff)); } var presetsCamera = Camera as IHasCameraPresets; if (presetsCamera != null) { for (int i = 1; i <= 6; i++) { var preset = i; appServerController.AddAction(MessagePath + "/cameraPreset" + i, new Action <int>((p) => presetsCamera.PresetSelect(preset))); } } }
/// <summary> /// Called from base's RegisterWithAppServer method /// </summary> /// <param name="appServerController"></param> protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController) { appServerController.AddAction("/device/videoCodec/isReady", new Action(SendIsReady)); appServerController.AddAction("/device/videoCodec/fullStatus", new Action(SendVtcFullMessageObject)); appServerController.AddAction("/device/videoCodec/dial", new Action <string>(s => Codec.Dial(s))); appServerController.AddAction("/device/videoCodec/endCallById", new Action <string>(s => { var call = GetCallWithId(s); if (call != null) { Codec.EndCall(call); } })); appServerController.AddAction(MessagePath + "/endAllCalls", new Action(Codec.EndAllCalls)); appServerController.AddAction(MessagePath + "/dtmf", new Action <string>(s => Codec.SendDtmf(s))); appServerController.AddAction(MessagePath + "/rejectById", new Action <string>(s => { var call = GetCallWithId(s); if (call != null) { Codec.RejectCall(call); } })); appServerController.AddAction(MessagePath + "/acceptById", new Action <string>(s => { var call = GetCallWithId(s); if (call != null) { Codec.AcceptCall(call); } })); // Directory actions var dirCodec = Codec as IHasDirectory; if (dirCodec != null) { appServerController.AddAction(MessagePath + "/getDirectory", new Action(GetDirectoryRoot)); appServerController.AddAction(MessagePath + "/directoryById", new Action <string>(s => GetDirectory(s))); appServerController.AddAction(MessagePath + "/directorySearch", new Action <string>(s => DirectorySearch(s))); appServerController.AddAction(MessagePath + "/directoryBack", new Action(GetPreviousDirectory)); } // History actions var recCodec = Codec as IHasCallHistory; if (recCodec != null) { appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory)); } var cameraCodec = Codec as IHasCodecCameras; if (cameraCodec != null) { Debug.Console(2, this, "Adding IHasCodecCameras Actions"); cameraCodec.CameraSelected += new EventHandler <CameraSelectedEventArgs>(cameraCodec_CameraSelected); appServerController.AddAction(MessagePath + "/cameraSelect", new Action <string>(s => cameraCodec.SelectCamera(s))); MapCameraActions(); var presetsCodec = Codec as IHasCodecRoomPresets; if (presetsCodec != null) { Debug.Console(2, this, "Adding IHasCodecRoomPresets Actions"); presetsCodec.CodecRoomPresetsListHasChanged += new EventHandler <EventArgs>(presetsCodec_CameraPresetsListHasChanged); appServerController.AddAction(MessagePath + "/cameraPreset", new Action <int>(u => presetsCodec.CodecRoomPresetSelect(u))); appServerController.AddAction(MessagePath + "/cameraPresetStore", new Action <CodecRoomPreset>(p => presetsCodec.CodecRoomPresetStore(p.ID, p.Description))); } var speakerTrackCodec = Codec as IHasCameraAutoMode; if (speakerTrackCodec != null) { Debug.Console(2, this, "Adding IHasCameraAutoMode Actions"); speakerTrackCodec.CameraAutoModeIsOnFeedback.OutputChange += new EventHandler <PepperDash.Essentials.Core.FeedbackEventArgs>(CameraAutoModeIsOnFeedback_OutputChange); appServerController.AddAction(MessagePath + "/cameraAuto", new Action(speakerTrackCodec.CameraAutoModeOn)); appServerController.AddAction(MessagePath + "/cameraManual", new Action(speakerTrackCodec.CameraAutoModeOff)); } } var selfViewCodec = Codec as IHasCodecSelfView; if (selfViewCodec != null) { Debug.Console(2, this, "Adding IHasCodecSelfView Actions"); appServerController.AddAction(MessagePath + "/cameraSelfView", new Action(selfViewCodec.SelfViewModeToggle)); } var layoutsCodec = Codec as IHasCodecLayouts; if (layoutsCodec != null) { Debug.Console(2, this, "Adding IHasCodecLayouts Actions"); appServerController.AddAction(MessagePath + "/cameraRemoteView", new Action(layoutsCodec.LocalLayoutToggle)); } Debug.Console(2, this, "Adding Privacy & Standby Actions"); appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn)); appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff)); appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle)); appServerController.AddAction(MessagePath + "/sharingStart", new Action(Codec.StartSharing)); appServerController.AddAction(MessagePath + "/sharingStop", new Action(Codec.StopSharing)); appServerController.AddAction(MessagePath + "/standbyOn", new Action(Codec.StandbyActivate)); appServerController.AddAction(MessagePath + "/standbyOff", new Action(Codec.StandbyDeactivate)); }
public static void LinkActions(this INumericKeypad dev, MobileControlSystemController controller) { var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key); controller.AddAction(prefix + "num0", new PressAndHoldAction(dev.Digit0)); controller.AddAction(prefix + "num1", new PressAndHoldAction(dev.Digit1)); controller.AddAction(prefix + "num2", new PressAndHoldAction(dev.Digit2)); controller.AddAction(prefix + "num3", new PressAndHoldAction(dev.Digit3)); controller.AddAction(prefix + "num4", new PressAndHoldAction(dev.Digit4)); controller.AddAction(prefix + "num5", new PressAndHoldAction(dev.Digit5)); controller.AddAction(prefix + "num6", new PressAndHoldAction(dev.Digit6)); controller.AddAction(prefix + "num7", new PressAndHoldAction(dev.Digit0)); controller.AddAction(prefix + "num8", new PressAndHoldAction(dev.Digit0)); controller.AddAction(prefix + "num9", new PressAndHoldAction(dev.Digit0)); controller.AddAction(prefix + "numDash", new PressAndHoldAction(dev.KeypadAccessoryButton1)); controller.AddAction(prefix + "numEnter", new PressAndHoldAction(dev.KeypadAccessoryButton2)); // Deal with the Accessory functions on the numpad later }
/// <summary> /// Called from base's RegisterWithAppServer method /// </summary> /// <param name="appServerController"></param> protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController) { appServerController.AddAction("/device/videoCodec/isReady", new Action(SendIsReady)); appServerController.AddAction("/device/videoCodec/fullStatus", new Action(SendVtcFullMessageObject)); appServerController.AddAction("/device/videoCodec/dial", new Action <string>(s => Codec.Dial(s))); appServerController.AddAction("/device/videoCodec/endCallById", new Action <string>(s => { var call = GetCallWithId(s); if (call != null) { Codec.EndCall(call); } })); appServerController.AddAction(MessagePath + "/endAllCalls", new Action(Codec.EndAllCalls)); appServerController.AddAction(MessagePath + "/dtmf", new Action <string>(s => Codec.SendDtmf(s))); appServerController.AddAction(MessagePath + "/rejectById", new Action <string>(s => { var call = GetCallWithId(s); if (call != null) { Codec.RejectCall(call); } })); appServerController.AddAction(MessagePath + "/acceptById", new Action <string>(s => { var call = GetCallWithId(s); if (call != null) { Codec.AcceptCall(call); } })); // Directory actions var dirCodec = Codec as IHasDirectory; if (dirCodec != null) { appServerController.AddAction(MessagePath + "/getDirectory", new Action(GetDirectoryRoot)); appServerController.AddAction(MessagePath + "/directoryById", new Action <string>(s => GetDirectory(s))); appServerController.AddAction(MessagePath + "/directorySearch", new Action <string>(s => DirectorySearch(s))); appServerController.AddAction(MessagePath + "/directoryBack", new Action(GetPreviousDirectory)); } // History actions var recCodec = Codec as IHasCallHistory; if (recCodec != null) { appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory)); } appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn)); appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff)); appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle)); appServerController.AddAction(MessagePath + "/sharingStart", new Action(Codec.StartSharing)); appServerController.AddAction(MessagePath + "/sharingStop", new Action(Codec.StopSharing)); appServerController.AddAction(MessagePath + "/standbyOn", new Action(Codec.StandbyActivate)); appServerController.AddAction(MessagePath + "/standbyOff", new Action(Codec.StandbyDeactivate)); }
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController) { appServerController.AddAction(MessagePath + "/updateConfig", new Action <string>(s => GetConfigFile(s))); }