Beispiel #1
1
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class. 
        /// </summary>
        public MainWindow()
        {
            this.InitializeComponent();

            // initialize the sensor chooser and UI
            this.sensorChooser = new KinectSensorChooser();
            this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
            this.sensorChooserUi.KinectSensorChooser = this.sensorChooser;
            this.sensorChooser.Start();

            // Bind the sensor chooser's current sensor to the KinectRegion
            var regionSensorBinding = new Binding("Kinect") { Source = this.sensorChooser };
            BindingOperations.SetBinding(this.kinectRegion, KinectRegion.KinectSensorProperty, regionSensorBinding);

            // Clear out placeholder content
            this.wrapPanel.Children.Clear();

            // Add in display content
            for (var index = 0; index < 300; ++index)
            {
                var button = new KinectTileButton { Label = (index + 1).ToString(CultureInfo.CurrentCulture) };
                this.wrapPanel.Children.Add(button);
            }

            // Bind listener to scroll viewer scroll position change, and check scroll viewer position
            this.UpdatePagingButtonState();
            scrollViewer.ScrollChanged += (o, e) => this.UpdatePagingButtonState();
        }
Beispiel #2
0
 private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
 {
     this.sensorChooser = new KinectSensorChooser();
     this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
     this.sensorChooserUi.KinectSensorChooser = this.sensorChooser;
     this.sensorChooser.Start();
 }
Beispiel #3
0
 public StatesScreen(Window MainWindow, KinectSensorChooser SensorChooser, Constants.TimeZones TimeZone)
 {
     // Get the main window and sensor objects
     this.mainWindow = MainWindow;
     this.sensorChooser = SensorChooser;
     // Populate the states based on TimeZone parameter
     this.timeZone = TimeZone;
     this.states = PopulateStates(TimeZone);
     #if (DEBUG)
     Console.WriteLine(TimeZone.ToString() + " states loading...");
     foreach (Utilities.State s in this.states)
     {
         Console.WriteLine(s);
     }
     Console.WriteLine("..." + TimeZone.ToString() + " states loaded!");
     #endif
     // Initialize display containers
     CreateContentGrid();
     CreateKinectRegion();
     CreateInfoGrid();
     CreateKinectScrollViewer();
     // Set up the display
     Grid.SetColumn(this.infoGrid, 0);
     Grid.SetRow(this.infoGrid, 0);
     this.content.Children.Add(this.infoGrid);
     this.kRegion.Content = this.statesKSV;
     Grid.SetColumn(this.kRegion, 0);
     Grid.SetRow(this.kRegion, 1);
     this.content.Children.Add(this.kRegion);
     // Bind the Kinect sensor
     //var regionSensorBinding = new Binding("Kinect") { Source = SensorChooser };
     this.regionSensorBinding = new Binding("Kinect") { Source = SensorChooser };
     BindingOperations.SetBinding(this.kRegion, KinectRegion.KinectSensorProperty, this.regionSensorBinding);
 }
Beispiel #4
0
 private void Window_Loaded_1(object sender, RoutedEventArgs e)
 {
     miKinect = new KinectSensorChooser();
     miKinect.KinectChanged += miKinect_KinectChanged;
     sensorChooserUI.KinectSensorChooser = miKinect;
     miKinect.Start();
 }
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public MainWindow()
        {
            this.InitializeComponent();
            this.SetEventHandler();

            this.kinectSensorChooser = null;

            this.pixelBuffer = null;
            this.skeletonBuffer = null;
            this.mainImageBuffer = null;

            this.speechRecognitionEngine = null;

            this.gameState = GameState.None;
            this.sound = new Sound();

            this.barArray = new Bar[2];

            for (int i = 0; i < this.barArray.Length; i++)
                this.barArray[i] = new Bar(this, i + 1);

            this.ball = new Ball(this);
            this.stage = new Stage();
            this.score = new Score(this.sound);

            this.life = 0;

            this.blockArray = null;
        }
        public MainWindow()
        {
            InitializeComponent();

            KinectInit init = new KinectInit();

            init.initialize();

            serial.Init();

            this.sensorChooser = new KinectSensorChooser();

            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);

            SkeletonTracking trackAngle = new SkeletonTracking();

            trackAngle.InitializeSkeleton();

            trackAngle.SkeletonLoading();
        }
