Esempio n. 1
0
        public static void Main()
        {
            var gesturesObserver = new GesturesObserver();
            var samplesFactory = new SamplesFactory();
            var gitare = samplesFactory.GetGitare();
            var plate = samplesFactory.GetGitare();
            var tube = samplesFactory.GetGitare();
            var drum = samplesFactory.GetGitare();
            var metronom = samplesFactory.GetMetronom();

            //gesturesObserver.TrackGesture(GestureType.SwipeLeft, gitare);
            //gesturesObserver.TrackGesture(GestureType.SwipeRight, plate);
            //gesturesObserver.TrackGesture(GestureType.WaveLeft, tube);
            //gesturesObserver.TrackGesture(GestureType.WaveRight, drum);

            metronom.Play();

            while (true)
            {
                Thread.Sleep(100);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Kinect enabled apps should customize which Kinect services it initializes here.
        /// </summary>
        /// <param name="kinectSensorManager"></param>
        /// <param name="sensor"></param>
        private void InitializeKinectServices(KinectSensorManager kinectSensorManager, KinectSensor sensor)
        {
            // Application should enable all streams first.

            // configure the color stream
            kinectSensorManager.ColorFormat = ColorImageFormat.RgbResolution640x480Fps30;

            kinectSensorManager.TransformSmoothParameters =
                new TransformSmoothParameters
                {
                    Smoothing = 0.5f,
                    Correction = 0.5f,
                    Prediction = 0.8f,
                    JitterRadius = 0.05f,
                    MaxDeviationRadius = 0.04f
                };

            // configure the skeleton stream
            sensor.SkeletonFrameReady += OnSkeletonFrameReady;
            kinectSensorManager.SkeletonStreamEnabled = true;

            // initialize the gesture recognizer
            _samplesFactory = new SamplesFactory();
            _metro = _samplesFactory.GetMetronom();
             _metro.PlayNonStop();

            CreateObserver(_samplesFactory);

            kinectSensorManager.KinectSensorEnabled = true;

            if (!kinectSensorManager.KinectSensorAppConflict)
            {
                // addition configuration, as needed
            }
        }