|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwiiusej.WiiUseApi
public class WiiUseApi
Singleton used to manipulate WiiUse Api.
Field Summary | |
---|---|
private static WiiUseApi |
instance
|
Constructor Summary | |
---|---|
WiiUseApi()
|
Method Summary | |
---|---|
(package private) void |
activateContinuous(int id)
Make the wiimote generate an event each time we poll. |
(package private) void |
activateIRTracking(int id)
Activate IR Tracking on the wiimote with the given id. |
(package private) void |
activateMotionSensing(int id)
Activate motion sensing on the wiimote with the given id. |
(package private) void |
activateRumble(int id)
Activate rumble on the wiimote with the given id. |
(package private) void |
activateSmoothing(int id)
Make the the accelerometers give smoother results. |
(package private) void |
cleanUp()
CleanUp Wiiuse API. |
(package private) void |
closeConnection(int id)
Close connection to the wiimote with the given id. |
(package private) int |
connect(int nbWiimotes)
Connect to a wiimote or wiimotes once an address is known. |
(package private) void |
deactivateContinuous(int id)
Make the wiimote generate an event only when there is one. |
(package private) void |
deactivateIRTracking(int id)
Deactivate IR Tracking on the wiimote with the given id. |
(package private) void |
deactivateMotionSensing(int id)
Deactivate motion sensing on the wiimote with the given id. |
(package private) void |
deactivateRumble(int id)
Deactivate rumble on the wiimote with the given id. |
(package private) void |
deactivateSmoothing(int id)
Make the the accelerometers give raw results. |
(package private) int |
find(int nbMaxWiimotes,
int timeout)
Find a wiimote or wiimotes. |
protected static WiiUseApi |
getInstance()
Get the only instance of WiiUseApi. |
(package private) void |
getStatus(int id)
Get status and values from the wiimotes and send it through callbacks. |
(package private) int |
getUnId(int index)
Get unique id of a wiimote in the wiimotes array. |
(package private) void |
init(int nbPossibleWiimotes)
Initialize an array of wiimote structures (for the C side of the library). |
(package private) void |
reSync(int id)
Try to resync with the wiimote by starting a new handshake. |
(package private) void |
setAccelThreshold(int id,
int value)
Set how much acceleration must change to generate an event. |
(package private) void |
setAlphaSmoothing(int id,
float value)
Set alpha smoothing parameter for the given id. |
(package private) void |
setIrSensitivity(int id,
int level)
Set the IR sensitivity. |
(package private) void |
setLeds(int id,
boolean led1,
boolean led2,
boolean led3,
boolean led4)
Set wiimote leds status. |
(package private) void |
setNunchukAccelerationThreshold(int id,
int value)
Set how much acceleration must change to generate an event for the nunchuk. |
(package private) void |
setNunchukOrientationThreshold(int id,
float angle)
Set how many degrees an angle must change to generate an event for the nunchuk. |
(package private) void |
setOrientThreshold(int id,
float angle)
Set how many degrees an angle must change to generate an event. |
(package private) void |
setScreenRatio169(int id)
Notify wiiuse that your screen has an aspect ratio of 16/9. |
(package private) void |
setScreenRatio43(int id)
Notify wiiuse that your screen has an aspect ratio of 4/3. |
(package private) void |
setSensorBarAboveScreen(int id)
Notify wiiuse that the sensor bar is above your screen. |
(package private) void |
setSensorBarBelowScreen(int id)
Notify wiiuse that the sensor bar is below your screen. |
(package private) void |
setTimeout(int id,
short normalTimeout,
short expansionTimeout)
Set the normal and expansion handshake timeouts. |
(package private) void |
setVirtualScreenResolution(int id,
int x,
int y)
Set virtual screen resolution. |
(package private) void |
specialPoll(EventsGatherer gath)
Check for new Events and Get it. |
(package private) void |
windowsSetBluetoothStack(int bluetoothStackType)
Force the bluetooth stack type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static WiiUseApi instance
Constructor Detail |
---|
public WiiUseApi()
Method Detail |
---|
protected static WiiUseApi getInstance()
int connect(int nbWiimotes)
nbWiimotes
- The number of wiimotes.
int find(int nbMaxWiimotes, int timeout)
nbMaxWiimotes
- The number of wiimotes.timeout
- The number of seconds before the search times out.
void init(int nbPossibleWiimotes)
nbPossibleWiimotes
- size of the array.void closeConnection(int id)
int getUnId(int index)
index
- index of the wiimote in the wiimotes array.
void cleanUp()
void activateRumble(int id)
id
- the id of the wiimote.void deactivateRumble(int id)
id
- the id of the wiimote.void activateIRTracking(int id)
id
- the id of the wiimote.void deactivateIRTracking(int id)
id
- the id of the wiimote.void activateMotionSensing(int id)
id
- the id of the wiimote.void deactivateMotionSensing(int id)
id
- the id of the wiimote.void setLeds(int id, boolean led1, boolean led2, boolean led3, boolean led4)
id
- the id of the wiimote concerned.led1
- status of led1: True=ON, False=OFF.led2
- status of led2: True=ON, False=OFF.led3
- status of led3: True=ON, False=OFF.led4
- status of led4: True=ON, False=OFF.void setOrientThreshold(int id, float angle)
id
- id of the wiimote concerned.angle
- minimum angle detected by an event.void setAccelThreshold(int id, int value)
id
- id of the wiimote concerned.value
- minimum value detected by an event.void setAlphaSmoothing(int id, float value)
id
- id of the wiimote concerned.value
- alpha smoothing value.void reSync(int id)
id
- id of the wiimote concerned.void activateSmoothing(int id)
id
- the id of the wiimote concerned.void deactivateSmoothing(int id)
id
- the id of the wiimote concerned.void activateContinuous(int id)
id
- the id of the wiimote concerned.void deactivateContinuous(int id)
id
- the id of the wiimote concerned.void setScreenRatio43(int id)
id
- the id of the wiimote of which we want the status.void setScreenRatio169(int id)
id
- the id of the wiimote of which we want the status.void setSensorBarAboveScreen(int id)
id
- the id of the wiimote of which we want the status.void setSensorBarBelowScreen(int id)
id
- the id of the wiimote of which we want the status.void setVirtualScreenResolution(int id, int x, int y)
id
- the id of the wiimote of which we want the status.x
- x resolution.y
- y resolution.void getStatus(int id)
id
- the id of the wiimote of which we want the status.void setTimeout(int id, short normalTimeout, short expansionTimeout)
id
- the id of the wiimote concerned.normalTimeout
- The timeout in milliseconds for a normal read.expansionTimeout
- The timeout in millisecondsd to wait for an expansion
handshake.void setIrSensitivity(int id, int level)
id
- the id of the wiimote concerned.level
- 1-5, same as Wii system sensitivity setting. If the level is <
1, then level will be set to 1. If the level is > 5, then
level will be set to 5.void setNunchukOrientationThreshold(int id, float angle)
id
- id of the wiimote concerned.angle
- minimum angle detected by an event.void setNunchukAccelerationThreshold(int id, int value)
id
- id of the wiimote concerned.value
- minimum value detected by an event.void windowsSetBluetoothStack(int bluetoothStackType)
bluetoothStackType
- must be WiiUseApi.WIIUSE_STACK_UNKNOWN or
WiiUseApi.WIIUSE_STACK_MS or
WiiUseApi.WIIUSE_STACK_BLUESOLEIL.void specialPoll(EventsGatherer gath)
gath
- the object where we store all the new events.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |