public void Stop() { if (!ReferenceEquals(null, _replay)) { _replay.Stop(); _replay.ScrubTo(new TimeSpan(0)); } Close(); }
void LocationSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { if (_locationSetByHand) { if (_replay != null) { _replay.ScrubTo(TimeSpan.FromMilliseconds((LocationSlider.Value / 100.0) * _replay.Duration.TotalMilliseconds)); } } else { _locationSetByHand = true; } }
void LocationSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) { if (_locationSetByHand) { if (_replay != null) { _replay.ScrubTo(TimeSpan.FromMilliseconds(LocationSlider.Value)); } } else { _locationSetByHand = true; } }
public void Play() { if (ReferenceEquals(null, _replay) && !ReferenceEquals(null, _dataAccessFacade.GetSceneInUseAccess().GetScene())) { try { string fileName = _dataAccessFacade.GetGeneralSettings().GetDataDirectory() + "scene/" + _dataAccessFacade.GetSceneInUseAccess().GetScene().SceneId + "/kinect.dvr"; if (File.Exists(fileName)) { Console.WriteLine($"archivo {fileName} existe, a abrirlo"); _replay = new KinectReplay(File.Open(fileName, FileMode.Open, FileAccess.Read)); _replay.PropertyChanged += _replay_PropertyChanged; if (_replay.HasBodyFrames) { _replay.BodyFrameArrived += KinectInput.SkeletonColorVideoViewer._replay_BodyFrameArrived; } if (_replay.HasColorFrames) { _replay.ColorFrameArrived += KinectInput.SkeletonColorVideoViewer._replay_ColorFrameArrived; } _replay.ScrubTo(new TimeSpan(0)); _replay.Start(); } } catch (Exception) { Close(); } } else { _replay.Start(); } }
private void sendToStartLocation() { _replay.ScrubTo(TimeSpan.FromMilliseconds(StartFromMillis)); }