From 4f3ae569cda0daf58a9c67d767856556353e13d1 Mon Sep 17 00:00:00 2001 From: "guilhem.duche" Date: Thu, 5 Jun 2008 17:46:57 +0000 Subject: [PATCH] starting to add classic controller and guitar hero controller support git-svn-id: http://wiiusej.googlecode.com/svn/trunk@177 ae48ae66-6a45-0410-b38e-211266189506 --- .../ClassicControllerInsertedEvent.java | 46 ++++++++++++++++++ .../ClassicControllerRemovedEvent.java | 47 +++++++++++++++++++ .../GuitarHeroInsertedEvent.java | 47 +++++++++++++++++++ .../GuitarHeroRemovedEvent.java | 47 +++++++++++++++++++ 4 files changed, 187 insertions(+) create mode 100644 WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/ClassicControllerInsertedEvent.java create mode 100644 WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/ClassicControllerRemovedEvent.java create mode 100644 WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/GuitarHeroInsertedEvent.java create mode 100644 WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/GuitarHeroRemovedEvent.java diff --git a/WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/ClassicControllerInsertedEvent.java b/WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/ClassicControllerInsertedEvent.java new file mode 100644 index 0000000..5480c04 --- /dev/null +++ b/WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/ClassicControllerInsertedEvent.java @@ -0,0 +1,46 @@ +/** + * 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.wiiusejevents.wiiuseapievents; + +/** + * Event that represents the connection of a classic controller to a wiimote. + * + * @author guiguito + * + */ +public class ClassicControllerInsertedEvent extends WiiUseApiEvent { + + /** + * Construct the ClassicControllerInsertedEvent setting up the id. + * + * @param id + * id of the wiimote. + */ + public ClassicControllerInsertedEvent(int id) { + super(id, WIIUSE_CLASSIC_CTRL_INSERTED); + } + + @Override + public String toString() { + String out = ""; + /* Status */ + out += "/*********** CLASSIC CONTROLLER INSERTED EVENT : WIIMOTE ID :" + + super.getWiimoteId() + " ********/\n"; + return out; + } + +} diff --git a/WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/ClassicControllerRemovedEvent.java b/WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/ClassicControllerRemovedEvent.java new file mode 100644 index 0000000..c0c72b2 --- /dev/null +++ b/WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/ClassicControllerRemovedEvent.java @@ -0,0 +1,47 @@ +/** + * 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.wiiusejevents.wiiuseapievents; + +/** + * Event that represents the disconnection of a classic controller from a + * wiimote. + * + * @author guiguito + * + */ +public class ClassicControllerRemovedEvent extends WiiUseApiEvent { + + /** + * Construct the ClassicControllerRemovedEvent setting up the id. + * + * @param id + * id of the wiimote. + */ + public ClassicControllerRemovedEvent(int id) { + super(id, WIIUSE_CLASSIC_CTRL_REMOVED); + } + + @Override + public String toString() { + String out = ""; + /* Status */ + out += "/*********** CLASSIC CONTROLLER REMOVED EVENT : WIIMOTE ID :" + + super.getWiimoteId() + " ********/\n"; + return out; + } + +} diff --git a/WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/GuitarHeroInsertedEvent.java b/WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/GuitarHeroInsertedEvent.java new file mode 100644 index 0000000..18eda40 --- /dev/null +++ b/WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/GuitarHeroInsertedEvent.java @@ -0,0 +1,47 @@ +/** + * 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.wiiusejevents.wiiuseapievents; + +/** + * Event that represents the connection of a Guitar hero controller to a + * wiimote. + * + * @author guiguito + * + */ +public class GuitarHeroInsertedEvent extends WiiUseApiEvent { + + /** + * Construct the GuitarHeroInsertedEvent setting up the id. + * + * @param id + * id of the wiimote. + */ + public GuitarHeroInsertedEvent(int id) { + super(id, WIIUSE_GUITAR_HERO_3_CTRL_INSERTED); + } + + @Override + public String toString() { + String out = ""; + /* Status */ + out += "/*********** GUITAR HERO INSERTED EVENT : WIIMOTE ID :" + + super.getWiimoteId() + " ********/\n"; + return out; + } + +} diff --git a/WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/GuitarHeroRemovedEvent.java b/WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/GuitarHeroRemovedEvent.java new file mode 100644 index 0000000..e5ab258 --- /dev/null +++ b/WiiUseJ/src/wiiusej/wiiusejevents/wiiuseapievents/GuitarHeroRemovedEvent.java @@ -0,0 +1,47 @@ +/** + * 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.wiiusejevents.wiiuseapievents; + +/** + * Event that represents the disconnection of a guitar hero controller from a + * wiimote. + * + * @author guiguito + * + */ +public class GuitarHeroRemovedEvent extends WiiUseApiEvent { + + /** + * Construct the GuitarHeroRemovedEvent setting up the id. + * + * @param id + * id of the wiimote. + */ + public GuitarHeroRemovedEvent(int id) { + super(id, WIIUSE_GUITAR_HERO_3_CTRL_REMOVED); + } + + @Override + public String toString() { + String out = ""; + /* Status */ + out += "/*********** GUITAR HERO REMOVED EVENT : WIIMOTE ID :" + + super.getWiimoteId() + " ********/\n"; + return out; + } + +}