private void StopKinect(KinectSensor sensorToStop)
 {
     if (sensorToStop != null)
     {
         sensorToStop.Stop();
     }
 }
 /// <summary>
 /// Kinectの動作を停止する
 /// </summary>
 /// <param name="kinect"></param>
 private static void StopKinect( KinectSensor kinect )
 {
     if ( kinect.IsRunning ) {
         kinect.Stop();
         kinect.Dispose();
     }
 }
 void StopKinect(KinectSensor sensor)
 {
     if (sensor != null)
     {
         sensor.Stop();
         sensor.AudioSource.Stop();
     }
 }
 private void UninitializeKinectSensor(KinectSensor kinect)
 {
     if (kinect != null)
     {
         kinect.Stop();
         //kinect.DepthFrameReady -= new EventHandler<DepthImageFrameReadyEventArgs>(kinectSensor_DepthFrameReady);
     }
 }
Example #5
0
        private void StopKinect(KinectSensor sensor)
        {
            if (sensor == null || !sensor.IsRunning)
                return;
            sensor.Stop();

            if (sensor.AudioSource != null)
                sensor.AudioSource.Stop();
        }
Example #6
0
 public void StopKinect(KinectSensor sensor)
 {
     if (sensor != null)
     {
         if (sensor.IsRunning)
         {
             sensor.Stop();
             Expansor.IsExpanded = true;
         }
     }
 }
        private void StopKinect(KinectSensor sensorToStop)
        {
            if (sensorToStop != null)
            {
                if (sensorToStop.IsRunning)
                {
                    sensorToStop.Stop();

                    if (sensorToStop.AudioSource != null)
                    {
                        sensorToStop.AudioSource.Stop();
                    }

                }
            }
        }
        //void newSensor_AllFramesReady(object sender, AllFramesReadyEventArgs e)
        //{
        //    
        //}

        private void StopKinect(KinectSensor sensor)
        {
            if (sensor != null)
            {
                if (sensor.IsRunning)
                {
                    //stop sensor 
                    sensor.Stop();

                    //stop audio if not null
                    if (sensor.AudioSource != null)
                    {
                        sensor.AudioSource.Stop();
                    }
                }
            }
        }
Example #9
0
        public KinectManager()
        {
            kinectConverter = new KinectConverter();
            AssimpConverter = kinectConverter;
            deviceStatusArgs = new KineapStatusChangedArgs();
            KinectSensor.KinectSensors.StatusChanged += new EventHandler<StatusChangedEventArgs>(Sensor_StatusChanged);
            sensor = KinectSensor.KinectSensors.FirstOrDefault();

            if (sensor != null) // If a Kinect is detected on startup, assigns its current status
            {
                deviceStatusArgs.CurrentStatus = GetStatus(sensor.Status);
                deviceStatusArgs.OriginalDeviceStatus = sensor.Status.ToString();
                Device_StatusChanged(deviceStatusArgs);
                if (sensor.IsRunning) // This verification is important because if the software crashes unexpectedly, the sensor might still be on when relauching the software
                    sensor.Stop();
            }
            else // If not, assigns default status 'Disconnected'
            {
                deviceStatusArgs.CurrentStatus = GetStatus(KinectStatus.Disconnected);
                deviceStatusArgs.OriginalDeviceStatus = "No Kinect was found on startup";
            }
        }
        /// <summary>
        /// Kinectの動作を停止する
        /// </summary>
        /// <param name="kinect"></param>
        private void StopKinect( KinectSensor kinect )
        {
            if ( kinect != null ) {
            if ( kinect.IsRunning ) {
              // 音声のスレッドを停止する
              isContinue = false;

              // フレーム更新イベントを削除する
              kinect.ColorFrameReady -= kinect_ColorFrameReady;
              kinect.DepthFrameReady -= kinect_DepthFrameReady;
              kinect.SkeletonFrameReady -= kinect_SkeletonFrameReady;

              // Kinectの停止と、ネイティブリソースを解放する
              kinect.Stop();
              kinect.Dispose();

              imageRgb.Source = null;
              imageDepth.Source = null;
            }
              }
        }
