Ejemplo n.º 1
0
 public override void StateChange(CMSState state)
 {
     if (state.Equals(CMSState.Tracking) || state.Equals(CMSState.ControlTracking))
     {
         trackingSuiteAdapter.SendMessage(", Press Tab to reset");
     }
 }
Ejemplo n.º 2
0
        public void StateChange(CMSState state)
        {
            lock (mutex)
            {
                if (state.Equals(CMSState.Tracking) ||
                    state.Equals(CMSState.ControlTracking))
                {
                    CMSTrackingSuiteAdapter.SendMessage("");
                }

                if (trackingModule != null)
                {
                    trackingModule.State = state;
                    trackingModule.StateChange(state);
                }

                if (mouseControlModule != null)
                {
                    mouseControlModule.State = state;
                    mouseControlModule.StateChange(state);
                }

                if (clickControlModule != null)
                {
                    clickControlModule.State = state;
                    clickControlModule.StateChange(state);
                }
            }
        }
        private void StartThreadLoop()
        {
            while (!quit)
            {
                CMSState curState = getState();
                if (controlTogglerConfig.AutoStartControlEnabled && curState.Equals(CMSState.Tracking))
                {
                    TestControlAutoStart();
                }

                else if (controlTogglerConfig.AutoStopControlEnabled && curState.Equals(CMSState.ControlTracking))
                {
                    TestControlAutoStop();
                }
                Thread.Sleep(controlTogglerConfig.IntervalTime);
            }
        }
 public override void StateChange(CMSState state)
 {
     if (state.Equals(CMSState.ControlTracking))
     {
         firstFrameInControl = true;
         ShowExcludeForms();
     }
     else
     {
         HideExcludeForms();
     }
 }
        public void ProcessKeys(Keys keys)
        {
            if (!quit)
            {
                lock (keyMutex)
                {
                    CMSState currentState = getState();

                    if (currentState.Equals(CMSState.Tracking))
                    {
                        if ((this.controlTogglerConfig.CtrlStart && (keys.Equals(Keys.LControlKey) || keys.Equals(Keys.RControlKey))) ||
                            (this.controlTogglerConfig.ScrollStart && keys.Equals(Keys.Scroll)))
                        {
                            if (toggleControl(true))
                            {
                                if (this.controlTogglerConfig.PlaySoundOnControlChanges)
                                {
                                    soundPlayer.PlayChangeState();
                                }
                            }
                        }
                    }
                    else if (currentState.Equals(CMSState.ControlTracking))
                    {
                        if ((this.controlTogglerConfig.CtrlStop && (keys.Equals(Keys.LControlKey) || keys.Equals(Keys.RControlKey))) ||
                            (this.controlTogglerConfig.ScrollStop && keys.Equals(Keys.Scroll)))
                        {
                            if (toggleControl(false))
                            {
                                if (this.controlTogglerConfig.PlaySoundOnControlChanges)
                                {
                                    soundPlayer.PlayChangeState();
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 6
0
 public override void StateChange(CMSState state)
 {
     controlEnabled = state.Equals(CMSState.ControlTracking);
 }
Ejemplo n.º 7
0
        /******************** Video Source Events ***********************/

        private void CameraFound()
        {
            lock (mutex)
            {
                if (CMSLogger.CanCreateLogEvent(false, false, false, "CMSLogCameraFoundEvent"))
                {
                    CMSLogCameraFoundEvent cameraFoundEvent = new CMSLogCameraFoundEvent();
                    if (cameraFoundEvent != null)
                    {
                        CMSLogger.SendLogEvent(cameraFoundEvent);
                    }
                }

                if (controllerState.Equals(CMSState.CameraNotFound))
                {
                    if (videoSource.StartSource())
                    {
                        SetState(CMSState.Setup);
                        model.CurrentMonikor = videoSource.GetCurrentMonikor();
                    }
                    else
                    {
                        SetState(CMSState.CameraNotFound);
                    }
                }
                else
                {
                    throw new Exception("Received Camera Found in state " + controllerState.ToString());
                }
            }
        }