void handMovements_RightGesture(object sender, handMovements.GestureEventArgs e) { Storyboard sb = this.FindResource("selectWallOfSound") as Storyboard; switch (e.Trigger) { case handMovements.UserDecisions.Triggered: if (modeDecision == null) { selectedMode = modeSelected.WallOfSound; modeDecision = new DispatcherTimer(); modeDecision.Interval = TimeSpan.FromSeconds(3); modeDecision.Start(); modeDecision.Tick += new EventHandler(modeDecisionWOS_Tick); sb.Begin(); MainWindow.SFXMenu.Play(); } break; case handMovements.UserDecisions.NotTriggered: if (selectedMode == modeSelected.WallOfSound) { selectedMode = modeSelected.None; } sb.Stop(); if (modeDecision != null) { modeDecision.Stop(); modeDecision.Tick -= new EventHandler(modeDecisionWOS_Tick); modeDecision = null; } imgBandMode.Visibility = Visibility.Visible; imgLeftHand.Visibility = Visibility.Visible; imgWallOfSound.Visibility = Visibility.Visible; imgRightHand.Visibility = Visibility.Visible; break; } }
void handMovements_LeftSwipeRight(object sender, handMovements.GestureEventArgs e) { if (e.Trigger == handMovements.UserDecisions.Triggered) { MainWindow.SFXSuccess.Play(); exitKinectGuide(); switch (kinectGuideMenu[menuPosition]) { case menuOptions.GoBack: returnToStart(); break; case menuOptions.TakeAPicture: takeAPicture(); break; case menuOptions.RecordNewWall: case menuOptions.CustomWall: case menuOptions.Sax: case menuOptions.Trance: case menuOptions.Metal: case menuOptions.EightBit: case menuOptions.Animal: case menuOptions.Beatbox: wallSwitchPlayerTo(MainWindow.activeSkeletons[MainWindow.gestureSkeletonKey], kinectGuideMenu[menuPosition]); break; } } else { //Stop listening and reset the flag for next time handMovements.LeftSwipeRight -= handMovements_LeftSwipeRight; handMovements.LeftSwipeRightStatus[MainWindow.gestureSkeletonKey] = false; } }
//Kinect Guide code void handMovements_KinectGuideGesture(object sender, handMovements.GestureEventArgs e) { if (currentFocus != playerFocus.Tutorial) { Storyboard sb = this.FindResource("kinectGuideStart") as Storyboard; Console.WriteLine("Kinect Guide: " + e.Trigger); switch (e.Trigger) { case handMovements.UserDecisions.Triggered: if (currentFocus != playerFocus.KinectGuide) { sb.Begin(); kinectGuideTimer = new DispatcherTimer(); kinectGuideTimer.Interval = TimeSpan.FromSeconds(3); kinectGuideTimer.Tick += new EventHandler(kinectGuideTimer_Tick); kinectGuideTimer.Start(); } break; case handMovements.UserDecisions.NotTriggered: sb.Stop(); if (kinectGuideTimer != null) { kinectGuideTimer.Stop(); kinectGuideTimer.Tick -= kinectGuideTimer_Tick; kinectGuideTimer = null; } break; } } }
void dismissTutorial(object sender, handMovements.GestureEventArgs e) { handMovements.LeftSwipeRight -= dismissTutorial; handMovements.LeftSwipeRightStatus[MainWindow.gestureSkeletonKey] = false; MainWindow.animateFade(imgDimmer, 0.5, 0, 0.5); MainWindow.animateSlide(MainWindow.availableTutorials[MainWindow.activeTutorial].tutImage, true, false, 50, 0.5); MainWindow.Tutorials previousTutorial = MainWindow.activeTutorial; MainWindow.activeTutorial = MainWindow.Tutorials.None; currentFocus = playerFocus.None; MainWindow.showPlayerOverlays(); if (previousTutorial == MainWindow.Tutorials.WallOfSound) { checkTutorial(MainWindow.Tutorials.KinectGuide); } else if (previousTutorial == MainWindow.Tutorials.KinectGuide) { checkTutorial(MainWindow.Tutorials.VoiceRecognition); } }
private void adjustMenuSpeed(handMovements.scrollDirection scrollDirection) { if (scrollDirection == handMovements.scrollDirection.SmallUp || scrollDirection == handMovements.scrollDirection.SmallDown) { menuMovementTimer.Interval = TimeSpan.FromMilliseconds(1000); menuMovementTimer.Start(); } else if (scrollDirection == handMovements.scrollDirection.LargeUp || scrollDirection == handMovements.scrollDirection.LargeDown) { menuMovementTimer.Interval = TimeSpan.FromMilliseconds(250); menuMovementTimer.Start(); } else { menuMovementTimer.Stop(); } }
void handMovements_LeftSwipeRight(object sender, handMovements.GestureEventArgs e) { if (e.Trigger == handMovements.UserDecisions.Triggered) { MainWindow.SFXSuccess.Play(); exitKinectGuide(); switch (kinectGuideMenu[menuPosition]) { case menuOptions.GoBack: returnToStart(); break; case menuOptions.TakeAPicture: takeAPicture(); break; case menuOptions.Metronome: currentFocus = playerFocus.Metronome; metronome.destroyMetronome(); MainWindow.sensor.AllFramesReady -= listenForMetronome; metronome.setupMetronome(); MainWindow.sensor.AllFramesReady += new EventHandler<AllFramesReadyEventArgs>(listenForMetronome); checkTutorial(MainWindow.Tutorials.Metronome); break; case menuOptions.Guitar: switchInstrument(MainWindow.activeSkeletons[MainWindow.gestureSkeletonKey], instrumentList.GuitarRight, MainWindow.PlayerMode.Acoustic); break; case menuOptions.LeftyGuitar: switchInstrument(MainWindow.activeSkeletons[MainWindow.gestureSkeletonKey], instrumentList.GuitarLeft, MainWindow.PlayerMode.Acoustic); break; case menuOptions.ElectricGuitar: switchInstrument(MainWindow.activeSkeletons[MainWindow.gestureSkeletonKey], instrumentList.GuitarRight, MainWindow.PlayerMode.Electric); break; case menuOptions.LeftyElectricGuitar: switchInstrument(MainWindow.activeSkeletons[MainWindow.gestureSkeletonKey], instrumentList.GuitarLeft, MainWindow.PlayerMode.Electric); break; case menuOptions.Drum: switchInstrument(MainWindow.activeSkeletons[MainWindow.gestureSkeletonKey], instrumentList.Drums); break; case menuOptions.Keyboard: switchInstrument(MainWindow.activeSkeletons[MainWindow.gestureSkeletonKey], instrumentList.Keyboard); break; case menuOptions.Triangle: switchInstrument(MainWindow.activeSkeletons[MainWindow.gestureSkeletonKey], instrumentList.Triangle); break; } } else { //Stop listening and reset the flag for next time handMovements.LeftSwipeRight -= handMovements_LeftSwipeRight; handMovements.LeftSwipeRightStatus[MainWindow.gestureSkeletonKey] = false; } }