diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2008-03-10 21:50:43 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@iem.at> | 2015-10-14 15:08:25 +0200 |
commit | da3f6b1d47080e0162944834d18017c9a691c0b1 (patch) | |
tree | 7a694aa59e70926112eca729716fbcaa655b6508 /wiiremote/wiiremote.h | |
parent | 71d377c64cf05eb5726e4ec803dc8288bf4c8357 (diff) |
moved wiiremote to aka.wiiremote to reflect the name of the Max/MSP object.
This is a direct port, so it makes sense to have the same name.
svn path=/trunk/externals/io/; revision=9551
Diffstat (limited to 'wiiremote/wiiremote.h')
-rw-r--r-- | wiiremote/wiiremote.h | 175 |
1 files changed, 0 insertions, 175 deletions
diff --git a/wiiremote/wiiremote.h b/wiiremote/wiiremote.h deleted file mode 100644 index 4a03f09..0000000 --- a/wiiremote/wiiremote.h +++ /dev/null @@ -1,175 +0,0 @@ -// wiiremote.h -// Copyright by Masayuki Akamatsu -// Based on "DarwiinRemote" by Hiroaki Kimura - -#include <CoreFoundation/CoreFoundation.h> -#include <IOBluetooth/Bluetooth.h> -#include <IOBluetooth/IOBluetoothUserLib.h> -#include <stdio.h> -#include <string.h> - -// Macros for PD for compability with Max macros -#ifdef PD -#define SETSYM SETSYMBOL -#define SETLONG SETFLOAT -#endif - -typedef unsigned char WiiIRModeType; -enum { - kWiiIRModeBasic = 0x01, - kWiiIRModeExtended = 0x03, - kWiiIRModeFull = 0x05 -}; - -typedef struct { - int x, y, s; -} IRData; - -typedef struct { - unsigned char accX_zero, accY_zero, accZ_zero, accX_1g, accY_1g, accZ_1g; -} WiiAccCalibData; - -typedef struct { - unsigned char x_min, x_max, x_center, y_min, y_max, y_center; -} WiiJoyStickCalibData; - -typedef UInt16 WiiButtonType; -enum { - WiiRemoteAButton, - WiiRemoteBButton, - WiiRemoteOneButton, - WiiRemoteTwoButton, - WiiRemoteMinusButton, - WiiRemoteHomeButton, - WiiRemotePlusButton, - WiiRemoteUpButton, - WiiRemoteDownButton, - WiiRemoteLeftButton, - WiiRemoteRightButton, - - WiiNunchukZButton, - WiiNunchukCButton, - - WiiClassicControllerXButton, - WiiClassicControllerYButton, - WiiClassicControllerAButton, - WiiClassicControllerBButton, - WiiClassicControllerLButton, - WiiClassicControllerRButton, - WiiClassicControllerZLButton, - WiiClassicControllerZRButton, - WiiClassicControllerUpButton, - WiiClassicControllerDownButton, - WiiClassicControllerLeftButton, - WiiClassicControllerRightButton, - WiiClassicControllerMinusButton, - WiiClassicControllerHomeButton, - WiiClassicControllerPlusButton -}; - -typedef UInt16 WiiExpansionPortType; -enum{ - WiiExpNotAttached, - WiiNunchuk, - WiiClassicController -}; - -typedef UInt16 WiiAccelerationSensorType; -enum{ - WiiRemoteAccelerationSensor, - WiiNunchukAccelerationSensor -}; - - -typedef UInt16 WiiJoyStickType; -enum{ - WiiNunchukJoyStick, - WiiClassicControllerLeftJoyStick, - WiiClassicControllerRightJoyStick -}; - - -typedef struct _WiiRemoteRec -{ - IOBluetoothDeviceInquiryRef inquiry; - IOBluetoothDeviceRef device; - IOBluetoothL2CAPChannelRef ichan; - IOBluetoothL2CAPChannelRef cchan; - - CFStringRef address; - - unsigned char accX; - unsigned char accY; - unsigned char accZ; - unsigned short buttonData; - - float lowZ; - float lowX; - int orientation; - int leftPoint; // is point 0 or 1 on the left. -1 when not tracking. - - float posX; - float posY; - float angle; - Boolean tracking; - - WiiExpansionPortType expType; - WiiAccCalibData wiiCalibData, nunchukCalibData; - WiiJoyStickCalibData nunchukJoyStickCalibData; - WiiIRModeType wiiIRMode; - IRData irData[4]; - double batteryLevel; - - Boolean readingRegister; - Boolean isMotionSensorEnabled; - Boolean isIRSensorEnabled; - Boolean isVibrationEnabled; - Boolean isExpansionPortEnabled; - Boolean initExpPort; - Boolean isLED1Illuminated; - Boolean isLED2Illuminated; - Boolean isLED3Illuminated; - Boolean isLED4Illuminated; - Boolean isExtraOutputEnabled; - - Boolean isExpansionPortAttached; - - IOBluetoothUserNotificationRef disconnectNotification; - - //nunchuk - unsigned char nStickX; - unsigned char nStickY; - unsigned char nAccX; - unsigned char nAccY; - unsigned char nAccZ; - unsigned char nButtonData; - - float nLowZ; - float nLowX; - int nOrientation; - - //classic controller - unsigned short cButtonData; - unsigned char cStickX1; - unsigned char cStickY1; - unsigned char cStickX2; - unsigned char cStickY2; - unsigned char cAnalogL; - unsigned char cAnalogR; - -} WiiRemoteRec, *WiiRemoteRef; - -void wiiremote_init(WiiRemoteRef wiiremote); -Boolean wiiremote_isconnected(WiiRemoteRef wiiremote); -Boolean wiiremote_search(WiiRemoteRef wiiremote, char *address); -Boolean wiiremote_stopsearch(WiiRemoteRef wiiremote); -Boolean wiiremote_connect(WiiRemoteRef wiiremote); -Boolean wiiremote_disconnect(WiiRemoteRef wiiremote); -void wiiremote_getaddress(WiiRemoteRef wiiremote, char *address); -Boolean wiiremote_motionsensor(WiiRemoteRef wiiremote, Boolean enabled); -Boolean wiiremote_irsensor(WiiRemoteRef wiiremote, Boolean enabled); -Boolean wiiremote_vibration(WiiRemoteRef wiiremote, Boolean enabled); -Boolean wiiremote_led(WiiRemoteRef wiiremote, Boolean enabled1, Boolean enabled2, Boolean enabled3, Boolean enabled4); -Boolean wiiremote_expansion(WiiRemoteRef wiiremote, Boolean enabled); -Boolean wiiremote_getstatus(WiiRemoteRef wiiremote); - |