Ejemplo n.º 1
0
        private void Window_Closing(object sender,
                                    System.ComponentModel.CancelEventArgs e)
        {
            if (bodyIndexFrameReader != null)
            {
                bodyIndexFrameReader.Dispose();
                bodyIndexFrameReader = null;
            }

            if (bodyFrameReader != null)
            {
                bodyFrameReader.Dispose();
                bodyFrameReader = null;
            }

            if (audioBeamFrameReader != null)
            {
                audioBeamFrameReader.Dispose();
                audioBeamFrameReader = null;
            }

            if (kinect != null)
            {
                kinect.Close();
                kinect = null;
            }
        }
Ejemplo n.º 2
0
        protected override void OnNavigatingFrom(
            NavigatingCancelEventArgs e)
        {
            base.OnNavigatingFrom(e);

            if (bodyIndexFrameReader != null)
            {
                bodyIndexFrameReader.Dispose();
                bodyIndexFrameReader = null;
            }

            if (bodyFrameReader != null)
            {
                bodyFrameReader.Dispose();
                bodyFrameReader = null;
            }

            if (audioBeamFrameReader != null)
            {
                audioBeamFrameReader.Dispose();
                audioBeamFrameReader = null;
            }

            if (kinect != null)
            {
                kinect.Close();
                kinect = null;
            }
        }
Ejemplo n.º 3
0
 private void DisposeAudioFrameReader()
 {
     if (m_AudioFrameReader == null)
     {
         return;
     }
     m_AudioFrameReader.Dispose();
     m_AudioFrameReader = null;
 }
Ejemplo n.º 4
0
        public void Dispose()
        {
            if (_kinect != null)
            {
                if (_kinect.IsOpen)
                {
                    _kinect.Close();
                }
                _kinect = null;
            }

            if (_audioBeamFrameReader != null)
            {
                _audioBeamFrameReader.Dispose();
                _audioBeamFrameReader = null;
            }
        }
Ejemplo n.º 5
0
    void OnApplicationQuit()
    {
        print("quit");
        if (i_reader != null)
        {
            i_reader.Dispose();
            i_reader = null;
        }

        if (i_sensor != null)
        {
            if (i_sensor.IsOpen)
            {
                i_sensor.Close(); i_sensor = null;
            }
        }
    }
Ejemplo n.º 6
0
        public void ShutdownSensor()
        {
            if (skeletonReader != null)
            {
                skeletonReader.FrameArrived -= skeletonReader_FrameArrived;
                skeletonReader.Dispose();
                skeletonReader = null;
            }
            if (depthReader != null)
            {
                depthReader.FrameArrived -= depthReader_FrameArrived;
                depthReader.Dispose();
                depthReader = null;
            }
            if (colorReader != null)
            {
                colorReader.FrameArrived -= colorReader_FrameArrived;
                colorReader.Dispose();
                colorReader = null;
            }
            if (irReader != null)
            {
                irReader.FrameArrived -= irReader_FrameArrived;
                irReader.Dispose();
                irReader = null;
            }
            if (audioStream != null)
            {
                audioStream.Close();
                audioStream.Dispose();
                audioStream = null;
            }
            if (audioReader != null)
            {
                audioReader.FrameArrived -= audioReader_FrameArrived;
                audioReader.Dispose();
                audioReader = null;
            }

            //Note: we don't close the Kinect here because it would remove it from the list of avaliable Kinects
        }
Ejemplo n.º 7
0
        private void CloseKinect(object sender, CancelEventArgs e)
        {
            ConvertedStream.SpeechActive = true;
            SpeechEngine.RecognizeAsyncStop();

            if (null != AudioReader)
            {
                AudioReader.Dispose();
                AudioReader = null;
            }

            if (null != FrameReader)
            {
                FrameReader.MultiSourceFrameArrived -= FramesArrived;
                FrameReader.Dispose();
                FrameReader = null;
            }

            if (null != Sensor)
            {
                Sensor.Close();
                Sensor = null;
            }
        }