Exemplo n.º 1
0
 private void BtnPause_Click(object sender, RoutedEventArgs e)
 {
     capturer.StopRecording();
     btnPlay.IsEnabled  = true;
     btnPause.IsEnabled = false;
     appInfo.SetState(false);
     updateTimer.Stop();
 }
Exemplo n.º 2
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();
            }
        }