示例#1
0
 public void Stop()
 {
     if (!ReferenceEquals(null, _replay))
     {
         _replay.Stop();
         _replay.ScrubTo(new TimeSpan(0));
     }
     Close();
 }
示例#2
0
 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;
     }
 }
示例#3
0
 void LocationSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     if (_locationSetByHand)
     {
         if (_replay != null)
         {
             _replay.ScrubTo(TimeSpan.FromMilliseconds(LocationSlider.Value));
         }
     }
     else
     {
         _locationSetByHand = true;
     }
 }
示例#4
0
        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();
            }
        }
示例#5
0
 private void sendToStartLocation()
 {
     _replay.ScrubTo(TimeSpan.FromMilliseconds(StartFromMillis));
 }