예제 #1
0
 public ReplayKinectModel(Stream fileStream)
     : base()
 {
     this.fileStream = fileStream;
     replay = new SkeletonReplay(fileStream);
     replay.SkeletonFrameReady += new EventHandler<ReplaySkeletonFrameReadyEventArgs>(SkeletonFrameReady);
     replay.Start();
 }
예제 #2
0
        private void replayButton_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog { Title = "Select filename", Filter = "Replay files|*.replay" };

            if (openFileDialog.ShowDialog() == true)
            {
                if (replay != null)
                {
                    replay.SkeletonFrameReady -= replay_SkeletonFrameReady;
                    replay.Stop();
                }
                Stream recordStream = File.OpenRead(openFileDialog.FileName);

                replay = new SkeletonReplay(recordStream);

                replay.SkeletonFrameReady += replay_SkeletonFrameReady;

                replay.Start();
            }
        }
예제 #3
0
파일: MainWindow.xaml.cs 프로젝트: dtx/KMPC
        /// <summary>
        /// Runs a test with basic swipes and clockwise
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RunTest1(object sender, RoutedEventArgs e)
        {
            ClearDetectedList();
            KnownGestures[] testSet1 = new KnownGestures[] { KnownGestures.SwipeDown, KnownGestures.SwipeUp, KnownGestures.SwipeLeft, 
                KnownGestures.SwipeRight, KnownGestures.Clockwise};
        
            CopyArrayToTest(testSet1);
            SetExpectedList(testSet1);

            string testFile = System.IO.Path.Combine(Environment.CurrentDirectory, @"data\test1.replay");
            Stream testReplayStreeam = File.OpenRead(testFile);
            _testReplay = new SkeletonReplay(testReplayStreeam);
            _testReplay.SkeletonFrameReady += replay_SkeletonFrameReady;
            _currentIndex = 0;
            _testReplay.Start();
        }
예제 #4
0
파일: MainWindow.xaml.cs 프로젝트: dtx/KMPC
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if (replay != null)
            {
                replay.SkeletonFrameReady -= replay_SkeletonFrameReady;
                replay.Stop();
            }
            isTesting = true;
            inIndex = 0;
            Stream recordStream = File.OpenRead(testFile);
            replay = new SkeletonReplay(recordStream);
            replay.SkeletonFrameReady += replay_SkeletonFrameReady;
            replay.Start();

        }
예제 #5
0
파일: MainWindow.xaml.cs 프로젝트: dtx/KMPC
        /// <summary>
        /// Runs a test with hands opening and Hands closing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RunTest2(object sender, RoutedEventArgs e)
        {
            ClearDetectedList();
            KnownGestures[] testSet2 = new KnownGestures[] { KnownGestures.HandsOpened, KnownGestures.HandsClosed};

            CopyArrayToTest(testSet2);
            SetExpectedList(testSet2);

            string testFile = System.IO.Path.Combine(Environment.CurrentDirectory, @"data\test2.replay");
            Stream testReplayStreeam = File.OpenRead(testFile);
            _testReplay = new SkeletonReplay(testReplayStreeam);
            _testReplay.SkeletonFrameReady += replay_SkeletonFrameReady;
            _currentIndex = 0;
            _testReplay.Start();
        }