cmake: supernova - missing include_directories() for Jack
[supercollider.git] / lang / LangPrimSource / WiiMote_OSX / wiiremote.h
blobb957a988ee448d2d81ba16b10d3516f5880fec9b
1 // wiiremote.h
2 // Copyright by Masayuki Akamatsu
3 // Based on "DarwiinRemote" by Hiroaki Kimura
5 #define BLUETOOTH_VERSION_USE_CURRENT
6 //#include <AvailabilityMacros.h>
7 #include <math.h>
8 #include <CoreFoundation/CoreFoundation.h>
9 //#include <CoreFoundation/CFMachPort.h>
10 #include <IOBluetooth/IOBluetoothUserLib.h>
12 typedef unsigned char WiiIRModeType;
13 enum {
14 kWiiIRModeBasic = 0x01,
15 kWiiIRModeExtended = 0x03,
16 kWiiIRModeFull = 0x05
19 typedef struct {
20 int x, y, s;
21 } IRData;
23 typedef struct {
24 unsigned char accX_zero, accY_zero, accZ_zero, accX_1g, accY_1g, accZ_1g;
25 } WiiAccCalibData;
27 typedef struct {
28 unsigned char x_min, x_max, x_center, y_min, y_max, y_center;
29 } WiiJoyStickCalibData;
31 typedef UInt16 WiiButtonType;
32 enum {
33 WiiRemoteAButton,
34 WiiRemoteBButton,
35 WiiRemoteOneButton,
36 WiiRemoteTwoButton,
37 WiiRemoteMinusButton,
38 WiiRemoteHomeButton,
39 WiiRemotePlusButton,
40 WiiRemoteUpButton,
41 WiiRemoteDownButton,
42 WiiRemoteLeftButton,
43 WiiRemoteRightButton,
45 WiiNunchukZButton,
46 WiiNunchukCButton,
48 WiiClassicControllerXButton,
49 WiiClassicControllerYButton,
50 WiiClassicControllerAButton,
51 WiiClassicControllerBButton,
52 WiiClassicControllerLButton,
53 WiiClassicControllerRButton,
54 WiiClassicControllerZLButton,
55 WiiClassicControllerZRButton,
56 WiiClassicControllerUpButton,
57 WiiClassicControllerDownButton,
58 WiiClassicControllerLeftButton,
59 WiiClassicControllerRightButton,
60 WiiClassicControllerMinusButton,
61 WiiClassicControllerHomeButton,
62 WiiClassicControllerPlusButton
66 typedef UInt16 WiiExpansionPortType;
67 enum{
68 WiiExpNotAttached,
69 WiiNunchuk,
70 WiiClassicController
73 typedef UInt16 WiiAccelerationSensorType;
74 enum{
75 WiiRemoteAccelerationSensor,
76 WiiNunchukAccelerationSensor
80 typedef UInt16 WiiJoyStickType;
81 enum{
82 WiiNunchukJoyStick,
83 WiiClassicControllerLeftJoyStick,
84 WiiClassicControllerRightJoyStick
88 typedef struct _WiiRemoteRec
90 IOBluetoothDeviceInquiryRef inquiry;
91 IOBluetoothDeviceRef device;
92 IOBluetoothL2CAPChannelRef ichan;
93 IOBluetoothL2CAPChannelRef cchan;
95 CFStringRef address;
97 unsigned char accX;
98 unsigned char accY;
99 unsigned char accZ;
100 unsigned short buttonData;
102 float lowZ;
103 float lowX;
104 int orientation;
105 int leftPoint; // is point 0 or 1 on the left. -1 when not tracking.
107 float posX;
108 float posY;
109 float angle;
110 Boolean tracking;
112 WiiExpansionPortType expType;
113 WiiAccCalibData wiiCalibData, nunchukCalibData;
114 WiiJoyStickCalibData nunchukJoyStickCalibData;
115 WiiIRModeType wiiIRMode;
116 IRData irData[4];
117 double batteryLevel;
119 Boolean readingRegister;
120 Boolean isMotionSensorEnabled;
121 Boolean isIRSensorEnabled;
122 Boolean isVibrationEnabled;
123 Boolean isExpansionPortEnabled;
124 Boolean initExpPort;
125 Boolean isLED1Illuminated;
126 Boolean isLED2Illuminated;
127 Boolean isLED3Illuminated;
128 Boolean isLED4Illuminated;
130 Boolean isExpansionPortAttached;
132 IOBluetoothUserNotificationRef disconnectNotification;
134 //nunchuk
135 unsigned char nStickX;
136 unsigned char nStickY;
137 unsigned char nAccX;
138 unsigned char nAccY;
139 unsigned char nAccZ;
140 unsigned char nButtonData;
142 float nLowZ;
143 float nLowX;
144 int nOrientation;
146 //classic controller
147 unsigned short cButtonData;
148 unsigned char cStickX1;
149 unsigned char cStickY1;
150 unsigned char cStickX2;
151 unsigned char cStickY2;
152 unsigned char cAnalogL;
153 unsigned char cAnalogR;
155 } WiiRemoteRec, *WiiRemoteRef;
157 void wiiremote_init(WiiRemoteRef wiiremote);
158 Boolean wiiremote_isconnected(WiiRemoteRef wiiremote);
159 Boolean wiiremote_search(WiiRemoteRef wiiremote, char *address);
160 Boolean wiiremote_stopsearch(WiiRemoteRef wiiremote);
161 Boolean wiiremote_connect(WiiRemoteRef wiiremote);
162 Boolean wiiremote_disconnect(WiiRemoteRef wiiremote);
163 void wiiremote_getaddress(WiiRemoteRef wiiremote, char *address);
164 Boolean wiiremote_motionsensor(WiiRemoteRef wiiremote, Boolean enabled);
165 Boolean wiiremote_irsensor(WiiRemoteRef wiiremote, Boolean enabled);
166 Boolean wiiremote_vibration(WiiRemoteRef wiiremote, Boolean enabled);
167 Boolean wiiremote_led(WiiRemoteRef wiiremote, Boolean enabled1, Boolean enabled2, Boolean enabled3, Boolean enabled4);
168 Boolean wiiremote_expansion(WiiRemoteRef wiiremote, Boolean enabled);
169 Boolean wiiremote_getstatus(WiiRemoteRef wiiremote);