Beispiel #7
0
 public MainWindow()
 {
     #if (DEBUG)
     Console.WriteLine("Starting Crash Fatality Inspector");
     #endif
     InitializeComponent();
     //
     //this.WindowState = System.Windows.WindowState.Maximized;
     this.Closing += MainWindow_Closing;
     //
     string exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
     string appPath = System.IO.Path.GetDirectoryName(exePath);
     #if (DEBUG)
     Console.WriteLine("Executable Path: " + exePath);
     Console.WriteLine("Application Path: " + appPath);
     #endif
     //
     Utilities.Data.LoadData(appPath);
     //
     #if (DEBUG)
     Console.WriteLine("Starting the Kinect sensor...");
     #endif
     this.sensorChooser = new KinectSensorChooser();
     this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
     this.sensorChooser.Start();
     #if (DEBUG)
     Console.WriteLine("...Kinect started!");
     #endif
     //
     Views.TitleScreen titleScreen = new Views.TitleScreen(this, this.sensorChooser);
     titleScreen.Show();
 }
 public LettersGameConfigPage(string itemId, KinectSensorChooser sensorChooser)
 {
     InitializeComponent();
     SensorChooser = sensorChooser;
     Config = new LettersGameConfig();
     DataContext = Config;
 }
 public ApplesGameConfigPage(string itemId, KinectSensorChooser kinectSensor)
 {
     InitializeComponent();
     _kinectSensor = kinectSensor;
     Config = new ApplesGameConfig();
     DataContext = Config;
 }
        public MainMenu()
        {
            InitializeComponent();

            // initialize the sensor chooser and UI
            if (Generics.GlobalKinectSensorChooser == null)
            {
                this.sensorChooser = new KinectSensorChooser();
                this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
                this.sensorChooserUi.KinectSensorChooser = this.sensorChooser;
                this.sensorChooser.Start();
                Generics.GlobalKinectSensorChooser = this.sensorChooser;
            }
            else
            {
                this.sensorChooser = new KinectSensorChooser();
                this.sensorChooser = Generics.GlobalKinectSensorChooser;
                this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
                this.sensorChooserUi.KinectSensorChooser = sensorChooser;
            }

            // Bind the sensor chooser's current sensor to the KinectRegion
            var regionSensorBinding = new Binding("Kinect") { Source = this.sensorChooser };
            BindingOperations.SetBinding(this.kinectRegion, KinectRegion.KinectSensorProperty, regionSensorBinding);
        }
 public void initKinectInteraction()
 {
     this.sensorChooser = new KinectSensorChooser();
     this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
     this.sensorChooserUi.KinectSensorChooser = this.sensorChooser;
     this.sensorChooser.Start();
 }
