From d55ddcdddec0167fa1406db22746d0de9d81a641 Mon Sep 17 00:00:00 2001 From: "guilhem.duche" Date: Sat, 8 Mar 2008 01:06:45 +0000 Subject: [PATCH] added infos on IR event motion sensing event (raw acceleration) and support for more wiiuse functions git-svn-id: http://wiiusej.googlecode.com/svn/trunk@75 ae48ae66-6a45-0410-b38e-211266189506 --- WiiUseJ/libWiiuseJ.dll | Bin 22771 -> 25448 bytes WiiUseJ/src/wiiusej/WiiUseApi.java | 38 ++- WiiUseJ/src/wiiusej/WiiUseApiManager.java | 96 +++++++- WiiUseJ/src/wiiusej/Wiimote.java | 54 ++++- WiiUseJ/src/wiiusej/test/Tests.java | 12 +- WiiUseJ/src/wiiusej/values/GForce.java | 21 -- WiiUseJ/src/wiiusej/values/IRSource.java | 109 +++++++++ WiiUseJ/src/wiiusej/values/Orientation.java | 20 +- ...int2DInteger.java => RawAcceleration.java} | 58 +++-- .../wiiusej/wiiuseapievents/ButtonsEvent.java | 49 +++- .../wiiuseapievents/EventsGatherer.java | 61 ++++- .../wiiusej/wiiuseapievents/GenericEvent.java | 87 +++++-- .../src/wiiusej/wiiuseapievents/IREvent.java | 227 +++++++++++++++++- .../wiiuseapievents/MotionSensingEvent.java | 33 ++- .../wiiusej/wiiuseapievents/StatusEvent.java | 48 ++++ .../wiiuseapievents/WiiUseApiEvent.java | 8 +- .../wiiuseapirequest/IntValueRequest.java | 9 +- .../wiiuseapirequest/WiiUseApiRequest.java | 5 + 18 files changed, 808 insertions(+), 127 deletions(-) create mode 100644 WiiUseJ/src/wiiusej/values/IRSource.java rename WiiUseJ/src/wiiusej/values/{Point2DInteger.java => RawAcceleration.java} (53%) diff --git a/WiiUseJ/libWiiuseJ.dll b/WiiUseJ/libWiiuseJ.dll index 604fa63d469d9913a74a2ae859a73c3bef1a2f51..d1c51cc1f529bec3dd4625205911b8a76351d7dd 100644 GIT binary patch literal 25448 zcmeHP4Rl;poxe#38u~$ol48LCQw^9x8)lM8(n8WqnoOHw3LziBLg8haOq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6e*=Wj1*iZ3 diff --git a/WiiUseJ/src/wiiusej/WiiUseApi.java b/WiiUseJ/src/wiiusej/WiiUseApi.java index 4c580e1..cb91767 100644 --- a/WiiUseJ/src/wiiusej/WiiUseApi.java +++ b/WiiUseJ/src/wiiusej/WiiUseApi.java @@ -158,6 +158,40 @@ public class WiiUseApi { * @param id the id of the wiimote concerned */ native void deactivateContinuous(int id); + + /** + * Notify wiiuse that your screen has an aspect ratio of 4/3. + * @param id the id of the wiimote of which we want the status. + */ + native void setScreenRatio43(int id); + + /** + * Notify wiiuse that your screen has an aspect ratio of 16/9. + * @param id the id of the wiimote of which we want the status. + */ + native void setScreenRatio169(int id); + + /** + * Notify wiiuse that the sensor bar is above your screen. + * @param id the id of the wiimote of which we want the status. + */ + native void setSensorBarAboveScreen(int id); + + /** + * Notify wiiuse that the sensor bar is below your screen. + * @param id the id of the wiimote of which we want the status. + */ + native void setSensorBarBelowScreen(int id); + + /** + * Set virtual screen resolution. It is used to automatically + * compute the position of a cursor on this virtual screen + * using the sensor bar. These results come in the IREvent. + * @param id the id of the wiimote of which we want the status. + * @param x x resolution. + * @param y y resolution. + */ + native void setVirtualScreenResolution(int id, int x, int y); /** * Get status and values from the wiimotes and send it through callbacks. @@ -171,6 +205,8 @@ public class WiiUseApi { * * @param gath the object where we store all the new events. */ - native void specialPoll(EventsGatherer gath); + native void specialPoll(EventsGatherer gath); + + } diff --git a/WiiUseJ/src/wiiusej/WiiUseApiManager.java b/WiiUseJ/src/wiiusej/WiiUseApiManager.java index 1f5bb4c..35549cb 100644 --- a/WiiUseJ/src/wiiusej/WiiUseApiManager.java +++ b/WiiUseJ/src/wiiusej/WiiUseApiManager.java @@ -27,6 +27,7 @@ import wiiusej.wiiuseapievents.WiiUseApiListener; import wiiusej.wiiuseapirequest.FloatValueRequest; import wiiusej.wiiuseapirequest.IntValueRequest; import wiiusej.wiiuseapirequest.LedsRequest; +import wiiusej.wiiuseapirequest.TwoIntValueRequest; import wiiusej.wiiuseapirequest.WiiUseApiRequest; /** @@ -72,7 +73,7 @@ public class WiiUseApiManager extends Thread { manager.wiimotes = new Wiimote[nbWiimotes]; for (int i = 1; i <= nbWiimotes; i++) { Wiimote wim = new Wiimote(i, manager); - manager.wiimotes[i-1] = wim; + manager.wiimotes[i - 1] = wim; manager.addWiiUseApiListener(wim); } } @@ -113,9 +114,9 @@ public class WiiUseApiManager extends Thread { * @param id * id of the wiimote to disconnect. */ - public void closeConnection(int id) { - removeWiiUseApiListener(wiimotes[id-1]); - wiimotes[id-1] = null; + public void closeConnection(int id) { + removeWiiUseApiListener(wiimotes[id - 1]); + wiimotes[id - 1] = null; requests.add(new WiiUseApiRequest(id, WiiUseApiRequest.WIIUSE_CLOSE_CONNECTION_REQUEST)); System.out.println("Wiimote " + id + " disconnected !"); @@ -308,6 +309,7 @@ public class WiiUseApiManager extends Thread { /** * Try to resync with the wiimote by starting a new handshake. + * * @TODO not used yet !! * @param id * id of the wiimote @@ -316,6 +318,67 @@ public class WiiUseApiManager extends Thread { requests.add(new WiiUseApiRequest(id, WiiUseApiRequest.WIIUSE_RESYNC)); } + /** + * Set screen aspect ratio to 4/3 for the given id. + * + * @param id + * id of the wiimote + */ + public void setScreenAspectRatio43(int id) { + requests.add(new WiiUseApiRequest(id, + WiiUseApiRequest.WIIUSE_ASPECT_RATIO_4_3)); + } + + /** + * Set screen aspect ratio to 16/9 for the given id. + * + * @param id + * id of the wiimote + */ + public void setScreenAspectRatio169(int id) { + requests.add(new WiiUseApiRequest(id, + WiiUseApiRequest.WIIUSE_ASPECT_RATIO_16_9)); + } + + /** + * Set the sensor bar to be above the screen. + * + * @param id + * id of the wiimote + */ + public void setSensorBarAboveScreen(int id) { + requests.add(new WiiUseApiRequest(id, + WiiUseApiRequest.WIIUSE_SENSOR_BAR_ABOVE)); + } + + /** + * Set the sensor bar to be below the screen. + * + * @param id + * id of the wiimote + */ + public void setSensorBarBelowScreen(int id) { + requests.add(new WiiUseApiRequest(id, + WiiUseApiRequest.WIIUSE_SENSOR_BAR_BELOW)); + } + + /** + * Set virtual resolution. It is used to automatically compute the position + * of a cursor on this virtual screen using the sensor bar. These results + * come in the IREvent. + * + * @param id + * id of the wiimote + * @param x + * x resolution + * @param y + * y resolution + */ + public void setVirtualResolution(int id, int x, int y) { + requests.add(new TwoIntValueRequest(id, + WiiUseApiRequest.WIIUSE_SET_VIRTUAL_RESOLUTION, x, y)); + } + /** * Get Status for the wiimote for the given id. * @@ -336,8 +399,8 @@ public class WiiUseApiManager extends Thread { EventsGatherer gather = new EventsGatherer(nbMaxWiimotes); // Start polling and tell the observers when there Wiimote events - while (running.get() && connected > 0) { - + while (running.get() && connected > 0) { + /* Polling */ wiiuse.specialPoll(gather); @@ -358,8 +421,8 @@ public class WiiUseApiManager extends Thread { } } gather.clearEvents(); - - /* deal with request done to wiiuse API*/ + + /* deal with request done to wiiuse API */ WiiUseApiRequest req = requests.poll(); if (req != null) {// there is a request for the wiiuse api int id = req.getId(); @@ -427,6 +490,23 @@ public class WiiUseApiManager extends Thread { } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_RESYNC) { /* set resync request */ wiiuse.reSync(req.getId()); + } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_ASPECT_RATIO_4_3) { + /* set screen aspect ratio to 4/3 */ + wiiuse.setScreenRatio43(req.getId()); + } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_ASPECT_RATIO_16_9) { + /* set screen aspect ratio to 16/9 */ + wiiuse.setScreenRatio169(req.getId()); + } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_SENSOR_BAR_ABOVE) { + /* set sensor bar above the screen */ + wiiuse.setSensorBarAboveScreen(req.getId()); + } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_SENSOR_BAR_BELOW) { + /* set sensor bar above the screen */ + wiiuse.setSensorBarBelowScreen(req.getId()); + } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_SET_VIRTUAL_RESOLUTION) { + /* set virtual resolution */ + wiiuse.setVirtualScreenResolution(req.getId(), + ((TwoIntValueRequest) req).getIntValue(), + ((TwoIntValueRequest) req).getSecondIntValue()); } else { System.out.println("Bad request to Wiiuse API !!!!!"); } diff --git a/WiiUseJ/src/wiiusej/Wiimote.java b/WiiUseJ/src/wiiusej/Wiimote.java index 0179f60..4108c70 100644 --- a/WiiUseJ/src/wiiusej/Wiimote.java +++ b/WiiUseJ/src/wiiusej/Wiimote.java @@ -170,9 +170,48 @@ public class Wiimote implements WiiUseApiListener { * @param th * threshold */ - public void setAlphaSmoothingValue(int th) { + public void setAlphaSmoothingValue(float th) { manager.setAlphaSmoothing(id,th); } + + /** + * Set the screen aspect ratio to be considered as 4/3. + */ + public void setScreenAspectRatio43() { + manager.setScreenAspectRatio43(id); + } + + /** + * Set the screen aspect ratio to be considered as 16/9. + */ + public void setScreenAspectRatio169() { + manager.setScreenAspectRatio169(id); + } + + /** + * Set the sensor bar to be considered above the screen. + */ + public void setSensorBarAboveScreen() { + manager.setSensorBarAboveScreen(id); + } + + /** + * Set the sensor bar to be considered below the screen. + */ + public void setSensorBarBelowScreen() { + manager.setSensorBarBelowScreen(id); + } + + /** + * Set the screen resolution of the you are pointing at + * with your wiimote. + * + * @param x x resolution. + * @param y y resolution. + */ + public void setVirtualResolution(int x, int y) { + manager.setVirtualResolution(id, x ,y); + } //TODO resync ? @@ -185,12 +224,21 @@ public class Wiimote implements WiiUseApiListener { manager.getStatus(id); } - + /** + * Method called when a WiiUseApiEvent occurs. + * @param e the WiiUseApiEvent. + */ public void onWiiUseApiEvent(WiiUseApiEvent e) { if (e.getWiimoteId() == id){ if (e.getEventType() == WiiUseApiEvent.GENERIC_EVENT){ notifyWiiMoteEventListeners((GenericEvent)e); - }else if (e.getEventType() == WiiUseApiEvent.STATUS_EVENT){ + }else if (e.getEventType() == WiiUseApiEvent.STATUS_EVENT + ||e.getEventType() == WiiUseApiEvent.WIIUSE_NUNCHUK_INSERTED + ||e.getEventType() == WiiUseApiEvent.WIIUSE_NUNCHUK_REMOVED + ||e.getEventType() == WiiUseApiEvent.WIIUSE_CLASSIC_CTRL_INSERTED + ||e.getEventType() == WiiUseApiEvent.WIIUSE_CLASSIC_CTRL_REMOVED + ||e.getEventType() == WiiUseApiEvent.WIIUSE_GUITAR_HERO_3_CTRL_INSERTED + ||e.getEventType() == WiiUseApiEvent.WIIUSE_GUITAR_HERO_3_CTRL_REMOVED){ notifyStatusEventListeners((StatusEvent)e); }else if (e.getEventType() == WiiUseApiEvent.DISCONNECTION_EVENT){ notifyDisconnectionEventListeners((DisconnectionEvent)e); diff --git a/WiiUseJ/src/wiiusej/test/Tests.java b/WiiUseJ/src/wiiusej/test/Tests.java index ded66b8..6926be0 100644 --- a/WiiUseJ/src/wiiusej/test/Tests.java +++ b/WiiUseJ/src/wiiusej/test/Tests.java @@ -22,7 +22,7 @@ import java.awt.event.InputEvent; import wiiusej.WiiUseApiManager; import wiiusej.Wiimote; -import wiiusej.values.Point2DInteger; +import wiiusej.values.IRSource; import wiiusej.wiiuseapievents.ButtonsEvent; import wiiusej.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiuseapievents.IREvent; @@ -343,17 +343,11 @@ public class Tests implements WiimoteListener { public void onIrEvent(IREvent e) { if (dump == DISPLAY_EACH_VALUE) { - /* display ir points */ - Point2DInteger[] list = e.getIRPoints(); - for (int i = 0; i < list.length; i++) { - if (list[i] != null) - System.out.print("Point :(" + list[i].getX() + "," - + list[i].getY() + ") "); - } + System.out.println(e); } else if (dump == DUMP) { System.out.println(e); } else if (dump == MOVE_MOUSE) { - Point2DInteger[] list = e.getIRPoints(); + IRSource[] list = e.getIRPoints(); if (list.length > 0) { int x1 = (int) list[0].getX(); int y1 = (int) list[0].getY(); diff --git a/WiiUseJ/src/wiiusej/values/GForce.java b/WiiUseJ/src/wiiusej/values/GForce.java index 144024e..9732121 100644 --- a/WiiUseJ/src/wiiusej/values/GForce.java +++ b/WiiUseJ/src/wiiusej/values/GForce.java @@ -54,13 +54,6 @@ public class GForce { return x; } - /** - * @param x the x to set - */ - public void setX(float x) { - this.x = x; - } - /** * @return the y */ @@ -68,26 +61,12 @@ public class GForce { return y; } - /** - * @param y the y to set - */ - public void setY(float y) { - this.y = y; - } - /** * @return the z */ public float getZ() { return z; } - - /** - * @param z the z to set - */ - public void setZ(float z) { - this.z = z; - } @Override public String toString() { diff --git a/WiiUseJ/src/wiiusej/values/IRSource.java b/WiiUseJ/src/wiiusej/values/IRSource.java new file mode 100644 index 0000000..7caef55 --- /dev/null +++ b/WiiUseJ/src/wiiusej/values/IRSource.java @@ -0,0 +1,109 @@ +/** + * This file is part of WiiuseJ. + * + * WiiuseJ is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * WiiuseJ is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with WiiuseJ. If not, see . + */ +package wiiusej.values; + +/** + * Class used for IR sources. + * @author guiguito + */ +public class IRSource{ + + private int x; + private int y; + private short rx; + private short ry; + private short size; + + /** + * Build an IR source with all details. + * + * @param xx + * xx interpolated coordinates. + * @param yy + * yy interpolated coordinates. + * @param rxx + * raw X coordinate (0-1023). + * @param ryy + * raw Y coordinate (0-1023). + * @param si + * size of the IR dot (0-15). + */ + public IRSource(int xx, int yy, short rxx, short ryy, short si) { + x = xx; + y = yy; + rx = rxx; + ry = ryy; + size = si; + } + + + /** + * Return x interpolated coordinates. + * @return the x + */ + public int getX() { + return x; + } + + + + /** + * Return y interpolated coordinates. + * @return the y + */ + public int getY() { + return y; + } + + + + /** + * Return raw X coordinate (0-1023). + * @return the rx + */ + public short getRx() { + return rx; + } + + + + /** + * Return raw Y coordinate (0-1023). + * @return the ry + */ + public short getRy() { + return ry; + } + + + + /** + * Return size of the IR dot (0-15). + * @return the size + */ + public short getSize() { + return size; + } + + + + @Override + public String toString() { + return "Interpolated coordinates ("+x+","+y+"), Raw coordinates("+rx+","+ry+"), source size : "+size+")"; + } + +} diff --git a/WiiUseJ/src/wiiusej/values/Orientation.java b/WiiUseJ/src/wiiusej/values/Orientation.java index 7afe928..4c4f741 100644 --- a/WiiUseJ/src/wiiusej/values/Orientation.java +++ b/WiiUseJ/src/wiiusej/values/Orientation.java @@ -53,36 +53,20 @@ public class Orientation { public float getRoll() { return roll; } - /** - * @param roll the roll to set - */ - public void setRoll(float roll) { - this.roll = roll; - } + /** * @return the pitch */ public float getPitch() { return pitch; } - /** - * @param pitch the pitch to set - */ - public void setPitch(float pitch) { - this.pitch = pitch; - } + /** * @return the yaw */ public float getYaw() { return yaw; } - /** - * @param yaw the yaw to set - */ - public void setYaw(float yaw) { - this.yaw = yaw; - } @Override public String toString() { diff --git a/WiiUseJ/src/wiiusej/values/Point2DInteger.java b/WiiUseJ/src/wiiusej/values/RawAcceleration.java similarity index 53% rename from WiiUseJ/src/wiiusej/values/Point2DInteger.java rename to WiiUseJ/src/wiiusej/values/RawAcceleration.java index a717882..903a51c 100644 --- a/WiiUseJ/src/wiiusej/values/Point2DInteger.java +++ b/WiiUseJ/src/wiiusej/values/RawAcceleration.java @@ -16,40 +16,60 @@ */ package wiiusej.values; -import java.awt.geom.Point2D; - /** - * Class used for IR sources. + * Represents raw acceleration on each axis. * @author guiguito */ -public class Point2DInteger extends Point2D { - private int x; - private int y; +public class RawAcceleration { - public Point2DInteger(int xx, int yy) { - super(); - setLocation(xx,yy); + private short x; + private short y; + private short z; + + /** + * Default constructor; + */ + public RawAcceleration() { + x = 0; + y = 0; + z = 0; + } + + /** + * Constructor with raw acceleration on each axis. + * @param xx x value + * @param yy x value + * @param zz x value + */ + public RawAcceleration(short xx, short yy, short zz) { + x = xx; + y = yy; + z = zz; } - @Override - public double getX() { + /** + * @return the x + */ + public short getX() { return x; } - - @Override - public double getY() { + /** + * @return the y + */ + public short getY() { return y; } - @Override - public void setLocation(double xx, double yy) { - this.x = (int)xx; - this.y = (int)yy; + /** + * @return the z + */ + public short getZ() { + return z; } @Override public String toString() { - return "("+x+","+y+")"; + return "Raw acceleration : ("+x+", "+y+","+z+")"; } } diff --git a/WiiUseJ/src/wiiusej/wiiuseapievents/ButtonsEvent.java b/WiiUseJ/src/wiiusej/wiiuseapievents/ButtonsEvent.java index b79818e..ce78551 100644 --- a/WiiUseJ/src/wiiusej/wiiuseapievents/ButtonsEvent.java +++ b/WiiUseJ/src/wiiusej/wiiuseapievents/ButtonsEvent.java @@ -119,7 +119,10 @@ public class ButtonsEvent extends WiimoteEvent{ private boolean isButtonHeld(short buttonBitsDefinition) { return buttonTest(buttonBitsDefinition, buttonsHeld); } - + + private boolean isButtonPressed(short buttonBitsDefinition) { + return isButtonHeld(buttonBitsDefinition)||isButtonJustPressed(buttonBitsDefinition); + } /* Button ONE */ public boolean isButtonOneJustPressed() { @@ -133,6 +136,10 @@ public class ButtonsEvent extends WiimoteEvent{ public boolean isButtonOneHeld() { return isButtonHeld(WIIMOTE_BUTTON_ONE); } + + public boolean isButtonOnePressed() { + return isButtonPressed(WIIMOTE_BUTTON_ONE); + } /* Button TWO */ @@ -147,6 +154,10 @@ public class ButtonsEvent extends WiimoteEvent{ public boolean isButtonTwoHeld() { return isButtonHeld(WIIMOTE_BUTTON_TWO); } + + public boolean isButtonTwoPressed() { + return isButtonPressed(WIIMOTE_BUTTON_TWO); + } /* Button A */ @@ -161,6 +172,10 @@ public class ButtonsEvent extends WiimoteEvent{ public boolean isButtonAHeld() { return isButtonHeld(WIIMOTE_BUTTON_A); } + + public boolean isButtonAPressed() { + return isButtonPressed(WIIMOTE_BUTTON_A); + } /* Button B */ @@ -175,6 +190,10 @@ public class ButtonsEvent extends WiimoteEvent{ public boolean isButtonBHeld() { return isButtonHeld(WIIMOTE_BUTTON_B); } + + public boolean isButtonBPressed() { + return isButtonPressed(WIIMOTE_BUTTON_B); + } /* Button LEFT */ @@ -189,6 +208,10 @@ public class ButtonsEvent extends WiimoteEvent{ public boolean isButtonLeftHeld() { return isButtonHeld(WIIMOTE_BUTTON_LEFT); } + + public boolean isButtonLeftPressed() { + return isButtonPressed(WIIMOTE_BUTTON_LEFT); + } /* Button RIGHT */ @@ -203,6 +226,10 @@ public class ButtonsEvent extends WiimoteEvent{ public boolean isButtonRightHeld() { return isButtonHeld(WIIMOTE_BUTTON_RIGHT); } + + public boolean isButtonRightPressed() { + return isButtonPressed(WIIMOTE_BUTTON_RIGHT); + } /* Button UP */ @@ -217,6 +244,10 @@ public class ButtonsEvent extends WiimoteEvent{ public boolean isButtonUpHeld() { return isButtonHeld(WIIMOTE_BUTTON_UP); } + + public boolean isButtonUpPressed() { + return isButtonPressed(WIIMOTE_BUTTON_UP); + } /* Button DOWN */ @@ -231,6 +262,10 @@ public class ButtonsEvent extends WiimoteEvent{ public boolean isButtonDownHeld() { return isButtonHeld(WIIMOTE_BUTTON_DOWN); } + + public boolean isButtonDownPressed() { + return isButtonPressed(WIIMOTE_BUTTON_DOWN); + } /* Button - */ @@ -245,6 +280,10 @@ public class ButtonsEvent extends WiimoteEvent{ public boolean isButtonMinusHeld() { return isButtonHeld(WIIMOTE_BUTTON_MINUS); } + + public boolean isButtonMinusPressed() { + return isButtonPressed(WIIMOTE_BUTTON_MINUS); + } /* Button + */ @@ -259,6 +298,10 @@ public class ButtonsEvent extends WiimoteEvent{ public boolean isButtonPlusHeld() { return isButtonHeld(WIIMOTE_BUTTON_PLUS); } + + public boolean isButtonPlusPressed() { + return isButtonPressed(WIIMOTE_BUTTON_PLUS); + } /* Button HOME */ @@ -274,6 +317,10 @@ public class ButtonsEvent extends WiimoteEvent{ return isButtonHeld(WIIMOTE_BUTTON_HOME); } + public boolean isButtonHomePressed() { + return isButtonPressed(WIIMOTE_BUTTON_HOME); + } + @Override public String toString() { String out = ""; diff --git a/WiiUseJ/src/wiiusej/wiiuseapievents/EventsGatherer.java b/WiiUseJ/src/wiiusej/wiiuseapievents/EventsGatherer.java index 5014901..7fcb57c 100644 --- a/WiiUseJ/src/wiiusej/wiiuseapievents/EventsGatherer.java +++ b/WiiUseJ/src/wiiusej/wiiuseapievents/EventsGatherer.java @@ -16,7 +16,6 @@ */ package wiiusej.wiiuseapievents; - /** * This class is used to gather events during a call to the Wiiuse API. * @@ -44,7 +43,7 @@ public class EventsGatherer { * @param e * the event to add. */ - private void addEvent(WiiUseApiEvent e) { + private void addEvent(WiiUseApiEvent e) { events[index] = e; index++; } @@ -67,6 +66,39 @@ public class EventsGatherer { buttonsJustReleased, buttonsHeld); } + /** + * Prepare an IR event to populate. + * + * @param x + * calculated X coordinate. + * @param y + * calculated Y coordinate. + * @param z + * calculated distance. + * @param ax + * absolute X coordinate. + * @param ay + * absolute Y coordinate + * @param xVRes + * IR virtual screen x resolution. + * @param yVRes + * IR virtual screen y resolution. + * @param xOffset + * IR X correction offset. + * @param yOffset + * IR Y correction offset. + * @param sensorBarPostion + * aspect ratio of the screen. + * @param screenAsPectRatio + * IR sensor bar position. + */ + public void prepareIRevent(int x, int y, int z, int ax, int ay, + int xVRes, int yVRes, int xOffset, int yOffset, + short sensorBarPostion, short screenAsPectRatio) { + genericEvent.prepareIRevent(x, y, z, ax, ay, xVRes, + yVRes, xOffset, yOffset, sensorBarPostion, screenAsPectRatio); + + } /** * Add an IR point to the WiiMoteEvent prepared @@ -75,13 +107,20 @@ public class EventsGatherer { * x coordinates * @param y * y coordinates + * @param rxx + * raw X coordinate (0-1023). + * @param ryy + * raw Y coordinate (0-1023). + * @param si + * size of the IR dot (0-15). */ - public void addIRPointToPreparedWiiMoteEvent(int x, int y) { - if (genericEvent != null) { - genericEvent.addIRpoint(x, y); + public void addIRPointToPreparedWiiMoteEvent(int x, int y, short rx, + short ry, short size) { + if (genericEvent != null) { + genericEvent.addIRpoint(x, y, rx, ry, size); } } - + /** * Set orientation and gravity force of the prepared event. * @@ -97,11 +136,17 @@ public class EventsGatherer { * gravity force on y axis * @param z * gravity force on z axis + * @param xx + * raw acceleration on x axis + * @param yy + * raw acceleration on y axis + * @param zz + * raw acceleration on z axis */ public void addMotionSensingValues(float r, float p, float ya, float x, - float y, float z) { + float y, float z, short xx, short yy, short zz) { if (genericEvent != null) { - genericEvent.setMotionSensingEvent(r, p, ya, x, y, z); + genericEvent.setMotionSensingEvent(r, p, ya, x, y, z, xx, yy, zz); } } diff --git a/WiiUseJ/src/wiiusej/wiiuseapievents/GenericEvent.java b/WiiUseJ/src/wiiusej/wiiuseapievents/GenericEvent.java index f534ff0..0671ff8 100644 --- a/WiiUseJ/src/wiiusej/wiiuseapievents/GenericEvent.java +++ b/WiiUseJ/src/wiiusej/wiiuseapievents/GenericEvent.java @@ -16,7 +16,6 @@ */ package wiiusej.wiiuseapievents; - /** * Class that is a bean to be filled by the wiiuse API. * @@ -77,6 +76,7 @@ public class GenericEvent extends WiiUseApiEvent { /** * Get buttons event. + * * @return the buttons event. */ public ButtonsEvent getButtonsEvent() { @@ -85,6 +85,7 @@ public class GenericEvent extends WiiUseApiEvent { /** * Get IR event. + * * @return the IR event if there is one or null. */ public IREvent getIREvent() { @@ -93,6 +94,7 @@ public class GenericEvent extends WiiUseApiEvent { /** * Get motion sensing event. + * * @return the motion sensing event if there is one or null. */ public MotionSensingEvent getMotionSensingEvent() { @@ -100,19 +102,61 @@ public class GenericEvent extends WiiUseApiEvent { } /** - * Add an IR point to the generic event. - * Create an IR Event if it's not created yet. - * @param x x coordinates. - * @param y y coordinates + * Prepare an IR event to populate. + * + * @param x + * calculated X coordinate. + * @param y + * calculated Y coordinate. + * @param z + * calculated distance. + * @param ax + * absolute X coordinate. + * @param ay + * absolute Y coordinate + * @param xVRes + * IR virtual screen x resolution. + * @param yVRes + * IR virtual screen y resolution. + * @param xOffset + * IR X correction offset. + * @param yOffset + * IR Y correction offset. + * @param sensorBarPostion + * aspect ratio of the screen. + * @param screenAsPectRatio + * IR sensor bar position. */ - public void addIRpoint(int x,int y){ - //@TODO add points size - if (infraredEvent == null){ - infraredEvent = new IREvent(getWiimoteId()); + public void prepareIRevent(int x, int y, int z, int ax, int ay, int xVRes, + int yVRes, int xOffset, int yOffset, short sensorBarPostion, + short screenAsPectRatio) { + if (infraredEvent == null) { + infraredEvent = new IREvent(getWiimoteId(), x, y, z, ax, ay, xVRes, + yVRes, xOffset, yOffset, sensorBarPostion, + screenAsPectRatio); } - infraredEvent.addIRpoint(x, y); } - + + /** + * Add an IR point to the generic event. Create an IR Event if it's not + * created yet. + * + * @param x + * x coordinates. + * @param y + * y coordinates + * @param rxx + * raw X coordinate (0-1023). + * @param ryy + * raw Y coordinate (0-1023). + * @param si + * size of the IR dot (0-15). + */ + public void addIRpoint(int x, int y, short rx, short ry, short size) { + if (infraredEvent != null) + infraredEvent.addIRpoint(x, y, rx, ry, size); + } + /** * Set the Motion Sensing Event. * @@ -128,13 +172,18 @@ public class GenericEvent extends WiiUseApiEvent { * gravity force on y axis * @param z * gravity force on z axis + * @param xx + * raw acceleration on x axis + * @param yy + * raw acceleration on y axis + * @param zz + * raw acceleration on z axis */ - public void setMotionSensingEvent(float r, float p, float ya, float x, float y, - float z){ - motionSensingEvent = new MotionSensingEvent(getWiimoteId(), r, p, ya, x, y, z); + public void setMotionSensingEvent(float r, float p, float ya, float x, + float y, float z, short xx, short yy, short zz) { + motionSensingEvent = new MotionSensingEvent(getWiimoteId(), r, p, ya, + x, y, z, xx, yy, zz); } - - @Override public String toString() { @@ -147,19 +196,19 @@ public class GenericEvent extends WiiUseApiEvent { if (infraredEvent != null) { out += infraredEvent; - }else{ + } else { out += "/******** IR Tracking ********/\n"; out += "--- Active : false\n"; } if (motionSensingEvent != null) { out += motionSensingEvent; - }else{ + } else { out += "/******** Motion sensing ********/\n"; out += "--- Motion sensing : false \n"; } return out; } - + } diff --git a/WiiUseJ/src/wiiusej/wiiuseapievents/IREvent.java b/WiiUseJ/src/wiiusej/wiiuseapievents/IREvent.java index 568fb4e..9950327 100644 --- a/WiiUseJ/src/wiiusej/wiiuseapievents/IREvent.java +++ b/WiiUseJ/src/wiiusej/wiiuseapievents/IREvent.java @@ -16,28 +16,81 @@ */ package wiiusej.wiiuseapievents; -import wiiusej.values.Point2DInteger; +import wiiusej.values.IRSource; /** * Class which represents an IR event. * * @author guiguito */ -public class IREvent extends WiimoteEvent{ +public class IREvent extends WiimoteEvent { /* IR Tracking */ - private Point2DInteger[] IRPoints; + private IRSource[] IRPoints; private short indexPoints = 0; + private int x; + private int y; + private int z;// distance from the sensor bar + private int ax; + private int ay; + private int xVRes; + private int yVRes; + private int xOffset; + private int yOffset; + private short sensorBarPostion; + private short screenAsPectRatio; + + static private short WIIUSE_IR_ABOVE = 0; + static private short WIIUSE_IR_BELOW = 1; + static private short WIIUSE_SCREEN_RATIO_4_3 = 0; + static private short WIIUSE_SCREEN_RATIO_16_9 = 1; private static short NB_POINTS = 4;// number of points IR can track - + /** - * Constructor for an infrared event. - * @param id id of the wiimote concerned. + * Constructor of IREvent with full infos. + * + * @param id + * d of the wiimote concerned. + * @param x + * calculated X coordinate. + * @param y + * calculated Y coordinate. + * @param z + * calculated distance. + * @param ax + * absolute X coordinate. + * @param ay + * absolute Y coordinate + * @param xVRes + * IR virtual screen x resolution. + * @param yVRes + * IR virtual screen y resolution. + * @param xOffset + * IR X correction offset. + * @param yOffset + * IR Y correction offset. + * @param sensorBarPostion + * aspect ratio of the screen. + * @param screenAsPectRatio + * IR sensor bar position. */ - public IREvent(int id) { + public IREvent(int id, int x, int y, int z, int ax, int ay, int xVRes, + int yVRes, int xOffset, int yOffset, short sensorBarPostion, + short screenAsPectRatio) { super(id); - IRPoints = new Point2DInteger[NB_POINTS]; + this.x = x; + this.y = y; + this.z = z; + this.ax = ax; + this.ay = ay; + this.xVRes = xVRes; + this.yVRes = yVRes; + this.xOffset = xOffset; + this.yOffset = yOffset; + this.sensorBarPostion = sensorBarPostion; + this.screenAsPectRatio = screenAsPectRatio; + IRPoints = new IRSource[NB_POINTS]; } /** @@ -45,7 +98,7 @@ public class IREvent extends WiimoteEvent{ * * @return the list of 2D points */ - public Point2DInteger[] getIRPoints() { + public IRSource[] getIRPoints() { return java.util.Arrays.copyOfRange(IRPoints, 0, indexPoints); } @@ -56,19 +109,170 @@ public class IREvent extends WiimoteEvent{ * x value * @param y * y value + * @param rxx + * raw X coordinate (0-1023). + * @param ryy + * raw Y coordinate (0-1023). + * @param si + * size of the IR dot (0-15). */ - public void addIRpoint(int x, int y) { - IRPoints[indexPoints] = new Point2DInteger(x, y); + public void addIRpoint(int x, int y, short rx, short ry, short size) { + IRPoints[indexPoints] = new IRSource(x, y, rx, ry, size); indexPoints++; return; } + /** + * Return calculated X coordinate. + * + * @return the x + */ + public int getX() { + return x; + } + + /** + * Return calculated Y coordinate. + * + * @return the y + */ + public int getY() { + return y; + } + + /** + * Return calculated distance. + * + * @return the z + */ + public int getZ() { + return z; + } + + /** + * Return absolute X coordinate. + * + * @return the ax + */ + public int getAx() { + return ax; + } + + /** + * Return absolute Y coordinate. + * + * @return the ay + */ + public int getAy() { + return ay; + } + + /** + * Return IR virtual screen x resolution. + * + * @return the xVRes + */ + public int getXVRes() { + return xVRes; + } + + /** + * Return IR virtual screen y resolution. + * + * @return the yVRes + */ + public int getYVRes() { + return yVRes; + } + + /** + * Return IR X correction offset. + * + * @return the xOffset + */ + public int getXOffset() { + return xOffset; + } + + /** + * Return IR Y correction offset. + * + * @return the yOffset + */ + public int getYOffset() { + return yOffset; + } + + /** + * Return true if the sensor bar is above. + * + * @return true if the sensor bar is above. + */ + public boolean isSensorBarAbove() { + return sensorBarPostion == WIIUSE_IR_ABOVE; + } + + /** + * Return true if the sensor bar is below. + * + * @return true if the sensor bar is below. + */ + public boolean isSensorBarBelow() { + return sensorBarPostion == WIIUSE_IR_BELOW; + } + + /** + * Return true if screen aspect ratio set is 4/3. + * + * @return true if screen aspect ratio set is 4/3. + */ + public boolean isScreenAspectRatio43() { + return screenAsPectRatio == WIIUSE_SCREEN_RATIO_4_3; + } + + /** + * Return true if screen aspect ratio set is 16/9. + * + * @return true if screen aspect ratio set is 16/9. + */ + public boolean isScreenAspectRatio169() { + return screenAsPectRatio == WIIUSE_SCREEN_RATIO_16_9; + } + + /** + * Return aspect ratio of the screen. + * + * @return the screenAsPectRatio + */ + public short getScreenAsPectRatio() { + return screenAsPectRatio; + } + @Override public String toString() { String out = ""; /* Display IR Tracking */ out += "/******** IR Tracking ********/\n"; out += "--- Active : true\n"; + out += "--- calculated X coordinate : " + x + "\n"; + out += "--- calculated Y coordinate : " + y + "\n"; + out += "--- calculated distance : " + z + "\n"; + out += "--- absolute X coordinate : " + ax + "\n"; + out += "--- absolute Y coordinate : " + ay + "\n"; + out += "--- IR virtual screen x resolution : " + xVRes + "\n"; + out += "--- IR virtual screen y resolution : " + yVRes + "\n"; + out += "--- IR X correction offset : " + xOffset + "\n"; + out += "--- IR Y correction offset : " + yOffset + "\n"; + if (isScreenAspectRatio43()) { + out += "--- aspect ratio of the screen : 4/3\n"; + } else if (isScreenAspectRatio169()) { + out += "--- aspect ratio of the screen : 16/9\n"; + } + if (isSensorBarAbove()) { + out += "--- IR sensor bar position. : Above\n"; + } else if (isSensorBarBelow()) { + out += "--- IR sensor bar position. : Below\n"; + } out += "--- Seen points\n"; for (int i = 0; i < IRPoints.length; i++) { if (IRPoints[i] != null) { @@ -77,5 +281,4 @@ public class IREvent extends WiimoteEvent{ } return out; } - } diff --git a/WiiUseJ/src/wiiusej/wiiuseapievents/MotionSensingEvent.java b/WiiUseJ/src/wiiusej/wiiuseapievents/MotionSensingEvent.java index 305c346..c15127d 100644 --- a/WiiUseJ/src/wiiusej/wiiuseapievents/MotionSensingEvent.java +++ b/WiiUseJ/src/wiiusej/wiiuseapievents/MotionSensingEvent.java @@ -18,6 +18,7 @@ package wiiusej.wiiuseapievents; import wiiusej.values.GForce; import wiiusej.values.Orientation; +import wiiusej.values.RawAcceleration; /** * Class which represents a motion sensing event. @@ -29,6 +30,7 @@ public class MotionSensingEvent extends WiimoteEvent{ /* Motion Sensing */ private Orientation orientation; private GForce gforce; + private RawAcceleration acceleration; /** * Constructor for a Motion Sensing Event. @@ -47,15 +49,21 @@ public class MotionSensingEvent extends WiimoteEvent{ * gravity force on y axis * @param z * gravity force on z axis + * @param xx + * raw acceleration on x axis + * @param yy + * raw acceleration on y axis + * @param zz + * raw acceleration on z axis */ public MotionSensingEvent(int id, float r, float p, float ya, float x, float y, - float z) { + float z, short xx, short yy, short zz) { super(id); - setOrientationAndGforce(r, p, ya, x, y, z); + setOrientationAndGforce(r, p, ya, x, y, z, xx, yy, zz); } /** - * Set orientation and gravity force. + * Set orientation, gravity force and raw acceleration. * * @param r * roll @@ -69,11 +77,18 @@ public class MotionSensingEvent extends WiimoteEvent{ * gravity force on y axis * @param z * gravity force on z axis + * @param xx + * raw acceleration on x axis + * @param yy + * raw acceleration on y axis + * @param zz + * raw acceleration on z axis */ private void setOrientationAndGforce(float r, float p, float ya, float x, - float y, float z) { + float y, float z, short xx, short yy, short zz) { this.orientation = new Orientation(r, p, ya); this.gforce = new GForce(x, y, z); + this.acceleration = new RawAcceleration(xx, yy, zz); } /** @@ -91,6 +106,15 @@ public class MotionSensingEvent extends WiimoteEvent{ public GForce getGforce() { return gforce; } + + /** + * Get the raw acceleration. + * + * @return the raw acceleration + */ + public RawAcceleration getRawAcceleration() { + return acceleration; + } @Override public String toString() { @@ -100,6 +124,7 @@ public class MotionSensingEvent extends WiimoteEvent{ out += "--- Motion sensing : true \n"; out += "--- " + orientation + "\n"; out += "--- " + gforce + "\n"; + out += "--- " + acceleration + "\n"; return out; } } diff --git a/WiiUseJ/src/wiiusej/wiiuseapievents/StatusEvent.java b/WiiUseJ/src/wiiusej/wiiuseapievents/StatusEvent.java index e45410c..7367ced 100644 --- a/WiiUseJ/src/wiiusej/wiiuseapievents/StatusEvent.java +++ b/WiiUseJ/src/wiiusej/wiiuseapievents/StatusEvent.java @@ -153,6 +153,54 @@ public class StatusEvent extends WiiUseApiEvent { public short getLeds() { return leds; } + + /** + * Get led1 status. + * @return true if the led is set. + */ + public boolean isLed1Set(){ + if ((leds & WIIMOTE_LED_1) > 0){ + return true; + }else{ + return false; + } + } + + /** + * Get led2 status. + * @return true if the led is set. + */ + public boolean isLed2Set(){ + if ((leds & WIIMOTE_LED_2) > 0){ + return true; + }else{ + return false; + } + } + + /** + * Get led3 status. + * @return true if the led is set. + */ + public boolean isLed3Set(){ + if ((leds & WIIMOTE_LED_3) > 0){ + return true; + }else{ + return false; + } + } + + /** + * Get led4 status. + * @return true if the led is set. + */ + public boolean isLed4Set(){ + if ((leds & WIIMOTE_LED_4) > 0){ + return true; + }else{ + return false; + } + } /** * Tell if the speaker is enable for this wiimote diff --git a/WiiUseJ/src/wiiusej/wiiuseapievents/WiiUseApiEvent.java b/WiiUseJ/src/wiiusej/wiiuseapievents/WiiUseApiEvent.java index 4c5b032..880c632 100644 --- a/WiiUseJ/src/wiiusej/wiiuseapievents/WiiUseApiEvent.java +++ b/WiiUseJ/src/wiiusej/wiiuseapievents/WiiUseApiEvent.java @@ -25,7 +25,13 @@ public abstract class WiiUseApiEvent extends WiimoteEvent{ public static int GENERIC_EVENT = 1; public static int STATUS_EVENT = 2; - public static int DISCONNECTION_EVENT = 3; + public static int DISCONNECTION_EVENT = 3; + public static int WIIUSE_NUNCHUK_INSERTED = 4; + public static int WIIUSE_NUNCHUK_REMOVED = 5; + public static int WIIUSE_CLASSIC_CTRL_INSERTED = 6; + public static int WIIUSE_CLASSIC_CTRL_REMOVED = 7; + public static int WIIUSE_GUITAR_HERO_3_CTRL_INSERTED = 8; + public static int WIIUSE_GUITAR_HERO_3_CTRL_REMOVED = 9; /* Event Type */ private int eventType; diff --git a/WiiUseJ/src/wiiusej/wiiuseapirequest/IntValueRequest.java b/WiiUseJ/src/wiiusej/wiiuseapirequest/IntValueRequest.java index b2a9a14..801093d 100644 --- a/WiiUseJ/src/wiiusej/wiiuseapirequest/IntValueRequest.java +++ b/WiiUseJ/src/wiiusej/wiiuseapirequest/IntValueRequest.java @@ -26,7 +26,8 @@ public class IntValueRequest extends WiiUseApiRequest { private int intValue; /** - * Constructor setting the id of the wiimote concerned. + * Constructor setting the id of the wiimote + * concerned and the type of the request. * * @param id * the id of the wiimote concerned. @@ -36,14 +37,16 @@ public class IntValueRequest extends WiiUseApiRequest { } /** - * Constructor setting the id of the wiimote concerned. + * Constructor setting the id of the wiimote + * concerned, the type of the request + * and the int value. * * @param id * the id of the wiimote concerned. * @param type * type of the request * @param th - * threshold in degrees + * the int value. */ public IntValueRequest(int id, int type, int th) { super(id, type); diff --git a/WiiUseJ/src/wiiusej/wiiuseapirequest/WiiUseApiRequest.java b/WiiUseJ/src/wiiusej/wiiuseapirequest/WiiUseApiRequest.java index 679213f..1f4525b 100644 --- a/WiiUseJ/src/wiiusej/wiiuseapirequest/WiiUseApiRequest.java +++ b/WiiUseJ/src/wiiusej/wiiuseapirequest/WiiUseApiRequest.java @@ -40,6 +40,11 @@ public class WiiUseApiRequest { public static int WIIUSE_ACCEL_THRESHOLHD_REQUEST = 10; public static int WIIUSE_ALPHA_SMOOTHING_REQUEST = 11; public static int WIIUSE_RESYNC = 12; + public static int WIIUSE_ASPECT_RATIO_4_3 = 13; + public static int WIIUSE_ASPECT_RATIO_16_9 = 14; + public static int WIIUSE_SENSOR_BAR_ABOVE = 15; + public static int WIIUSE_SENSOR_BAR_BELOW = 16; + public static int WIIUSE_SET_VIRTUAL_RESOLUTION = 17; private int wiimoteId = 0; private int requestType = 0;