Example #11
0
 private void UninitializeKinectSensor(KinectSensor sensor)
 {
     if (sensor != null)
     {
         sensor.Stop();
         sensor.DepthFrameReady -= Kinect_DepthFrameReady;
     }
 }
        private static void UninitializeKinectServices(KinectSensor sensor)
        {
            if (null == sensor)
            {
                return;
            }

            // Stop streaming
            sensor.Stop();

            if (null != sensor.AudioSource)
            {
                sensor.AudioSource.Stop();
            }

            if (null != sensor.SkeletonStream)
            {
                sensor.SkeletonStream.Disable();
            }

            if (null != sensor.DepthStream)
            {
                sensor.DepthStream.Disable();
            }

            if (null != sensor.ColorStream)
            {
                sensor.ColorStream.Disable();
            }
        }
Example #13
0
        /// <summary>
        /// stop the Kinect sensor
        /// </summary>
        /// <param name="sensor">the Kinect to stop</param>
        public void StopKinect(KinectSensor sensor)
        {
            if (sensor != null)
            {
                if (sensor.IsRunning)
                {
                    //stop sensor
                    sensor.Stop();
                    LogHelper.logInput("Sensor stopped", LogHelper.logType.INFO, this);

                    //stopAudio if not null
                    if (sensor.AudioSource != null)
                    {
                        sensor.AudioSource.Stop();
                        LogHelper.logInput("Microphone stopped", LogHelper.logType.INFO, this);
                    }
                }
            }
        }
Example #14
0
 private void StopKinect(KinectSensor sensor)
 {
     if (sensor != null)
     {
         if (sensor.IsRunning)
         {
             //stop sensor
             sensor.Stop();
         }
     }
 }
        /// <summary>
        /// Uninitialize kinect device. This method is based on kinect SDK reference code.
        /// </summary>
        /// <param name="sensor">Devide to be uninitialized</param>
        private void UninitializeKinectServices(KinectSensor sensor)
        {
            // Stop streaming
            sensor.Stop();

            // Disable skeletonengine, as only one Kinect can have it enabled at a time.
            if (sensor.SkeletonStream != null)
            {
                sensor.SkeletonStream.Disable();
            }
        }
 //DeHandle and stop stream
 private void UninitializeKinectSensor(KinectSensor sensor)
 {
     if (sensor != null)
     {
         sensor.DepthStream.Disable();
         sensor.ColorStream.Disable();
         sensor.Stop();
         Console.WriteLine("Stopped Kinect");
     }
 }
Example #17
0
 // Shut down an old KinectSensor
 private void StopKinect(KinectSensor oldKinect)
 {
     oldKinect.Stop();
 }
Example #18
0
 private void UninitializeKinect(KinectSensor kinectSensor)
 {
     this.UninitializeSpeechRecognitionEngine(kinectSensor);
     kinectSensor.Stop();
     kinectSensor.Dispose();
 }
Example #19
0
 private void Uninitsensor(KinectSensor sensor)
 {
     if (sensor != null)
     {
         sensor.Stop();
         sensor.AudioSource.Stop();
         sensor.DepthStream.Disable();
         sensor.SkeletonStream.Disable();
         this._FrameSkeles = null;
     }
 }
