private void showScoreFeedback(double score)
        {
            string scoreText;

            if (score <= 5)
            {
                scoreText = ProjectConstants.SUPER_SCORE_TEXT;
            }
            else if (score <= 10)
            {
                scoreText = ProjectConstants.EXCELLENT_SCORE_TEXT;
            }
            else if (score <= 30)
            {
                scoreText = ProjectConstants.GOOD_SCORE_TEXT;
            }
            else if (score <= 50)
            {
                scoreText = ProjectConstants.FAIR_SCORE_TEXT;
            }
            else
            {
                scoreText = ProjectConstants.POOR_SCORE_TEXT;
            }

            this.m_parent.SetTextFeedback(scoreText);

            ApplicationSpeech.speakText(scoreText);
        }
        public void OnRecordingCompletedEvent(object sender, WiimoteRecordingEventArgs e)
        {
            if (!e.RecordingInvoker.Equals(this))
            {
                return;
            }

            this.m_parent.SetTextBeatCounter(e.getNumBeatInBar().ToString());

            if (m_RecordReference)
            {
                m_RecordReference = false;
                this.m_parent.SetTextRecordingStatus(REFERENCE_RECORDING_COMPLETED);
            }

            if (m_RecordPlay)
            {
                m_RecordPlay = false;
                this.m_parent.SetTextRecordingStatus(PLAY_RECORDING_COMPLETED);
            }

            this.m_parent.SetTestTimerButtonState(true);
            this.m_parent.SetRecordingButtonState(false);

            this.m_parent.SetTextBeatCounter("");

            ApplicationSpeech.speakText(ProjectConstants.RECORDING_COMPLETED_TEXT);

            this.m_parent.TestTimer.Enabled = true;

            this.m_parent.SetReferenceRecordingItemDataBindingSource(((WiimoteReferenceRecord)e.ChildRecord.ParentRecord).ReferenceRecordingItems);
        }
Beispiel #3
0
        private void OnTimedEvent(object source, ElapsedEventArgs e)
        {
            if (!m_UseMP3Music)
            {
                if ((recordingBeatCounter % m_beatsPerBar) == 0 || recordingBeatCounter == 0)
                {
                    ApplicationSpeech.systemBeep((int)Tone.A, (int)Duration.SIXTEENTH);
                }
                else
                {
                    ApplicationSpeech.systemBeep((int)Tone.B, (int)Duration.SIXTEENTH);
                }
            }

            if (recordingBeatCounter == m_numBars * m_beatsPerBar - 1)
            {
                closeRecordingTimer();
                TimerCompletedEvent(this, new TimerEventArgs(recordingBeatCounter, (recordingBeatCounter / m_beatsPerBar), (recordingBeatCounter % m_beatsPerBar) + 1));
            }
            else if (recordingBeatCounter < m_numBars * m_beatsPerBar - 1)
            {
                BeatTimerEvent(this, new TimerEventArgs(recordingBeatCounter, (recordingBeatCounter / m_beatsPerBar), (recordingBeatCounter % m_beatsPerBar) + 1));
            }


            //if (m_UseMP3Music)
            //    m_MP3PLayer.restartMP3IfEnded();

            recordingBeatCounter++;
        }
Beispiel #4
0
        private void OnLeadinTimedEvent(object source, ElapsedEventArgs e)
        {
            if (((leadinBeatCounter % m_beatsPerBar) == 0 || leadinBeatCounter == 0) && !m_LeadInCompleted)
            {
                ApplicationSpeech.systemBeep((int)Tone.A, (int)Duration.SIXTEENTH);
            }
            else if (!m_LeadInCompleted)
            {
                ApplicationSpeech.systemBeep((int)Tone.B, (int)Duration.SIXTEENTH);
            }


            if (leadinBeatCounter <= m_LeadIn * m_beatsPerBar - 1)
            {
                BeatTimerEvent(this, new TimerEventArgs(leadinBeatCounter, (leadinBeatCounter / m_beatsPerBar), (leadinBeatCounter % m_beatsPerBar) + 1));
            }

            if ((leadinBeatCounter == m_LeadIn * m_beatsPerBar - 1) && !m_LeadInCompleted)
            {
                closeLeadInTimer();
                startRecording();
                return;
            }

            leadinBeatCounter++;
        }
 internal void setMessage(string pMessage)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (m_parent.calibrationRecordingStatus.InvokeRequired)
     {
         setMessageCallback d = new setMessageCallback(setMessage);
         m_parent.calibrationRecordingStatus.Invoke(d, new object[] { pMessage });
     }
     else
     {
         m_parent.calibrationRecordingStatus.Text = pMessage;
         ApplicationSpeech.speakText(pMessage);
     }
 }
        public void Initialize()
        {
            // openTrainingVideoDialog
            //
            this.openTrainingVideoDialog            = new System.Windows.Forms.OpenFileDialog();
            this.openTrainingVideoDialog.DefaultExt = "avi";
            this.openTrainingVideoDialog.Filter     = "movie files|*.avi||";
            this.openTrainingVideoDialog.Title      = "Choose a movie to play";

            // openTrainingMusicDialog
            //
            this.openTrainingMusicDialog            = new System.Windows.Forms.OpenFileDialog();
            this.openTrainingMusicDialog.DefaultExt = "mp3";
            this.openTrainingMusicDialog.Filter     = "mpw files|*.mp3||";
            this.openTrainingMusicDialog.Title      = "Choose a music to play";

            selectMusicFile(Configuration.getConfiguration().TrainingMusicFile);

            ApplicationSpeech.setVolume(100);

            m_parent.TrainingSelectionEvent += new TrainingVideoPanel.OnTrainingSelectionEvent(OnTrainingSelectionEvent);
        }
Beispiel #7
0
        private void startRecording()
        {
            StartingRecordingTimerEvent(this, new TimerEventArgs(recordingBeatCounter, (recordingBeatCounter / m_beatsPerBar), (recordingBeatCounter % m_beatsPerBar) + 1));

            string[] rows = m_IntroductoryMessage.Split(',');

            if (rows.Length > 1)
            {
                int length = rows.Length;

                for (int i = 0; i < length; i = i + 2)
                {
                    ApplicationSpeech.speakText(rows[i]);
                    System.Threading.Thread.Sleep(Convert.ToInt32(rows[i + 1]));
                }
            }

            /*
             * ApplicationSpeech.speakText("Start Tapping");
             * System.Threading.Thread.Sleep(100);
             * ApplicationSpeech.speakText("1");
             * System.Threading.Thread.Sleep(200);
             * ApplicationSpeech.speakText("2");
             * System.Threading.Thread.Sleep(200);
             * ApplicationSpeech.speakText("3");
             * System.Threading.Thread.Sleep(200);
             * ApplicationSpeech.speakText("4");
             * System.Threading.Thread.Sleep(200);
             */
            if (m_UseMP3Music)
            {
                m_MP3PLayer.play();
            }

            //                ApplicationSpeech.speakText("Start Tapping");

            startRecordingTimer();
        }
Beispiel #8
0
 private void applicationStartSpeech()
 {
     ApplicationSpeech.speakText(ProjectConstants.APPLICATION_START_MESSAGE);
 }