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(); } }
public void SetNote(Note n) { m_note.Content = n.ToString(); }