示例#1
0
        public bool stop()
        {
            if (mVideoPlayer == null)
            {
                return(false);
            }

            if (mVideoPlayer.getVideoState() != VideoState.Running)
            {
                return(false);
            }

            mVideoPlayer.stop();

            ConsoleLogger.logMessage("Executing Stop");
            mVideoPlayer.dispose();
            if (mRecordingStarted)
            {
                mWiimotes.stopRecording();
                mRecordingStarted = false;
            }

            mTrainingStarted = false;

            return(true);
        }
示例#2
0
        public void videoCompletedEvent(object sender, EventArgs args)
        {
            ConsoleLogger.logMessage("In videoCompletedEvent");

            mVideoPlayer.dispose();
            if (mRecordingStarted)
            {
                mWiimotes.stopRecording();
                mRecordingStarted = false;

                mWiimotes.comparePlayToReference(mCurrentTrainingSegment.TrainingPlayRecord);

                int lNumStars = mCurrentTrainingSegment.TrainingPlayRecord.NumberOfStars;
                if (lNumStars == 1)
                {
                    lNumStars = 2;
                }

                StringBuilder lFeedbackMessage = new StringBuilder();

//                for (int lIndex = 0; lIndex < lNumStars; lIndex++)
//                    lFeedbackMessage.Append("*  ");
//                lFeedbackMessage.Append("   :   ");

                switch (lNumStars)
                {
                case 1: lFeedbackMessage.Append(ProjectConstants.TRAINING_FEEDBACK_FOR_ONE_STAR);
                    break;

                case 2: lFeedbackMessage.Append(ProjectConstants.TRAINING_FEEDBACK_FOR_TWO_STARS);
                    break;

                case 3: lFeedbackMessage.Append(ProjectConstants.TRAINING_FEEDBACK_FOR_THREE_STARS);
                    break;

                case 4: lFeedbackMessage.Append(ProjectConstants.TRAINING_FEEDBACK_FOR_FOUR_STARS);
                    break;

                case 5: lFeedbackMessage.Append(ProjectConstants.TRAINING_FEEDBACK_FOR_FIVE_STARS);
                    break;

                default:
                    break;
                }

                mVideoPlayer.addInformation(mCurrentTrainingSegment.TrainingReferenceRecord.RecordName, lNumStars);
                SetScoreFeedback(lFeedbackMessage.ToString(), lNumStars);
            }

            if (mCurrentVideoIndex == mVideoInfoList.Count - 1)
            {
                //Last Video done
                return;
            }

            mCurrentVideoIndex++;

            if (mCurrentTrainingSegment.TrainingReferenceRecord.NextVideoPlay.CompareTo(ProjectConstants.TRAINING_AUTOMATIC_NEXT_VIDEO_PLAY) == 0)
            {
                ClickContinueButton();
            }
            else if (mCurrentVideoIndex == mVideoInfoList.Count - 1 || mCurrentTrainingSegment.TrainingReferenceRecord.NextVideoPlay.CompareTo(ProjectConstants.TRAINING_LAST_VIDEO_PLAY) == 0)
            {
                //Code for end
            }

            SetCurentPlayName();
        }