wiiusej
Class WiiUseApiManager

java.lang.Object
  extended by java.lang.Thread
      extended by wiiusej.WiiUseApiManager
All Implemented Interfaces:
java.lang.Runnable

public class WiiUseApiManager
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
WiiUseApiManager()
           
 
Method Summary
 void activateIRTRacking(int id)
          Activate IR Tracking for the wiimotes with the given id.
 void activateMotionSensing(int id)
          Activate IR Tracking of the wiimotes with the given id.
 void activateRumble(int id)
          Activate the rumble for the wiimotes with the given id.
 void addWiiUseApiListener(WiiUseApiListener listener)
           
 void closeConnection(int id)
          Ask the thread to close a connection.
 int connectWiimotes()
          Connect wiimote and get the nu ber of wiimotes connected.
 void deactivateIRTRacking(int id)
          Deactivate IR Tracking for the wiimotes with the given id.
 void deactivateMotionSensing(int id)
           
 void deactivateRumble(int id)
          Deactivate the rumble for the wiimotes with the given id.
static WiiUseApiManager getInstance()
           
 int getNbConnectedWiimotes()
          Get the number of wiimotes connected.
 void getStatus(int id)
           
 WiiUseApiListener[] getWiiUseApiListeners()
           
 boolean loadLibrary()
          Load the wiimote library.
 void notifyWiiUseApiListener(WiiMoteEvent evt)
           
 void removeWiiUseApiListener(WiiUseApiListener listener)
           
 void run()
           
 void shutdown()
          Stop thread and shutdown wiiuse Api.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WiiUseApiManager

public WiiUseApiManager()
Method Detail

getInstance

public static WiiUseApiManager getInstance()

loadLibrary

public boolean loadLibrary()
Load the wiimote library.

Returns:
false if the library is not loaded true otherwise.

connectWiimotes

public int connectWiimotes()
Connect wiimote and get the nu ber of wiimotes connected. Supposed to be used once.

Returns:
0 if nothing connected or the number of wiimotes connected.

closeConnection

public void closeConnection(int id)
Ask the thread to close a connection.

Parameters:
id - id of the wiimote to disconnect.

getNbConnectedWiimotes

public int getNbConnectedWiimotes()
Get the number of wiimotes connected.

Returns:
the number of wiimotes connected.

shutdown

public void shutdown()
Stop thread and shutdown wiiuse Api.


activateRumble

public void activateRumble(int id)
Activate the rumble for the wiimotes with the given id.

Parameters:
id - the id of the wiimote.

deactivateRumble

public void deactivateRumble(int id)
Deactivate the rumble for the wiimotes with the given id.

Parameters:
id - the id of the wiimote.

activateIRTRacking

public void activateIRTRacking(int id)
Activate IR Tracking for the wiimotes with the given id.

Parameters:
id - the id of the wiimote.

deactivateIRTRacking

public void deactivateIRTRacking(int id)
Deactivate IR Tracking for the wiimotes with the given id.

Parameters:
id - the id of the wiimote.

activateMotionSensing

public void activateMotionSensing(int id)
Activate IR Tracking of the wiimotes with the given id.

Parameters:
id - the id of the wiimote.

deactivateMotionSensing

public void deactivateMotionSensing(int id)

getStatus

public void getStatus(int id)

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

addWiiUseApiListener

public void addWiiUseApiListener(WiiUseApiListener listener)

removeWiiUseApiListener

public void removeWiiUseApiListener(WiiUseApiListener listener)

getWiiUseApiListeners

public WiiUseApiListener[] getWiiUseApiListeners()

notifyWiiUseApiListener

public void notifyWiiUseApiListener(WiiMoteEvent evt)