AudioBeamFrame.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. using RootSystem = System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. namespace Windows.Kinect
  5. {
  6. //
  7. // Windows.Kinect.AudioBeamFrame
  8. //
  9. public sealed partial class AudioBeamFrame : RootSystem.IDisposable, Helper.INativeWrapper
  10. {
  11. internal RootSystem.IntPtr _pNative;
  12. RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
  13. // Constructors and Finalizers
  14. internal AudioBeamFrame(RootSystem.IntPtr pNative)
  15. {
  16. _pNative = pNative;
  17. Windows_Kinect_AudioBeamFrame_AddRefObject(ref _pNative);
  18. }
  19. ~AudioBeamFrame()
  20. {
  21. Dispose(false);
  22. }
  23. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  24. private static extern void Windows_Kinect_AudioBeamFrame_ReleaseObject(ref RootSystem.IntPtr pNative);
  25. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  26. private static extern void Windows_Kinect_AudioBeamFrame_AddRefObject(ref RootSystem.IntPtr pNative);
  27. // Public Properties
  28. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  29. private static extern RootSystem.IntPtr Windows_Kinect_AudioBeamFrame_get_AudioBeam(RootSystem.IntPtr pNative);
  30. public Windows.Kinect.AudioBeam AudioBeam
  31. {
  32. get
  33. {
  34. if (_pNative == RootSystem.IntPtr.Zero)
  35. {
  36. throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
  37. }
  38. RootSystem.IntPtr objectPointer = Windows_Kinect_AudioBeamFrame_get_AudioBeam(_pNative);
  39. Helper.ExceptionHelper.CheckLastError();
  40. if (objectPointer == RootSystem.IntPtr.Zero)
  41. {
  42. return null;
  43. }
  44. return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioBeam>(objectPointer, n => new Windows.Kinect.AudioBeam(n));
  45. }
  46. }
  47. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  48. private static extern RootSystem.IntPtr Windows_Kinect_AudioBeamFrame_get_AudioSource(RootSystem.IntPtr pNative);
  49. public Windows.Kinect.AudioSource AudioSource
  50. {
  51. get
  52. {
  53. if (_pNative == RootSystem.IntPtr.Zero)
  54. {
  55. throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
  56. }
  57. RootSystem.IntPtr objectPointer = Windows_Kinect_AudioBeamFrame_get_AudioSource(_pNative);
  58. Helper.ExceptionHelper.CheckLastError();
  59. if (objectPointer == RootSystem.IntPtr.Zero)
  60. {
  61. return null;
  62. }
  63. return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioSource>(objectPointer, n => new Windows.Kinect.AudioSource(n));
  64. }
  65. }
  66. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  67. private static extern long Windows_Kinect_AudioBeamFrame_get_Duration(RootSystem.IntPtr pNative);
  68. public RootSystem.TimeSpan Duration
  69. {
  70. get
  71. {
  72. if (_pNative == RootSystem.IntPtr.Zero)
  73. {
  74. throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
  75. }
  76. return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_AudioBeamFrame_get_Duration(_pNative));
  77. }
  78. }
  79. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  80. private static extern long Windows_Kinect_AudioBeamFrame_get_RelativeTimeStart(RootSystem.IntPtr pNative);
  81. public RootSystem.TimeSpan RelativeTimeStart
  82. {
  83. get
  84. {
  85. if (_pNative == RootSystem.IntPtr.Zero)
  86. {
  87. throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
  88. }
  89. return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_AudioBeamFrame_get_RelativeTimeStart(_pNative));
  90. }
  91. }
  92. // Public Methods
  93. private void __EventCleanup()
  94. {
  95. }
  96. }
  97. }