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