Inheritance: KinectBase.IKinectCore
        public KinectV2SettingsControl(int kinectNumber, ref KinectBase.MasterSettings settings, KinectBase.IKinectCore kinect)
        {
            if (settings != null)
            {
                if (settings.kinectOptionsList[kinectNumber].version == KinectBase.KinectVersion.KinectV2)
                {
                    masterSettings = settings;
                    dynamic tempSettings = settings.kinectOptionsList[kinectNumber];
                    kinectSettings = (KinectV2Settings)tempSettings;
                    kinectID       = kinectNumber;
                    kinectCore     = (KinectCoreV2)kinect;
                    uniqueKinectID = kinect.uniqueKinectID;

                    InitializeComponent();
                    this.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                    this.VerticalAlignment   = System.Windows.VerticalAlignment.Stretch;
                }
                else
                {
                    throw new ArgumentException("The provided KinectID is not for a Kinect v2 sensor.");
                }
            }
            else
            {
                throw new NotSupportedException("Method arguments are invalid!");
            }
        }
        public KinectV2SettingsControl(int kinectNumber, ref KinectBase.MasterSettings settings, KinectBase.IKinectCore kinect)
        {
            if (settings != null)
            {
                if (settings.kinectOptionsList[kinectNumber].version == KinectBase.KinectVersion.KinectV2)
                {
                    masterSettings = settings;
                    dynamic tempSettings = settings.kinectOptionsList[kinectNumber];
                    kinectSettings = (KinectV2Settings)tempSettings;
                    kinectID = kinectNumber;
                    kinectCore = (KinectCoreV2)kinect;
                    uniqueKinectID = kinect.uniqueKinectID;

                    InitializeComponent();
                    this.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                    this.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
                }
                else
                {
                    throw new ArgumentException("The provided KinectID is not for a Kinect v2 sensor.");
                }
            }
            else
            {
                throw new NotSupportedException("Method arguments are invalid!");
            }
        }
Example #3
0
        //Constructor to setup the real KinectV2Core object
        public Core(ref MasterSettings settings, bool isGUILaunched, int kinectNumber)
        {
            realCore = new KinectCoreV2(ref settings, isGUILaunched, kinectNumber);

            //Subscribe to the events so they can be forwarded
            realCore.SkeletonChanged += realCore_SkeletonChanged;
            realCore.DepthFrameReceived += realCore_DepthFrameReceived;
            realCore.ColorFrameReceived += realCore_ColorFrameReceived;
            realCore.AccelerationChanged += realCore_AccelerationChanged;
            realCore.AudioPositionChanged += realCore_AudioPositionChanged;
            realCore.LogMessageGenerated += realCore_LogMessageGenerated;
        }