Example #20
0
 private void StopSensor(KinectSensor sensor)
 {
     sensor.ColorFrameReady -= this.OnColorFrameReady;
     sensor.DepthFrameReady -= this.OnDepthFrameReady;
     sensor.Stop();
 }
 private void UninitializeKinectSensor(KinectSensor sensor)
 {
     if (sensor != null)
     {
         sensor.Stop();
         sensor.SkeletonFrameReady -= NuiSkeletonFrameReady;
         sensor.ColorFrameReady -= NuiColorFrameReady;
     }
 }
        /// <summary>
        /// Kinectの動作を停止する
        /// </summary>
        /// <param name="kinect"></param>
        private void StopKinect( KinectSensor kinect )
        {
            if ( kinect != null ) {
            if ( kinect.IsRunning ) {
              kinect.AllFramesReady -= kinect_AllFramesReady;

              kinect.Stop();
              kinect.Dispose();
            }
              }
        }
 /// <summary>
 /// Stops the kinect.
 /// </summary>
 /// <param name="kinectSensor">The kinect sensor.</param>
 private void StopKinect(KinectSensor kinectSensor)
 {
     kinectSensor.Stop();
 }
        /// <summary>
        /// Execute shutdown tasks and UninitializeKinectSensor
        /// </summary>
        /// <param name="kinectSensor">object sending the event</param>

        private void UninitializeKinectSensor(KinectSensor kinectSensor)
        {
            if (kinectSensor != null)
            {
                kinectSensor.Stop();
                kinectSensor.SkeletonFrameReady -= KinectSkeletonFrameReady;
            }
        }
 private void UninitializeKinectSensor(KinectSensor sensor)
 {
     if (sensor != null)
     {
         sensor.Stop();
         sensor.ColorStream.Disable();
         sensor.DepthStream.Disable();
         sensor.SkeletonStream.Disable();
         sensor.AllFramesReady -= KinectDevice_AllFramesReady;
     }
 }
 public void stopKinect(KinectSensor theSensor)
 {
     //Kill off the sensor for other programs to use
     if (theSensor != null)
     {
         theSensor.Stop();
     }
 }
 private void StopKinect(KinectSensor sensor)
 {
     if (this.sensors.Contains(sensor))
     {
         this.sensors.Remove(sensor);
         this.faceTrackers.Remove(sensor);
         this.colorPixelData.Remove(sensor);
         this.depthPixelData.Remove(sensor);
     }
     if (this.sensors.Count > 0)
         SetStatusbarText("Kinect stopped (" + this.sensors.Count + " sensors active)", Colors.Red);
     else
         SetStatusbarText("Kinect stopped", Colors.Red);
     if (sensors.Count == 0)
     {
         CloseCSVFile();
     }
     if (sensor.IsRunning)
     {
         sensor.ColorStream.Disable();
         sensor.DepthStream.Disable();
         sensor.SkeletonStream.Disable();
         StopSpeechRecognizer(sensor);
         if (sensor.AudioSource != null)
         {
             sensor.AudioSource.Stop();
         }
         sensor.Stop();
     }
 }
        /// <summary>
        /// Kinectの動作を停止する
        /// </summary>
        /// <param name="kinect"></param>
        private void StopKinect( KinectSensor kinect )
        {
            if ( kinect != null ) {
            if ( kinect.IsRunning ) {
              // フレーム更新イベントを削除する
              kinect.AllFramesReady -= kinect_AllFramesReady;

              // Kinectの停止と、ネイティブリソースを解放する
              kinect.Stop();
              kinect.Dispose();

              imageRgb.Source = null;
            }
              }
        }
        private void kinectStop(KinectSensor sensor)
        {
            if (sensor != null)
            {
                // Stop the sensor
                sensor.Stop();

                // Stop audio
                if (sensor.AudioSource != null)
                {
                    sensor.AudioSource.Stop();
                }
            }
        }
        // Kinect enabled apps should uninitialize all Kinect services that were initialized in InitializeKinectServices() here.
        private void UninitializeKinectServices(KinectSensor sensor)
        {
            sensor.Stop();

            sensor.SkeletonFrameReady -= this.SkeletonsReady;
            kinectTable.Remove(sensor.DeviceConnectionId);
            gui.removeKinectSensorToList(sensor.DeviceConnectionId);

            kinectDepthViewer.Kinect = null;
            //KinectSkeletonViewerOnDepth.Kinect = null;

            if (speechRecognizer != null)
            {
                speechRecognizer.RecognizeAsyncCancel();
                speechRecognizer.RecognizeAsyncStop();
            }

            //enableAec.Visibility = Visibility.Collapsed;
        }