コード例 #1
0
        private static void Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_Handler(IntPtr result, IntPtr pNative)
        {
            List <EventHandler <BodyIndexFrameArrivedEventArgs> > list = null;

            BodyIndexFrameReader.Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_callbacks.TryGetValue(pNative, out list);
            object obj = list;

            lock (obj)
            {
                BodyIndexFrameReader           objThis = NativeObjectCache.GetObject <BodyIndexFrameReader>(pNative);
                BodyIndexFrameArrivedEventArgs args    = new BodyIndexFrameArrivedEventArgs(result);
                using (List <EventHandler <BodyIndexFrameArrivedEventArgs> > .Enumerator enumerator = list.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        EventHandler <BodyIndexFrameArrivedEventArgs> func = enumerator.Current;
                        EventPump.Instance.Enqueue(delegate
                        {
                            try
                            {
                                func(objThis, args);
                            }
                            catch
                            {
                            }
                        });
                    }
                }
            }
        }
コード例 #2
0
        private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(IntPtr result, IntPtr pNative)
        {
            List <EventHandler <PropertyChangedEventArgs> > list = null;

            KinectSensor.Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out list);
            object obj = list;

            lock (obj)
            {
                KinectSensor             objThis = NativeObjectCache.GetObject <KinectSensor>(pNative);
                PropertyChangedEventArgs args    = new PropertyChangedEventArgs(result);
                using (List <EventHandler <PropertyChangedEventArgs> > .Enumerator enumerator = list.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        EventHandler <PropertyChangedEventArgs> func = enumerator.Current;
                        EventPump.Instance.Enqueue(delegate
                        {
                            try
                            {
                                func(objThis, args);
                            }
                            catch
                            {
                            }
                        });
                    }
                }
            }
        }
コード例 #3
0
        private static void Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_Delegate_Handler(
            RootSystem.IntPtr result, RootSystem.IntPtr pNative)
        {
            List <RootSystem.EventHandler <TrackingIdLostEventArgs> > callbackList =
                null;

            Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_Delegate_callbacks.TryGetValue(pNative,
                                                                                                         out callbackList);
            lock (callbackList)
            {
                var objThis = NativeObjectCache.GetObject <VisualGestureBuilderFrameSource>(pNative);
                var args    = new TrackingIdLostEventArgs(result);
                foreach (var func in callbackList)
                {
                    EventPump.Instance.Enqueue(() =>
                    {
                        try
                        {
                            func(objThis, args);
                        }
                        catch
                        {
                        }
                    });
                }
            }
        }
コード例 #4
0
        public IList <AudioBeamFrame> AcquireBeamFrames()
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                throw new RootSystem.ObjectDisposedException("AudioBeamFrameReference");
            }

            var outCollectionSize = Windows_Kinect_AudioBeamFrameReference_AcquireBeamFrames_Length(_pNative);
            var outCollection     = new RootSystem.IntPtr[outCollectionSize];
            var managedCollection = new AudioBeamFrame[outCollectionSize];

            outCollectionSize =
                Windows_Kinect_AudioBeamFrameReference_AcquireBeamFrames(_pNative, outCollection, outCollectionSize);
            ExceptionHelper.CheckLastError();
            for (var i = 0; i < outCollectionSize; i++)
            {
                if (outCollection[i] == RootSystem.IntPtr.Zero)
                {
                    continue;
                }

                var obj = NativeObjectCache.CreateOrGetObject(outCollection[i],
                                                              n => new AudioBeamFrame(n));

                managedCollection[i] = obj;
            }

            return(managedCollection);
        }
コード例 #5
0
        private void Dispose(bool disposing)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                return;
            }

            if (_subFrames != null)
            {
                foreach (var subFrame in _subFrames)
                {
                    subFrame.Dispose();
                }

                _subFrames = null;
            }

            __EventCleanup();

            NativeObjectCache.RemoveObject <AudioBeamFrame>(_pNative);
            Windows_Kinect_AudioBeamFrame_ReleaseObject(ref _pNative);

            if (disposing)
            {
                Windows_Kinect_AudioBeamFrame_Dispose(_pNative);
            }

            _pNative = RootSystem.IntPtr.Zero;
        }
