Exemple #1
0
        private void Timer_Tick(object sender, EventArgs e)
        {
            if (learningProcess)
            {
                prgBar.Value = lPr;
                if (lPr > 99)
                {
                    this.Close();
                }
            }
            else if (timer.Interval == new TimeSpan(0, 0, 20))
            {
                testedNote++;
                lbNote.Content = "Pause";
                capturer.StopRecording();
                if (testedNote.ToInt() == 0)
                {
                    learningProcess = true;
                    capturer.StopRecording();
                    btnStart.IsEnabled = false;
                    btnStop.IsEnabled  = false;
                    lbNote.Content     = "End";
                    prgBar.Value       = 0;
                    Task.Factory.StartNew(() => Learn());
                }

                timer.Interval        = new TimeSpan(0, 0, 2);
                prgBar.Value          = testedNote.ToInt() * 100 / 61;
                samplesOneType        = 0;
                lbSampleCount.Content = samplesOneType;
            }
            else
            {
                timer.Interval = new TimeSpan(0, 0, 20);
                lbNote.Content = testedNote.ToString();
                capturer.StartRecording();
            }
        }
Exemple #2
0
 public void SetNote(Note n)
 {
     m_note.Content = n.ToString();
 }