Beispiel #12
0
 public LevelOne(KinectSensorChooser sensorChooser)
 {
     InitializeComponent();
     sensorChooser = this.sensorChooser;
     Loaded += OnLoaded;
     long playerpos = Convert.ToInt64(player.GetValue(Canvas.LeftProperty));
 }
 public Kinecterface(KinectSensorChooser chooser)
 {
     this.chooser = chooser;
     this.chooser.KinectChanged += KinectChanged;
     this.DataRecieved = (skels, depth, colors) => { };
     this.ErrorWhileRecivingData = (s, d, c) => { };
 }
 public Player(string s, KinectSensorChooser w)
     : this()
 {
     this.movieName = s;
     this._sensor = w.Kinect;
     MoviePlayer.Source = new Uri(@"F:\KinectTest\KinectTest\KinectTest\Movies\" + movieName + ".MP4", UriKind.RelativeOrAbsolute);
     MoviePlayer.Play();
 }
 public SongPlayer(string s,KinectSensorChooser w)
     : this()
 {
     this.songName = s;
     this._sensor = w.Kinect;
     MoviePlayer.Source = new Uri(@"F:\KinectTest\KinectTest\KinectTest\Musics\" + songName + ".MP3", UriKind.Absolute);
     MoviePlayer.Play();
 }
Beispiel #16
0
 public Asimov(ICreateController create)
     : this(create, null)
 {
     // Find the Kinect and subscribe to changes in the sensor
     KinectSensorChooser sensorChooser = new KinectSensorChooser();
     sensorChooser.KinectChanged += this.KinectSensorChanged;
     sensorChooser.Start();
 }
 private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
 {
     _sensorChooser = new KinectSensorChooser();
     _sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
     KinectSensorChooserUi.KinectSensorChooser = _sensorChooser;
     _sensorChooser.Start();
     SetGameField();
 }
Beispiel #18
0
 public MainWindow()
 {
     InitializeComponent();
     myChooser = new KinectSensorChooser();
     myChooser.KinectChanged += new EventHandler<KinectChangedEventArgs>(myChooser_KinectChanged);
     this.SensorChooserUI.KinectSensorChooser = myChooser;
     myChooser.Start();
 }
 public DrawingGameConfigPage(string itemId, KinectSensorChooser kinectSensor)
 {
    
     this.InitializeComponent();
     this.kinectSensor = kinectSensor;
     config = new DrawingGameConfig();                                 
     this.DataContext = Config;
 }
 private void SetupKinectSensor()
 {
     _sensorChooser = new KinectSensorChooser();
     _sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
     sensorChooserUi.KinectSensorChooser = _sensorChooser;
     _sensorChooser.Start();
     var regionSensorBinding = new Binding("Kinect") { Source = _sensorChooser };
     BindingOperations.SetBinding(kinectRegion, KinectRegion.KinectSensorProperty, regionSensorBinding);
 }
 public KinectManager(MainManager manager, KinectSensorChooserUI sensorUi)
 {
     this.mainManager = manager;
     //initialize the sensor chooser UI
     this.sensorChooser = new KinectSensorChooser();
     this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
     sensorUi.KinectSensorChooser = this.sensorChooser;
     this.sensorChooser.Start();
 }
 private void Window_Loaded_1(object sender, RoutedEventArgs e)
 {
     Console.WriteLine("Main Windows Loading...");
     //Kinect Event Handler Register
     KinectSensor = new KinectSensorChooser();
     KinectSensor.KinectChanged += KinectSensor_KinectChanged;
     sensorChooserUI.KinectSensorChooser = KinectSensor;
     KinectSensor.Start();
 }
        public MainWindow()
        {
            InitializeComponent();

            this.sensorChooser = new KinectSensorChooser();
            this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
            this.sensorChooserUI.KinectSensorChooser = this.sensorChooser;
            this.sensorChooser.Start();
        }
Beispiel #24
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            //Initialize sensor UI helper called sensorChooser and start the sensor.
            this.sensorChooser = new KinectSensorChooser();
            this.sensorChooser.KinectChanged += this.SensorChooserOnKinectChanged;
            this.sensorChooserUi.KinectSensorChooser = this.sensorChooser;
            this.sensorChooser.Start();
            this.kinect = this.sensorChooser.Kinect;

            /* Skeleton handling */

            // Allocate and start the skeleton Data stream.
            this.skeleonTracker = new SkeletonPositionTracking(kinect.SkeletonStream.FrameSkeletonArrayLength);
            this.kinect.SkeletonStream.Enable();

            // Get Ready for Skeleton Ready Events.
            this.kinect.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(skeleonTracker.kinectSkeletonFrameReady);
            /* End Skeleton handling */

            /* Color handling */
            this.colorDisplay = new ColorRecorder(kinect);

            // Turn on the color stream to receive color frames
            this.kinect.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);

            // Set the image we display to point to the bitmap where we'll put the image data
            this.colorImage.Source = colorDisplay.ColorBitmap;

            // Add an event handler to be called whenever there is new color frame data
            this.kinect.ColorFrameReady += this.colorDisplay.SensorColorFrameReady;
            /* End of Color handling. */

            /* Depth handling */
            this.depthDisplay = new DepthRecoder();

            // Turn on the depth stream to receive depth frames
            this.kinect.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);

            // Allocate space to put the depth pixels we'll receive
            depthDisplay.DepthPixels = new DepthImagePixel[this.kinect.DepthStream.FramePixelDataLength];

            // Allocate space to put the color pixels we'll create
            depthDisplay.ColorPixels = new byte[this.kinect.DepthStream.FramePixelDataLength * sizeof(int)];

            // This is the bitmap we'll display on-screen
            depthDisplay.ColorBitmap = new WriteableBitmap(this.kinect.DepthStream.FrameWidth, this.kinect.DepthStream.FrameHeight, 96.0, 96.0, PixelFormats.Bgr32, null);

            // Set the image we display to point to the bitmap where we'll put the image data
            this.depthImage.Source = depthDisplay.ColorBitmap;

            // Add an event handler to be called whenever there is new depth frame data
            this.kinect.DepthFrameReady += depthDisplay.SensorDepthFrameReady;
            /* End of Depth handling */

            this.kinect.Start();
        }
        private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
        {

            System.Media.SoundPlayer player = new System.Media.SoundPlayer(@"F:\Personal\Study\Assingment\PSM\E-SiLK\E-SiLK\Sound\bg.wav");
            player.Play();
            this.sensorChooser = new KinectSensorChooser();
            this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
            this.sensorChooserUi.KinectSensorChooser = this.sensorChooser;
            this.sensorChooser.Start();
        }
        private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return; 

            this.sensorChooser = new KinectSensorChooser();
            this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
            this.sensorChooserUI.KinectSensorChooser = this.sensorChooser;
            this.sensorChooser.Start();
        }
        /// <summary>
        /// Initializes a new instance of the MainWindow class.
        /// </summary>
        public MainWindow()
        {
            this.InitializeComponent();

            // initialize the sensor chooser and UI
            this.sensorChooser = new KinectSensorChooser();
            this.sensorChooserUi.KinectSensorChooser = this.sensorChooser;
            this.sensorChooser.KinectChanged += this.SensorChooserOnKinectChanged;
            this.sensorChooser.Start();
        }
