private void CleanupReplay() { if (!IsReplaying) { return; } message = ""; //if (_soundPlayer != null && _startedAudio) // _soundPlayer.Stop(); replay.AllFramesReady -= ReplayAllFramesReady; replay.Stop(); replay.Dispose(); replay = null; IsReplaying = false; }
public void Close() { if (_replay != null) { if (_replay.IsStarted) { _replay.Stop(); } _replay.PropertyChanged -= _replay_PropertyChanged; if (_replay.HasBodyFrames) { _replay.BodyFrameArrived -= _replay_BodyFrameArrived; } if (_replay.HasColorFrames) { _replay.ColorFrameArrived -= _replay_ColorFrameArrived; } _replay.Dispose(); _replay = null; } _colorBitmap = null; // reset to force recreation for new file }
public void StopReplaying() { if (null != KinectReplay && KinectReplay.Started) { KinectReplay.Dispose(); } Status = Service.RecordingManagerStatus.Standby; }
public void Close() { if (!ReferenceEquals(null, _replay)) { _replay.Stop(); _replay.Dispose(); _replay = null; } }
public void StartReplaying(string fileId) { StopRecording(); if (null != KinectReplay && KinectReplay.Started) { KinectReplay.Dispose(); } if (null != SkeletonEventListener) { foreach (EventHandler <ReplaySkeletonFrameReadyEventArgs> eventHandler in SkeletonEventListener) { KinectReplay.SkeletonFrameReady -= eventHandler; } } if (null != ColorEventListener) { foreach (EventHandler <ReplayColorImageFrameReadyEventArgs> eventHandler in ColorEventListener) { KinectReplay.ColorImageFrameReady -= eventHandler; } } _replayStream = new FileStream( FilesUsed[fileId], FileMode.Open, FileAccess.Read ); KinectReplay = new KinectReplay(_replayStream); if (null != SkeletonEventListener) { foreach (EventHandler <ReplaySkeletonFrameReadyEventArgs> eventHandler in SkeletonEventListener) { KinectReplay.SkeletonFrameReady += eventHandler; } } if (null != ColorEventListener) { foreach (EventHandler <ReplayColorImageFrameReadyEventArgs> eventHandler in ColorEventListener) { KinectReplay.ColorImageFrameReady += eventHandler; } } KinectReplay.Start(); Status = Service.RecordingManagerStatus.Replaying; }
private void Clean() { KinectPresent = false; if (recorder != null && IsRecording) { recorder.Stop(); } if (replay != null) { replay.Stop(); replay.Dispose(); } if (_kinectSensor == null) { return; } if (_kinectSensor.IsRunning) { _kinectSensor.Stop(); } _kinectSensor.AllFramesReady -= KinectSensorAllFramesReady; _kinectSensor.Dispose(); _kinectSensor = null; }