private void buttonSubmit_Click(object sender, EventArgs e)
        {
            _player.Stop();

            foreach (ToolStripStatusLabel label in statusStrip1.Items)
            {
                label.Text = "";
            }

            _stopWatchListenToSong.Stop();
            TimeSpan ts = _stopWatchListenToSong.Elapsed;

            // Format and display the TimeSpan value.
            string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
                                               ts.Hours, ts.Minutes, ts.Seconds,
                                               ts.Milliseconds / 10);

            Result currentResult = new Result(_experimentData.NameOfParticipant, elapsedTime,
                                              new MixScore(Path.GetFileName(_track1FileName), trackBarTrack1.Value), _track1TimesMoved,
                                              new MixScore(Path.GetFileName(_track2FileName), trackBarTrack2.Value), _track2TimesMoved,
                                              new MixScore(Path.GetFileName(_track3FileName), trackBarTrack3.Value), _track3TimesMoved,
                                              new MixScore(Path.GetFileName(_track4FileName), trackBarTrack4.Value), _track4TimesMoved,
                                              new MixScore(Path.GetFileName(_track5FileName), trackBarTrack5.Value), _track5TimesMoved);

            _results.Add(currentResult);

            _logger.WriteLTData(currentResult);

            if (_testNumber == 4)
            {
                ThankYou thankYouDialog = new ThankYou("Thank you for taking part in this part of the experiment. Please continue to the next section.");           // Show testDialog as a modal dialog and determine if DialogResult = OK.
                if (thankYouDialog.ShowDialog(this) == DialogResult.OK)
                {
                    // Read the contents of testDialog's TextBox.
                }
                _logger.CloseFile();
                _perceivedEmotion = new PerceivedEmotion(_experimentData.NameOfParticipant);
                _perceivedEmotion.Show(this);
                this.Hide();
            }
            else
            {
                ThankYou thankYouDialog = new ThankYou();           // Show testDialog as a modal dialog and determine if DialogResult = OK.
                if (thankYouDialog.ShowDialog(this) == DialogResult.OK)
                {
                    // Read the contents of testDialog's TextBox.
                }

                _testNumber++;
                int songNum = _testNumber + 1;
                this.Text = "Perceived Emotion Experiment - Song " + songNum.ToString();
                AssignSliders();
                _stopWatchListenToSong.Reset();
                _stopWatchListenToSong.Start();
                buttonSubmit.Enabled = false;
            }
        }
Exemplo n.º 2
0
        private void buttonSubmit_Click(object sender, EventArgs e)
        {
            _player.Stop();

            foreach (ToolStripStatusLabel label in statusStrip1.Items)
            {
                label.Text = "";
            }

            _stopWatchListenToSong.Stop();
            TimeSpan ts = _stopWatchListenToSong.Elapsed;

            // Format and display the TimeSpan value.
            string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
                                               ts.Hours, ts.Minutes, ts.Seconds,
                                               ts.Milliseconds / 10);

            Result currentResult = new Result(_experimentData.NameOfParticipant, elapsedTime,
                                              new EmotionScore(Path.GetFileName(_track1FileName), trackBarMix1Arousal.Value, trackBarMix1Valence.Value, trackBarMix1Tension.Value),
                                              new EmotionScore(Path.GetFileName(_track2FileName), trackBarMix2Arousal.Value, trackBarMix2Valence.Value, trackBarMix2Tension.Value));

            _logger.WriteEmotionData(currentResult);

            if (_testNumber == 4)
            {
                ThankYou thankYouDialog = new ThankYou("Thank you for taking part in this experiment.");
                // Show testDialog as a modal dialog and determine if DialogResult = OK.
                if (thankYouDialog.ShowDialog(this) == DialogResult.OK)
                {
                    // Read the contents of testDialog's TextBox.
                }
                _player.Stop();
                _logger.CloseFile();
                this.Close();
                Application.Exit(null);
            }
            else
            {
                ThankYou thankYouDialog = new ThankYou();
                // Show testDialog as a modal dialog and determine if DialogResult = OK.
                if (thankYouDialog.ShowDialog(this) == DialogResult.OK)
                {
                    // Read the contents of testDialog's TextBox.
                }

                _testNumber++;
                int songNum = _testNumber + 1;
                this.Text = "Perceived Emotion Experiment - Song " + songNum.ToString();
                AssignSliders();

                _stopWatchListenToSong.Reset();
                _stopWatchListenToSong.Start();

                buttonSubmit.Enabled = false;
            }
        }