Example #1
0
 private void StopTracks(object state)
 {
     Dispatcher.BeginInvoke(delegate
     {
         MainProgress.Stop();
         viewModel.AudioMan.StopAll();
         PlayBank1.Stop();
         PlayBank2.Stop();
         PlayBank3.Stop();
         PlayBank4.Stop();
         PlayBank5.Stop();
         PlayBank6.Stop();
     });
 }
Example #2
0
 private void StopTracks(object state)
 {
     Dispatcher.BeginInvoke(delegate
     {
         MainProgress.Stop();
         viewModel.AudioMan.StopAll();
         Bank1Go.Stop();
         Bank2Go.Stop();
         Bank3Go.Stop();
         Bank4Go.Stop();
         Bank5Go.Stop();
         Bank6Go.Stop();
     });
 }
Example #3
0
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     base.OnNavigatingFrom(e);
     playingTimer.Dispose();
     stopTimer.Dispose();
     MainProgress.Stop();
     PlayBank1.Stop();
     PlayBank2.Stop();
     PlayBank3.Stop();
     PlayBank4.Stop();
     PlayBank5.Stop();
     PlayBank6.Stop();
     viewModel.AudioMan.StopAll();
     isPlaying = false;
 }
Example #4
0
        private void StartButton_Click(object sender, RoutedEventArgs e)
        {
            if (recording)
            {
                playingTimer.Dispose();
                stopTimer.Dispose();
                isPlaying = false;
                recording = false;

                play1 = false;
                play2 = false;
                play3 = false;
                play4 = false;
                play5 = false;
                play6 = false;
                MainProgress.Stop();
                PlayBank1.Stop();
                PlayBank2.Stop();
                PlayBank3.Stop();
                PlayBank4.Stop();
                PlayBank5.Stop();
                PlayBank6.Stop();
                viewModel.AudioMan.StopAll();

                int numMeasures = currentMeasure - 1;
                //string fileName = FileNameTextBox.Text;
                string fileName = "ML_Performance_" + DateTime.Now.ToShortDateString();
                if (string.IsNullOrEmpty(fileName) || string.IsNullOrWhiteSpace(fileName))
                {
                    fileName = "MyWave";
                }
                fileName += ".wav";
                viewModel.AudioMan.ExportAndUpload(instructions, viewModel.SelectedProject.banks.Count, numMeasures, fileName);

                StartButton.Content = "Start";

                NavigationService.GoBack();
            }
            recording = true;
            if (!isPlaying)
            {
                StartButton.Content = "Finalize";
                playingTimer.Change(0, 4000);
                isPlaying = true;
                recording = true;
            }
        }