Beispiel #28
0
        public MainWindow()
        {
            InitializeComponent();

            myChooser = new KinectSensorChooser();
            myColorArray = new byte[640*480*4];
            myChooser.KinectChanged += new EventHandler<KinectChangedEventArgs>(myChooser_KinectChanged);
            this.SensorChooserUI.KinectSensorChooser = myChooser;
            myChooser.Start();
            updateWindow();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class. 
        /// </summary>
        public BrowseCategory(string category)
        {
            this.InitializeComponent();
            // set the category name displayed
            this.category.Text = category.ToUpper();

            this.categoryName = category;
            string url = "http://backend.deviantart.com/rss.xml?q=in:" + category;
            // get the images of the category
            images = DeviantInteraction.getImagesFromCategory(url);
            // get the number of components to display
            int numImages = images.Count;

            // initialize the sensor chooser and UI
            this.sensorChooser = new KinectSensorChooser();
            this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
            this.sensorChooserUi.KinectSensorChooser = this.sensorChooser;
            this.sensorChooser.Start();

            // Bind the sensor chooser's current sensor to the KinectRegion
            var regionSensorBinding = new Binding("Kinect") { Source = this.sensorChooser };
            BindingOperations.SetBinding(this.kinectRegion, KinectRegion.KinectSensorProperty, regionSensorBinding);

            // Clear out placeholder content
            this.wrapPanel.Children.Clear();

            // Add in display content - initialize all the images
            for (var index = 0; index < images.Count; ++index)
            {
                Console.WriteLine("browse category : image " + index);
                // access current image object
                Image img = images[index];
                // load image from url
                BitmapImage bi = new BitmapImage();
                bi.BeginInit();
                bi.UriSource = new Uri( DeviantInteraction.getImageThumbnail(images[index].link));
                bi.EndInit();

                var button = new KinectTileButton
                {
                    Background = new ImageBrush(bi),
                    Label = img.title,
                    Height = 250,
                    Width = 250
                };
                this.wrapPanel.Children.Add(button);
            }

            // Bind listener to scrollviwer scroll position change, and check scroll viewer position
            this.UpdatePagingButtonState();
            scrollViewer.ScrollChanged += (o, e) => this.UpdatePagingButtonState();
            _gestureController = new GestureController(GestureType.All);
            _gestureController.GestureRecognized += GestureRecognized;
        }
        public MainWindow()
        {
            if ()
            {
                if ( < 80 && > 800)
                {
                    InitializeComponent();
                    MediaPlayer1.LoadedBehavior = MediaState.Manual;
                    MediaPlayer1.UnloadedBehavior = MediaState.Manual;

                    MediaPlayer2.LoadedBehavior = MediaState.Manual;
                    MediaPlayer2.UnloadedBehavior = MediaState.Manual;

                    MediaPlayer3.LoadedBehavior = MediaState.Manual;
                    MediaPlayer3.UnloadedBehavior = MediaState.Manual;

                    MediaPlayer4.LoadedBehavior = MediaState.Manual;
                    MediaPlayer4.UnloadedBehavior = MediaState.Manual;
                    afficher("C:\\noAudio.mp4");

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

                    connexion_kinect = Connexion.getInstance();
                    connexion_kinect.Initconnexion();

                    micro = Son.getInstance();
                    squelette = Squelette.getInstance();

                    //Thread microThread = new Thread(micro.WindowLoaded);
                    //Thread squeletteThread = new Thread(squelette.Load);

                    // Start the worker thread.

                    //TODO : Mettre en commun sensor
                    //microThread.Start(sensor);
                    //squeletteThread.Start(sensor);

                    micro.addObserver(this);
                    squelette.addObserver(this);

                    micro.Load();
                    squelette.Load();
                }
            }
            else
            {
                Thread newWindowThread = new Thread(new ThreadStart(ThreadStartingPoint));
                newWindowThread.SetApartmentState(ApartmentState.STA);
                newWindowThread.IsBackground = true;
                newWindowThread.Start();
            }
        }
Beispiel #31
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            this.sensorChooser = new Microsoft.Kinect.Toolkit.KinectSensorChooser();
            this.sensorChooser.KinectChanged        += SensorChooserOnKinectChanged;
            this.sensorChooserUI.KinectSensorChooser = this.sensorChooser;
            this.sensorChooser.Start();

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

            BindingOperations.SetBinding(this.kinectRegion, Microsoft.Kinect.Toolkit.Controls.KinectRegion.KinectSensorProperty, regionSensorBinding);
            GetTileButtonsForStackPanel();
        }
Beispiel #32
0
 private void OnKinectKinectSensorChooserChanged(KinectSensorChooser newValue)
 {
     if (newValue != null)
     {
         var statusBinding = new Binding("Status")
         {
             Source = newValue
         };
         BindingOperations.SetBinding(this, StatusProperty, statusBinding);
     }
     else
     {
         BindingOperations.ClearBinding(this, StatusProperty);
     }
 }