annotate Orchestland/Assets/LeapMotion+OVR/SystemWipe/SystemWipeRecognizerNative.cs @ 1:f7675884f2a1

Add Orchestland project
author Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2015 23:09:20 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 ´╗┐using System;
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 using System.Runtime.InteropServices;
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 namespace Leap.Util
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 {
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 public enum Direction : int { Invalid, Up, Down };
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 public enum Status : int { Invalid, ErrorCannotAccessImages, Idle, SwipeBegin, SwipeUpdate, SwipeComplete, SwipeAbort, InfoQueueEmpty };
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 [StructLayout(LayoutKind.Sequential)]
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 public struct SystemWipeInfo
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 {
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 public Direction Direction;
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 public Status Status;
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 public float Progress;
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 }
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 public class SystemWipeRecognizerNative
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 {
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 # if UNITY_STANDALONE_OSX
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 const CallingConvention LeapCallingConvention = CallingConvention.Cdecl;
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 # else
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 const CallingConvention LeapCallingConvention = CallingConvention.StdCall;
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 # endif
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 [UnmanagedFunctionPointer(LeapCallingConvention)]
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 public delegate void CallbackSystemWipeInfoDelegate(SystemWipeInfo systemWipeInfo);
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 public static extern void SetSystemWipeRecognizerCallback(IntPtr property);
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 public static extern void EnableSystemWipeRecognizer();
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 public static extern void DisableSystemWipeRecognizer();
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 public static extern bool WasLastImageAccessOk();
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 public static extern int GetFrameCount();
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 public static extern SystemWipeInfo GetNextSystemWipeInfo();
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 }
f7675884f2a1 Add Orchestland project
Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 }