Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            ViewSwitcher.SetMainWindow(this);
            ViewSwitcher.Switch(mainMenu = new Menu(this));

            gestureGenerator = new GestureGenerator();
            // Listen to recognized gestures
            gestureGenerator.GestureRecognized += gestureGenerator_GestureRecognized;

            this.sensorChooser = new KinectSensorChooser();
            //this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
            this.sensorChooser.KinectChanged        += SensorChooserOnKinectChanged;
            this.sensorChooserUi.KinectSensorChooser = this.sensorChooser;
            this.sensorChooser.Start();

            var regionSensorBinding = new Binding("Kinect")
            {
                Source = this.sensorChooser
            };

            BindingOperations.SetBinding(this.kinectRegion, KinectRegion.KinectSensorProperty, regionSensorBinding);

            buttonMinus.MouseEnter += this.volumneChanged;
            buttonPlus.MouseEnter  += this.volumneChanged;
            KinectRegion.AddHandPointerEnterHandler(buttonMinus, this.volumneChanged);
            //KinectRegion.AddHandPointerLeaveHandler(buttonMinus, this.volumneChanged);

            KinectRegion.AddHandPointerEnterHandler(buttonPlus, this.volumneChanged);
            //KinectRegion.AddHandPointerLeaveHandler(buttonPlus, this.volumneChanged);
        }
Exemplo n.º 2
0
        private void KinectButtonMenu(object sender, RoutedEventArgs e)
        {
            String name = ((Microsoft.Kinect.Toolkit.Controls.KinectTileButton)e.OriginalSource).Name;

            switch (name)
            {
            case "buttonMultimedia":
                ViewSwitcher.Switch(player.getInstance(null, true));
                break;

            case "buttonVideo":
                ViewSwitcher.Switch(player.getInstance(null, true));
                player.getInstance(null, true).sortedContent("video");
                break;

            case "buttonImage":
                ViewSwitcher.Switch(player.getInstance(null));
                player.getInstance(null, true).sortedContent("photo");
                break;

            case "buttonAudio":
                ViewSwitcher.Switch(player.getInstance(null));
                player.getInstance(null, true).sortedContent("music");
                break;

            case "buttonPlaylist":
                Playlist.Instance.setPlaylistVisible();
                Playlist.Instance.updateAudioList();
                ViewSwitcher.Switch(Playlist.Instance);

                break;

            case "buttonPictures":

                Playlist.Instance.setPlaylistVisible();
                Playlist.Instance.updateAudioListTop10();
                ViewSwitcher.Switch(Playlist.Instance);
                break;
            }
        }
Exemplo n.º 3
0
 private void KinectTileButton_Click_2(object sender, RoutedEventArgs e)
 {
     this.setPlaylistVisible();
     this.updateAudioList();
     ViewSwitcher.Switch(this);
 }
Exemplo n.º 4
0
        private void KinectButtonTopBar(object sender, RoutedEventArgs e)
        {
            String name = "";

            try
            {
                name = ((Microsoft.Kinect.Toolkit.Controls.KinectTileButton)e.OriginalSource).Name;
            }
            catch (InvalidCastException e1)
            {
                try
                {
                    name = ((Microsoft.Kinect.Toolkit.Controls.KinectCircleButton)e.OriginalSource).Name;
                }
                catch (InvalidCastException e2)
                {
                    MessageBoxResult result = MessageBox.Show("Event isn't from kinect button");
                }
            }

            switch (name)
            {
            case "buttonMute":
                sliderVolumn.Value = 0;
                player.getInstance(null).mediaElement.Volume = 0;
                break;

            case "buttonVolumne":
                sliderVolumn.Value = 10.0;
                player.getInstance(null).mediaElement.Volume = 1;;
                break;

            case "buttonBack":
                ViewSwitcher.Switch(mainMenu);
                break;

            case "buttonExit":
                helpContent.Visibility = Visibility.Hidden;
                break;

            case "buttonHelp":
                helpContent.Visibility = Visibility.Visible;
                BitmapImage bi = new BitmapImage();
                bi.BeginInit();
                //TODO fix below if condition to looking if file exists in relative path
                if (System.IO.File.Exists(MainWindow.mainDir + @"/Resources/Help_pages/" + currentViewName + ".png"))
                {
                    bi.UriSource = new Uri(@"Resources/Help_pages/" + currentViewName + ".png", UriKind.Relative);
                }
                else
                {
                    bi.UriSource = new Uri(@"Resources/Help_pages/under-construction.gif", UriKind.Relative);
                }

                bi.EndInit();
                imageHelp.Source = bi;
                break;

            case "buttonLanguage0":
                if (languageContent.Visibility == Visibility.Visible)
                {
                    languageContent.Visibility = Visibility.Collapsed;
                }
                else
                {
                    languageContent.Visibility = Visibility.Visible;
                }
                break;
            }
        }