コード例 #6
0
        private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(IntPtr result, IntPtr pNative)
        {
            List <EventHandler <FrameCapturedEventArgs> > list = null;

            LongExposureInfraredFrameSource.Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryGetValue(pNative, out list);
            object obj = list;

            lock (obj)
            {
                LongExposureInfraredFrameSource objThis = NativeObjectCache.GetObject <LongExposureInfraredFrameSource>(pNative);
                FrameCapturedEventArgs          args    = new FrameCapturedEventArgs(result);
                using (List <EventHandler <FrameCapturedEventArgs> > .Enumerator enumerator = list.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        EventHandler <FrameCapturedEventArgs> func = enumerator.Current;
                        EventPump.Instance.Enqueue(delegate
                        {
                            try
                            {
                                func(objThis, args);
                            }
                            catch
                            {
                            }
                        });
                    }
                }
            }
        }
コード例 #7
0
        private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result,
                                                                                   RootSystem.IntPtr pNative)
        {
            List <RootSystem.EventHandler <PropertyChangedEventArgs> > callbackList = null;

            Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
            lock (callbackList)
            {
                var objThis = NativeObjectCache.GetObject <MultiSourceFrameReader>(pNative);
                var args    = new PropertyChangedEventArgs(result);
                foreach (var func in callbackList)
                {
                    EventPump.Instance.Enqueue(() =>
                    {
                        try
                        {
                            func(objThis, args);
                        }
                        catch
                        {
                        }
                    });
                }
            }
        }
コード例 #8
0
        private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(RootSystem.IntPtr result,
                                                                                   RootSystem.IntPtr pNative)
        {
            List <RootSystem.EventHandler <FrameCapturedEventArgs> > callbackList = null;

            Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
            lock (callbackList)
            {
                var objThis = NativeObjectCache.GetObject <DepthFrameSource>(pNative);
                var args    = new FrameCapturedEventArgs(result);
                foreach (var func in callbackList)
                {
                    EventPump.Instance.Enqueue(() =>
                    {
                        try
                        {
                            func(objThis, args);
                        }
                        catch
                        {
                        }
                    });
                }
            }
        }
コード例 #9
0
 // Token: 0x06002A33 RID: 10803 RVA: 0x000D6D98 File Offset: 0x000D5198
 private void Dispose(bool disposing)
 {
     if (this._pNative == IntPtr.Zero)
     {
         return;
     }
     this.__EventCleanup();
     NativeObjectCache.RemoveObject <PropertyChangedEventArgs>(this._pNative);
     PropertyChangedEventArgs.Windows_Data_PropertyChangedEventArgs_ReleaseObject(ref this._pNative);
     this._pNative = IntPtr.Zero;
 }
コード例 #10
0
        // Token: 0x06002985 RID: 10629 RVA: 0x000D4348 File Offset: 0x000D2748
        public static KinectSensor GetDefault()
        {
            IntPtr intPtr = KinectSensor.Windows_Kinect_KinectSensor_GetDefault();

            ExceptionHelper.CheckLastError();
            if (intPtr == IntPtr.Zero)
            {
                return(null);
            }
            return(NativeObjectCache.CreateOrGetObject <KinectSensor>(intPtr, (IntPtr n) => new KinectSensor(n)));
        }
コード例 #11
0
 // Token: 0x06002D6B RID: 11627 RVA: 0x000DFF70 File Offset: 0x000DE370
 private void Dispose(bool disposing)
 {
     if (this._pNative == IntPtr.Zero)
     {
         return;
     }
     this.__EventCleanup();
     NativeObjectCache.RemoveObject <LongExposureInfraredFrameSource>(this._pNative);
     LongExposureInfraredFrameSource.Windows_Kinect_LongExposureInfraredFrameSource_ReleaseObject(ref this._pNative);
     this._pNative = IntPtr.Zero;
 }
コード例 #12
0
 // Token: 0x06002BDA RID: 11226 RVA: 0x000DBC18 File Offset: 0x000DA018
 private void Dispose(bool disposing)
 {
     if (this._pNative == IntPtr.Zero)
     {
         return;
     }
     this.__EventCleanup();
     NativeObjectCache.RemoveObject <ColorFrameReference>(this._pNative);
     ColorFrameReference.Windows_Kinect_ColorFrameReference_ReleaseObject(ref this._pNative);
     this._pNative = IntPtr.Zero;
 }
