コード例 #1
0
        ///<summary>
        ///Releasing the media elements when closing the replay window
        ///Switch to recording mode
        ///Written by Baptiste Germond
        ///</summary>
        private void quit()
        {
            isReplaying    = false;
            statisticsPath = "";
            if (skeletonScrolling != null)
            {
                skeletonScrolling.Stop();
                skeletonScrolling = null;
            }
            (TrainingSideTool.Get().FindResource("StopReplayButtonAction") as Storyboard).Begin();
            DrawingSheetView.Get().ReplayVideo.Close();
            DrawingSheetView.Get().ReplayVideo.Source = null;
            DrawingSheetView.Get().ReplayAudio.Close();
            DrawingSheetView.Get().ReplayAudio.Source = null;
            ReplayView.Get().SoundCheckbox.IsChecked = false;
            SideToolsViewModel.Get().enableTrackingAndTrainingTab();
            TrainingSideToolViewModel.Get().recordingMode();
            DrawingSheetAvatarViewModel.Get().normalMode();

            // reactivate the sensors
            KinectDevice.sensor.SkeletonStream.Enable();
            if (faceTrack)
            {
                KinectDevice.faceTracking = true;
            }
            TrackingSideToolViewModel.get().SpeedRate = speedRateActive;

            // reactivate the audience
            if (TrainingSideToolViewModel.audienceOn)
            {
                TrainingSideToolViewModel.audienceOn = false;
                GeneralSideTool.Get().AudienceControlCheckBox.IsChecked = true;
            }
        }
コード例 #2
0
        /// <summary>
        /// Constructor
        /// Modified by Baptiste Germond
        /// </summary>
        /// <param name="file"></param>
        private ReplayViewModel(String file)
        {
            filePath = file;
            instance = this;
            performanceSoundCommand   = new RelayCommand(performanceSound);
            playPerformanceCommand    = new RelayCommand(Play);
            pausePerformanceCommand   = new RelayCommand(Pause);
            stopPerformanceCommand    = new RelayCommand(Stop);
            videoAvatarDisplayCommand = new RelayCommand(videoAvatarDisplay);
            avatarDisplayCommand      = new RelayCommand(avatarDisplay);
            streamDisplayCommand      = new RelayCommand(videoStreamDisplay);
            quitCommand        = new RelayCommand(quit);
            otherReplayCommand = new RelayCommand(otherReplay);
            Tools.initStopWatch();

            DrawingSheetView.Get().ReplayVideo.MediaEnded += videoEnded;

            SideToolsViewModel.Get().disableTrackingAndTrainingTab();
            ManagePerformanceFiles();
            //ManageSpeedElements();
            Mute();
            pauseButtonCommand();
            if (!skdRead)
            {
                throw new Exception(".skd file is not correct\nPlease try with one avatarSkeletonData.skd file correct");
            }
        }
コード例 #3
0
 public static SideToolsViewModel Get()
 {
     if (stvm == null)
     {
         stvm = new SideToolsViewModel();
     }
     return(stvm);
 }
コード例 #4
0
 public void StopVideoTraining()
 {
     SideToolsViewModel.Get().enableTrackingAndTrainingTab();
     (TrainingSideTool.Get().FindResource("StopVideoTraining") as Storyboard).Begin();
     VideosNameList = new List <VideosList>();
     DrawingSheetAvatarViewModel.Get().isTraining = false;
     SkeletonList = null;
 }
コード例 #5
0
        /// <summary>
        /// Launch the record when the waiting time is over
        /// </summary>
        public void launchRecordingAfterWait()
        {
            inRecord = true;

            allFalse();
            if (FaceRecognition == true)
            {
                TrackingSideToolViewModel tracking = TrackingSideToolViewModel.get();
                tracking.FaceTracking = true;
                tracking.emo          = true;
                //tracking.Mouth = true;
                //tracking.Mouth2 = true; //Those feature are not working for now
                //tracking.pupilR = true;
                tracking.LookR = true;
            }
            if (VoiceRecognition == true)
            {
                TrackingSideToolViewModel tracking = TrackingSideToolViewModel.get();
                //tracking.PeakDetection = true; //Create lags when in record
                tracking.SpeedRate        = true;
                tracking.ShowTextOnScreen = true;

                /*tracking.VoiceMonotony = true;
                 * tracking.BadVoiceReflex = true;*///Features are not working
            }
            if (BodyRecognition == true)
            {
                TrackingSideToolViewModel.get().UseFeedback = true;
            }

            SideToolsViewModel.Get().chooseTraining();

            TrainingSideToolViewModel tstvm = TrainingSideToolViewModel.Get();

            tstvm.limitedTimeHours   = "0";
            tstvm.limitedTimeMinutes = MinRecord.ToString();
            tstvm.limitedTimeSeconds = SecRecord.ToString();
            tstvm.isTimeLimited      = true;

            /*Depending on which view the user was using when he start his session record
             * the session recording will record the view the user was using*/
            if (MainWindow.drawingSheet.getMode() == SheetMode.AvatarMode)
            {
                tstvm.ToggleAvatarOpenGLRecording = true;
            }
            else if (MainWindow.drawingSheet.getMode() == SheetMode.StreamMode)
            {
                tstvm.ToggleStreamRecording = true;
            }
            tstvm.ToggleAudioRecording = true;

            //Launch the record
            ButtonAutomationPeer peer = new ButtonAutomationPeer(TrainingSideTool.Get().StartRecordingButton);

            IInvokeProvider invokeProv = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider;

            invokeProv.Invoke();
        }