private void Clean() { swipeGestureRecognizer.OnGestureDetected -= OnGestureDetected; CloseGestureDetector(); ClosePostureDetector(); //if (voiceCommander != null) //{ // voiceCommander.OrderDetected -= voiceCommander_OrderDetected; // voiceCommander.Dispose(); // voiceCommander = null; //} if (recorder != null) { recorder.Stop(); recorder = null; } if (kinectRuntime != null) { kinectRuntime.SkeletonFrameReady -= kinectRuntime_SkeletonFrameReady; kinectRuntime.VideoFrameReady -= kinectRuntime_VideoFrameReady; kinectRuntime.Uninitialize(); kinectRuntime = null; } }
// Ctr public KinectRecorder(KinectRecordOptions options, CoordinateMapper mapper, float colorFocalLength, float depthFocalLength, Stream stream) { Options = options; recordStream = stream; writer = new BinaryWriter(recordStream); var coordParams = mapper.ColorToDepthRelationalParameters; int count = coordParams.Count; byte[] array = new byte[count]; coordParams.CopyTo(array, 0); writer.Write(count); writer.Write(array); writer.Write(colorFocalLength); writer.Write(depthFocalLength); writer.Write((int)Options); if ((Options & KinectRecordOptions.Color) != 0) { colorRecoder = new ColorRecorder(writer); } if ((Options & KinectRecordOptions.Depth) != 0) { depthRecorder = new DepthRecorder(writer); } if ((Options & KinectRecordOptions.Skeletons) != 0) { skeletonRecorder = new SkeletonRecorder(writer); } previousFlushDate = DateTime.Now; }
void DirectRecord(string targetFileName) { recorder = new SkeletonRecorder(); Stream recordStream = File.Create(targetFileName); recorder.Start(recordStream); recordOption.Content = "Stop Recording"; }
// Ctr public KinectRecorder(KinectRecordOptions options, Stream stream) { Options = options; recordStream = stream; writer = new BinaryWriter(recordStream); writer.Write((int)Options); if ((Options & KinectRecordOptions.Color) != 0) { colorRecoder = new ColorRecorder(writer); } if ((Options & KinectRecordOptions.Depth) != 0) { depthRecorder = new DepthRecorder(writer); } if ((Options & KinectRecordOptions.Skeletons) != 0) { skeletonRecorder = new SkeletonRecorder(writer); } previousFlushDate = DateTime.Now; }
private void Clean() { if (swipeGestureRecognizer != null) { swipeGestureRecognizer.OnGestureDetected -= OnGestureDetected; } if (audioManager != null) { audioManager.Dispose(); audioManager = null; } ClosePostureDetector(); if (voiceCommander != null) { voiceCommander.OrderDetected -= voiceCommander_OrderDetected; voiceCommander.Dispose(); voiceCommander = null; } if (recorder != null) { recorder.Stop(); recorder = null; } if (kinectSensor != null) { kinectSensor.ColorFrameReady -= kinectRuntime_ColorFrameReady; kinectSensor.SkeletonFrameReady -= kinectRuntime_SkeletonFrameReady; kinectSensor.ColorFrameReady -= kinectRuntime_ColorFrameReady; kinectSensor.Stop(); kinectSensor = null; } }
private void Clean() { if (_gestureSuite != null) { _gestureSuite.OnGestureDetected -= OnGestureDetected; _gestureSuite.OnGestureDetected -= UpdateGestureList; } if (audioManager != null) { audioManager.Dispose(); audioManager = null; } ClosePostureDetector(); if (voiceCommander != null) { voiceCommander.OrderDetected -= voiceCommander_OrderDetected; voiceCommander.Dispose(); voiceCommander = null; } if (recorder != null) { recorder.Stop(); recorder = null; } if (_kinectSensor != null) { _kinectSensor.ColorFrameReady -= kinectRuntime_ColorFrameReady; _kinectSensor.SkeletonFrameReady -= kinectRuntime_SkeletonFrameReady; _kinectSensor.ColorFrameReady -= kinectRuntime_ColorFrameReady; _kinectSensor.Stop(); _kinectSensor = null; } }