示例#1
0
        void tempoChangeHandler(double change)
        {
            TempoSlider.Value += change / 2;
            Processing.Audio.ChangeTempo(TempoSlider.Value);

            if (_type == "Tutor" && Tutorial.getCurrentTutorial() == tempo)
            {
                totalTempoChange += Math.Abs(change);
                if (totalTempoChange > 150)
                {
                    doneTempo = true;
                }
            }
        }
示例#2
0
        void volumeChangeHandler(double change)
        {
            VolumeSlider.Value -= change;
            Processing.Audio.ChangeVolume(VolumeSlider.Value);

            if (_type == "Tutor" && Tutorial.getCurrentTutorial() == volume)
            {
                totalVolumeChange += Math.Abs(change);
                if (totalVolumeChange > 100)
                {
                    doneVolume = true;
                }
            }
        }
示例#3
0
        void pitchChangeHandler(double change)
        {
            PitchSlider.Value -= change * 3;
            Processing.Audio.ChangePitch(PitchSlider.Value);

            if (_type == "Tutor" && Tutorial.getCurrentTutorial() == pitch)
            {
                totalPitchChange += Math.Abs(change);
                // Seek.Content = totalPitchChange;
                if (totalPitchChange > 50)
                {
                    donePitch = true;
                }
            }
        }
        public FreeFormMode()
        {
            InitializeComponent();
            InitializeAvatars();

            initSliders();
            quitButton = new NavigationButton(QuitButton, delegate()
            {
                tearDown();
                return MainWindow.loadingPage;
            });

            homeButton = new NavigationButton(HomeButton, delegate()
            {
                tearDown();
                return MainWindow.homePage;
            });

            resumeButton = new NavigationButton(ResumeButton, delegate()
            {
                Resume();
                return null;
            });

            tutorialsButton = new NavigationButton(TutorialsButton, delegate()
            {
                tearDown();
                return MainWindow.browseTutorialsPage;
            });

            new NavigationButton(NextTutorial, delegate()
            {
                Tutorial.nextTutorial();
                _isPaused = false;
                Processing.Audio.Resume();
                // NextOverLay.Visibility = System.Windows.Visibility.Hidden;
                PauseOverlay.Visibility = System.Windows.Visibility.Hidden;
                MainWindow.setManipulating(true);
                mainCanvas.Background = new SolidColorBrush(Colors.Black);
                playTutorial(Tutorial.getCurrentTutorial());
                return null;
            });

            // Tutor stuff
            string tutorials_base = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Tutorials\\";
            pause = new Tutorial("Pause", "To pause move your left arm to a 45 degree angle with your body",
                    new Uri(tutorials_base + "00pause.m4v"), pauseChecker, null);
            tempo = new Tutorial("Changing the Tempo", "To increase the tempo lean towards the right, to decrease the tempo lean towards the left",
                    new Uri(tutorials_base + "01tempo.m4v"), tempoChecker, "Tempo determins the speed of a song");
            pitch = new Tutorial("Changing the Pitch", "To increase/decrease the pitch put your arms above your head and move your body up/down",
                    new Uri(tutorials_base + "02pitch.m4v"), pitchChecker, "Pitch determines how low or high the sounds of a song becomes");
            volume = new Tutorial("Changing the Volume", "To change the volume put both your arms in the midsection of your body and expand/intract your hands",
                    new Uri(tutorials_base + "03volume.m4v"), volumeChecker);
            seek = new Tutorial("Changing the Position of the track", "To seek around the track put your right hand up and hover it left and right",
                    new Uri(tutorials_base + "04seek.m4v"), seekChecker);
            switch_tracks = new Tutorial("Switching Tracks", "To switch between your tracks jump to the left/right",
                  new Uri(tutorials_base + "05swaptracks.m4v"), switchTrackChecker);

            Tutorial.addTutorial(pause);
            Tutorial.addTutorial(tempo);
            Tutorial.addTutorial(pitch);
            Tutorial.addTutorial(volume);
            Tutorial.addTutorial(seek);
            Tutorial.addTutorial(switch_tracks);
        }
 public void showTutorialChooser(Tutorial tutorial)
 {
     MainWindow.setManipulating(false);
     mainCanvas.Background = new SolidColorBrush(Colors.Gray);
     NextOverLay.Visibility = System.Windows.Visibility.Visible;
 }
 public void playTutorial(Tutorial tutorial)
 {
     myMediaElement.Source = tutorial.getSource();
     Instructions.Text = tutorial.getInstructions();
     Facts.Text = tutorial.getFacts();
     myMediaElement.Play();
 }
示例#7
0
 public static void addTutorial(Tutorial tutorial)
 {
     _tutorials.Add(tutorial);
 }
示例#8
0
 public void showTutorialChooser(Tutorial tutorial)
 {
     MainWindow.setManipulating(false);
     mainCanvas.Background  = new SolidColorBrush(Colors.Gray);
     NextOverLay.Visibility = System.Windows.Visibility.Visible;
 }