コード例 #13
0
 // Token: 0x06002C19 RID: 11289 RVA: 0x000DC70C File Offset: 0x000DAB0C
 private void Dispose(bool disposing)
 {
     if (this._pNative == IntPtr.Zero)
     {
         return;
     }
     this.__EventCleanup();
     NativeObjectCache.RemoveObject <CoordinateMappingChangedEventArgs>(this._pNative);
     CoordinateMappingChangedEventArgs.Windows_Kinect_CoordinateMappingChangedEventArgs_ReleaseObject(ref this._pNative);
     this._pNative = IntPtr.Zero;
 }
コード例 #14
0
ファイル: AudioSource.cs プロジェクト: Smoothstep/VRChat
 // Token: 0x06002AA9 RID: 10921 RVA: 0x000D8090 File Offset: 0x000D6490
 private void Dispose(bool disposing)
 {
     if (this._pNative == IntPtr.Zero)
     {
         return;
     }
     this.__EventCleanup();
     NativeObjectCache.RemoveObject <AudioSource>(this._pNative);
     AudioSource.Windows_Kinect_AudioSource_ReleaseObject(ref this._pNative);
     this._pNative = IntPtr.Zero;
 }
コード例 #15
0
 // Token: 0x06002AD5 RID: 10965 RVA: 0x000D89F4 File Offset: 0x000D6DF4
 private void Dispose(bool disposing)
 {
     if (this._pNative == IntPtr.Zero)
     {
         return;
     }
     this.__EventCleanup();
     NativeObjectCache.RemoveObject <BodyFrameArrivedEventArgs>(this._pNative);
     BodyFrameArrivedEventArgs.Windows_Kinect_BodyFrameArrivedEventArgs_ReleaseObject(ref this._pNative);
     this._pNative = IntPtr.Zero;
 }
コード例 #16
0
 // Token: 0x06002C97 RID: 11415 RVA: 0x000DDD04 File Offset: 0x000DC104
 private void Dispose(bool disposing)
 {
     if (this._pNative == IntPtr.Zero)
     {
         return;
     }
     this.__EventCleanup();
     NativeObjectCache.RemoveObject <FrameDescription>(this._pNative);
     FrameDescription.Windows_Kinect_FrameDescription_ReleaseObject(ref this._pNative);
     this._pNative = IntPtr.Zero;
 }
コード例 #17
0
        public static KinectSensor GetDefault()
        {
            var objectPointer = Windows_Kinect_KinectSensor_GetDefault();

            ExceptionHelper.CheckLastError();
            if (objectPointer == RootSystem.IntPtr.Zero)
            {
                return(null);
            }

            return(NativeObjectCache.CreateOrGetObject(objectPointer,
                                                       n => new KinectSensor(n)));
        }
コード例 #18
0
        private void Dispose(bool disposing)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                return;
            }

            __EventCleanup();

            NativeObjectCache.RemoveObject <CoordinateMappingChangedEventArgs>(_pNative);
            Windows_Kinect_CoordinateMappingChangedEventArgs_ReleaseObject(ref _pNative);

            _pNative = RootSystem.IntPtr.Zero;
        }
コード例 #19
0
        private void Dispose(bool disposing)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                return;
            }

            __EventCleanup();

            NativeObjectCache.RemoveObject <DiscreteGestureResult>(_pNative);
            Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_ReleaseObject(ref _pNative);

            _pNative = RootSystem.IntPtr.Zero;
        }
コード例 #20
0
ファイル: KinectBuffer.cs プロジェクト: Smoothstep/VRChat
 // Token: 0x0600285F RID: 10335 RVA: 0x000D1A64 File Offset: 0x000CFE64
 private void Dispose(bool disposing)
 {
     if (this._pNative == IntPtr.Zero)
     {
         return;
     }
     NativeObjectCache.RemoveObject <KinectBuffer>(this._pNative);
     if (disposing)
     {
         KinectBuffer.Windows_Storage_Streams_IBuffer_Dispose(this._pNative);
     }
     KinectBuffer.Windows_Storage_Streams_IBuffer_ReleaseObject(ref this._pNative);
     this._pNative = IntPtr.Zero;
 }
コード例 #21
0
        private void Dispose(bool disposing)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                return;
            }

            __EventCleanup();

            NativeObjectCache.RemoveObject <Body>(_pNative);
            Windows_Kinect_Body_ReleaseObject(ref _pNative);

            _pNative = RootSystem.IntPtr.Zero;
        }
コード例 #22
0
        private void Dispose(bool disposing)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                return;
            }

            __EventCleanup();

            NativeObjectCache.RemoveObject <LongExposureInfraredFrameArrivedEventArgs>(_pNative);
            Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_ReleaseObject(ref _pNative);

            _pNative = RootSystem.IntPtr.Zero;
        }
