Exemple #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();
     });
 }
Exemple #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();
     });
 }
Exemple #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;
 }
Exemple #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;
            }
        }
Exemple #5
0
 private void PlayTracks(object state)
 {
     stopTimer.Change(3950, System.Threading.Timeout.Infinite);
     Dispatcher.BeginInvoke(delegate
     {
         MainProgress.Begin();
         //foreach (int k in banksToPlay.Keys)
         //{
         //    if (banksToPlay[k])
         //    {
         //        viewModel.AudioMan.PlayBank(k);
         //    }
         //}
         if (play1)
         {
             viewModel.AudioMan.PlayMixedBank(0);
             Bank1Go.Begin();
         }
         if (play2)
         {
             viewModel.AudioMan.PlayMixedBank(1);
             Bank2Go.Begin();
         }
         if (play3)
         {
             viewModel.AudioMan.PlayMixedBank(2);
             Bank3Go.Begin();
         }
         if (play4)
         {
             viewModel.AudioMan.PlayMixedBank(3);
             Bank4Go.Begin();
         }
         if (play5)
         {
             viewModel.AudioMan.PlayMixedBank(4);
             Bank5Go.Begin();
         }
         if (play6)
         {
             viewModel.AudioMan.PlayMixedBank(5);
             Bank6Go.Begin();
         }
     });
 }
Exemple #6
0
        private static IEnumerator <YieldInstruction> continueMain(GameState mainState)
        {
            yield return(CoroutineManager.Instance.StartCoroutine(GameManager.Instance.FadeOut(false)));

            MainProgress mainSave = mainState.Save as MainProgress;

            DataManager.Instance.SetProgress(mainSave);
            mainSave.MergeDataTo(mainSave);
            ZoneManager.LoadFromState(mainState.Zone);

            yield return(CoroutineManager.Instance.StartCoroutine(ZoneManager.Instance.CurrentZone.OnInit()));

            if (ZoneManager.Instance.CurrentMapID.Segment > -1)
            {
                GameManager.Instance.MoveToScene(DungeonScene.Instance);
            }
            else
            {
                GameManager.Instance.MoveToScene(Ground.GroundScene.Instance);
            }

            if (DataManager.Instance.Save.NextDest.IsValid())
            {
                yield return(CoroutineManager.Instance.StartCoroutine(GameManager.Instance.MoveToZone(DataManager.Instance.Save.NextDest)));
            }
            else
            {
                if (ZoneManager.Instance.CurrentMapID.Segment > -1)
                {
                    GameManager.Instance.BGM(ZoneManager.Instance.CurrentMap.Music, true);
                }
                else
                {
                    GameManager.Instance.BGM(ZoneManager.Instance.CurrentGround.Music, true);
                }

                yield return(CoroutineManager.Instance.StartCoroutine(ZoneManager.Instance.CurrentGround.OnInit()));

                Content.GraphicsManager.GlobalIdle = Content.GraphicsManager.IdleAction;
                yield return(CoroutineManager.Instance.StartCoroutine(GameManager.Instance.FadeIn()));
            }
        }
Exemple #7
0
        private void PlayTracks(object state)
        {
            stopTimer.Change(3950, System.Threading.Timeout.Infinite);
            Dispatcher.BeginInvoke(delegate
            {
                MainProgress.Begin();
                if (play1)
                {
                    viewModel.AudioMan.PlayMixedBank(0);
                    PlayBank1.Begin();
                    if (recording)
                    {
                        instructions[0][currentMeasure] = true;
                    }
                }
                if (play2)
                {
                    viewModel.AudioMan.PlayMixedBank(1);
                    PlayBank2.Begin();
                    if (recording)
                    {
                        instructions[1][currentMeasure] = true;
                    }
                }
                if (play3)
                {
                    viewModel.AudioMan.PlayMixedBank(2);
                    PlayBank3.Begin();
                    if (recording)
                    {
                        instructions[2][currentMeasure] = true;
                    }
                }
                if (play4)
                {
                    viewModel.AudioMan.PlayMixedBank(3);
                    PlayBank4.Begin();

                    if (recording)
                    {
                        instructions[3][currentMeasure] = true;
                    }
                }
                if (play5)
                {
                    viewModel.AudioMan.PlayMixedBank(4);
                    PlayBank5.Begin();

                    if (recording)
                    {
                        instructions[4][currentMeasure] = true;
                    }
                }
                if (play6)
                {
                    viewModel.AudioMan.PlayMixedBank(5);
                    PlayBank6.Begin();

                    if (recording)
                    {
                        instructions[5][currentMeasure] = true;
                    }
                }

                if (recording)
                {
                    currentMeasure++;
                }
            });
        }