示例#9
0
        public FreeFormMode()
        {
            InitializeComponent();
            InitializeAvatars();

            initSliders();
            quitButton = new NavigationButton(QuitButton, delegate()
            {
                tearDown();
                return(MainWindow.loadingPage);
            });


            homeButton = new NavigationButton(HomeButton, delegate()
            {
                tearDown();
                return(MainWindow.homePage);
            });


            resumeButton = new NavigationButton(ResumeButton, delegate()
            {
                Resume();
                return(null);
            });

            tutorialsButton = new NavigationButton(TutorialsButton, delegate()
            {
                tearDown();
                return(MainWindow.browseTutorialsPage);
            });

            new NavigationButton(NextTutorial, delegate()
            {
                Tutorial.nextTutorial();
                _isPaused = false;
                Processing.Audio.Resume();
                // NextOverLay.Visibility = System.Windows.Visibility.Hidden;
                PauseOverlay.Visibility = System.Windows.Visibility.Hidden;
                MainWindow.setManipulating(true);
                mainCanvas.Background = new SolidColorBrush(Colors.Black);
                playTutorial(Tutorial.getCurrentTutorial());
                return(null);
            });

            // Tutor stuff
            string tutorials_base = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Tutorials\\";

            pause = new Tutorial("Pause", "To pause move your left arm to a 45 degree angle with your body",
                                 new Uri(tutorials_base + "00pause.m4v"), pauseChecker, null);
            tempo = new Tutorial("Changing the Tempo", "To increase the tempo lean towards the right, to decrease the tempo lean towards the left",
                                 new Uri(tutorials_base + "01tempo.m4v"), tempoChecker, "Tempo determins the speed of a song");
            pitch = new Tutorial("Changing the Pitch", "To increase/decrease the pitch put your arms above your head and move your body up/down",
                                 new Uri(tutorials_base + "02pitch.m4v"), pitchChecker, "Pitch determines how low or high the sounds of a song becomes");
            volume = new Tutorial("Changing the Volume", "To change the volume put both your arms in the midsection of your body and expand/intract your hands",
                                  new Uri(tutorials_base + "03volume.m4v"), volumeChecker);
            seek = new Tutorial("Changing the Position of the track", "To seek around the track put your right hand up and hover it left and right",
                                new Uri(tutorials_base + "04seek.m4v"), seekChecker);
            switch_tracks = new Tutorial("Switching Tracks", "To switch between your tracks jump to the left/right",
                                         new Uri(tutorials_base + "05swaptracks.m4v"), switchTrackChecker);

            Tutorial.addTutorial(pause);
            Tutorial.addTutorial(tempo);
            Tutorial.addTutorial(pitch);
            Tutorial.addTutorial(volume);
            Tutorial.addTutorial(seek);
            Tutorial.addTutorial(switch_tracks);
        }
示例#10
0
        public void initTutor(int index)
        {
            _type = "Tutor";
            initCommon();
            List <string> nameList = new List <string> {
                "Chasing Pavements", "Enough To Fly With You"
            };
            ArrayList addrList = new ArrayList {
                @"..\..\Resources\Music\Chasing Pavements.mp3", @"..\..\Resources\Music\Enough To Fly With You.mp3"
            };
            int doneCount = 0;

            myMediaElement.Visibility = System.Windows.Visibility.Visible;
            Instructions.Visibility   = System.Windows.Visibility.Visible;
            Facts.Visibility          = System.Windows.Visibility.Visible;

            Timer          = new DispatcherTimer();
            Timer.Interval = TimeSpan.FromSeconds(2);

            /*
             * Timer.Tick += (delegate(object s, EventArgs args)
             * {
             *  //Checks if the user has finished the task, and queues up the next task
             *  if (Tutorial.checkTask())
             *  {
             *      Tutorial next = Tutorial.nextTutorial();
             *      if (next != null)
             *      {
             *          showTutorialChooser(next);
             *      }
             *      else
             *      {
             *          showTutorialsFinished();
             *          Timer.Stop();
             *      }
             *  }
             * });
             * */

            // Load and set the song titles
            for (int i = 0; i < addrList.Count; i++)
            {
                string address = addrList[i] as String;
                string name    = nameList[i] as String;
                _nameList.Add(name);
                SongTitles[i].Text = name;
                Processing.Audio.LoadFile(address);

                // Initlaize the wave form
                initWaveForm(waveFormContainers[i], address, delegate()
                {
                    doneCount++;
                    if (doneCount == _nameList.Count)
                    {
                        MainWindow.currentPage = MainWindow.freeFormPage;
                        MainWindow.loadingPage.NavigationService.Navigate(MainWindow.currentPage);

                        // Sets the current track & also plays it
                        currentTrackIndex = _nameList.Count > 1 ? 1 : 0;
                        Processing.Audio.Play(currentTrackIndex);
                        Timer.Start();

                        Tutorial.TutorialIndex = index;
                        playTutorial(Tutorial.getCurrentTutorial());
                    }
                });
            }


            tutoree = new KinectGesturePlayer();
            tutoree.registerCallBack(tutoree.kinectGuideListener, pauseTrackingHandler, pauseChangeHandler);
            tutoree.registerCallBack(tutoree.handsAboveHeadListener, pitchTrackingHandler, pitchChangeHandler);
            tutoree.registerCallBack(tutoree.handSwingListener, seekTrackingHandler, seekChangeHandler);
            tutoree.registerCallBack(tutoree.leanListener, tempoTrackingHandler, tempoChangeHandler);
            tutoree.registerCallBack(tutoree.handsWidenListener, volumeTrackingHandler, volumeChangeHandler);
            tutoree.registerCallBack(tutoree.trackMoveListener, changeTrackTrackingHandler, volumeChangeHandler);

            IsTutorialMode = true;
        }
示例#11
0
 public static void addTutorial(Tutorial tutorial)
 {
     _tutorials.Add(tutorial);
 }