コード例 #23
0
        private void Dispose(bool disposing)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                return;
            }

            __EventCleanup();

            NativeObjectCache.RemoveObject <PropertyChangedEventArgs>(_pNative);
            Windows_Data_PropertyChangedEventArgs_ReleaseObject(ref _pNative);

            _pNative = RootSystem.IntPtr.Zero;
        }
コード例 #24
0
        private void Dispose(bool disposing)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                return;
            }

            __EventCleanup();

            NativeObjectCache.RemoveObject <InfraredFrameReference>(_pNative);
            Windows_Kinect_InfraredFrameReference_ReleaseObject(ref _pNative);

            _pNative = RootSystem.IntPtr.Zero;
        }
コード例 #25
0
        private void Dispose(bool disposing)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                return;
            }

            __EventCleanup();

            NativeObjectCache.RemoveObject <TrackingIdLostEventArgs>(_pNative);
            Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_ReleaseObject(ref _pNative);

            _pNative = RootSystem.IntPtr.Zero;
        }
コード例 #26
0
 // Token: 0x06002ADF RID: 10975 RVA: 0x000D8B04 File Offset: 0x000D6F04
 private void Dispose(bool disposing)
 {
     if (this._pNative == IntPtr.Zero)
     {
         return;
     }
     this.__EventCleanup();
     NativeObjectCache.RemoveObject <BodyFrameReader>(this._pNative);
     if (disposing)
     {
         BodyFrameReader.Windows_Kinect_BodyFrameReader_Dispose(this._pNative);
     }
     BodyFrameReader.Windows_Kinect_BodyFrameReader_ReleaseObject(ref this._pNative);
     this._pNative = IntPtr.Zero;
 }
コード例 #27
0
ファイル: DepthFrame.cs プロジェクト: Smoothstep/VRChat
 // Token: 0x0600291B RID: 10523 RVA: 0x000D3194 File Offset: 0x000D1594
 private void Dispose(bool disposing)
 {
     if (this._pNative == IntPtr.Zero)
     {
         return;
     }
     this.__EventCleanup();
     NativeObjectCache.RemoveObject <DepthFrame>(this._pNative);
     if (disposing)
     {
         DepthFrame.Windows_Kinect_DepthFrame_Dispose(this._pNative);
     }
     DepthFrame.Windows_Kinect_DepthFrame_ReleaseObject(ref this._pNative);
     this._pNative = IntPtr.Zero;
 }
コード例 #28
0
ファイル: DepthFrame.cs プロジェクト: Smoothstep/VRChat
        // Token: 0x06002916 RID: 10518 RVA: 0x000D30E8 File Offset: 0x000D14E8
        public KinectBuffer LockImageBuffer()
        {
            if (this._pNative == IntPtr.Zero)
            {
                throw new ObjectDisposedException("DepthFrame");
            }
            IntPtr intPtr = DepthFrame.Windows_Kinect_DepthFrame_LockImageBuffer(this._pNative);

            ExceptionHelper.CheckLastError();
            if (intPtr == IntPtr.Zero)
            {
                return(null);
            }
            return(NativeObjectCache.CreateOrGetObject <KinectBuffer>(intPtr, (IntPtr n) => new KinectBuffer(n)));
        }
コード例 #29
0
        // Token: 0x06002BDE RID: 11230 RVA: 0x000DBC8C File Offset: 0x000DA08C
        public ColorFrame AcquireFrame()
        {
            if (this._pNative == IntPtr.Zero)
            {
                throw new ObjectDisposedException("ColorFrameReference");
            }
            IntPtr intPtr = ColorFrameReference.Windows_Kinect_ColorFrameReference_AcquireFrame(this._pNative);

            ExceptionHelper.CheckLastError();
            if (intPtr == IntPtr.Zero)
            {
                return(null);
            }
            return(NativeObjectCache.CreateOrGetObject <ColorFrame>(intPtr, (IntPtr n) => new ColorFrame(n)));
        }
        public static VisualGestureBuilderDatabase Create(string path)
        {
            var objectPointer =
                Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ctor(path);

            ExceptionHelper.CheckLastError();
            if (objectPointer == RootSystem.IntPtr.Zero)
            {
                return(null);
            }

            return(NativeObjectCache
                   .CreateOrGetObject(
                       objectPointer, n => new VisualGestureBuilderDatabase(n)));
        }