# HG changeset patch # User bastiena # Date 1334237605 -7200 # Node ID 9ccef81f02ab58cba8e06a23e4190c17c7b513ef # Parent 6c08d4d7219e4de641db2a3d6ffd1b5b361727e2 Charset set to UTF-8 without bom tab replaced by 4 spaces \r\n replaced by \n in non cs files diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/TestClient/Program.cs --- a/front_idill/extern/TestClient/Program.cs Thu Apr 12 13:09:46 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace TestClient -{ - class Program - { - static void Main(string[] args) - { - } - } -} diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/TestClient/Properties/AssemblyInfo.cs --- a/front_idill/extern/TestClient/Properties/AssemblyInfo.cs Thu Apr 12 13:09:46 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TestClient")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TestClient")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("8f32aa72-b821-4da2-86c1-cb32c9bca196")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/TestClient/TestClient.csproj --- a/front_idill/extern/TestClient/TestClient.csproj Thu Apr 12 13:09:46 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - 8f32aa72-b821-4da2-86c1-cb32c9bca196 - Exe - Properties - TestClient - TestClient - v4.0 - Client - 512 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/English.lproj/InfoPlist.strings Binary file front_idill/extern/fajran-npTuioClient/English.lproj/InfoPlist.strings has changed diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/Makefile --- a/front_idill/extern/fajran-npTuioClient/Makefile Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/Makefile Thu Apr 12 15:33:25 2012 +0200 @@ -1,18 +1,18 @@ SRC= \ - ./TuioClient/oscpack/ip/IpEndpointName.cpp \ - ./TuioClient/oscpack/ip/posix/UdpSocket.cpp \ - ./TuioClient/oscpack/ip/posix/NetworkingUtils.cpp \ - ./TuioClient/oscpack/osc/OscPrintReceivedElements.cpp \ - ./TuioClient/oscpack/osc/OscReceivedElements.cpp \ - ./TuioClient/oscpack/osc/OscTypes.cpp \ - ./TuioClient/oscpack/osc/OscOutboundPacketStream.cpp \ - ./TuioClient/TuioClient.cpp \ - ./src/npn_gate.cpp \ - ./src/npp_gate.cpp \ - ./src/client.cpp \ - ./src/np_entry.cpp \ - ./src/plugin.cpp + ./TuioClient/oscpack/ip/IpEndpointName.cpp \ + ./TuioClient/oscpack/ip/posix/UdpSocket.cpp \ + ./TuioClient/oscpack/ip/posix/NetworkingUtils.cpp \ + ./TuioClient/oscpack/osc/OscPrintReceivedElements.cpp \ + ./TuioClient/oscpack/osc/OscReceivedElements.cpp \ + ./TuioClient/oscpack/osc/OscTypes.cpp \ + ./TuioClient/oscpack/osc/OscOutboundPacketStream.cpp \ + ./TuioClient/TuioClient.cpp \ + ./src/npn_gate.cpp \ + ./src/npp_gate.cpp \ + ./src/client.cpp \ + ./src/np_entry.cpp \ + ./src/plugin.cpp CC=g++ BIN=npTuioClient.so @@ -23,8 +23,8 @@ all : ${BIN} clean : - rm ${BIN} + rm ${BIN} ${BIN} : ${SRC} - ${CC} -o $@ -shared ${CFLAGS} ${LDFLAGS} $+ + ${CC} -o $@ -shared ${CFLAGS} ${LDFLAGS} $+ diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TestClient/Test.cpp --- a/front_idill/extern/fajran-npTuioClient/TestClient/Test.cpp Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TestClient/Test.cpp Thu Apr 12 15:33:25 2012 +0200 @@ -1,34 +1,38 @@ -#include -#include -#include -#include - -using namespace std; - -int main(int argc, char ** argv) -{ - /* get handle to dll */ - HINSTANCE hGetProcIDDLL = LoadLibrary((LPCWSTR)"npTuioClient.dll"); - - /* get pointer to the function in the dll*/ - FARPROC lpfnGetProcessID = GetProcAddress(HMODULE (hGetProcIDDLL),"tuio_start"); - FARPROC lpfnGetProcessID2 = GetProcAddress(HMODULE (hGetProcIDDLL),"tuio_stop"); +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to debug this project. +*/ - /* - Define the Function in the DLL for reuse. This is just prototyping the dll's function. - A mock of it. Use "stdcall" for maximum compatibility. - */ - typedef int (__stdcall * pICFUNC)(void); - - pICFUNC t; - t = pICFUNC(lpfnGetProcessID); - - /* The actual call to the function contained in the dll */ - t(); - - /* Release the Dll */ - FreeLibrary(hGetProcIDDLL); - - system("PAUSE"); - return 0; +#include +#include +#include +#include + +using namespace std; + +int main(int argc, char ** argv) +{ + /* get handle to dll */ + HINSTANCE hGetProcIDDLL = LoadLibrary((LPCWSTR)"npTuioClient.dll"); + + /* get pointer to the function in the dll*/ + FARPROC lpfnGetProcessID = GetProcAddress(HMODULE (hGetProcIDDLL),"tuio_start"); + FARPROC lpfnGetProcessID2 = GetProcAddress(HMODULE (hGetProcIDDLL),"tuio_stop"); + + /* + Define the Function in the DLL for reuse. This is just prototyping the dll's function. + A mock of it. Use "stdcall" for maximum compatibility. + */ + typedef int (__stdcall * pICFUNC)(void); + + pICFUNC t; + t = pICFUNC(lpfnGetProcessID); + + /* The actual call to the function contained in the dll */ + t(); + + /* Release the Dll */ + FreeLibrary(hGetProcIDDLL); + + system("PAUSE"); + return 0; } \ No newline at end of file diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/TuioClient.cpp --- a/front_idill/extern/fajran-npTuioClient/TuioClient/TuioClient.cpp Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/TuioClient.cpp Thu Apr 12 15:33:25 2012 +0200 @@ -1,8 +1,8 @@ /* - TUIO C++ Library - part of the reacTIVision project - http://reactivision.sourceforge.net/ + TUIO C++ Library - part of the reacTIVision project + http://reactivision.sourceforge.net/ - Copyright (c) 2005-2008 Martin Kaltenbrunner + Copyright (c) 2005-2008 Martin Kaltenbrunner This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,6 +19,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ + #include "TuioClient.h" #ifndef WIN32 @@ -27,613 +31,613 @@ static DWORD WINAPI ThreadFunc( LPVOID obj ) #endif { - static_cast(obj)->socket->Run(); - return 0; + static_cast(obj)->socket->Run(); + return 0; }; using namespace std; - + TuioClient::TuioClient() { - TuioClient(3333); + TuioClient(3333); } TuioClient::TuioClient(int port) { - try { - socket = new UdpListeningReceiveSocket(IpEndpointName( IpEndpointName::ANY_ADDRESS, port ), this ); - } catch (std::exception &e) { - std::cout << "could not bind to UDP port " << port << std::endl; - socket = NULL; - } - - if (socket!=NULL) { - if (!socket->IsBound()) { - delete socket; - socket = NULL; - } else std::cout << "listening to TUIO messages on UDP port " << port << std::endl; - } + try { + socket = new UdpListeningReceiveSocket(IpEndpointName( IpEndpointName::ANY_ADDRESS, port ), this ); + } catch (std::exception &e) { + std::cout << "could not bind to UDP port " << port << std::endl; + socket = NULL; + } + + if (socket!=NULL) { + if (!socket->IsBound()) { + delete socket; + socket = NULL; + } else std::cout << "listening to TUIO messages on UDP port " << port << std::endl; + } - locked = false; - running = false; - currentFrame = lastFrame = maxFingerID = maxStringID = -1; + locked = false; + running = false; + currentFrame = lastFrame = maxFingerID = maxStringID = -1; } TuioClient::~TuioClient() { - delete socket; + delete socket; } void TuioClient::ProcessBundle( const ReceivedBundle& b, const IpEndpointName& remoteEndpoint) { - for( ReceivedBundle::const_iterator i = b.ElementsBegin(); i != b.ElementsEnd(); ++i ){ - if( i->IsBundle() ) - ProcessBundle( ReceivedBundle(*i), remoteEndpoint); - else - ProcessMessage( ReceivedMessage(*i), remoteEndpoint); - } + for( ReceivedBundle::const_iterator i = b.ElementsBegin(); i != b.ElementsEnd(); ++i ){ + if( i->IsBundle() ) + ProcessBundle( ReceivedBundle(*i), remoteEndpoint); + else + ProcessMessage( ReceivedMessage(*i), remoteEndpoint); + } } void TuioClient::ProcessMessage( const ReceivedMessage& msg, const IpEndpointName& remoteEndpoint) { - try - { - ReceivedMessageArgumentStream args = msg.ArgumentStream(); - ReceivedMessage::const_iterator arg = msg.ArgumentsBegin(); + try + { + ReceivedMessageArgumentStream args = msg.ArgumentStream(); + ReceivedMessage::const_iterator arg = msg.ArgumentsBegin(); - if( strcmp( msg.AddressPattern(), "/tuio/2Dobj" ) == 0 ) - { - const char* cmd; - args >> cmd; - - if( strcmp( cmd, "set" ) == 0 ) - { - if ((currentFrame0)) return; + if( strcmp( msg.AddressPattern(), "/tuio/2Dobj" ) == 0 ) + { + const char* cmd; + args >> cmd; + + if( strcmp( cmd, "set" ) == 0 ) + { + if ((currentFrame0)) return; - int32 s_id, f_id; - float xpos, ypos, angle, xspeed, yspeed, rspeed, maccel, raccel; + int32 s_id, f_id; + float xpos, ypos, angle, xspeed, yspeed, rspeed, maccel, raccel; - args >> s_id >> f_id >> xpos >> ypos >> angle >> xspeed >> yspeed >> rspeed >> maccel >> raccel >> EndMessage; + args >> s_id >> f_id >> xpos >> ypos >> angle >> xspeed >> yspeed >> rspeed >> maccel >> raccel >> EndMessage; - std::list::iterator tobj; - for (tobj=objectList.begin(); tobj!= objectList.end(); tobj++) - if((*tobj)->getSessionID()==(long)s_id) break; + std::list::iterator tobj; + for (tobj=objectList.begin(); tobj!= objectList.end(); tobj++) + if((*tobj)->getSessionID()==(long)s_id) break; - if (tobj == objectList.end()) - { + if (tobj == objectList.end()) + { - TuioObject *addObject = new TuioObject((long)s_id,(int)f_id,xpos,ypos,angle); - objectList.push_back(addObject); - - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->addTuioObject(addObject); + TuioObject *addObject = new TuioObject((long)s_id,(int)f_id,xpos,ypos,angle); + objectList.push_back(addObject); + + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->addTuioObject(addObject); - } - else if ( ((*tobj)->getX()!=xpos) || ((*tobj)->getY()!=ypos) || ((*tobj)->getAngle()!=angle) || ((*tobj)->getXSpeed()!=xspeed) || ((*tobj)->getYSpeed()!=yspeed) || ((*tobj)->getRotationSpeed()!=rspeed) || ((*tobj)->getMotionAccel()!=maccel) || ((*tobj)->getRotationAccel()!=raccel) ) - { - (*tobj)->update(xpos,ypos,angle,xspeed,yspeed,rspeed,maccel,raccel); + } + else if ( ((*tobj)->getX()!=xpos) || ((*tobj)->getY()!=ypos) || ((*tobj)->getAngle()!=angle) || ((*tobj)->getXSpeed()!=xspeed) || ((*tobj)->getYSpeed()!=yspeed) || ((*tobj)->getRotationSpeed()!=rspeed) || ((*tobj)->getMotionAccel()!=maccel) || ((*tobj)->getRotationAccel()!=raccel) ) + { + (*tobj)->update(xpos,ypos,angle,xspeed,yspeed,rspeed,maccel,raccel); - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->updateTuioObject((*tobj)); - } - } - else if( strcmp( cmd, "alive" ) == 0 ) - { - if ((currentFrame0)) return; + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->updateTuioObject((*tobj)); + } + } + else if( strcmp( cmd, "alive" ) == 0 ) + { + if ((currentFrame0)) return; - int32 s_id; - while(!args.Eos()) - { - args >> s_id; - objectBuffer.push_back((long)s_id); - std::list::iterator iter; - iter = find(aliveObjectList.begin(), aliveObjectList.end(), (long)s_id); - if (iter != aliveObjectList.end()) aliveObjectList.erase(iter); - } - args >> EndMessage; - - std::list::iterator alive_iter; - for (alive_iter=aliveObjectList.begin(); alive_iter != aliveObjectList.end(); alive_iter++) - { - std::list::iterator tobj; - for (tobj=objectList.begin(); tobj!=objectList.end(); tobj++) - { - TuioObject *deleteObject = (*tobj); - if(deleteObject->getSessionID()==*alive_iter) - { - deleteObject->remove(); - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->removeTuioObject(deleteObject); - objectList.erase(tobj); - delete deleteObject; - break; - } - } - } - aliveObjectList = objectBuffer; - objectBuffer.clear(); - } - else if( strcmp( cmd, "fseq" ) == 0 ) - { - if(currentFrame>0) lastFrame = currentFrame; - args >> currentFrame >> EndMessage; + int32 s_id; + while(!args.Eos()) + { + args >> s_id; + objectBuffer.push_back((long)s_id); + std::list::iterator iter; + iter = find(aliveObjectList.begin(), aliveObjectList.end(), (long)s_id); + if (iter != aliveObjectList.end()) aliveObjectList.erase(iter); + } + args >> EndMessage; + + std::list::iterator alive_iter; + for (alive_iter=aliveObjectList.begin(); alive_iter != aliveObjectList.end(); alive_iter++) + { + std::list::iterator tobj; + for (tobj=objectList.begin(); tobj!=objectList.end(); tobj++) + { + TuioObject *deleteObject = (*tobj); + if(deleteObject->getSessionID()==*alive_iter) + { + deleteObject->remove(); + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->removeTuioObject(deleteObject); + objectList.erase(tobj); + delete deleteObject; + break; + } + } + } + aliveObjectList = objectBuffer; + objectBuffer.clear(); + } + else if( strcmp( cmd, "fseq" ) == 0 ) + { + if(currentFrame>0) lastFrame = currentFrame; + args >> currentFrame >> EndMessage; - if ((currentFrame>=lastFrame) || (currentFrame<0)) - { - long currentTime = lastTime; - if (currentFrame>lastFrame) - { - currentTime = getCurrentTime()-startTime; - lastTime = currentTime; - } - - for (std::list::iterator refreshObject=objectList.begin(); refreshObject!=objectList.end(); refreshObject++) - if ((*refreshObject)->getUpdateTime()==TUIO_UNDEFINED) (*refreshObject)->setUpdateTime(currentTime); - - for (std::list::iterator listener=listenerList.begin(); listener!=listenerList.end(); listener++) - (*listener)->refresh(currentTime); - } - } - } - else if( strcmp( msg.AddressPattern(), "/tuio/3Dcur" ) == 0 ) - { - const char* cmd; - args >> cmd; - - if( strcmp( cmd, "set" ) == 0 ) - { - if ((currentFrame0)) return; + if ((currentFrame>=lastFrame) || (currentFrame<0)) + { + long currentTime = lastTime; + if (currentFrame>lastFrame) + { + currentTime = getCurrentTime()-startTime; + lastTime = currentTime; + } + + for (std::list::iterator refreshObject=objectList.begin(); refreshObject!=objectList.end(); refreshObject++) + if ((*refreshObject)->getUpdateTime()==TUIO_UNDEFINED) (*refreshObject)->setUpdateTime(currentTime); + + for (std::list::iterator listener=listenerList.begin(); listener!=listenerList.end(); listener++) + (*listener)->refresh(currentTime); + } + } + } + else if( strcmp( msg.AddressPattern(), "/tuio/3Dcur" ) == 0 ) + { + const char* cmd; + args >> cmd; + + if( strcmp( cmd, "set" ) == 0 ) + { + if ((currentFrame0)) return; - int32 s_id; - float xpos, ypos, zpos, xspeed, yspeed, maccel; - //Modifié par alexandre.bastien@iri.centrepompidou.fr - args >> s_id >> xpos >> ypos >> zpos >> xspeed >> yspeed >> maccel >> EndMessage; - std::list::iterator tcur; - for (tcur=cursorList.begin(); tcur != cursorList.end(); tcur++) - if((*tcur)->getSessionID()==(long)s_id) break; + int32 s_id; + float xpos, ypos, zpos, xspeed, yspeed, maccel; + //Modifié par alexandre.bastien@iri.centrepompidou.fr + args >> s_id >> xpos >> ypos >> zpos >> xspeed >> yspeed >> maccel >> EndMessage; + std::list::iterator tcur; + for (tcur=cursorList.begin(); tcur != cursorList.end(); tcur++) + if((*tcur)->getSessionID()==(long)s_id) break; - if (tcur == cursorList.end()) - { - int f_id = (int)cursorList.size(); - if ((int)(cursorList.size())<=maxFingerID) - { - std::list::iterator closestCursor = freeCursorList.begin(); - //Modifié par alexandre.bastien@iri.centrepompidou.fr - for(std::list::iterator testCursor = freeCursorList.begin();testCursor!= freeCursorList.end(); testCursor++) - { - if((*testCursor)->getDistance(xpos,ypos,zpos)<(*closestCursor)->getDistance(xpos,ypos,zpos)) closestCursor = testCursor; - } - f_id = (*closestCursor)->getFingerID(); - freeCursorList.erase(closestCursor); - delete *closestCursor; - } - else maxFingerID = f_id; - //Modifié par alexandre.bastien@iri.centrepompidou.fr - TuioCursor *addCursor = new TuioCursor((long)s_id,f_id,xpos,ypos,zpos); - cursorList.push_back(addCursor); - - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->addTuioCursor(addCursor); - - //Modifié par alexandre.bastien@iri.centrepompidou.fr - } - else if ( ((*tcur)->getX()!=xpos) || ((*tcur)->getY()!=ypos) || ((*tcur)->getZ()!=zpos) || ((*tcur)->getXSpeed()!=xspeed) || ((*tcur)->getYSpeed()!=yspeed) || ((*tcur)->getMotionAccel()!=maccel) ) - { - (*tcur)->update(xpos,ypos,zpos,xspeed,yspeed,maccel); - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->updateTuioCursor((*tcur)); - } - } - else if( strcmp( cmd, "alive" ) == 0 ) - { - if ((currentFrame0)) return; + if (tcur == cursorList.end()) + { + int f_id = (int)cursorList.size(); + if ((int)(cursorList.size())<=maxFingerID) + { + std::list::iterator closestCursor = freeCursorList.begin(); + //Modifié par alexandre.bastien@iri.centrepompidou.fr + for(std::list::iterator testCursor = freeCursorList.begin();testCursor!= freeCursorList.end(); testCursor++) + { + if((*testCursor)->getDistance(xpos,ypos,zpos)<(*closestCursor)->getDistance(xpos,ypos,zpos)) closestCursor = testCursor; + } + f_id = (*closestCursor)->getFingerID(); + freeCursorList.erase(closestCursor); + delete *closestCursor; + } + else maxFingerID = f_id; + //Modifié par alexandre.bastien@iri.centrepompidou.fr + TuioCursor *addCursor = new TuioCursor((long)s_id,f_id,xpos,ypos,zpos); + cursorList.push_back(addCursor); + + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->addTuioCursor(addCursor); + + //Modifié par alexandre.bastien@iri.centrepompidou.fr + } + else if ( ((*tcur)->getX()!=xpos) || ((*tcur)->getY()!=ypos) || ((*tcur)->getZ()!=zpos) || ((*tcur)->getXSpeed()!=xspeed) || ((*tcur)->getYSpeed()!=yspeed) || ((*tcur)->getMotionAccel()!=maccel) ) + { + (*tcur)->update(xpos,ypos,zpos,xspeed,yspeed,maccel); + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->updateTuioCursor((*tcur)); + } + } + else if( strcmp( cmd, "alive" ) == 0 ) + { + if ((currentFrame0)) return; - int32 s_id; - while(!args.Eos()) - { - args >> s_id; - cursorBuffer.push_back((long)s_id); - std::list::iterator iter; - iter = find(aliveCursorList.begin(), aliveCursorList.end(), (long)s_id); - if (iter != aliveCursorList.end()) aliveCursorList.erase(iter); - } - args >> EndMessage; - std::list::iterator alive_iter; - for (alive_iter=aliveCursorList.begin(); alive_iter != aliveCursorList.end(); alive_iter++) - { - std::list::iterator tcur; - for (tcur=cursorList.begin(); tcur != cursorList.end(); tcur++) - { - TuioCursor *deleteCursor = (*tcur); - if(deleteCursor->getSessionID()==*alive_iter) - { - cursorList.erase(tcur); - deleteCursor->remove(); - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->removeTuioCursor(deleteCursor); - - if (deleteCursor->getFingerID()==maxFingerID) - { - maxFingerID = -1; - delete deleteCursor; - - if (cursorList.size()>0) - { - std::list::iterator clist; - for (clist=cursorList.begin(); clist != cursorList.end(); clist++) - { - int f_id = (*clist)->getFingerID(); - if (f_id>maxFingerID) maxFingerID=f_id; - } - std::list::iterator flist; - for (flist=freeCursorList.begin(); flist != freeCursorList.end(); flist++) - { - TuioCursor *freeCursor = (*flist); - if (freeCursor->getFingerID()>maxFingerID) delete freeCursor; - else freeCursorBuffer.push_back(freeCursor); - } - freeCursorList = freeCursorBuffer; - freeCursorBuffer.clear(); - } - } - else if (deleteCursor->getFingerID()0) lastFrame = currentFrame; - args >> currentFrame >> EndMessage; + int32 s_id; + while(!args.Eos()) + { + args >> s_id; + cursorBuffer.push_back((long)s_id); + std::list::iterator iter; + iter = find(aliveCursorList.begin(), aliveCursorList.end(), (long)s_id); + if (iter != aliveCursorList.end()) aliveCursorList.erase(iter); + } + args >> EndMessage; + std::list::iterator alive_iter; + for (alive_iter=aliveCursorList.begin(); alive_iter != aliveCursorList.end(); alive_iter++) + { + std::list::iterator tcur; + for (tcur=cursorList.begin(); tcur != cursorList.end(); tcur++) + { + TuioCursor *deleteCursor = (*tcur); + if(deleteCursor->getSessionID()==*alive_iter) + { + cursorList.erase(tcur); + deleteCursor->remove(); + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->removeTuioCursor(deleteCursor); + + if (deleteCursor->getFingerID()==maxFingerID) + { + maxFingerID = -1; + delete deleteCursor; + + if (cursorList.size()>0) + { + std::list::iterator clist; + for (clist=cursorList.begin(); clist != cursorList.end(); clist++) + { + int f_id = (*clist)->getFingerID(); + if (f_id>maxFingerID) maxFingerID=f_id; + } + std::list::iterator flist; + for (flist=freeCursorList.begin(); flist != freeCursorList.end(); flist++) + { + TuioCursor *freeCursor = (*flist); + if (freeCursor->getFingerID()>maxFingerID) delete freeCursor; + else freeCursorBuffer.push_back(freeCursor); + } + freeCursorList = freeCursorBuffer; + freeCursorBuffer.clear(); + } + } + else if (deleteCursor->getFingerID()0) lastFrame = currentFrame; + args >> currentFrame >> EndMessage; - if ((currentFrame>=lastFrame) || (currentFrame<0)) - { - long currentTime = lastTime; - if (currentFrame>lastFrame) - { - currentTime = getCurrentTime()-startTime; - lastTime = currentTime; - } - for (std::list::iterator refreshCursor=cursorList.begin(); refreshCursor!=cursorList.end(); refreshCursor++) - if ((*refreshCursor)->getUpdateTime()==TUIO_UNDEFINED) (*refreshCursor)->setUpdateTime(currentTime); + if ((currentFrame>=lastFrame) || (currentFrame<0)) + { + long currentTime = lastTime; + if (currentFrame>lastFrame) + { + currentTime = getCurrentTime()-startTime; + lastTime = currentTime; + } + for (std::list::iterator refreshCursor=cursorList.begin(); refreshCursor!=cursorList.end(); refreshCursor++) + if ((*refreshCursor)->getUpdateTime()==TUIO_UNDEFINED) (*refreshCursor)->setUpdateTime(currentTime); - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->refresh(currentTime); - } - } - } - else if( strcmp( msg.AddressPattern(), "/tuio/_siP" ) == 0 ) - { - const char* cmd; - args >> cmd; - - if( strcmp( cmd, "set" ) == 0 ) - { - if ((currentFrame0)) return; + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->refresh(currentTime); + } + } + } + else if( strcmp( msg.AddressPattern(), "/tuio/_siP" ) == 0 ) + { + const char* cmd; + args >> cmd; + + if( strcmp( cmd, "set" ) == 0 ) + { + if ((currentFrame0)) return; - int32 s_id; - const char* code; - args >> s_id >> code >> EndMessage; - std::list::iterator tstr; - for (tstr=stringList.begin(); tstr != stringList.end(); tstr++) - if((*tstr)->getSessionID()==(long)s_id) break; + int32 s_id; + const char* code; + args >> s_id >> code >> EndMessage; + std::list::iterator tstr; + for (tstr=stringList.begin(); tstr != stringList.end(); tstr++) + if((*tstr)->getSessionID()==(long)s_id) break; - if (tstr == stringList.end()) - { - int s_id = (int)stringList.size();// - if ((int)(stringList.size())<=maxStringID)// - {// - std::list::iterator closestString = freeStringList.begin();// - //Modifié par alexandre.bastien@iri.centrepompidou.fr + if (tstr == stringList.end()) + { + int s_id = (int)stringList.size();// + if ((int)(stringList.size())<=maxStringID)// + {// + std::list::iterator closestString = freeStringList.begin();// + //Modifié par alexandre.bastien@iri.centrepompidou.fr - //for(std::list::iterator testString = freeStringList.begin();testString!= freeStringList.end(); testString++) - //{ - //if((*testString)->getDistance(xpos,ypos,zpos)<(*closestCursor)->getDistance(xpos,ypos,zpos)) closestCursor = testCursor; - //} - s_id = (*closestString)->getStringID();// - freeStringList.erase(closestString);// - delete *closestString;// - }// - else maxStringID = s_id;// - //Modifié par alexandre.bastien@iri.centrepompidou.fr - TuioString *addString = new TuioString((long)s_id,-1,code); - stringList.push_back(addString); - - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->addTuioString(addString); - - //Modifié par alexandre.bastien@iri.centrepompidou.fr - } - else if ( ((*tstr)->getCode()!=code) ) - { - (*tstr)->update(code); - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->updateTuioString((*tstr)); - } - } - else if( strcmp( cmd, "alive" ) == 0 ) - { - if ((currentFrame0)) return; + //for(std::list::iterator testString = freeStringList.begin();testString!= freeStringList.end(); testString++) + //{ + //if((*testString)->getDistance(xpos,ypos,zpos)<(*closestCursor)->getDistance(xpos,ypos,zpos)) closestCursor = testCursor; + //} + s_id = (*closestString)->getStringID();// + freeStringList.erase(closestString);// + delete *closestString;// + }// + else maxStringID = s_id;// + //Modifié par alexandre.bastien@iri.centrepompidou.fr + TuioString *addString = new TuioString((long)s_id,-1,code); + stringList.push_back(addString); + + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->addTuioString(addString); + + //Modifié par alexandre.bastien@iri.centrepompidou.fr + } + else if ( ((*tstr)->getCode()!=code) ) + { + (*tstr)->update(code); + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->updateTuioString((*tstr)); + } + } + else if( strcmp( cmd, "alive" ) == 0 ) + { + if ((currentFrame0)) return; - int32 s_id; - while(!args.Eos()) - { - args >> s_id; - stringBuffer.push_back((long)s_id); - std::list::iterator iter; - iter = find(aliveStringList.begin(), aliveStringList.end(), (long)s_id); - if (iter != aliveStringList.end()) aliveStringList.erase(iter); - } - args >> EndMessage; - std::list::iterator alive_iter; - for (alive_iter=aliveStringList.begin(); alive_iter != aliveStringList.end(); alive_iter++) - { - std::list::iterator tstr; - for (tstr=stringList.begin(); tstr != stringList.end(); tstr++) - { - TuioString *deleteString = (*tstr); - if(deleteString->getSessionID()==*alive_iter) - { - stringList.erase(tstr); - deleteString->remove(); - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->removeTuioString(deleteString); - - if (deleteString->getStringID()==maxStringID)// - {// - maxStringID = -1;// - delete deleteString; - - if (stringList.size()>0) - { - std::list::iterator clist;// - for (clist=stringList.begin(); clist != stringList.end(); clist++)// - {// - int s_id = (*clist)->getStringID();// - if (s_id>maxStringID) maxStringID=s_id;// - }// - std::list::iterator flist; - for (flist=freeStringList.begin(); flist != freeStringList.end(); flist++) - { - TuioString *freeString = (*flist); - if (freeString->getStringID()>maxStringID) delete freeString;// - else freeStringBuffer.push_back(freeString);// - freeStringBuffer.push_back(freeString); - } - freeStringList = freeStringBuffer; - freeStringBuffer.clear(); - } - }// - else if (deleteString->getStringID()0) lastFrame = currentFrame; - args >> currentFrame >> EndMessage; + int32 s_id; + while(!args.Eos()) + { + args >> s_id; + stringBuffer.push_back((long)s_id); + std::list::iterator iter; + iter = find(aliveStringList.begin(), aliveStringList.end(), (long)s_id); + if (iter != aliveStringList.end()) aliveStringList.erase(iter); + } + args >> EndMessage; + std::list::iterator alive_iter; + for (alive_iter=aliveStringList.begin(); alive_iter != aliveStringList.end(); alive_iter++) + { + std::list::iterator tstr; + for (tstr=stringList.begin(); tstr != stringList.end(); tstr++) + { + TuioString *deleteString = (*tstr); + if(deleteString->getSessionID()==*alive_iter) + { + stringList.erase(tstr); + deleteString->remove(); + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->removeTuioString(deleteString); + + if (deleteString->getStringID()==maxStringID)// + {// + maxStringID = -1;// + delete deleteString; + + if (stringList.size()>0) + { + std::list::iterator clist;// + for (clist=stringList.begin(); clist != stringList.end(); clist++)// + {// + int s_id = (*clist)->getStringID();// + if (s_id>maxStringID) maxStringID=s_id;// + }// + std::list::iterator flist; + for (flist=freeStringList.begin(); flist != freeStringList.end(); flist++) + { + TuioString *freeString = (*flist); + if (freeString->getStringID()>maxStringID) delete freeString;// + else freeStringBuffer.push_back(freeString);// + freeStringBuffer.push_back(freeString); + } + freeStringList = freeStringBuffer; + freeStringBuffer.clear(); + } + }// + else if (deleteString->getStringID()0) lastFrame = currentFrame; + args >> currentFrame >> EndMessage; - if ((currentFrame>=lastFrame) || (currentFrame<0)) - { - long currentTime = lastTime; - if (currentFrame>lastFrame) - { - currentTime = getCurrentTime()-startTime; - lastTime = currentTime; - } - for (std::list::iterator refreshString=stringList.begin(); refreshString!=stringList.end(); refreshString++) - if ((*refreshString)->getUpdateTime()==TUIO_UNDEFINED) (*refreshString)->setUpdateTime(currentTime); + if ((currentFrame>=lastFrame) || (currentFrame<0)) + { + long currentTime = lastTime; + if (currentFrame>lastFrame) + { + currentTime = getCurrentTime()-startTime; + lastTime = currentTime; + } + for (std::list::iterator refreshString=stringList.begin(); refreshString!=stringList.end(); refreshString++) + if ((*refreshString)->getUpdateTime()==TUIO_UNDEFINED) (*refreshString)->setUpdateTime(currentTime); - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->refresh(currentTime); - } - } - } - //Ajouté par alexandre.bastien@iri.centrepompidou.fr - /*else if( strcmp( msg.AddressPattern(), "/tuio/_siP" ) == 0 ) - { - const char* cmd; - args >> cmd; - - if( strcmp( cmd, "set" ) == 0 ) - { - if ((currentFrame0)) return; - int32 s_id; - const char* code; - args >> s_id >> code >> EndMessage; - std::list::iterator tstr; - for (tstr=stringList.begin(); tstr != stringList.end(); tstr++) - if((*tstr)->getSessionID()==(long)s_id) break; + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->refresh(currentTime); + } + } + } + //Ajouté par alexandre.bastien@iri.centrepompidou.fr + /*else if( strcmp( msg.AddressPattern(), "/tuio/_siP" ) == 0 ) + { + const char* cmd; + args >> cmd; + + if( strcmp( cmd, "set" ) == 0 ) + { + if ((currentFrame0)) return; + int32 s_id; + const char* code; + args >> s_id >> code >> EndMessage; + std::list::iterator tstr; + for (tstr=stringList.begin(); tstr != stringList.end(); tstr++) + if((*tstr)->getSessionID()==(long)s_id) break; - if (tstr == stringList.end()) - { - TuioString *addString = new TuioString((long)s_id,code); - stringList.push_back(addString); - - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->addTuioString(addString); - - - } - else if ( ((*tstr)->getCode()!=code) ) - { - (*tstr)->update(code); - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->updateTuioString((*tstr)); - } - } - else if( strcmp( cmd, "alive" ) == 0 ) - { - if ((currentFrame0)) return; - - int32 s_id; - while(!args.Eos()) - { - args >> s_id; - stringBuffer.push_back((long)s_id); - std::list::iterator iter; - iter = find(aliveStringList.begin(), aliveStringList.end(), (long)s_id); - if (iter != aliveStringList.end()) aliveStringList.erase(iter); - } - args >> EndMessage; - - std::list::iterator alive_iter; - for (alive_iter=aliveStringList.begin(); alive_iter != aliveStringList.end(); alive_iter++) - { - std::list::iterator tstr; - for (tstr=stringList.begin(); tstr != stringList.end(); tstr++) - { - TuioString *deleteString = (*tstr); - if(deleteString->getSessionID()==*alive_iter) - { - stringList.erase(tstr); - deleteString->remove(); - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->removeTuioString(deleteString); - - if (stringList.size()>0) - { - std::list::iterator flist; - for (flist=freeStringList.begin(); flist != freeStringList.end(); flist++) - { - TuioString *freeString = (*flist); - } - freeStringList = freeStringBuffer; - freeStringBuffer.clear(); - } - } - break; - } - } - aliveStringList = stringBuffer; - stringBuffer.clear(); - } - else if( strcmp( cmd, "fseq" ) == 0 ) - { - if(currentFrame>0) lastFrame = currentFrame; - args >> currentFrame >> EndMessage; + if (tstr == stringList.end()) + { + TuioString *addString = new TuioString((long)s_id,code); + stringList.push_back(addString); + + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->addTuioString(addString); + + + } + else if ( ((*tstr)->getCode()!=code) ) + { + (*tstr)->update(code); + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->updateTuioString((*tstr)); + } + } + else if( strcmp( cmd, "alive" ) == 0 ) + { + if ((currentFrame0)) return; + + int32 s_id; + while(!args.Eos()) + { + args >> s_id; + stringBuffer.push_back((long)s_id); + std::list::iterator iter; + iter = find(aliveStringList.begin(), aliveStringList.end(), (long)s_id); + if (iter != aliveStringList.end()) aliveStringList.erase(iter); + } + args >> EndMessage; + + std::list::iterator alive_iter; + for (alive_iter=aliveStringList.begin(); alive_iter != aliveStringList.end(); alive_iter++) + { + std::list::iterator tstr; + for (tstr=stringList.begin(); tstr != stringList.end(); tstr++) + { + TuioString *deleteString = (*tstr); + if(deleteString->getSessionID()==*alive_iter) + { + stringList.erase(tstr); + deleteString->remove(); + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->removeTuioString(deleteString); + + if (stringList.size()>0) + { + std::list::iterator flist; + for (flist=freeStringList.begin(); flist != freeStringList.end(); flist++) + { + TuioString *freeString = (*flist); + } + freeStringList = freeStringBuffer; + freeStringBuffer.clear(); + } + } + break; + } + } + aliveStringList = stringBuffer; + stringBuffer.clear(); + } + else if( strcmp( cmd, "fseq" ) == 0 ) + { + if(currentFrame>0) lastFrame = currentFrame; + args >> currentFrame >> EndMessage; - if ((currentFrame>=lastFrame) || (currentFrame<0)) - { - long currentTime = lastTime; - if (currentFrame>lastFrame) - { - currentTime = getCurrentTime()-startTime; - lastTime = currentTime; - } - - for (std::list::iterator refreshString=stringList.begin(); refreshString!=stringList.end(); refreshString++) - if ((*refreshString)->getUpdateTime()==TUIO_UNDEFINED) (*refreshString)->setUpdateTime(currentTime); + if ((currentFrame>=lastFrame) || (currentFrame<0)) + { + long currentTime = lastTime; + if (currentFrame>lastFrame) + { + currentTime = getCurrentTime()-startTime; + lastTime = currentTime; + } + + for (std::list::iterator refreshString=stringList.begin(); refreshString!=stringList.end(); refreshString++) + if ((*refreshString)->getUpdateTime()==TUIO_UNDEFINED) (*refreshString)->setUpdateTime(currentTime); - for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) - (*listener)->refresh(currentTime); - } - } - }*/ - } - catch( Exception& e ) - { - std::cout << "error while parsing message: "<< msg.AddressPattern() << ": " << e.what() << "\n"; - } + for (std::list::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++) + (*listener)->refresh(currentTime); + } + } + }*/ + } + catch( Exception& e ) + { + std::cout << "error while parsing message: "<< msg.AddressPattern() << ": " << e.what() << "\n"; + } } void TuioClient::ProcessPacket( const char *data, int size, const IpEndpointName& remoteEndpoint ) { - if (listenerList.size()==0) return; - ReceivedPacket p( data, size ); - if(p.IsBundle()) ProcessBundle( ReceivedBundle(p), remoteEndpoint); + if (listenerList.size()==0) return; + ReceivedPacket p( data, size ); + if(p.IsBundle()) ProcessBundle( ReceivedBundle(p), remoteEndpoint); else ProcessMessage( ReceivedMessage(p), remoteEndpoint); } void TuioClient::start(bool lk) { - if (socket==NULL) return; + if (socket==NULL) return; - locked = lk; - if (!locked) { - #ifndef WIN32 - pthread_create(&thread , NULL, ThreadFunc, this); - #else - DWORD threadId; - thread = CreateThread( 0, 0, ThreadFunc, this, 0, &threadId ); - #endif - } else socket->Run(); - - startTime = getCurrentTime(); - lastTime = 0; + locked = lk; + if (!locked) { + #ifndef WIN32 + pthread_create(&thread , NULL, ThreadFunc, this); + #else + DWORD threadId; + thread = CreateThread( 0, 0, ThreadFunc, this, 0, &threadId ); + #endif + } else socket->Run(); + + startTime = getCurrentTime(); + lastTime = 0; - running = true; + running = true; } void TuioClient::stop() { - if (socket==NULL) return; - socket->Break(); + if (socket==NULL) return; + socket->Break(); - if (!locked) { - #ifdef WIN32 - if( thread ) CloseHandle( thread ); - #endif - thread = 0; - locked = false; - } - running = false; + if (!locked) { + #ifdef WIN32 + if( thread ) CloseHandle( thread ); + #endif + thread = 0; + locked = false; + } + running = false; } void TuioClient::addTuioListener(TuioListener *listener) { - listenerList.push_back(listener); + listenerList.push_back(listener); } void TuioClient::removeTuioListener(TuioListener *listener) { - std::list::iterator result = find(listenerList.begin(),listenerList.end(),listener); - if (result!=listenerList.end()) listenerList.remove(listener); + std::list::iterator result = find(listenerList.begin(),listenerList.end(),listener); + if (result!=listenerList.end()) listenerList.remove(listener); } TuioObject* TuioClient::getTuioObject(long s_id) { - for (std::list::iterator iter=objectList.begin(); iter != objectList.end(); iter++) - if((*iter)->getSessionID()==s_id) return (*iter); - - return NULL; + for (std::list::iterator iter=objectList.begin(); iter != objectList.end(); iter++) + if((*iter)->getSessionID()==s_id) return (*iter); + + return NULL; } TuioCursor* TuioClient::getTuioCursor(long s_id) { - for (std::list::iterator iter=cursorList.begin(); iter != cursorList.end(); iter++) - if((*iter)->getSessionID()==s_id) return (*iter); - - return NULL; + for (std::list::iterator iter=cursorList.begin(); iter != cursorList.end(); iter++) + if((*iter)->getSessionID()==s_id) return (*iter); + + return NULL; } TuioString* TuioClient::getTuioString(long s_id) { - for (std::list::iterator iter=stringList.begin(); iter != stringList.end(); iter++) - if((*iter)->getSessionID()==s_id) return (*iter); - - return NULL; + for (std::list::iterator iter=stringList.begin(); iter != stringList.end(); iter++) + if((*iter)->getSessionID()==s_id) return (*iter); + + return NULL; } std::list TuioClient::getTuioObjects() { - return objectList; + return objectList; } std::list TuioClient::getTuioCursors() { - return cursorList; + return cursorList; } std::list TuioClient::getTuioStrings() { - return stringList; + return stringList; } long TuioClient::getCurrentTime() { - - #ifdef WIN32 - long timestamp = GetTickCount(); - #else - struct timeval tv; - struct timezone tz; - gettimeofday(&tv,&tz); - long timestamp = (tv.tv_sec*1000)+(tv.tv_usec/1000); - #endif - - return timestamp; + + #ifdef WIN32 + long timestamp = GetTickCount(); + #else + struct timeval tv; + struct timezone tz; + gettimeofday(&tv,&tz); + long timestamp = (tv.tv_sec*1000)+(tv.tv_usec/1000); + #endif + + return timestamp; } diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/TuioClient.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/TuioClient.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/TuioClient.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,8 +1,8 @@ /* - TUIO C++ Library - part of the reacTIVision project - http://reactivision.sourceforge.net/ + TUIO C++ Library - part of the reacTIVision project + http://reactivision.sourceforge.net/ - Copyright (c) 2005-2008 Martin Kaltenbrunner + Copyright (c) 2005-2008 Martin Kaltenbrunner This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,6 +19,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ + #ifndef INCLUDED_TUIOCLIENT_H #define INCLUDED_TUIOCLIENT_H @@ -47,75 +51,75 @@ using namespace osc; class TuioClient : public PacketListener { - - public: - TuioClient(); - TuioClient(int p); - ~TuioClient(); + + public: + TuioClient(); + TuioClient(int p); + ~TuioClient(); - void start(bool lk=false); - void stop(); - bool isRunning() { return running; } - - - TuioObject* getTuioObject(long s_id); - TuioCursor* getTuioCursor(long s_id); - /* - * Ajouté par alexandre.bastien@iri.centrepompidou.fr - */ - TuioString* getTuioString(long s_id); - std::list getTuioObjects(); - std::list getTuioCursors(); - /* - * Ajouté par alexandre.bastien@iri.centrepompidou.fr - */ - std::list getTuioStrings(); - - void addTuioListener(TuioListener *listener); - void removeTuioListener(TuioListener *listener); + void start(bool lk=false); + void stop(); + bool isRunning() { return running; } + + + TuioObject* getTuioObject(long s_id); + TuioCursor* getTuioCursor(long s_id); + /* + * Ajouté par alexandre.bastien@iri.centrepompidou.fr + */ + TuioString* getTuioString(long s_id); + std::list getTuioObjects(); + std::list getTuioCursors(); + /* + * Ajouté par alexandre.bastien@iri.centrepompidou.fr + */ + std::list getTuioStrings(); + + void addTuioListener(TuioListener *listener); + void removeTuioListener(TuioListener *listener); - void ProcessPacket( const char *data, int size, const IpEndpointName& remoteEndpoint ); + void ProcessPacket( const char *data, int size, const IpEndpointName& remoteEndpoint ); - UdpListeningReceiveSocket *socket; + UdpListeningReceiveSocket *socket; - protected: - void ProcessBundle( const ReceivedBundle& b, const IpEndpointName& remoteEndpoint); - void ProcessMessage( const ReceivedMessage& m, const IpEndpointName& remoteEndpoint); + protected: + void ProcessBundle( const ReceivedBundle& b, const IpEndpointName& remoteEndpoint); + void ProcessMessage( const ReceivedMessage& m, const IpEndpointName& remoteEndpoint); - private: - std::list listenerList; + private: + std::list listenerList; - std::list objectList; - std::list aliveObjectList, objectBuffer; - std::list cursorList; - std::list aliveCursorList, cursorBuffer; - /* - * Ajouté par alexandre.bastien@iri.centrepompidou.fr - */ - std::list stringList; - std::list aliveStringList, stringBuffer; - - int32 currentFrame, lastFrame; - - long startTime; - long lastTime; - long getCurrentTime(); - - std::list freeCursorList, freeCursorBuffer; - /* - * Ajouté par alexandre.bastien@iri.centrepompidou.fr - */ - std::list freeStringList, freeStringBuffer; - int maxFingerID, maxStringID; - - #ifndef WIN32 - pthread_t thread; - #else - HANDLE thread; - #endif + std::list objectList; + std::list aliveObjectList, objectBuffer; + std::list cursorList; + std::list aliveCursorList, cursorBuffer; + /* + * Ajouté par alexandre.bastien@iri.centrepompidou.fr + */ + std::list stringList; + std::list aliveStringList, stringBuffer; + + int32 currentFrame, lastFrame; + + long startTime; + long lastTime; + long getCurrentTime(); + + std::list freeCursorList, freeCursorBuffer; + /* + * Ajouté par alexandre.bastien@iri.centrepompidou.fr + */ + std::list freeStringList, freeStringBuffer; + int maxFingerID, maxStringID; + + #ifndef WIN32 + pthread_t thread; + #else + HANDLE thread; + #endif - bool locked; - bool running; + bool locked; + bool running; }; #endif /* INCLUDED_TUIOCLIENT_H */ diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/TuioContainer.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/TuioContainer.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/TuioContainer.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,9 +1,9 @@ /* - TUIO C++ Library - part of the reacTIVision project - http://reactivision.sourceforge.net/ + TUIO C++ Library - part of the reacTIVision project + http://reactivision.sourceforge.net/ - Copyright (c) 2005-2008 Martin Kaltenbrunner - + Copyright (c) 2005-2008 Martin Kaltenbrunner + This program 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 2 of the License, or @@ -19,6 +19,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ + #ifndef INCLUDED_TUIOCONTAINER_H #define INCLUDED_TUIOCONTAINER_H @@ -33,132 +37,132 @@ class TuioContainer: public TuioPoint { - protected: - long session_id; - float xpos, ypos, zpos; - float x_speed, y_speed; - float motion_speed, motion_accel; - std::list path; - - int state; - - public: - TuioContainer (long s_id, float xpos, float ypos):TuioPoint(xpos,ypos) { - this->session_id = s_id; - this->x_speed = 0.0f; - this->y_speed = 0.0f; - this->motion_speed = 0.0f; - this->motion_accel = 0.0f; - TuioPoint p(xpos,ypos); - path.push_back(p); - - state = TUIO_ADDED; - }; + protected: + long session_id; + float xpos, ypos, zpos; + float x_speed, y_speed; + float motion_speed, motion_accel; + std::list path; + + int state; + + public: + TuioContainer (long s_id, float xpos, float ypos):TuioPoint(xpos,ypos) { + this->session_id = s_id; + this->x_speed = 0.0f; + this->y_speed = 0.0f; + this->motion_speed = 0.0f; + this->motion_accel = 0.0f; + TuioPoint p(xpos,ypos); + path.push_back(p); + + state = TUIO_ADDED; + }; - /* - * Surchargé par alexandre.bastien@iri.centrepompidou.fr - */ - TuioContainer (long s_id, float xpos, float ypos, float zpos):TuioPoint(xpos,ypos,zpos) { - this->session_id = s_id; - this->x_speed = 0.0f; - this->y_speed = 0.0f; - this->motion_speed = 0.0f; - this->motion_accel = 0.0f; - TuioPoint p(xpos,ypos,zpos); - path.push_back(p); - - state = TUIO_ADDED; - }; + /* + * Surchargé par alexandre.bastien@iri.centrepompidou.fr + */ + TuioContainer (long s_id, float xpos, float ypos, float zpos):TuioPoint(xpos,ypos,zpos) { + this->session_id = s_id; + this->x_speed = 0.0f; + this->y_speed = 0.0f; + this->motion_speed = 0.0f; + this->motion_accel = 0.0f; + TuioPoint p(xpos,ypos,zpos); + path.push_back(p); + + state = TUIO_ADDED; + }; - /* - * Modifié par alexandre.bastien@iri.centrepompidou.fr - */ - TuioContainer (TuioContainer *tuioContainer):TuioPoint(tuioContainer) { - this->session_id = tuioContainer->getSessionID(); - this->x_speed = 0.0f; - this->y_speed = 0.0f; - this->motion_speed = 0.0f; - this->motion_accel = 0.0f; - TuioPoint p(xpos,ypos,zpos); - path.push_back(p); - - state = TUIO_ADDED; - }; - - virtual ~TuioContainer(){}; + /* + * Modifié par alexandre.bastien@iri.centrepompidou.fr + */ + TuioContainer (TuioContainer *tuioContainer):TuioPoint(tuioContainer) { + this->session_id = tuioContainer->getSessionID(); + this->x_speed = 0.0f; + this->y_speed = 0.0f; + this->motion_speed = 0.0f; + this->motion_accel = 0.0f; + TuioPoint p(xpos,ypos,zpos); + path.push_back(p); + + state = TUIO_ADDED; + }; + + virtual ~TuioContainer(){}; - virtual void update (float xpos, float ypos,float xspeed, float yspeed,float maccel) { - TuioPoint::update(xpos, ypos); - this->x_speed = xspeed; - this->y_speed = yspeed; - this->motion_speed = (float)sqrt(xspeed*xspeed+yspeed*yspeed); - this->motion_accel = maccel; - TuioPoint p(xpos,ypos); - path.push_back(p); - - state = TUIO_UPDATED; - }; + virtual void update (float xpos, float ypos,float xspeed, float yspeed,float maccel) { + TuioPoint::update(xpos, ypos); + this->x_speed = xspeed; + this->y_speed = yspeed; + this->motion_speed = (float)sqrt(xspeed*xspeed+yspeed*yspeed); + this->motion_accel = maccel; + TuioPoint p(xpos,ypos); + path.push_back(p); + + state = TUIO_UPDATED; + }; - /* - * Surchargé par alexandre.bastien@iri.centrepompidou.fr - */ - virtual void update (float xpos, float ypos, float zpos, float xspeed, float yspeed,float maccel) { - TuioPoint::update(xpos, ypos, zpos); - this->x_speed = xspeed; - this->y_speed = yspeed; - this->motion_speed = (float)sqrt(xspeed*xspeed+yspeed*yspeed); - this->motion_accel = maccel; - TuioPoint p(xpos,ypos,zpos); - path.push_back(p); - - state = TUIO_UPDATED; - }; + /* + * Surchargé par alexandre.bastien@iri.centrepompidou.fr + */ + virtual void update (float xpos, float ypos, float zpos, float xspeed, float yspeed,float maccel) { + TuioPoint::update(xpos, ypos, zpos); + this->x_speed = xspeed; + this->y_speed = yspeed; + this->motion_speed = (float)sqrt(xspeed*xspeed+yspeed*yspeed); + this->motion_accel = maccel; + TuioPoint p(xpos,ypos,zpos); + path.push_back(p); + + state = TUIO_UPDATED; + }; - /* - * Modifié par alexandre.bastien@iri.centrepompidou.fr - */ - virtual void update (TuioContainer *tuioContainer) { - TuioPoint::update(tuioContainer); - this->x_speed = tuioContainer->getXSpeed(); - this->y_speed = tuioContainer->getYSpeed(); - this->motion_speed = tuioContainer->getMotionSpeed(); - this->motion_accel = tuioContainer->getMotionAccel(); - TuioPoint p(xpos,ypos,zpos); - path.push_back(p); - - state = TUIO_UPDATED; - }; - - virtual long getSessionID() { return session_id; }; - - /* - * Modifié par alexandre.bastien@iri.centrepompidou.fr - */ - virtual TuioPoint getPosition() { - TuioPoint p(xpos,ypos,zpos); - return p; - }; + /* + * Modifié par alexandre.bastien@iri.centrepompidou.fr + */ + virtual void update (TuioContainer *tuioContainer) { + TuioPoint::update(tuioContainer); + this->x_speed = tuioContainer->getXSpeed(); + this->y_speed = tuioContainer->getYSpeed(); + this->motion_speed = tuioContainer->getMotionSpeed(); + this->motion_accel = tuioContainer->getMotionAccel(); + TuioPoint p(xpos,ypos,zpos); + path.push_back(p); + + state = TUIO_UPDATED; + }; + + virtual long getSessionID() { return session_id; }; + + /* + * Modifié par alexandre.bastien@iri.centrepompidou.fr + */ + virtual TuioPoint getPosition() { + TuioPoint p(xpos,ypos,zpos); + return p; + }; - virtual std::list getPath() { - return path; - }; - - virtual void remove() { - state = TUIO_REMOVED; - timestamp = TUIO_UNDEFINED; - } - - virtual float getXSpeed() { return x_speed; }; - virtual float getYSpeed() { return y_speed; }; - virtual float getMotionSpeed() { return motion_speed; }; - virtual float getMotionAccel() { return motion_accel; }; - - virtual int getState() { return state; }; - virtual void setUpdateTime(long timestamp) { - this->timestamp = timestamp; - TuioPoint *lastPoint = &path.back(); - if (lastPoint!=NULL) lastPoint->setUpdateTime(timestamp); - }; + virtual std::list getPath() { + return path; + }; + + virtual void remove() { + state = TUIO_REMOVED; + timestamp = TUIO_UNDEFINED; + } + + virtual float getXSpeed() { return x_speed; }; + virtual float getYSpeed() { return y_speed; }; + virtual float getMotionSpeed() { return motion_speed; }; + virtual float getMotionAccel() { return motion_accel; }; + + virtual int getState() { return state; }; + virtual void setUpdateTime(long timestamp) { + this->timestamp = timestamp; + TuioPoint *lastPoint = &path.back(); + if (lastPoint!=NULL) lastPoint->setUpdateTime(timestamp); + }; }; diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/TuioCursor.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/TuioCursor.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/TuioCursor.h Thu Apr 12 15:33:25 2012 +0200 @@ -19,6 +19,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ + #ifndef INCLUDED_TUIOCURSOR_H #define INCLUDED_TUIOCURSOR_H @@ -38,7 +42,7 @@ }; /* - * Surchargé par alexandre.bastien@iri.centrepompidou.fr + * Surchargé par alexandre.bastien@iri.centrepompidou.fr */ TuioCursor (long s_id, int f_id, float xpos, float ypos, float zpos):TuioContainer(s_id,xpos,ypos,zpos) { this->finger_id = f_id; diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/TuioListener.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/TuioListener.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/TuioListener.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,9 +1,9 @@ /* - TUIO C++ Library - part of the reacTIVision project - http://reactivision.sourceforge.net/ + TUIO C++ Library - part of the reacTIVision project + http://reactivision.sourceforge.net/ - Copyright (c) 2005-2008 Martin Kaltenbrunner - + Copyright (c) 2005-2008 Martin Kaltenbrunner + This program 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 2 of the License, or @@ -19,6 +19,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ + #ifndef INCLUDED_TUIOLISTENER_H #define INCLUDED_TUIOLISTENER_H @@ -28,25 +32,25 @@ class TuioListener { - public: - virtual ~TuioListener(){}; + public: + virtual ~TuioListener(){}; - virtual void addTuioObject(TuioObject *tuioObject)=0; - virtual void updateTuioObject(TuioObject *tuioObject)=0; - virtual void removeTuioObject(TuioObject *tuioObject)=0; + virtual void addTuioObject(TuioObject *tuioObject)=0; + virtual void updateTuioObject(TuioObject *tuioObject)=0; + virtual void removeTuioObject(TuioObject *tuioObject)=0; - virtual void addTuioCursor(TuioCursor *tuioCursor)=0; - virtual void updateTuioCursor(TuioCursor *tuioCursor)=0; - virtual void removeTuioCursor(TuioCursor *tuioCursor)=0; + virtual void addTuioCursor(TuioCursor *tuioCursor)=0; + virtual void updateTuioCursor(TuioCursor *tuioCursor)=0; + virtual void removeTuioCursor(TuioCursor *tuioCursor)=0; - /* - * Ajouté par alexandre.bastien@iri.centrepompidou.fr - */ - virtual void addTuioString(TuioString *tuioString)=0; - virtual void updateTuioString(TuioString *tuioString)=0; - virtual void removeTuioString(TuioString *tuioString)=0; + /* + * Ajouté par alexandre.bastien@iri.centrepompidou.fr + */ + virtual void addTuioString(TuioString *tuioString)=0; + virtual void updateTuioString(TuioString *tuioString)=0; + virtual void removeTuioString(TuioString *tuioString)=0; - virtual void refresh(long timestamp)=0; + virtual void refresh(long timestamp)=0; }; #endif /* INCLUDED_TUIOLISTENER_H */ diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/TuioObject.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/TuioObject.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/TuioObject.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,9 +1,9 @@ /* - TUIO C++ Library - part of the reacTIVision project - http://reactivision.sourceforge.net/ + TUIO C++ Library - part of the reacTIVision project + http://reactivision.sourceforge.net/ - Copyright (c) 2005-2008 Martin Kaltenbrunner - + Copyright (c) 2005-2008 Martin Kaltenbrunner + This program 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 2 of the License, or @@ -23,7 +23,7 @@ #define INCLUDED_TUIOOBJECT_H #ifndef M_PI -#define M_PI 3.14159265358979323846 +#define M_PI 3.14159265358979323846 #endif #include @@ -31,54 +31,54 @@ #include "TuioContainer.h" class TuioObject: public TuioContainer { - - protected: - long session_id; - int fiducial_id; - float xpos, ypos, angle; - float x_speed, y_speed, motion_speed, motion_accel; - float rotation_speed, rotation_accel; - std::list path; + + protected: + long session_id; + int fiducial_id; + float xpos, ypos, angle; + float x_speed, y_speed, motion_speed, motion_accel; + float rotation_speed, rotation_accel; + std::list path; - public: - TuioObject (long s_id, int f_id, float xpos, float ypos, float angle):TuioContainer(s_id, xpos, ypos) { - this->fiducial_id = f_id; - this->angle = angle; - this->rotation_speed = 0.0f; - this->rotation_accel = 0.0f; - }; + public: + TuioObject (long s_id, int f_id, float xpos, float ypos, float angle):TuioContainer(s_id, xpos, ypos) { + this->fiducial_id = f_id; + this->angle = angle; + this->rotation_speed = 0.0f; + this->rotation_accel = 0.0f; + }; - TuioObject (TuioObject *tuioObject):TuioContainer(tuioObject) { - this->fiducial_id = tuioObject->getFiducialID(); - this->angle = angle; - this->rotation_speed = 0.0f; - this->rotation_accel = 0.0f; - }; - - ~TuioObject() {}; - - void update (float xpos, float ypos, float angle, float xspeed, float yspeed, float rspeed, float maccel, float raccel) { - TuioContainer::update(xpos,ypos,xspeed,yspeed,maccel); - this->angle = angle; - this->rotation_speed = rspeed; - this->rotation_accel = raccel; - }; + TuioObject (TuioObject *tuioObject):TuioContainer(tuioObject) { + this->fiducial_id = tuioObject->getFiducialID(); + this->angle = angle; + this->rotation_speed = 0.0f; + this->rotation_accel = 0.0f; + }; + + ~TuioObject() {}; + + void update (float xpos, float ypos, float angle, float xspeed, float yspeed, float rspeed, float maccel, float raccel) { + TuioContainer::update(xpos,ypos,xspeed,yspeed,maccel); + this->angle = angle; + this->rotation_speed = rspeed; + this->rotation_accel = raccel; + }; - void update (TuioObject *tuioObject) { - TuioContainer::update(tuioObject); - this->angle = tuioObject->getAngle(); - this->rotation_speed = tuioObject->getRotationSpeed(); - this->rotation_accel = tuioObject->getRotationAccel(); - }; - - int getFiducialID() { return fiducial_id; }; + void update (TuioObject *tuioObject) { + TuioContainer::update(tuioObject); + this->angle = tuioObject->getAngle(); + this->rotation_speed = tuioObject->getRotationSpeed(); + this->rotation_accel = tuioObject->getRotationAccel(); + }; + + int getFiducialID() { return fiducial_id; }; - float getAngle() { return angle; } - float getAngleDegrees() { return (float)(angle/M_PI*180); } + float getAngle() { return angle; } + float getAngleDegrees() { return (float)(angle/M_PI*180); } - float getRotationSpeed() { return rotation_speed; }; - float getRotationAccel() { return rotation_accel; }; - + float getRotationSpeed() { return rotation_speed; }; + float getRotationAccel() { return rotation_accel; }; + }; #endif diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/TuioPoint.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/TuioPoint.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/TuioPoint.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,9 +1,9 @@ /* - TUIO C++ Library - part of the reacTIVision project - http://reactivision.sourceforge.net/ + TUIO C++ Library - part of the reacTIVision project + http://reactivision.sourceforge.net/ - Copyright (c) 2005-2008 Martin Kaltenbrunner - + Copyright (c) 2005-2008 Martin Kaltenbrunner + This program 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 2 of the License, or @@ -26,129 +26,129 @@ class TuioPoint { - protected: - float xpos, ypos, zpos; - long timestamp; - - public: - TuioPoint (float xpos, float ypos) { - this->xpos = xpos; - this->ypos = ypos; - timestamp = TUIO_UNDEFINED; - }; + protected: + float xpos, ypos, zpos; + long timestamp; + + public: + TuioPoint (float xpos, float ypos) { + this->xpos = xpos; + this->ypos = ypos; + timestamp = TUIO_UNDEFINED; + }; - /* - * Surchargé par alexandre.bastien@iri.centrepompidou.fr - */ - TuioPoint (float xpos, float ypos, float zpos) { - this->xpos = xpos; - this->ypos = ypos; - this->zpos = zpos; - timestamp = TUIO_UNDEFINED; - }; + /* + * Surchargé par alexandre.bastien@iri.centrepompidou.fr + */ + TuioPoint (float xpos, float ypos, float zpos) { + this->xpos = xpos; + this->ypos = ypos; + this->zpos = zpos; + timestamp = TUIO_UNDEFINED; + }; - /* - * Modifié par alexandre.bastien@iri.centrepompidou.fr - */ - TuioPoint (TuioPoint *tuioPoint) { - this->xpos = tuioPoint->getX(); - this->ypos = tuioPoint->getY(); - this->zpos = tuioPoint->getZ(); - timestamp = TUIO_UNDEFINED; - }; - - ~TuioPoint(){}; + /* + * Modifié par alexandre.bastien@iri.centrepompidou.fr + */ + TuioPoint (TuioPoint *tuioPoint) { + this->xpos = tuioPoint->getX(); + this->ypos = tuioPoint->getY(); + this->zpos = tuioPoint->getZ(); + timestamp = TUIO_UNDEFINED; + }; + + ~TuioPoint(){}; - /* - * Modifié par alexandre.bastien@iri.centrepompidou.fr - */ - void update (TuioPoint *tuioPoint) { - this->xpos = tuioPoint->getX(); - this->ypos = tuioPoint->getY(); - this->zpos = tuioPoint->getZ(); - timestamp = TUIO_UNDEFINED; - }; - - void update (float xpos, float ypos) { - this->xpos = xpos; - this->ypos = ypos; - timestamp = TUIO_UNDEFINED; - }; + /* + * Modifié par alexandre.bastien@iri.centrepompidou.fr + */ + void update (TuioPoint *tuioPoint) { + this->xpos = tuioPoint->getX(); + this->ypos = tuioPoint->getY(); + this->zpos = tuioPoint->getZ(); + timestamp = TUIO_UNDEFINED; + }; + + void update (float xpos, float ypos) { + this->xpos = xpos; + this->ypos = ypos; + timestamp = TUIO_UNDEFINED; + }; - /* - * Surchargé par alexandre.bastien@iri.centrepompidou.fr - */ - void update (float xpos, float ypos, float zpos) { - this->xpos = xpos; - this->ypos = ypos; - this->zpos = zpos; - timestamp = TUIO_UNDEFINED; - }; - - float getX() { return xpos; }; - float getY() { return ypos; }; - /* - * Ajouté par alexandre.bastien@iri.centrepompidou.fr - */ - float getZ() { return zpos; }; + /* + * Surchargé par alexandre.bastien@iri.centrepompidou.fr + */ + void update (float xpos, float ypos, float zpos) { + this->xpos = xpos; + this->ypos = ypos; + this->zpos = zpos; + timestamp = TUIO_UNDEFINED; + }; + + float getX() { return xpos; }; + float getY() { return ypos; }; + /* + * Ajouté par alexandre.bastien@iri.centrepompidou.fr + */ + float getZ() { return zpos; }; - float getDistance(float x, float y) { - float dx = xpos-x; - float dy = ypos-y; - return sqrtf(dx*dx+dy*dy); - } - - /* - * Surchargé par alexandre.bastien@iri.centrepompidou.fr - */ - float getDistance(float x, float y, float z) { - float dx = xpos-x; - float dy = ypos-y; - float dz = zpos-z; - return sqrtf(dx*dx+dy*dy+dz*dz); - } + float getDistance(float x, float y) { + float dx = xpos-x; + float dy = ypos-y; + return sqrtf(dx*dx+dy*dy); + } + + /* + * Surchargé par alexandre.bastien@iri.centrepompidou.fr + */ + float getDistance(float x, float y, float z) { + float dx = xpos-x; + float dy = ypos-y; + float dz = zpos-z; + return sqrtf(dx*dx+dy*dy+dz*dz); + } - /* - * Modifié par alexandre.bastien@iri.centrepompidou.fr - */ - float getDistance(TuioPoint *tuioPoint) { - float dx = xpos-tuioPoint->getX(); - float dy = ypos-tuioPoint->getY(); - float dz = zpos-tuioPoint->getZ(); - return sqrtf(dx*dx+dy*dy+dz*dz); - } + /* + * Modifié par alexandre.bastien@iri.centrepompidou.fr + */ + float getDistance(TuioPoint *tuioPoint) { + float dx = xpos-tuioPoint->getX(); + float dy = ypos-tuioPoint->getY(); + float dz = zpos-tuioPoint->getZ(); + return sqrtf(dx*dx+dy*dy+dz*dz); + } - /* - * Modifié par alexandre.bastien@iri.centrepompidou.fr - */ - /*float getDistance3D(TuioPoint *tuioPoint) { - float dx = xpos-tuioPoint->getX(); - float dy = ypos-tuioPoint->getY(); - float dz = zpos-tuioPoint->getZ(); - return sqrtf(dx*dx+dy*dy+dz*dz); - }*/ + /* + * Modifié par alexandre.bastien@iri.centrepompidou.fr + */ + /*float getDistance3D(TuioPoint *tuioPoint) { + float dx = xpos-tuioPoint->getX(); + float dy = ypos-tuioPoint->getY(); + float dz = zpos-tuioPoint->getZ(); + return sqrtf(dx*dx+dy*dy+dz*dz); + }*/ - float getAngle(TuioPoint *tuioPoint) { - - float side = tuioPoint->getX()-xpos; - float height = tuioPoint->getY()-ypos; - float distance = tuioPoint->getDistance(xpos,ypos); - - float angle = (float)(asin(side/distance)+M_PI/2); - if (height<0) angle = 2.0f*(float)M_PI-angle; - - return angle; - } - - float getAngleDegrees(TuioPoint *tuioPoint) { - return ((getAngle(tuioPoint)/(float)M_PI)*180.0f); - } - - float getScreenX(int w) { return xpos*w; }; - float getScreenY(int h) { return ypos*h; }; - - long getUpdateTime() { return timestamp; }; - void setUpdateTime(long timestamp) { this->timestamp = timestamp; }; + float getAngle(TuioPoint *tuioPoint) { + + float side = tuioPoint->getX()-xpos; + float height = tuioPoint->getY()-ypos; + float distance = tuioPoint->getDistance(xpos,ypos); + + float angle = (float)(asin(side/distance)+M_PI/2); + if (height<0) angle = 2.0f*(float)M_PI-angle; + + return angle; + } + + float getAngleDegrees(TuioPoint *tuioPoint) { + return ((getAngle(tuioPoint)/(float)M_PI)*180.0f); + } + + float getScreenX(int w) { return xpos*w; }; + float getScreenY(int h) { return ypos*h; }; + + long getUpdateTime() { return timestamp; }; + void setUpdateTime(long timestamp) { this->timestamp = timestamp; }; }; diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/TuioString.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/TuioString.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/TuioString.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,53 +1,57 @@ +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ + #ifndef INCLUDED_TUIOSTRING_H #define INCLUDED_TUIOSTRING_H class TuioString { - protected: - int session_id; - int string_id; - const char* code; - long timestamp; - int state; - - public: - TuioString (int s_id, int string_id, const char* _code) { - this->session_id = s_id; - this->string_id = string_id; - this->code = _code; - timestamp = TUIO_UNDEFINED; - state = TUIO_ADDED; - }; + protected: + int session_id; + int string_id; + const char* code; + long timestamp; + int state; + + public: + TuioString (int s_id, int string_id, const char* _code) { + this->session_id = s_id; + this->string_id = string_id; + this->code = _code; + timestamp = TUIO_UNDEFINED; + state = TUIO_ADDED; + }; - TuioString (TuioString *tuioString) { - this->session_id = tuioString->getSessionID(); - this->string_id = tuioString->getStringID(); - this->code = tuioString->getCode(); - timestamp = TUIO_UNDEFINED; - state = TUIO_ADDED; - }; - - ~TuioString(){}; - - int getSessionID() { return session_id; }; - int getStringID() { return string_id; }; - const char* getCode() { return code; }; + TuioString (TuioString *tuioString) { + this->session_id = tuioString->getSessionID(); + this->string_id = tuioString->getStringID(); + this->code = tuioString->getCode(); + timestamp = TUIO_UNDEFINED; + state = TUIO_ADDED; + }; + + ~TuioString(){}; + + int getSessionID() { return session_id; }; + int getStringID() { return string_id; }; + const char* getCode() { return code; }; - void update(const char* _code) - { - this->code = _code; - timestamp = TUIO_UNDEFINED; - state = TUIO_UPDATED; - } + void update(const char* _code) + { + this->code = _code; + timestamp = TUIO_UNDEFINED; + state = TUIO_UPDATED; + } - void remove() { - state = TUIO_REMOVED; - timestamp = TUIO_UNDEFINED; - } + void remove() { + state = TUIO_REMOVED; + timestamp = TUIO_UNDEFINED; + } - long getUpdateTime() { return timestamp; }; - void setUpdateTime(long timestamp) { this->timestamp = timestamp; }; + long getUpdateTime() { return timestamp; }; + void setUpdateTime(long timestamp) { this->timestamp = timestamp; }; }; #endif diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/IpEndpointName.cpp --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/IpEndpointName.cpp Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/IpEndpointName.cpp Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "IpEndpointName.h" @@ -36,46 +36,46 @@ unsigned long IpEndpointName::GetHostByName( const char *s ) { - return ::GetHostByName(s); + return ::GetHostByName(s); } void IpEndpointName::AddressAsString( char *s ) const { - if( address == ANY_ADDRESS ){ - sprintf( s, "" ); - }else{ - sprintf( s, "%d.%d.%d.%d", - (int)((address >> 24) & 0xFF), - (int)((address >> 16) & 0xFF), - (int)((address >> 8) & 0xFF), - (int)(address & 0xFF) ); - } + if( address == ANY_ADDRESS ){ + sprintf( s, "" ); + }else{ + sprintf( s, "%d.%d.%d.%d", + (int)((address >> 24) & 0xFF), + (int)((address >> 16) & 0xFF), + (int)((address >> 8) & 0xFF), + (int)(address & 0xFF) ); + } } void IpEndpointName::AddressAndPortAsString( char *s ) const { - if( port == ANY_PORT ){ - if( address == ANY_ADDRESS ){ - sprintf( s, ":" ); - }else{ - sprintf( s, "%d.%d.%d.%d:", - (int)((address >> 24) & 0xFF), - (int)((address >> 16) & 0xFF), - (int)((address >> 8) & 0xFF), - (int)(address & 0xFF) ); - } - }else{ - if( address == ANY_ADDRESS ){ - sprintf( s, ":%d", port ); - }else{ - sprintf( s, "%d.%d.%d.%d:%d", - (int)((address >> 24) & 0xFF), - (int)((address >> 16) & 0xFF), - (int)((address >> 8) & 0xFF), - (int)(address & 0xFF), - (int)port ); - } - } + if( port == ANY_PORT ){ + if( address == ANY_ADDRESS ){ + sprintf( s, ":" ); + }else{ + sprintf( s, "%d.%d.%d.%d:", + (int)((address >> 24) & 0xFF), + (int)((address >> 16) & 0xFF), + (int)((address >> 8) & 0xFF), + (int)(address & 0xFF) ); + } + }else{ + if( address == ANY_ADDRESS ){ + sprintf( s, ":%d", port ); + }else{ + sprintf( s, "%d.%d.%d.%d:%d", + (int)((address >> 24) & 0xFF), + (int)((address >> 16) & 0xFF), + (int)((address >> 8) & 0xFF), + (int)(address & 0xFF), + (int)port ); + } + } } diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/IpEndpointName.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/IpEndpointName.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/IpEndpointName.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INCLUDED_IPENDPOINTNAME_H #define INCLUDED_IPENDPOINTNAME_H @@ -38,37 +38,37 @@ static const int ANY_PORT = -1; IpEndpointName() - : address( ANY_ADDRESS ), port( ANY_PORT ) {} + : address( ANY_ADDRESS ), port( ANY_PORT ) {} IpEndpointName( int port_ ) - : address( ANY_ADDRESS ), port( port_ ) {} + : address( ANY_ADDRESS ), port( port_ ) {} IpEndpointName( unsigned long ipAddress_, int port_ ) - : address( ipAddress_ ), port( port_ ) {} + : address( ipAddress_ ), port( port_ ) {} IpEndpointName( const char *addressName, int port_=ANY_PORT ) - : address( GetHostByName( addressName ) ) - , port( port_ ) {} + : address( GetHostByName( addressName ) ) + , port( port_ ) {} IpEndpointName( int addressA, int addressB, int addressC, int addressD, int port_=ANY_PORT ) - : address( ( (addressA << 24) | (addressB << 16) | (addressC << 8) | addressD ) ) - , port( port_ ) {} + : address( ( (addressA << 24) | (addressB << 16) | (addressC << 8) | addressD ) ) + , port( port_ ) {} - // address and port are maintained in host byte order here + // address and port are maintained in host byte order here unsigned long address; int port; - enum { ADDRESS_STRING_LENGTH=17 }; - void AddressAsString( char *s ) const; + enum { ADDRESS_STRING_LENGTH=17 }; + void AddressAsString( char *s ) const; - enum { ADDRESS_AND_PORT_STRING_LENGTH=23}; - void AddressAndPortAsString( char *s ) const; + enum { ADDRESS_AND_PORT_STRING_LENGTH=23}; + void AddressAndPortAsString( char *s ) const; }; inline bool operator==( const IpEndpointName& lhs, const IpEndpointName& rhs ) -{ - return (lhs.address == rhs.address && lhs.port == rhs.port ); +{ + return (lhs.address == rhs.address && lhs.port == rhs.port ); } inline bool operator!=( const IpEndpointName& lhs, const IpEndpointName& rhs ) { - return !(lhs == rhs); + return !(lhs == rhs); } #endif /* INCLUDED_IPENDPOINTNAME_H */ diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/NetworkingUtils.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/NetworkingUtils.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/NetworkingUtils.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INCLUDED_NETWORKINGUTILS_H #define INCLUDED_NETWORKINGUTILS_H diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/PacketListener.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/PacketListener.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/PacketListener.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INCLUDED_PACKETLISTENER_H #define INCLUDED_PACKETLISTENER_H @@ -37,7 +37,7 @@ public: virtual ~PacketListener() {} virtual void ProcessPacket( const char *data, int size, - const IpEndpointName& remoteEndpoint ) = 0; + const IpEndpointName& remoteEndpoint ) = 0; }; #endif /* INCLUDED_PACKETLISTENER_H */ diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/TimerListener.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/TimerListener.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/TimerListener.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INCLUDED_TIMERLISTENER_H #define INCLUDED_TIMERLISTENER_H diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/UdpSocket.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/UdpSocket.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/UdpSocket.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INCLUDED_UDPSOCKET_H #define INCLUDED_UDPSOCKET_H @@ -48,25 +48,25 @@ class Implementation; Implementation *impl_; - friend class UdpSocket; + friend class UdpSocket; public: SocketReceiveMultiplexer(); ~SocketReceiveMultiplexer(); - // only call the attach/detach methods _before_ calling Run + // only call the attach/detach methods _before_ calling Run // only one listener per socket, each socket at most once void AttachSocketListener( UdpSocket *socket, PacketListener *listener ); void DetachSocketListener( UdpSocket *socket, PacketListener *listener ); void AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener ); - void AttachPeriodicTimerListener( + void AttachPeriodicTimerListener( int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener ); void DetachPeriodicTimerListener( TimerListener *listener ); void Run(); // loop and block processing messages indefinitely - void RunUntilSigInt(); + void RunUntilSigInt(); void Break(); // call this from a listener to exit once the listener returns void AsynchronousBreak(); // call this from another thread or signal handler to exit the Run() state }; @@ -76,38 +76,38 @@ class Implementation; Implementation *impl_; - friend class SocketReceiveMultiplexer::Implementation; + friend class SocketReceiveMultiplexer::Implementation; public: - // ctor throws std::runtime_error if there's a problem - // initializing the socket. - UdpSocket(); - virtual ~UdpSocket(); + // ctor throws std::runtime_error if there's a problem + // initializing the socket. + UdpSocket(); + virtual ~UdpSocket(); - // the socket is created in an unbound, unconnected state - // such a socket can only be used to send to an arbitrary - // address using SendTo(). To use Send() you need to first - // connect to a remote endpoint using Connect(). To use - // ReceiveFrom you need to first bind to a local endpoint - // using Bind(). + // the socket is created in an unbound, unconnected state + // such a socket can only be used to send to an arbitrary + // address using SendTo(). To use Send() you need to first + // connect to a remote endpoint using Connect(). To use + // ReceiveFrom you need to first bind to a local endpoint + // using Bind(). - // retrieve the local endpoint name when sending to 'to' + // retrieve the local endpoint name when sending to 'to' IpEndpointName LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const; - // Connect to a remote endpoint which is used as the target - // for calls to Send() - void Connect( const IpEndpointName& remoteEndpoint ); - void Send( const char *data, int size ); + // Connect to a remote endpoint which is used as the target + // for calls to Send() + void Connect( const IpEndpointName& remoteEndpoint ); + void Send( const char *data, int size ); void SendTo( const IpEndpointName& remoteEndpoint, const char *data, int size ); - // Bind a local endpoint to receive incoming data. Endpoint - // can be 'any' for the system to choose an endpoint - void Bind( const IpEndpointName& localEndpoint ); - bool IsBound() const; + // Bind a local endpoint to receive incoming data. Endpoint + // can be 'any' for the system to choose an endpoint + void Bind( const IpEndpointName& localEndpoint ); + bool IsBound() const; - int ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, int size ); + int ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, int size ); }; @@ -118,15 +118,15 @@ class UdpTransmitSocket : public UdpSocket{ public: - UdpTransmitSocket( const IpEndpointName& remoteEndpoint ) - { Connect( remoteEndpoint ); } + UdpTransmitSocket( const IpEndpointName& remoteEndpoint ) + { Connect( remoteEndpoint ); } }; class UdpReceiveSocket : public UdpSocket{ public: - UdpReceiveSocket( const IpEndpointName& localEndpoint ) - { Bind( localEndpoint ); } + UdpReceiveSocket( const IpEndpointName& localEndpoint ) + { Bind( localEndpoint ); } }; @@ -137,7 +137,7 @@ SocketReceiveMultiplexer mux_; PacketListener *listener_; public: - UdpListeningReceiveSocket( const IpEndpointName& localEndpoint, PacketListener *listener ) + UdpListeningReceiveSocket( const IpEndpointName& localEndpoint, PacketListener *listener ) : listener_( listener ) { Bind( localEndpoint ); @@ -149,7 +149,7 @@ // see SocketReceiveMultiplexer above for the behaviour of these methods... void Run() { mux_.Run(); } - void RunUntilSigInt() { mux_.RunUntilSigInt(); } + void RunUntilSigInt() { mux_.RunUntilSigInt(); } void Break() { mux_.Break(); } void AsynchronousBreak() { mux_.AsynchronousBreak(); } }; diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/MessageMappingOscPacketListener.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/MessageMappingOscPacketListener.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/MessageMappingOscPacketListener.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INCLUDED_MESSAGEMAPPINGOSCPACKETLISTENER_H #define INCLUDED_MESSAGEMAPPINGOSCPACKETLISTENER_H @@ -51,7 +51,7 @@ } virtual void ProcessMessage( const osc::ReceivedMessage& m, - const IpEndpointName& remoteEndpoint ) + const IpEndpointName& remoteEndpoint ) { typename function_map_type::iterator i = functions_.find( m.AddressPattern() ); if( i != functions_.end() ) diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscException.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscException.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscException.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INCLUDED_OSC_EXCEPTION_H #define INCLUDED_OSC_EXCEPTION_H diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscHostEndianness.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscHostEndianness.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscHostEndianness.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef OSC_HOSTENDIANNESS_H #define OSC_HOSTENDIANNESS_H diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscOutboundPacketStream.cpp --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscOutboundPacketStream.cpp Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscOutboundPacketStream.cpp Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "OscOutboundPacketStream.h" diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscOutboundPacketStream.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscOutboundPacketStream.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscOutboundPacketStream.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INCLUDED_OSCOUTBOUNDPACKET_H #define INCLUDED_OSCOUTBOUNDPACKET_H @@ -66,8 +66,8 @@ class OutboundPacketStream{ public: - OutboundPacketStream( char *buffer, unsigned long capacity ); - ~OutboundPacketStream(); + OutboundPacketStream( char *buffer, unsigned long capacity ); + ~OutboundPacketStream(); void Clear(); diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscPrintReceivedElements.cpp --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscPrintReceivedElements.cpp Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscPrintReceivedElements.cpp Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "OscPrintReceivedElements.h" @@ -101,7 +101,7 @@ os.unsetf(std::ios::basefield); } break; - + case INT64_TYPE_TAG: os << "int64:" << arg.AsInt64Unchecked(); break; diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscPrintReceivedElements.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscPrintReceivedElements.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscPrintReceivedElements.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INCLUDED_OSCPRINTRECEIVEDELEMENTS_H #define INCLUDED_OSCPRINTRECEIVEDELEMENTS_H diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscReceivedElements.cpp --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscReceivedElements.cpp Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscReceivedElements.cpp Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "OscReceivedElements.h" @@ -42,8 +42,8 @@ // the string is terminated correctly. static inline const char* FindStr4End( const char *p ) { - if( p[0] == '\0' ) // special case for SuperCollider integer address pattern - return p + 4; + if( p[0] == '\0' ) // special case for SuperCollider integer address pattern + return p + 4; p += 3; @@ -61,8 +61,8 @@ if( p >= end ) return 0; - if( p[0] == '\0' ) // special case for SuperCollider integer address pattern - return p + 4; + if( p[0] == '\0' ) // special case for SuperCollider integer address pattern + return p + 4; p += 3; end -= 1; @@ -102,7 +102,7 @@ return u.i; #else - return *(int32*)p; + return *(int32*)p; #endif } @@ -122,7 +122,7 @@ return u.i; #else - return *(uint32*)p; + return *(uint32*)p; #endif } @@ -146,7 +146,7 @@ return u.i; #else - return *(int64*)p; + return *(int64*)p; #endif } @@ -170,7 +170,7 @@ return u.i; #else - return *(uint64*)p; + return *(uint64*)p; #endif } @@ -200,12 +200,12 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == TRUE_TYPE_TAG ) - return true; - else if( *typeTag_ == FALSE_TYPE_TAG ) - return false; - else - throw WrongArgumentTypeException(); + else if( *typeTag_ == TRUE_TYPE_TAG ) + return true; + else if( *typeTag_ == FALSE_TYPE_TAG ) + return false; + else + throw WrongArgumentTypeException(); } @@ -213,10 +213,10 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == TRUE_TYPE_TAG ) - return true; + else if( *typeTag_ == TRUE_TYPE_TAG ) + return true; else - return false; + return false; } @@ -224,10 +224,10 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == INT32_TYPE_TAG ) - return AsInt32Unchecked(); - else - throw WrongArgumentTypeException(); + else if( *typeTag_ == INT32_TYPE_TAG ) + return AsInt32Unchecked(); + else + throw WrongArgumentTypeException(); } @@ -246,7 +246,7 @@ return u.i; #else - return *(int32*)argument_; + return *(int32*)argument_; #endif } @@ -255,10 +255,10 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == FLOAT_TYPE_TAG ) - return AsFloatUnchecked(); - else - throw WrongArgumentTypeException(); + else if( *typeTag_ == FLOAT_TYPE_TAG ) + return AsFloatUnchecked(); + else + throw WrongArgumentTypeException(); } @@ -277,7 +277,7 @@ return u.f; #else - return *(float*)argument_; + return *(float*)argument_; #endif } @@ -286,10 +286,10 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == CHAR_TYPE_TAG ) - return AsCharUnchecked(); - else - throw WrongArgumentTypeException(); + else if( *typeTag_ == CHAR_TYPE_TAG ) + return AsCharUnchecked(); + else + throw WrongArgumentTypeException(); } @@ -303,16 +303,16 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == RGBA_COLOR_TYPE_TAG ) - return AsRgbaColorUnchecked(); - else - throw WrongArgumentTypeException(); + else if( *typeTag_ == RGBA_COLOR_TYPE_TAG ) + return AsRgbaColorUnchecked(); + else + throw WrongArgumentTypeException(); } uint32 ReceivedMessageArgument::AsRgbaColorUnchecked() const { - return ToUInt32( argument_ ); + return ToUInt32( argument_ ); } @@ -320,16 +320,16 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == MIDI_MESSAGE_TYPE_TAG ) - return AsMidiMessageUnchecked(); - else - throw WrongArgumentTypeException(); + else if( *typeTag_ == MIDI_MESSAGE_TYPE_TAG ) + return AsMidiMessageUnchecked(); + else + throw WrongArgumentTypeException(); } uint32 ReceivedMessageArgument::AsMidiMessageUnchecked() const { - return ToUInt32( argument_ ); + return ToUInt32( argument_ ); } @@ -337,10 +337,10 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == INT64_TYPE_TAG ) - return AsInt64Unchecked(); - else - throw WrongArgumentTypeException(); + else if( *typeTag_ == INT64_TYPE_TAG ) + return AsInt64Unchecked(); + else + throw WrongArgumentTypeException(); } @@ -354,10 +354,10 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == TIME_TAG_TYPE_TAG ) - return AsTimeTagUnchecked(); - else - throw WrongArgumentTypeException(); + else if( *typeTag_ == TIME_TAG_TYPE_TAG ) + return AsTimeTagUnchecked(); + else + throw WrongArgumentTypeException(); } @@ -371,10 +371,10 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == DOUBLE_TYPE_TAG ) - return AsDoubleUnchecked(); - else - throw WrongArgumentTypeException(); + else if( *typeTag_ == DOUBLE_TYPE_TAG ) + return AsDoubleUnchecked(); + else + throw WrongArgumentTypeException(); } @@ -397,7 +397,7 @@ return u.d; #else - return *(double*)argument_; + return *(double*)argument_; #endif } @@ -406,10 +406,10 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == STRING_TYPE_TAG ) - return argument_; - else - throw WrongArgumentTypeException(); + else if( *typeTag_ == STRING_TYPE_TAG ) + return argument_; + else + throw WrongArgumentTypeException(); } @@ -417,10 +417,10 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == SYMBOL_TYPE_TAG ) - return argument_; - else - throw WrongArgumentTypeException(); + else if( *typeTag_ == SYMBOL_TYPE_TAG ) + return argument_; + else + throw WrongArgumentTypeException(); } @@ -428,17 +428,17 @@ { if( !typeTag_ ) throw MissingArgumentException(); - else if( *typeTag_ == BLOB_TYPE_TAG ) - AsBlobUnchecked( data, size ); - else - throw WrongArgumentTypeException(); + else if( *typeTag_ == BLOB_TYPE_TAG ) + AsBlobUnchecked( data, size ); + else + throw WrongArgumentTypeException(); } void ReceivedMessageArgument::AsBlobUnchecked( const void*& data, unsigned long& size ) const { size = ToUInt32( argument_ ); - data = (void*)(argument_+4); + data = (void*)(argument_+4); } //------------------------------------------------------------------------------ @@ -463,7 +463,7 @@ break; case INT32_TYPE_TAG: - case FLOAT_TYPE_TAG: + case FLOAT_TYPE_TAG: case CHAR_TYPE_TAG: case RGBA_COLOR_TYPE_TAG: case MIDI_MESSAGE_TYPE_TAG: @@ -474,7 +474,7 @@ case INT64_TYPE_TAG: case TIME_TAG_TYPE_TAG: case DOUBLE_TYPE_TAG: - + value_.argument_ += 8; break; @@ -526,7 +526,7 @@ bool ReceivedMessage::AddressPatternIsUInt32() const { - return (addressPattern_[0] == '\0'); + return (addressPattern_[0] == '\0'); } diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscReceivedElements.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscReceivedElements.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscReceivedElements.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INCLUDED_OSCRECEIVEDELEMENTS_H #define INCLUDED_OSCRECEIVEDELEMENTS_H @@ -106,14 +106,14 @@ class ReceivedBundleElementIterator{ public: - ReceivedBundleElementIterator( const char *sizePtr ) + ReceivedBundleElementIterator( const char *sizePtr ) : value_( sizePtr ) {} - ReceivedBundleElementIterator operator++() - { + ReceivedBundleElementIterator operator++() + { Advance(); return *this; - } + } ReceivedBundleElementIterator operator++(int) { @@ -122,17 +122,17 @@ return old; } - const ReceivedBundleElement& operator*() const { return value_; } + const ReceivedBundleElement& operator*() const { return value_; } const ReceivedBundleElement* operator->() const { return &value_; } - friend bool operator==(const ReceivedBundleElementIterator& lhs, + friend bool operator==(const ReceivedBundleElementIterator& lhs, const ReceivedBundleElementIterator& rhs ); private: - ReceivedBundleElement value_; + ReceivedBundleElement value_; - void Advance() { value_.size_ = value_.Contents() + value_.Size(); } + void Advance() { value_.size_ = value_.Contents() + value_.Size(); } bool IsEqualTo( const ReceivedBundleElementIterator& rhs ) const { @@ -142,26 +142,26 @@ inline bool operator==(const ReceivedBundleElementIterator& lhs, const ReceivedBundleElementIterator& rhs ) -{ - return lhs.IsEqualTo( rhs ); +{ + return lhs.IsEqualTo( rhs ); } inline bool operator!=(const ReceivedBundleElementIterator& lhs, const ReceivedBundleElementIterator& rhs ) { - return !( lhs == rhs ); + return !( lhs == rhs ); } class ReceivedMessageArgument{ public: - ReceivedMessageArgument( const char *typeTag, const char *argument ) - : typeTag_( typeTag ) - , argument_( argument ) {} + ReceivedMessageArgument( const char *typeTag, const char *argument ) + : typeTag_( typeTag ) + , argument_( argument ) {} friend class ReceivedMessageArgumentIterator; - const char TypeTag() const { return *typeTag_; } + const char TypeTag() const { return *typeTag_; } // the unchecked methods below don't check whether the argument actually // is of the specified type. they should only be used if you've already @@ -220,21 +220,21 @@ void AsBlobUnchecked( const void*& data, unsigned long& size ) const; private: - const char *typeTag_; - const char *argument_; + const char *typeTag_; + const char *argument_; }; class ReceivedMessageArgumentIterator{ public: - ReceivedMessageArgumentIterator( const char *typeTags, const char *arguments ) + ReceivedMessageArgumentIterator( const char *typeTags, const char *arguments ) : value_( typeTags, arguments ) {} - ReceivedMessageArgumentIterator operator++() - { + ReceivedMessageArgumentIterator operator++() + { Advance(); return *this; - } + } ReceivedMessageArgumentIterator operator++(int) { @@ -243,17 +243,17 @@ return old; } - const ReceivedMessageArgument& operator*() const { return value_; } + const ReceivedMessageArgument& operator*() const { return value_; } const ReceivedMessageArgument* operator->() const { return &value_; } - friend bool operator==(const ReceivedMessageArgumentIterator& lhs, + friend bool operator==(const ReceivedMessageArgumentIterator& lhs, const ReceivedMessageArgumentIterator& rhs ); private: - ReceivedMessageArgument value_; + ReceivedMessageArgument value_; - void Advance(); + void Advance(); bool IsEqualTo( const ReceivedMessageArgumentIterator& rhs ) const { @@ -263,14 +263,14 @@ inline bool operator==(const ReceivedMessageArgumentIterator& lhs, const ReceivedMessageArgumentIterator& rhs ) -{ - return lhs.IsEqualTo( rhs ); +{ + return lhs.IsEqualTo( rhs ); } inline bool operator!=(const ReceivedMessageArgumentIterator& lhs, const ReceivedMessageArgumentIterator& rhs ) -{ - return !( lhs == rhs ); +{ + return !( lhs == rhs ); } @@ -415,25 +415,25 @@ explicit ReceivedMessage( const ReceivedPacket& packet ); explicit ReceivedMessage( const ReceivedBundleElement& bundleElement ); - const char *AddressPattern() const { return addressPattern_; } + const char *AddressPattern() const { return addressPattern_; } - // Support for non-standad SuperCollider integer address patterns: - bool AddressPatternIsUInt32() const; - uint32 AddressPatternAsUInt32() const; + // Support for non-standad SuperCollider integer address patterns: + bool AddressPatternIsUInt32() const; + uint32 AddressPatternAsUInt32() const; - unsigned long ArgumentCount() const { return static_cast(typeTagsEnd_ - typeTagsBegin_); } + unsigned long ArgumentCount() const { return static_cast(typeTagsEnd_ - typeTagsBegin_); } const char *TypeTags() const { return typeTagsBegin_; } typedef ReceivedMessageArgumentIterator const_iterator; - ReceivedMessageArgumentIterator ArgumentsBegin() const + ReceivedMessageArgumentIterator ArgumentsBegin() const { return ReceivedMessageArgumentIterator( typeTagsBegin_, arguments_ ); } - ReceivedMessageArgumentIterator ArgumentsEnd() const + ReceivedMessageArgumentIterator ArgumentsEnd() const { return ReceivedMessageArgumentIterator( typeTagsEnd_, 0 ); } @@ -444,9 +444,9 @@ } private: - const char *addressPattern_; - const char *typeTagsBegin_; - const char *typeTagsEnd_; + const char *addressPattern_; + const char *typeTagsBegin_; + const char *typeTagsEnd_; const char *arguments_; }; @@ -463,12 +463,12 @@ typedef ReceivedBundleElementIterator const_iterator; - ReceivedBundleElementIterator ElementsBegin() const + ReceivedBundleElementIterator ElementsBegin() const { return ReceivedBundleElementIterator( timeTag_ + 8 ); } - ReceivedBundleElementIterator ElementsEnd() const + ReceivedBundleElementIterator ElementsEnd() const { return ReceivedBundleElementIterator( end_ ); } diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscTypes.cpp --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscTypes.cpp Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscTypes.cpp Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "OscTypes.h" diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscTypes.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscTypes.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/osc/OscTypes.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,31 +1,31 @@ /* - oscpack -- Open Sound Control packet manipulation library - http://www.audiomulch.com/~rossb/oscpack + oscpack -- Open Sound Control packet manipulation library + http://www.audiomulch.com/~rossb/oscpack - Copyright (c) 2004-2005 Ross Bencina + Copyright (c) 2004-2005 Ross Bencina - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INCLUDED_OSCTYPES_H #define INCLUDED_OSCTYPES_H diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/example/events.html --- a/front_idill/extern/fajran-npTuioClient/example/events.html Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/example/events.html Thu Apr 12 15:33:25 2012 +0200 @@ -9,37 +9,37 @@ - + Plugin FAILED to load

diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/example/paint.html
--- a/front_idill/extern/fajran-npTuioClient/example/paint.html	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/example/paint.html	Thu Apr 12 15:33:25 2012 +0200
@@ -24,48 +24,48 @@
 }
 
 function tuio_cursor_update(sid, fid, x, y) {
-	var px = x * w;
-	var py = y * h;
+    var px = x * w;
+    var py = y * h;
 
-	ctx.beginPath();
-	ctx.fillStyle = "rgba(0, 0, 200, 0.2)";
-	ctx.arc(px, py, 5, 0, 2*Math.PI, true);
-	ctx.fill();
+    ctx.beginPath();
+    ctx.fillStyle = "rgba(0, 0, 200, 0.2)";
+    ctx.arc(px, py, 5, 0, 2*Math.PI, true);
+    ctx.fill();
 }
 
 function tuio_cursor_remove(sid, fid, x, y) {
 }
 
 function tuio_callback(type, sid, fid, x, y, a) {
-	if (type == 0) {
-		tuio_object_add(sid, fid, x, y, a);
-	}
-	else if (type == 1) {
-		tuio_object_update(sid, fid, x, y, a);
-	}
-	else if (type == 2) {
-		tuio_object_remove(sid, fid, x, y, a);
-	}
-	else if (type == 3) {
-		tuio_cursor_add(sid, fid, x, y);
-	}
-	else if (type == 4) {
-		tuio_cursor_update(sid, fid, x, y);
-	}
-	else if (type == 5) {
-		tuio_cursor_remove(sid, fid, x, y);
-	}
+    if (type == 0) {
+        tuio_object_add(sid, fid, x, y, a);
+    }
+    else if (type == 1) {
+        tuio_object_update(sid, fid, x, y, a);
+    }
+    else if (type == 2) {
+        tuio_object_remove(sid, fid, x, y, a);
+    }
+    else if (type == 3) {
+        tuio_cursor_add(sid, fid, x, y);
+    }
+    else if (type == 4) {
+        tuio_cursor_update(sid, fid, x, y);
+    }
+    else if (type == 5) {
+        tuio_cursor_remove(sid, fid, x, y);
+    }
 }
 
 function ol() {
-	canvas = document.getElementById('c');
-	ctx = canvas.getContext('2d');
+    canvas = document.getElementById('c');
+    ctx = canvas.getContext('2d');
 }
 
 
 
 
-	
+    
 
 Plugin FAILED to load
 
diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/example/tracker.html
--- a/front_idill/extern/fajran-npTuioClient/example/tracker.html	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/example/tracker.html	Thu Apr 12 15:33:25 2012 +0200
@@ -17,55 +17,55 @@
 var updateStarted = false;
 
 function update() {
-	if (updateStarted) return;
-	updateStarted = true;
+    if (updateStarted) return;
+    updateStarted = true;
 
-	var nw = window.innerWidth;
-	var nh = window.innerHeight;
+    var nw = window.innerWidth;
+    var nh = window.innerHeight;
 
-	if ((w != nw) || (h != nh)) {
-		w = nw;
-		h = nh;
-		canvas.style.width = w+'px';
-		canvas.style.height = h+'px';
-		canvas.width = w;
-		canvas.height = h;
-	}
+    if ((w != nw) || (h != nh)) {
+        w = nw;
+        h = nh;
+        canvas.style.width = w+'px';
+        canvas.style.height = h+'px';
+        canvas.width = w;
+        canvas.height = h;
+    }
 
-	ctx.clearRect(0, 0, w, h);
+    ctx.clearRect(0, 0, w, h);
 
-	var i, len = tuio.cursors.length;
-	for (i=0; i
 
 
-	
+    
 
 Plugin FAILED to load
 
diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/example/tuio.js
--- a/front_idill/extern/fajran-npTuioClient/example/tuio.js	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/example/tuio.js	Thu Apr 12 15:33:25 2012 +0200
@@ -1,89 +1,89 @@
 
 var tuio = {
-	cursors: [],
-	objects: [],
+    cursors: [],
+    objects: [],
 
-	_data: {},
+    _data: {},
 
-	_cb_object_add:    function(obj) { },
-	_cb_object_update: function(obj) { },
-	_cb_object_remove: function(obj) { },
-	_cb_cursor_add:    function(cur) { },
-	_cb_cursor_update: function(cur) { },
-	_cb_cursor_remove: function(cur) { },
+    _cb_object_add:    function(obj) { },
+    _cb_object_update: function(obj) { },
+    _cb_object_remove: function(obj) { },
+    _cb_cursor_add:    function(cur) { },
+    _cb_cursor_update: function(cur) { },
+    _cb_cursor_remove: function(cur) { },
 
-	// Callback from the main event handler
+    // Callback from the main event handler
 
-	callback: function(type, sid, fid, x, y, angle) {
-		var data;
-		
-		if ((type != 0) && (type != 3)) {
-			data = this._data[sid];
-		}
-		else {
-			data = {
-				sid: sid,
-				fid: fid
-			}
-			this._data[sid] = data;
-		}
+    callback: function(type, sid, fid, x, y, angle) {
+        var data;
+        
+        if ((type != 0) && (type != 3)) {
+            data = this._data[sid];
+        }
+        else {
+            data = {
+                sid: sid,
+                fid: fid
+            }
+            this._data[sid] = data;
+        }
 
-		data.x = x;
-		data.y = y;
-		
-		if (type < 3) {
-			data.angle = angle;
-		}
+        data.x = x;
+        data.y = y;
+        
+        if (type < 3) {
+            data.angle = angle;
+        }
 
-		switch (type) {
-			case 0: 
-				this.objects.push(data);
-				this._cb_object_add(data);
-				break;
+        switch (type) {
+            case 0: 
+                this.objects.push(data);
+                this._cb_object_add(data);
+                break;
 
-			case 1: 
-				this._cb_object_update(data);
-				break;
+            case 1: 
+                this._cb_object_update(data);
+                break;
 
-			case 2: 
-				this.objects.splice(this.objects.indexOf(data), 1);
-				this._cb_object_remove(data);
-				break;
+            case 2: 
+                this.objects.splice(this.objects.indexOf(data), 1);
+                this._cb_object_remove(data);
+                break;
 
-			case 3: 
-				this.cursors.push(data);
-				this._cb_cursor_add(data);
-				break;
+            case 3: 
+                this.cursors.push(data);
+                this._cb_cursor_add(data);
+                break;
 
-			case 4: 
-				this._cb_cursor_update(data);
-				break;
+            case 4: 
+                this._cb_cursor_update(data);
+                break;
 
-			case 5: 
-				this.cursors.splice(this.cursors.indexOf(data), 1);
-				this._cb_cursor_remove(data);
-				break;
+            case 5: 
+                this.cursors.splice(this.cursors.indexOf(data), 1);
+                this._cb_cursor_remove(data);
+                break;
 
-			default:
-				break;
-		}
+            default:
+                break;
+        }
 
-		if ((type == 2) || (type == 5)) {
-			delete this._data[sid];
-		}
-	},
+        if ((type == 2) || (type == 5)) {
+            delete this._data[sid];
+        }
+    },
 
-	// Callback for the developer
+    // Callback for the developer
 
-	object_add:    function(f) { this._cb_object_add    = f; },
-	object_update: function(f) { this._cb_object_update = f; },
-	object_remove: function(f) { this._cb_object_remove = f; },
-	cursor_add:    function(f) { this._cb_cursor_add    = f; },
-	cursor_update: function(f) { this._cb_cursor_update = f; },
-	cursor_remove: function(f) { this._cb_cursor_remove = f; },
+    object_add:    function(f) { this._cb_object_add    = f; },
+    object_update: function(f) { this._cb_object_update = f; },
+    object_remove: function(f) { this._cb_object_remove = f; },
+    cursor_add:    function(f) { this._cb_cursor_add    = f; },
+    cursor_update: function(f) { this._cb_cursor_update = f; },
+    cursor_remove: function(f) { this._cb_cursor_remove = f; },
 }
 
-function tuio_callback(type, sid, fid, x, y, angle)	{
-	tuio.callback(type, sid, fid, x, y, angle);
+function tuio_callback(type, sid, fid, x, y, angle)    {
+    tuio.callback(type, sid, fid, x, y, angle);
 }
 
diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/src/client.cpp
--- a/front_idill/extern/fajran-npTuioClient/src/client.cpp	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/src/client.cpp	Thu Apr 12 15:33:25 2012 +0200
@@ -15,6 +15,10 @@
 // along with this program.  If not, see .
 //
 
+/*
+    Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
+*/
+
 #include "client.h"
 
 #include 
@@ -24,129 +28,129 @@
 
 static inline void call(TuioEvent type, long sid, int fid, float x, float y, float a)
 {
-	TuioEventData data;
-	data.type = type;
-	data.sid = sid;
-	data.fid = fid;
-	data.x = x;
-	data.y = y;
-	data.a = a;
-	tuio_callback(data);
+    TuioEventData data;
+    data.type = type;
+    data.sid = sid;
+    data.fid = fid;
+    data.x = x;
+    data.y = y;
+    data.a = a;
+    tuio_callback(data);
 }
 
 /*
-* Surchargé par alexandre.bastien@iri.centrepompidou.fr
+* Surchargé par alexandre.bastien@iri.centrepompidou.fr
 */
 static inline void call(TuioEvent type, long sid, int fid, float x, float y, float z, float a)
 {
-	TuioEventData data;
-	data.type = type;
-	data.sid = sid;
-	data.fid = fid;
-	data.x = x;
-	data.y = y;
-	data.z = z;
-	data.a = a;
-	data.code = "";
-	tuio_callback(data);
+    TuioEventData data;
+    data.type = type;
+    data.sid = sid;
+    data.fid = fid;
+    data.x = x;
+    data.y = y;
+    data.z = z;
+    data.a = a;
+    data.code = "";
+    tuio_callback(data);
 }
 
 /*
-* Ajouté par alexandre.bastien@iri.centrepompidou.fr
+* Ajouté par alexandre.bastien@iri.centrepompidou.fr
 */
 static inline void call(TuioEvent type, long sid, const char* code)
 {
-	TuioEventData data;
-	data.type = type;
-	data.sid = sid;
-	data.code = code;
-	tuio_callback(data);
+    TuioEventData data;
+    data.type = type;
+    data.sid = sid;
+    data.code = code;
+    tuio_callback(data);
 }
 
 class Listener : public TuioListener
 {
 public:
-	Listener() { };
-	~Listener() { };
+    Listener() { };
+    ~Listener() { };
 
-	void addTuioObject(TuioObject *object)
-	{
-		call(TE_OBJECT_ADD,
-			object->getSessionID(), object->getFiducialID(),
-			object->getX(), object->getY(), object->getAngle());
-	}
+    void addTuioObject(TuioObject *object)
+    {
+        call(TE_OBJECT_ADD,
+            object->getSessionID(), object->getFiducialID(),
+            object->getX(), object->getY(), object->getAngle());
+    }
 
-	void updateTuioObject(TuioObject *object)
-	{
-		call(TE_OBJECT_UPDATE,
-			object->getSessionID(), object->getFiducialID(),
-			object->getX(), object->getY(), object->getAngle());
-	}
+    void updateTuioObject(TuioObject *object)
+    {
+        call(TE_OBJECT_UPDATE,
+            object->getSessionID(), object->getFiducialID(),
+            object->getX(), object->getY(), object->getAngle());
+    }
 
-	void removeTuioObject(TuioObject *object)
-	{
-		call(TE_OBJECT_REMOVE,
-			object->getSessionID(), object->getFiducialID(),
-			object->getX(), object->getY(), object->getAngle());
-	}
-	
-	/*
-	* Modifié par alexandre.bastien@iri.centrepompidou.fr
-	*/
-	void addTuioCursor(TuioCursor *cursor)
-	{
-		call(TE_CURSOR_ADD,
-			cursor->getSessionID(), cursor->getFingerID(),
-			cursor->getX(), cursor->getY(), cursor->getZ(), 0);
-	}
+    void removeTuioObject(TuioObject *object)
+    {
+        call(TE_OBJECT_REMOVE,
+            object->getSessionID(), object->getFiducialID(),
+            object->getX(), object->getY(), object->getAngle());
+    }
+    
+    /*
+    * Modifié par alexandre.bastien@iri.centrepompidou.fr
+    */
+    void addTuioCursor(TuioCursor *cursor)
+    {
+        call(TE_CURSOR_ADD,
+            cursor->getSessionID(), cursor->getFingerID(),
+            cursor->getX(), cursor->getY(), cursor->getZ(), 0);
+    }
 
-	/*
-	* Modifié par alexandre.bastien@iri.centrepompidou.fr
-	*/
-	void updateTuioCursor(TuioCursor *cursor)
-	{
-		call(TE_CURSOR_UPDATE,
-			cursor->getSessionID(), cursor->getFingerID(),
-			cursor->getX(), cursor->getY(), cursor->getZ(), 0);
-	}
+    /*
+    * Modifié par alexandre.bastien@iri.centrepompidou.fr
+    */
+    void updateTuioCursor(TuioCursor *cursor)
+    {
+        call(TE_CURSOR_UPDATE,
+            cursor->getSessionID(), cursor->getFingerID(),
+            cursor->getX(), cursor->getY(), cursor->getZ(), 0);
+    }
 
-	/*
-	* Modifié par alexandre.bastien@iri.centrepompidou.fr
-	*/
-	void removeTuioCursor(TuioCursor *cursor)
-	{
-		call(TE_CURSOR_REMOVE,
-			cursor->getSessionID(), cursor->getFingerID(),
-			cursor->getX(), cursor->getY(), cursor->getZ(), 0);
-	}
+    /*
+    * Modifié par alexandre.bastien@iri.centrepompidou.fr
+    */
+    void removeTuioCursor(TuioCursor *cursor)
+    {
+        call(TE_CURSOR_REMOVE,
+            cursor->getSessionID(), cursor->getFingerID(),
+            cursor->getX(), cursor->getY(), cursor->getZ(), 0);
+    }
 
-	/*
-	* Ajouté par alexandre.bastien@iri.centrepompidou.fr
-	*/
-	void addTuioString(TuioString *string)
-	{
-		call(TE_STRING_ADD, string->getSessionID(), string->getCode());
-	}
+    /*
+    * Ajouté par alexandre.bastien@iri.centrepompidou.fr
+    */
+    void addTuioString(TuioString *string)
+    {
+        call(TE_STRING_ADD, string->getSessionID(), string->getCode());
+    }
 
-	/*
-	* Ajouté par alexandre.bastien@iri.centrepompidou.fr
-	*/
-	void updateTuioString(TuioString *string)
-	{
-		call(TE_STRING_UPDATE, string->getSessionID(), string->getCode());
-	}
+    /*
+    * Ajouté par alexandre.bastien@iri.centrepompidou.fr
+    */
+    void updateTuioString(TuioString *string)
+    {
+        call(TE_STRING_UPDATE, string->getSessionID(), string->getCode());
+    }
 
-	/*
-	* Ajouté par alexandre.bastien@iri.centrepompidou.fr
-	*/
-	void removeTuioString(TuioString *string)
-	{
-		call(TE_STRING_REMOVE, string->getSessionID(), string->getCode());
-	}
-	
-	void refresh(long timestamp) 
-	{
-	}
+    /*
+    * Ajouté par alexandre.bastien@iri.centrepompidou.fr
+    */
+    void removeTuioString(TuioString *string)
+    {
+        call(TE_STRING_REMOVE, string->getSessionID(), string->getCode());
+    }
+    
+    void refresh(long timestamp) 
+    {
+    }
 };
 
 static TuioClient* client = 0;
@@ -154,26 +158,26 @@
 
 void tuio_start(int port)
 {
-	if (!client) {
-		listener = new Listener();
+    if (!client) {
+        listener = new Listener();
 
-		client = new TuioClient(port);
-		client->addTuioListener(listener);
-		client->start();
-	}
+        client = new TuioClient(port);
+        client->addTuioListener(listener);
+        client->start();
+    }
 }
 
 void tuio_stop()
 {
-	client->stop();
-	delete listener;
-	delete client;
+    client->stop();
+    delete listener;
+    delete client;
 
-	client = 0;
-	listener = 0;
+    client = 0;
+    listener = 0;
 }
 
 void t()
 {
-	std::cout << "t" << std::endl;
+    std::cout << "t" << std::endl;
 }
\ No newline at end of file
diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/src/client.h
--- a/front_idill/extern/fajran-npTuioClient/src/client.h	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/src/client.h	Thu Apr 12 15:33:25 2012 +0200
@@ -15,36 +15,40 @@
 // along with this program.  If not, see .
 //
 
+/*
+    Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
+*/
+
 #ifndef CLIENT_H_
 #define CLIENT_H_
 
 #include 
 
 enum TuioEvent {
-	TE_OBJECT_ADD    = 0,
-	TE_OBJECT_UPDATE = 1,
-	TE_OBJECT_REMOVE = 2,
-	TE_CURSOR_ADD    = 3,
-	TE_CURSOR_UPDATE = 4,
-	TE_CURSOR_REMOVE = 5,
-	/*
-	* Ajouté par alexandre.bastien@iri.centrepompidou.fr
-	*/
-	TE_STRING_ADD    = 6,
-	TE_STRING_UPDATE = 7,
-	TE_STRING_REMOVE = 8,
+    TE_OBJECT_ADD    = 0,
+    TE_OBJECT_UPDATE = 1,
+    TE_OBJECT_REMOVE = 2,
+    TE_CURSOR_ADD    = 3,
+    TE_CURSOR_UPDATE = 4,
+    TE_CURSOR_REMOVE = 5,
+    /*
+    * Ajouté par alexandre.bastien@iri.centrepompidou.fr
+    */
+    TE_STRING_ADD    = 6,
+    TE_STRING_UPDATE = 7,
+    TE_STRING_REMOVE = 8,
 };
 
 typedef struct {
-	TuioEvent type;
-	long      fid;
-	int       sid;
-	float     x;
-	float     y;
-	float     z;
-	float     a;
-	//Ajouté par alexandre.bastien@iri.centrepompidou.fr
-	const char* code;
+    TuioEvent type;
+    long      fid;
+    int       sid;
+    float     x;
+    float     y;
+    float     z;
+    float     a;
+    //Ajouté par alexandre.bastien@iri.centrepompidou.fr
+    const char* code;
 } TuioEventData;
 
 /*void tuio_start(int);
@@ -52,11 +56,11 @@
 
 extern void tuio_callback(TuioEventData);
 
-extern "C"
-{
-__declspec(dllexport) void tuio_start(int);
-__declspec(dllexport) void tuio_stop(void);
-__declspec(dllexport) void t(void);
+extern "C"
+{
+__declspec(dllexport) void tuio_start(int);
+__declspec(dllexport) void tuio_stop(void);
+__declspec(dllexport) void t(void);
 }
 
 #endif
diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/src/np_entry.cpp
--- a/front_idill/extern/fajran-npTuioClient/src/np_entry.cpp	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/src/np_entry.cpp	Thu Apr 12 15:33:25 2012 +0200
@@ -59,8 +59,8 @@
   aNPPFuncs->writeready    = NewNPP_WriteReadyProc(Private_WriteReady);
   aNPPFuncs->write         = NewNPP_WriteProc(Private_Write);
   aNPPFuncs->print         = NewNPP_PrintProc(Private_Print);
-  aNPPFuncs->event         = NewNPP_HandleEventProc(Private_HandleEvent);	
-  aNPPFuncs->urlnotify     = NewNPP_URLNotifyProc(Private_URLNotify);			
+  aNPPFuncs->event         = NewNPP_HandleEventProc(Private_HandleEvent);    
+  aNPPFuncs->urlnotify     = NewNPP_URLNotifyProc(Private_URLNotify);            
   aNPPFuncs->getvalue      = NewNPP_GetValueProc(Private_GetValue);
   aNPPFuncs->setvalue      = NewNPP_SetValueProc(Private_SetValue);
 #else
diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/src/npn_gate.cpp
--- a/front_idill/extern/fajran-npTuioClient/src/npn_gate.cpp	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/src/npn_gate.cpp	Thu Apr 12 15:33:25 2012 +0200
@@ -35,13 +35,13 @@
 
 NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target, void* notifyData)
 {
-	int navMinorVers = NPNFuncs.version & 0xFF;
+    int navMinorVers = NPNFuncs.version & 0xFF;
     NPError rv = NPERR_NO_ERROR;
 
     if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
         rv = CallNPN_GetURLNotifyProc(NPNFuncs.geturlnotify, instance, url, target, notifyData);
-	else
-		rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
+    else
+        rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
     
     return rv;
 }
@@ -54,13 +54,13 @@
 
 NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData)
 {
-	int navMinorVers = NPNFuncs.version & 0xFF;
+    int navMinorVers = NPNFuncs.version & 0xFF;
   NPError rv = NPERR_NO_ERROR;
 
-	if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
-		rv = CallNPN_PostURLNotifyProc(NPNFuncs.posturlnotify, instance, url, window, len, buf, file, notifyData);
-	else
-		rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
+    if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
+        rv = CallNPN_PostURLNotifyProc(NPNFuncs.posturlnotify, instance, url, window, len, buf, file, notifyData);
+    else
+        rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
 
   return rv;
 }
@@ -79,40 +79,40 @@
 
 NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream)
 {
-	int navMinorVersion = NPNFuncs.version & 0xFF;
+    int navMinorVersion = NPNFuncs.version & 0xFF;
 
   NPError rv = NPERR_NO_ERROR;
 
-	if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
-		rv = CallNPN_NewStreamProc(NPNFuncs.newstream, instance, type, target, stream);
-	else
-		rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
+    if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
+        rv = CallNPN_NewStreamProc(NPNFuncs.newstream, instance, type, target, stream);
+    else
+        rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
 
   return rv;
 }
 
 int32 NPN_Write(NPP instance, NPStream *stream, int32 len, void *buffer)
 {
-	int navMinorVersion = NPNFuncs.version & 0xFF;
+    int navMinorVersion = NPNFuncs.version & 0xFF;
   int32 rv = 0;
 
   if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
-		rv = CallNPN_WriteProc(NPNFuncs.write, instance, stream, len, buffer);
-	else
-		rv = -1;
+        rv = CallNPN_WriteProc(NPNFuncs.write, instance, stream, len, buffer);
+    else
+        rv = -1;
 
   return rv;
 }
 
 NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
 {
-	int navMinorVersion = NPNFuncs.version & 0xFF;
+    int navMinorVersion = NPNFuncs.version & 0xFF;
   NPError rv = NPERR_NO_ERROR;
 
   if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
-		rv = CallNPN_DestroyStreamProc(NPNFuncs.destroystream, instance, stream, reason);
-	else
-		rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
+        rv = CallNPN_DestroyStreamProc(NPNFuncs.destroystream, instance, stream, reason);
+    else
+        rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
 
   return rv;
 }
@@ -199,6 +199,6 @@
 
 void NPN_PluginThreadAsyncCall (NPP instance, void (*func)(void *), void  *userData)
 {
-	CallNPN_PluginThreadAsyncCallProc(NPNFuncs.pluginthreadasynccall,
-		instance, func,	userData);
+    CallNPN_PluginThreadAsyncCallProc(NPNFuncs.pluginthreadasynccall,
+        instance, func,    userData);
 }
diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/src/npp_gate.cpp
--- a/front_idill/extern/fajran-npTuioClient/src/npp_gate.cpp	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/src/npp_gate.cpp	Thu Apr 12 15:33:25 2012 +0200
@@ -198,7 +198,7 @@
   plugin->URLNotify(url, reason, notifyData);
 }
 
-NPError	NPP_GetValue(NPP instance, NPPVariable variable, void *value)
+NPError    NPP_GetValue(NPP instance, NPPVariable variable, void *value)
 {
   if(instance == NULL)
     return NPERR_INVALID_INSTANCE_ERROR;
@@ -224,7 +224,7 @@
   return rv;
 }
 
-int16	NPP_HandleEvent(NPP instance, void* event)
+int16    NPP_HandleEvent(NPP instance, void* event)
 {
   if(instance == NULL)
     return 0;
@@ -247,10 +247,10 @@
 
 #ifdef XP_MAC
 
-NPError	Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved)
+NPError    Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved)
 {
   NPError rv = NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
-  return rv;	
+  return rv;    
 }
 
 NPError Private_Destroy(NPP instance, NPSavedData** save)
diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/src/plugin.cpp
--- a/front_idill/extern/fajran-npTuioClient/src/plugin.cpp	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/src/plugin.cpp	Thu Apr 12 15:33:25 2012 +0200
@@ -15,6 +15,10 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+/*
+    Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
+*/
+
 #include "plugin.h"
 
 #include 
@@ -40,10 +44,10 @@
 
 void tuio_callback(TuioEventData data)
 {
-	std::set::iterator iter;
-	for (iter = instances.begin(); iter != instances.end(); iter++) {
-		(*iter)->event(data);
-	}
+    std::set::iterator iter;
+    for (iter = instances.begin(); iter != instances.end(); iter++) {
+        (*iter)->event(data);
+    }
 }
 
 void
@@ -86,7 +90,7 @@
 
     plugInitialized = TRUE;
 
-	tuio_start(80);
+    tuio_start(80);
 
     return NPERR_NO_ERROR;
 }
@@ -112,7 +116,7 @@
     plugInitialized = FALSE;
 #endif
 
-	tuio_stop();
+    tuio_stop();
 }
 
 
@@ -187,8 +191,8 @@
     :
     nsPluginInstanceBase(),
     _instance(data->instance),
-	_port(3333),
-	_callback("tuio_callback")
+    _port(3333),
+    _callback("tuio_callback")
 {
     for (size_t i=0, n=data->argc; idata.type << ", ";
-	ss << event->data.sid << ", ";
-	ss << event->data.fid << ", ";
-	ss << event->data.x << ", ";
-	ss << event->data.y << ", ";
-	ss << event->data.z << ", ";
-	ss << event->data.a << ", ";
-	if(event->data.code == NULL || event->data.code == "")
-		ss << "\"\");";
-	else
-		ss << "\"" << event->data.code << "\"" << ");";
-	
-	NPN_GetURL(event->instance, ss.str().c_str(), "_self");
+    D("ev=" << ev);
+    Event* event = (Event*)ev;
+    D("event=" << event);
+    std::stringstream ss;
+    ss << "javascript:tuio_callback(";
+    ss << event->data.type << ", ";
+    ss << event->data.sid << ", ";
+    ss << event->data.fid << ", ";
+    ss << event->data.x << ", ";
+    ss << event->data.y << ", ";
+    ss << event->data.z << ", ";
+    ss << event->data.a << ", ";
+    if(event->data.code == NULL || event->data.code == "")
+        ss << "\"\");";
+    else
+        ss << "\"" << event->data.code << "\"" << ");";
+    
+    NPN_GetURL(event->instance, ss.str().c_str(), "_self");
 
-	delete event;
+    delete event;
 }
 
 void nsPluginInstance::event(TuioEventData data)
 {
-	D("[event] callback: type=" << data.type
-	<< ", sid=" << data.sid << ", fid=" << data.fid
-	<< ", x=" << data.x << ", y=" << data.y
-	<< ", z=" << data.z << ", a=" << data.a
-	<< ", code=" << "\"" << data.code << "\"");
-	
-	Event* ev = new Event();
-	ev->instance = _instance;
-	ev->data = data;
+    D("[event] callback: type=" << data.type
+    << ", sid=" << data.sid << ", fid=" << data.fid
+    << ", x=" << data.x << ", y=" << data.y
+    << ", z=" << data.z << ", a=" << data.a
+    << ", code=" << "\"" << data.code << "\"");
+    
+    Event* ev = new Event();
+    ev->instance = _instance;
+    ev->data = data;
 
-	NPN_PluginThreadAsyncCall(_instance, test, ev);
+    NPN_PluginThreadAsyncCall(_instance, test, ev);
 }
 
 // Local Variables:
diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/src/plugin.h
--- a/front_idill/extern/fajran-npTuioClient/src/plugin.h	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/src/plugin.h	Thu Apr 12 15:33:25 2012 +0200
@@ -15,6 +15,9 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+/*
+    Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
+*/
 
 #ifndef PLUGIN_H
 #define PLUGIN_H
@@ -50,14 +53,14 @@
 
     NPError WriteStatus(const char *msg) const;
 
-	void event(TuioEventData);
+    void event(TuioEventData);
 
 
 private:
     NPP         _instance;
 
-	int         _port;
-	std::string _callback;
+    int         _port;
+    std::string _callback;
 };
 
 // end of __PLUGIN_H__
diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-tuiojs/connector/npTuioClient/tuiojs.npTuioClient.js
--- a/front_idill/extern/fajran-tuiojs/connector/npTuioClient/tuiojs.npTuioClient.js	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-tuiojs/connector/npTuioClient/tuiojs.npTuioClient.js	Thu Apr 12 15:33:25 2012 +0200
@@ -1,35 +1,38 @@
+/*
+    Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
+*/
 
 tuio.setConnector({
-	_failmsg: "Unable to initialize npTuioClient plugin.",
-	_id: "__tuiojs_connector_npTuioClient",
+    _failmsg: "Unable to initialize npTuioClient plugin.",
+    _id: "__tuiojs_connector_npTuioClient",
 
-	start: function() {
-		var el = document.getElementById(this._id);
-		if (el == undefined) {
-			var el = document.createElement('object');
-			el.setAttribute('id', this._id);
-			el.setAttribute('type', 'application/x-tuio');
-			el.appendChild(document.createTextNode(this._failmsg));
-			document.body.appendChild(el);
-		}
+    start: function() {
+        var el = document.getElementById(this._id);
+        if (el == undefined) {
+            var el = document.createElement('object');
+            el.setAttribute('id', this._id);
+            el.setAttribute('type', 'application/x-tuio');
+            el.appendChild(document.createTextNode(this._failmsg));
+            document.body.appendChild(el);
+        }
 
-		// TODO: check if the plugin can be loaded. 
-		//       if so, hide the plugin (display:none).
-	},
+        // TODO: check if the plugin can be loaded. 
+        //       if so, hide the plugin (display:none).
+    },
 
-	stop: function() {
-		var el = document.getElementById(this._id);
-		if (el != undefined) {
-			document.body.removeChild(el);
-		}
-	}
+    stop: function() {
+        var el = document.getElementById(this._id);
+        if (el != undefined) {
+            document.body.removeChild(el);
+        }
+    }
 });
 
 function tuio_callback(type, sid, fid, x, y, z, angle, code)  {
 
-	if(type < 6)
-		tuio.cursorCallback(type, sid, fid, x, y, z, angle);
-	else
-		tuio.stringCallback(type, sid, code);
+    if(type < 6)
+        tuio.cursorCallback(type, sid, fid, x, y, z, angle);
+    else
+        tuio.stringCallback(type, sid, code);
 }
 
diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-tuiojs/examples/processingjs/hand_pointing.html
--- a/front_idill/extern/fajran-tuiojs/examples/processingjs/hand_pointing.html	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-tuiojs/examples/processingjs/hand_pointing.html	Thu Apr 12 15:33:25 2012 +0200
@@ -1,149 +1,152 @@
-
-
-
-
-
-
-
-
-
-
-
- - -
- + + + + + + + + + + + +
+ + +
+ diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-tuiojs/examples/processingjs/paint.html --- a/front_idill/extern/fajran-tuiojs/examples/processingjs/paint.html Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-tuiojs/examples/processingjs/paint.html Thu Apr 12 15:33:25 2012 +0200 @@ -24,8 +24,8 @@ var list = client.getTuioCursors(); int i, len = list.length(); for (i=0; i - - - - - - - - -
- - -
- + + + + + + + + + + + +
+ + +
+ diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-tuiojs/examples/processingjs/tuio.processing.js --- a/front_idill/extern/fajran-tuiojs/examples/processingjs/tuio.processing.js Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-tuiojs/examples/processingjs/tuio.processing.js Thu Apr 12 15:33:25 2012 +0200 @@ -1,3 +1,6 @@ +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ // add hooks (function(){ @@ -20,119 +23,119 @@ * Modifié par alexandre.bastien@iri.centrepompidou.fr */ function wrapPath(d) { - var i, len = d.path.length; - var res = []; - for (i=0; i= 6) - return; - - var data; - - if ((type != 0) && (type != 3)) { - data = this._data[sid]; - } - else { - data = { - sid: sid, - fid: fid, - path: [] - } - this._data[sid] = data; - } + cursorCallback: function(type, sid, fid, x, y, z, angle) { + if(type >= 6) + return; + + var data; + + if ((type != 0) && (type != 3)) { + data = this._data[sid]; + } + else { + data = { + sid: sid, + fid: fid, + path: [] + } + this._data[sid] = data; + } - data.path.push([x, y, z]); - - data.x = x; - data.y = y; - data.z = z; - - if (type < 3) { - data.angle = angle; - } - - switch (type) { - case 0: - this.objects.push(data); - this._invoke('object_add', data); - break; - - case 1: - this._invoke('object_update', data); - break; - - case 2: - this.objects.splice(this.objects.indexOf(data), 1); - this._invoke('object_remove', data); - break; - - case 3: - this.cursors.push(data); - this._invoke('cursor_add', data); - break; - - case 4: - this._invoke('cursor_update', data); - break; - - case 5: - this.cursors.splice(this.cursors.indexOf(data), 1); - this._invoke('cursor_remove', data); - break; - - default: - break; - } - - if ((type == 2) || (type == 5)) { - delete this._data[sid]; - } - }, - - stringCallback: function(type, sid, code) { - if(type < 6) - return; - - var data; - - if ((type != 6)) { - data = this._data[sid]; - } - else { - data = { - sid: sid, - code: code - } - this._data[sid] = data; - } - - //data.code = code; - - switch (type) { - case 6: - if(this.strings != null && this.strings.length <= 0) - { - this.strings.push(data); - this._invoke('string_add', data); - test++; - //alert(test); - } - break; - - case 7: - this._invoke('string_update', data); - break; - - case 8: - //var str = ""; - //for(var j = 0 ; j < this.strings.length ; j++) - //str += "(" + this.strings[i].sid + ")" + this.strings[i].code + " "; - //alert(str); - //this.strings.splice(this.strings.indexOf(data), 1); - this.strings.length = 0; - this._invoke('string_remove', data); - test--; - alert(test); - break; + data.path.push([x, y, z]); + + data.x = x; + data.y = y; + data.z = z; + + if (type < 3) { + data.angle = angle; + } + + switch (type) { + case 0: + this.objects.push(data); + this._invoke('object_add', data); + break; + + case 1: + this._invoke('object_update', data); + break; + + case 2: + this.objects.splice(this.objects.indexOf(data), 1); + this._invoke('object_remove', data); + break; + + case 3: + this.cursors.push(data); + this._invoke('cursor_add', data); + break; + + case 4: + this._invoke('cursor_update', data); + break; + + case 5: + this.cursors.splice(this.cursors.indexOf(data), 1); + this._invoke('cursor_remove', data); + break; + + default: + break; + } + + if ((type == 2) || (type == 5)) { + delete this._data[sid]; + } + }, + + stringCallback: function(type, sid, code) { + if(type < 6) + return; + + var data; + + if ((type != 6)) { + data = this._data[sid]; + } + else { + data = { + sid: sid, + code: code + } + this._data[sid] = data; + } + + //data.code = code; + + switch (type) { + case 6: + if(this.strings != null && this.strings.length <= 0) + { + this.strings.push(data); + this._invoke('string_add', data); + test++; + //alert(test); + } + break; + + case 7: + this._invoke('string_update', data); + break; + + case 8: + //var str = ""; + //for(var j = 0 ; j < this.strings.length ; j++) + //str += "(" + this.strings[i].sid + ")" + this.strings[i].code + " "; + //alert(str); + //this.strings.splice(this.strings.indexOf(data), 1); + this.strings.length = 0; + this._invoke('string_remove', data); + test--; + alert(test); + break; - default: - break; - } - - if ((type == 8)) { - delete this._data[sid]; - } - }, + default: + break; + } + + if ((type == 8)) { + delete this._data[sid]; + } + }, - // Convenient callbacks set + // Convenient callbacks set - object_add: function(f) { this._default_listener.object_add = f; }, - object_update: function(f) { this._default_listener.object_update = f; }, - object_remove: function(f) { this._default_listener.object_remove = f; }, - cursor_add: function(f) { this._default_listener.cursor_add = f; }, - cursor_update: function(f) { this._default_listener.cursor_update = f; }, - cursor_remove: function(f) { this._default_listener.cursor_remove = f; }, - string_add: function(f) { this._default_listener.string_add = f; }, - string_update: function(f) { this._default_listener.string_update = f; }, - string_remove: function(f) { this._default_listener.string_remove = f; } + object_add: function(f) { this._default_listener.object_add = f; }, + object_update: function(f) { this._default_listener.object_update = f; }, + object_remove: function(f) { this._default_listener.object_remove = f; }, + cursor_add: function(f) { this._default_listener.cursor_add = f; }, + cursor_update: function(f) { this._default_listener.cursor_update = f; }, + cursor_remove: function(f) { this._default_listener.cursor_remove = f; }, + string_add: function(f) { this._default_listener.string_add = f; }, + string_update: function(f) { this._default_listener.string_update = f; }, + string_remove: function(f) { this._default_listener.string_remove = f; } - }; - this.tuio = new TUIO(); + }; + this.tuio = new TUIO(); })(); diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TUIO/TuioClient.java --- a/front_processing/extern/TUIO_JAVA/src/TUIO/TuioClient.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioClient.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,643 +1,647 @@ -/* - TUIO Java backend - part of the reacTIVision project - http://reactivision.sourceforge.net/ - - Copyright (c) 2005-2009 Martin Kaltenbrunner - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -package TUIO; - -import com.illposed.osc.*; -import java.util.*; - -/** - * The TuioClient class is the central TUIO protocol decoder component. It provides a simple callback infrastructure using the {@link TuioListener} interface. - * In order to receive and decode TUIO messages an instance of TuioClient needs to be created. The TuioClient instance then generates TUIO events - * which are broadcasted to all registered classes that implement the {@link TuioListener} interface.

- * - * TuioClient client = new TuioClient();
- * client.addTuioListener(myTuioListener);
- * client.connect();
- *
- * - * @author Martin Kaltenbrunner - * @version 1.4 - */ -public class TuioClient implements OSCListener { - - public String comm; - - private int port = 3333; - private OSCPortIn oscPort; - private boolean connected = false; - private Hashtable objectList = new Hashtable(); - private Vector aliveObjectList = new Vector(); - private Vector newObjectList = new Vector(); - private Hashtable cursorList = new Hashtable(); - private Vector aliveCursorList = new Vector(); - private Vector newCursorList = new Vector(); - private Hashtable stringList = new Hashtable(); - private Vector aliveStringList = new Vector(); - private Vector newStringList = new Vector(); - - private Vector frameObjects = new Vector(); - private Vector frameCursors = new Vector(); - private Vector frameStrings = new Vector(); - - private Vector freeCursorList = new Vector(); - private int maxCursorID = -1; - - private Vector freeStringList = new Vector(); - private int maxStringID = -1; - - private long currentFrame = 0; - private TuioTime currentTime; - - private Vector listenerList = new Vector(); - - /** - * The default constructor creates a client that listens to the default TUIO port 3333 - */ - public TuioClient() {} - - /** - * This constructor creates a client that listens to the provided port - * - * @param port the listening port number - */ - public TuioClient(int port) { - this.port = port; - } - - /** - * The TuioClient starts listening to TUIO messages on the configured UDP port - * All reveived TUIO messages are decoded and the resulting TUIO events are broadcasted to all registered TuioListeners - */ - public void connect() { - - TuioTime.initSession(); - currentTime = new TuioTime(); - currentTime.reset(); - - try { - oscPort = new OSCPortIn(port); - oscPort.addListener("/tuio/2Dobj",this); - oscPort.addListener("/tuio/3Dcur",this); - oscPort.addListener("/tuio/_siP",this); - oscPort.startListening(); - connected = true; - } catch (Exception e) { - System.out.println("TuioClient: failed to connect to port "+port); - connected = false; - } - } - - /** - * The TuioClient stops listening to TUIO messages on the configured UDP port - */ - public void disconnect() { - oscPort.stopListening(); - try { Thread.sleep(100); } - catch (Exception e) {}; - oscPort.close(); - connected = false; - } - - /** - * Returns true if this TuioClient is currently connected. - * @return true if this TuioClient is currently connected - */ - public boolean isConnected() { return connected; } - - /** - * Adds the provided TuioListener to the list of registered TUIO event listeners - * - * @param listener the TuioListener to add - */ - public void addTuioListener(TuioListener listener) { - listenerList.addElement(listener); - } - - /** - * Removes the provided TuioListener from the list of registered TUIO event listeners - * - * @param listener the TuioListener to remove - */ - public void removeTuioListener(TuioListener listener) { - listenerList.removeElement(listener); - } - - /** - * Removes all TuioListener from the list of registered TUIO event listeners - */ - public void removeAllTuioListeners() { - listenerList.clear(); - } - - /** - * Returns a Vector of all currently active TuioObjects - * - * @return a Vector of all currently active TuioObjects - */ - public Vector getTuioObjects() { - return new Vector(objectList.values()); - } - - /** - * Returns a Vector of all currently active TuioCursors - * - * @return a Vector of all currently active TuioCursors - */ - public Vector getTuioCursors() { - return new Vector(cursorList.values()); - } - - /** - * Returns a Vector of all currently active TuioStrings - * - * @return a Vector of all currently active TuioStrings - */ - public Vector getTuioStrings() { - return new Vector(stringList.values()); - } - - /** - * Returns the TuioObject corresponding to the provided Session ID - * or NULL if the Session ID does not refer to an active TuioObject - * - * @return an active TuioObject corresponding to the provided Session ID or NULL - */ - public TuioObject getTuioObject(long s_id) { - return objectList.get(s_id); - } - - /** - * Returns the TuioCursor corresponding to the provided Session ID - * or NULL if the Session ID does not refer to an active TuioCursor - * - * @return an active TuioCursor corresponding to the provided Session ID or NULL - */ - public TuioCursor getTuioCursor(long s_id) { - return cursorList.get(s_id); - } - - /** - * Returns the TuioString corresponding to the provided Session ID - * or NULL if the Session ID does not refer to an active TuioString - * - * @return an active TuioString corresponding to the provided Session ID or NULL - */ - public TuioString getTuioString(long s_id) { - return stringList.get(s_id); - } - - /** - * The OSC callback method where all TUIO messages are received and decoded - * and where the TUIO event callbacks are dispatched - * - * @param date the time stamp of the OSC bundle - * @param message the received OSC message - */ - public void acceptMessage(Date date, OSCMessage message) { - - Object[] args = message.getArguments(); - String command = (String)args[0]; - String address = message.getAddress(); - - if (address.equals("/tuio/2Dobj")) { - - if (command.equals("set")) { - - long s_id = ((Integer)args[1]).longValue(); - int c_id = ((Integer)args[2]).intValue(); - float xpos = ((Float)args[3]).floatValue(); - float ypos = ((Float)args[4]).floatValue(); - float angle = ((Float)args[5]).floatValue(); - float xspeed = ((Float)args[6]).floatValue(); - float yspeed = ((Float)args[7]).floatValue(); - float rspeed = ((Float)args[8]).floatValue(); - float maccel = ((Float)args[9]).floatValue(); - float raccel = ((Float)args[10]).floatValue(); - - if (objectList.get(s_id) == null) { - - TuioObject addObject = new TuioObject(s_id,c_id,xpos,ypos,angle); - frameObjects.addElement(addObject); - - } else { - - TuioObject tobj = objectList.get(s_id); - if (tobj==null) return; - if ((tobj.xpos!=xpos) || (tobj.ypos!=ypos) || (tobj.angle!=angle) || (tobj.x_speed!=xspeed) || (tobj.y_speed!=yspeed) || (tobj.rotation_speed!=rspeed) || (tobj.motion_accel!=maccel) || (tobj.rotation_accel!=raccel)) { - - TuioObject updateObject = new TuioObject(s_id,c_id,xpos,ypos,angle); - updateObject.update(xpos,ypos,angle,xspeed,yspeed,rspeed,maccel,raccel); - frameObjects.addElement(updateObject); - } - - } - - } else if (command.equals("alive")) { - - newObjectList.clear(); - for (int i=1;i0) { - if (fseq>currentFrame) currentTime = TuioTime.getSessionTime(); - if ((fseq>=currentFrame) || ((currentFrame-fseq)>100)) currentFrame=fseq; - else lateFrame = true; - } else if (TuioTime.getSessionTime().subtract(currentTime).getTotalMilliseconds()>100) { - currentTime = TuioTime.getSessionTime(); - } - - if (!lateFrame) { - Enumeration frameEnum = frameObjects.elements(); - while(frameEnum.hasMoreElements()) { - TuioObject tobj = frameEnum.nextElement(); - - switch (tobj.getTuioState()) { - case TuioObject.TUIO_REMOVED: - TuioObject removeObject = tobj; - removeObject.remove(currentTime); - for (int i=0;i buffer = aliveObjectList; - aliveObjectList = newObjectList; - // recycling the vector - newObjectList = buffer; - } - frameObjects.clear(); - } - } else if (address.equals("/tuio/3Dcur")) { - - if (command.equals("set")) { - - long s_id = ((Integer)args[1]).longValue(); - float xpos = ((Float)args[2]).floatValue(); - float ypos = ((Float)args[3]).floatValue(); - float zpos = ((Float)args[4]).floatValue(); - float xspeed = ((Float)args[5]).floatValue(); - float yspeed = ((Float)args[6]).floatValue(); - float maccel = ((Float)args[7]).floatValue(); - - if (cursorList.get(s_id) == null) { - - TuioCursor addCursor = new TuioCursor(s_id, -1 ,xpos,ypos,zpos); - frameCursors.addElement(addCursor); - - } else { - - TuioCursor tcur = cursorList.get(s_id); - if (tcur==null) return; - if ((tcur.xpos!=xpos) || (tcur.ypos!=ypos) || (tcur.zpos!=zpos) || (tcur.x_speed!=xspeed) || (tcur.y_speed!=yspeed) || (tcur.motion_accel!=maccel)) { - - TuioCursor updateCursor = new TuioCursor(s_id,tcur.getCursorID(),xpos,ypos,zpos); - updateCursor.update(xpos,ypos,zpos,xspeed,yspeed,maccel); - frameCursors.addElement(updateCursor); - } - } - - //System.out.println("set cur " + s_id+" "+xpos+" "+ypos+" "+xspeed+" "+yspeed+" "+maccel); - - } else if (command.equals("alive")) { - - newCursorList.clear(); - for (int i=1;i0) { - if (fseq>currentFrame) currentTime = TuioTime.getSessionTime(); - if ((fseq>=currentFrame) || ((currentFrame-fseq)>100)) currentFrame = fseq; - else lateFrame = true; - } else if (TuioTime.getSessionTime().subtract(currentTime).getTotalMilliseconds()>100) { - currentTime = TuioTime.getSessionTime(); - } - if (!lateFrame) { - - Enumeration frameEnum = frameCursors.elements(); - while(frameEnum.hasMoreElements()) { - TuioCursor tcur = frameEnum.nextElement(); - - switch (tcur.getTuioState()) { - case TuioCursor.TUIO_REMOVED: - - TuioCursor removeCursor = tcur; - removeCursor.remove(currentTime); - - for (int i=0;i0) { - Enumeration clist = cursorList.elements(); - while (clist.hasMoreElements()) { - int c_id = clist.nextElement().getCursorID(); - if (c_id>maxCursorID) maxCursorID=c_id; - } - - Enumeration flist = freeCursorList.elements(); - while (flist.hasMoreElements()) { - int c_id = flist.nextElement().getCursorID(); - if (c_id>=maxCursorID) freeCursorList.removeElement(c_id); - } - } else freeCursorList.clear(); - } else if (removeCursor.getCursorID()0)) { - TuioCursor closestCursor = freeCursorList.firstElement(); - Enumeration testList = freeCursorList.elements(); - while (testList.hasMoreElements()) { - TuioCursor testCursor = testList.nextElement(); - if (testCursor.getDistance(tcur) buffer = aliveCursorList; - aliveCursorList = newCursorList; - // recycling the vector - newCursorList = buffer; - } - - frameCursors.clear(); - } - } else if (address.equals("/tuio/_siP")) { - - if (command.equals("set")) { - - long s_id = ((Integer)args[1]).longValue(); - String msg = args[2].toString(); - - if (stringList.get(s_id) == null) { - - TuioString addString = new TuioString(s_id, -1, msg); - frameStrings.addElement(addString); - - } else { - - TuioString tstr = stringList.get(s_id); - if (tstr==null) return; - if (!tstr.getMessage().equals(msg)) { - - TuioString updateString = new TuioString(s_id,tstr.getStringID(),msg); - updateString.update(msg); - frameStrings.addElement(updateString); - } - } - - //System.out.println("set cur " + s_id+" "+xpos+" "+ypos+" "+xspeed+" "+yspeed+" "+maccel); - - } else if (command.equals("alive")) { - - newStringList.clear(); - for (int i=1;i0) { - if (fseq>currentFrame) currentTime = TuioTime.getSessionTime(); - if ((fseq>=currentFrame) || ((currentFrame-fseq)>100)) currentFrame = fseq; - else lateFrame = true; - } else if (TuioTime.getSessionTime().subtract(currentTime).getTotalMilliseconds()>100) { - currentTime = TuioTime.getSessionTime(); - } - if (!lateFrame) { - - Enumeration frameEnum = frameStrings.elements(); - while(frameEnum.hasMoreElements()) { - TuioString tstr = frameEnum.nextElement(); - - switch (tstr.getTuioState()) { - case TuioString.TUIO_REMOVED: - - TuioString removeString = tstr; - removeString.remove(currentTime); - - for (int i=0;i0) { - Enumeration slist = stringList.elements(); - while (slist.hasMoreElements()) { - int sl_id = slist.nextElement().getStringID(); - if (sl_id>maxStringID) maxStringID=sl_id; - } - - Enumeration flist = freeStringList.elements(); - while (flist.hasMoreElements()) { - int sl_id = flist.nextElement().getStringID(); - if (sl_id>=maxStringID) freeStringList.removeElement(sl_id); - } - } else freeStringList.clear(); - } else if (removeString.getStringID()0)) { - TuioString closestString = freeStringList.firstElement(); - Enumeration testList = freeStringList.elements(); - while (testList.hasMoreElements()) { - TuioString testString = testList.nextElement(); - //if (testString.getDistance(tstr) buffer = aliveStringList; - aliveStringList = newStringList; - // recycling the vector - newStringList = buffer; - } - - frameStrings.clear(); - } - } - - - } -} +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +package TUIO; + +import com.illposed.osc.*; +import java.util.*; + +/** + * The TuioClient class is the central TUIO protocol decoder component. It provides a simple callback infrastructure using the {@link TuioListener} interface. + * In order to receive and decode TUIO messages an instance of TuioClient needs to be created. The TuioClient instance then generates TUIO events + * which are broadcasted to all registered classes that implement the {@link TuioListener} interface.

+ * + * TuioClient client = new TuioClient();
+ * client.addTuioListener(myTuioListener);
+ * client.connect();
+ *
+ * + * @author Martin Kaltenbrunner + * @version 1.4 + */ + + /* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ +public class TuioClient implements OSCListener { + + public String comm; + + private int port = 3333; + private OSCPortIn oscPort; + private boolean connected = false; + private Hashtable objectList = new Hashtable(); + private Vector aliveObjectList = new Vector(); + private Vector newObjectList = new Vector(); + private Hashtable cursorList = new Hashtable(); + private Vector aliveCursorList = new Vector(); + private Vector newCursorList = new Vector(); + private Hashtable stringList = new Hashtable(); + private Vector aliveStringList = new Vector(); + private Vector newStringList = new Vector(); + + private Vector frameObjects = new Vector(); + private Vector frameCursors = new Vector(); + private Vector frameStrings = new Vector(); + + private Vector freeCursorList = new Vector(); + private int maxCursorID = -1; + + private Vector freeStringList = new Vector(); + private int maxStringID = -1; + + private long currentFrame = 0; + private TuioTime currentTime; + + private Vector listenerList = new Vector(); + + /** + * The default constructor creates a client that listens to the default TUIO port 3333 + */ + public TuioClient() {} + + /** + * This constructor creates a client that listens to the provided port + * + * @param port the listening port number + */ + public TuioClient(int port) { + this.port = port; + } + + /** + * The TuioClient starts listening to TUIO messages on the configured UDP port + * All reveived TUIO messages are decoded and the resulting TUIO events are broadcasted to all registered TuioListeners + */ + public void connect() { + + TuioTime.initSession(); + currentTime = new TuioTime(); + currentTime.reset(); + + try { + oscPort = new OSCPortIn(port); + oscPort.addListener("/tuio/2Dobj",this); + oscPort.addListener("/tuio/3Dcur",this); + oscPort.addListener("/tuio/_siP",this); + oscPort.startListening(); + connected = true; + } catch (Exception e) { + System.out.println("TuioClient: failed to connect to port "+port); + connected = false; + } + } + + /** + * The TuioClient stops listening to TUIO messages on the configured UDP port + */ + public void disconnect() { + oscPort.stopListening(); + try { Thread.sleep(100); } + catch (Exception e) {}; + oscPort.close(); + connected = false; + } + + /** + * Returns true if this TuioClient is currently connected. + * @return true if this TuioClient is currently connected + */ + public boolean isConnected() { return connected; } + + /** + * Adds the provided TuioListener to the list of registered TUIO event listeners + * + * @param listener the TuioListener to add + */ + public void addTuioListener(TuioListener listener) { + listenerList.addElement(listener); + } + + /** + * Removes the provided TuioListener from the list of registered TUIO event listeners + * + * @param listener the TuioListener to remove + */ + public void removeTuioListener(TuioListener listener) { + listenerList.removeElement(listener); + } + + /** + * Removes all TuioListener from the list of registered TUIO event listeners + */ + public void removeAllTuioListeners() { + listenerList.clear(); + } + + /** + * Returns a Vector of all currently active TuioObjects + * + * @return a Vector of all currently active TuioObjects + */ + public Vector getTuioObjects() { + return new Vector(objectList.values()); + } + + /** + * Returns a Vector of all currently active TuioCursors + * + * @return a Vector of all currently active TuioCursors + */ + public Vector getTuioCursors() { + return new Vector(cursorList.values()); + } + + /** + * Returns a Vector of all currently active TuioStrings + * + * @return a Vector of all currently active TuioStrings + */ + public Vector getTuioStrings() { + return new Vector(stringList.values()); + } + + /** + * Returns the TuioObject corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioObject + * + * @return an active TuioObject corresponding to the provided Session ID or NULL + */ + public TuioObject getTuioObject(long s_id) { + return objectList.get(s_id); + } + + /** + * Returns the TuioCursor corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioCursor + * + * @return an active TuioCursor corresponding to the provided Session ID or NULL + */ + public TuioCursor getTuioCursor(long s_id) { + return cursorList.get(s_id); + } + + /** + * Returns the TuioString corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioString + * + * @return an active TuioString corresponding to the provided Session ID or NULL + */ + public TuioString getTuioString(long s_id) { + return stringList.get(s_id); + } + + /** + * The OSC callback method where all TUIO messages are received and decoded + * and where the TUIO event callbacks are dispatched + * + * @param date the time stamp of the OSC bundle + * @param message the received OSC message + */ + public void acceptMessage(Date date, OSCMessage message) { + + Object[] args = message.getArguments(); + String command = (String)args[0]; + String address = message.getAddress(); + + if (address.equals("/tuio/2Dobj")) { + + if (command.equals("set")) { + + long s_id = ((Integer)args[1]).longValue(); + int c_id = ((Integer)args[2]).intValue(); + float xpos = ((Float)args[3]).floatValue(); + float ypos = ((Float)args[4]).floatValue(); + float angle = ((Float)args[5]).floatValue(); + float xspeed = ((Float)args[6]).floatValue(); + float yspeed = ((Float)args[7]).floatValue(); + float rspeed = ((Float)args[8]).floatValue(); + float maccel = ((Float)args[9]).floatValue(); + float raccel = ((Float)args[10]).floatValue(); + + if (objectList.get(s_id) == null) { + + TuioObject addObject = new TuioObject(s_id,c_id,xpos,ypos,angle); + frameObjects.addElement(addObject); + + } else { + + TuioObject tobj = objectList.get(s_id); + if (tobj==null) return; + if ((tobj.xpos!=xpos) || (tobj.ypos!=ypos) || (tobj.angle!=angle) || (tobj.x_speed!=xspeed) || (tobj.y_speed!=yspeed) || (tobj.rotation_speed!=rspeed) || (tobj.motion_accel!=maccel) || (tobj.rotation_accel!=raccel)) { + + TuioObject updateObject = new TuioObject(s_id,c_id,xpos,ypos,angle); + updateObject.update(xpos,ypos,angle,xspeed,yspeed,rspeed,maccel,raccel); + frameObjects.addElement(updateObject); + } + + } + + } else if (command.equals("alive")) { + + newObjectList.clear(); + for (int i=1;i0) { + if (fseq>currentFrame) currentTime = TuioTime.getSessionTime(); + if ((fseq>=currentFrame) || ((currentFrame-fseq)>100)) currentFrame=fseq; + else lateFrame = true; + } else if (TuioTime.getSessionTime().subtract(currentTime).getTotalMilliseconds()>100) { + currentTime = TuioTime.getSessionTime(); + } + + if (!lateFrame) { + Enumeration frameEnum = frameObjects.elements(); + while(frameEnum.hasMoreElements()) { + TuioObject tobj = frameEnum.nextElement(); + + switch (tobj.getTuioState()) { + case TuioObject.TUIO_REMOVED: + TuioObject removeObject = tobj; + removeObject.remove(currentTime); + for (int i=0;i buffer = aliveObjectList; + aliveObjectList = newObjectList; + // recycling the vector + newObjectList = buffer; + } + frameObjects.clear(); + } + } else if (address.equals("/tuio/3Dcur")) { + + if (command.equals("set")) { + + long s_id = ((Integer)args[1]).longValue(); + float xpos = ((Float)args[2]).floatValue(); + float ypos = ((Float)args[3]).floatValue(); + float zpos = ((Float)args[4]).floatValue(); + float xspeed = ((Float)args[5]).floatValue(); + float yspeed = ((Float)args[6]).floatValue(); + float maccel = ((Float)args[7]).floatValue(); + + if (cursorList.get(s_id) == null) { + + TuioCursor addCursor = new TuioCursor(s_id, -1 ,xpos,ypos,zpos); + frameCursors.addElement(addCursor); + + } else { + + TuioCursor tcur = cursorList.get(s_id); + if (tcur==null) return; + if ((tcur.xpos!=xpos) || (tcur.ypos!=ypos) || (tcur.zpos!=zpos) || (tcur.x_speed!=xspeed) || (tcur.y_speed!=yspeed) || (tcur.motion_accel!=maccel)) { + + TuioCursor updateCursor = new TuioCursor(s_id,tcur.getCursorID(),xpos,ypos,zpos); + updateCursor.update(xpos,ypos,zpos,xspeed,yspeed,maccel); + frameCursors.addElement(updateCursor); + } + } + + //System.out.println("set cur " + s_id+" "+xpos+" "+ypos+" "+xspeed+" "+yspeed+" "+maccel); + + } else if (command.equals("alive")) { + + newCursorList.clear(); + for (int i=1;i0) { + if (fseq>currentFrame) currentTime = TuioTime.getSessionTime(); + if ((fseq>=currentFrame) || ((currentFrame-fseq)>100)) currentFrame = fseq; + else lateFrame = true; + } else if (TuioTime.getSessionTime().subtract(currentTime).getTotalMilliseconds()>100) { + currentTime = TuioTime.getSessionTime(); + } + if (!lateFrame) { + + Enumeration frameEnum = frameCursors.elements(); + while(frameEnum.hasMoreElements()) { + TuioCursor tcur = frameEnum.nextElement(); + + switch (tcur.getTuioState()) { + case TuioCursor.TUIO_REMOVED: + + TuioCursor removeCursor = tcur; + removeCursor.remove(currentTime); + + for (int i=0;i0) { + Enumeration clist = cursorList.elements(); + while (clist.hasMoreElements()) { + int c_id = clist.nextElement().getCursorID(); + if (c_id>maxCursorID) maxCursorID=c_id; + } + + Enumeration flist = freeCursorList.elements(); + while (flist.hasMoreElements()) { + int c_id = flist.nextElement().getCursorID(); + if (c_id>=maxCursorID) freeCursorList.removeElement(c_id); + } + } else freeCursorList.clear(); + } else if (removeCursor.getCursorID()0)) { + TuioCursor closestCursor = freeCursorList.firstElement(); + Enumeration testList = freeCursorList.elements(); + while (testList.hasMoreElements()) { + TuioCursor testCursor = testList.nextElement(); + if (testCursor.getDistance(tcur) buffer = aliveCursorList; + aliveCursorList = newCursorList; + // recycling the vector + newCursorList = buffer; + } + + frameCursors.clear(); + } + } else if (address.equals("/tuio/_siP")) { + + if (command.equals("set")) { + + long s_id = ((Integer)args[1]).longValue(); + String msg = args[2].toString(); + + if (stringList.get(s_id) == null) { + + TuioString addString = new TuioString(s_id, -1, msg); + frameStrings.addElement(addString); + + } else { + + TuioString tstr = stringList.get(s_id); + if (tstr==null) return; + if (!tstr.getMessage().equals(msg)) { + + TuioString updateString = new TuioString(s_id,tstr.getStringID(),msg); + updateString.update(msg); + frameStrings.addElement(updateString); + } + } + + //System.out.println("set cur " + s_id+" "+xpos+" "+ypos+" "+xspeed+" "+yspeed+" "+maccel); + + } else if (command.equals("alive")) { + + newStringList.clear(); + for (int i=1;i0) { + if (fseq>currentFrame) currentTime = TuioTime.getSessionTime(); + if ((fseq>=currentFrame) || ((currentFrame-fseq)>100)) currentFrame = fseq; + else lateFrame = true; + } else if (TuioTime.getSessionTime().subtract(currentTime).getTotalMilliseconds()>100) { + currentTime = TuioTime.getSessionTime(); + } + if (!lateFrame) { + + Enumeration frameEnum = frameStrings.elements(); + while(frameEnum.hasMoreElements()) { + TuioString tstr = frameEnum.nextElement(); + + switch (tstr.getTuioState()) { + case TuioString.TUIO_REMOVED: + + TuioString removeString = tstr; + removeString.remove(currentTime); + + for (int i=0;i0) { + Enumeration slist = stringList.elements(); + while (slist.hasMoreElements()) { + int sl_id = slist.nextElement().getStringID(); + if (sl_id>maxStringID) maxStringID=sl_id; + } + + Enumeration flist = freeStringList.elements(); + while (flist.hasMoreElements()) { + int sl_id = flist.nextElement().getStringID(); + if (sl_id>=maxStringID) freeStringList.removeElement(sl_id); + } + } else freeStringList.clear(); + } else if (removeString.getStringID()0)) { + TuioString closestString = freeStringList.firstElement(); + Enumeration testList = freeStringList.elements(); + while (testList.hasMoreElements()) { + TuioString testString = testList.nextElement(); + //if (testString.getDistance(tstr) buffer = aliveStringList; + aliveStringList = newStringList; + // recycling the vector + newStringList = buffer; + } + + frameStrings.clear(); + } + } + + + } +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TUIO/TuioContainer.java --- a/front_processing/extern/TUIO_JAVA/src/TUIO/TuioContainer.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioContainer.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,463 +1,468 @@ -/* - TUIO Java backend - part of the reacTIVision project - http://reactivision.sourceforge.net/ - - Copyright (c) 2005-2009 Martin Kaltenbrunner - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -package TUIO; - -import java.util.*; - -/** - * The abstract TuioContainer class defines common attributes that apply to both subclasses {@link TuioObject} and {@link TuioCursor}. - * - * @author Martin Kaltenbrunner - * @version 1.4 - */ -abstract class TuioContainer extends TuioPoint { - - /** - * The unique session ID number that is assigned to each TUIO object or cursor. - */ - protected long session_id; - /** - * The X-axis velocity value. - */ - protected float x_speed; - /** - * The Y-axis velocity value. - */ - protected float y_speed; - /** - * The motion speed value. - */ - protected float motion_speed; - /** - * The motion acceleration value. - */ - protected float motion_accel; - /** - * A Vector of TuioPoints containing all the previous positions of the TUIO component. - */ - protected Vector path; - /** - * Defines the ADDED state. - */ - public static final int TUIO_ADDED = 0; - /** - * Defines the ACCELERATING state. - */ - public static final int TUIO_ACCELERATING = 1; - /** - * Defines the DECELERATING state. - */ - public static final int TUIO_DECELERATING = 2; - /** - * Defines the STOPPED state. - */ - public static final int TUIO_STOPPED = 3; - /** - * Defines the REMOVED state. - */ - public static final int TUIO_REMOVED = 4; - /** - * Reflects the current state of the TuioComponent - */ - protected int state; - - /** - * This constructor takes a TuioTime argument and assigns it along with the provided - * Session ID, X and Y coordinate to the newly created TuioContainer. - * - * @param ttime the TuioTime to assign - * @param si the Session ID to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - */ - TuioContainer(TuioTime ttime, long si, float xp, float yp) { - super(ttime,xp,yp); - - session_id = si; - x_speed = 0.0f; - y_speed = 0.0f; - motion_speed = 0.0f; - motion_accel = 0.0f; - - path = new Vector(); - path.addElement(new TuioPoint(currentTime,xpos,ypos)); - state = TUIO_ADDED; - } - - /** - * This constructor takes a TuioTime argument and assigns it along with the provided - * Session ID, X, Y and Z coordinate to the newly created TuioContainer. - * - * @param ttime the TuioTime to assign - * @param si the Session ID to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param zp the Z coordinate to assign - */ - TuioContainer(TuioTime ttime, long si, float xp, float yp, float zp) { - super(ttime,xp,yp, zp); - - session_id = si; - x_speed = 0.0f; - y_speed = 0.0f; - motion_speed = 0.0f; - motion_accel = 0.0f; - - path = new Vector(); - path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); - state = TUIO_ADDED; - } - - /** - * This constructor takes the provided Session ID, X and Y coordinate - * and assigs these values to the newly created TuioContainer. - * - * @param si the Session ID to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - */ - TuioContainer(long si, float xp, float yp) { - super(xp,yp); - - session_id = si; - x_speed = 0.0f; - y_speed = 0.0f; - motion_speed = 0.0f; - motion_accel = 0.0f; - - path = new Vector(); - path.addElement(new TuioPoint(currentTime,xpos,ypos)); - state = TUIO_ADDED; - } - - /** - * This constructor takes the provided Session ID, X, Y and Z coordinate - * and assigs these values to the newly created TuioContainer. - * - * @param si the Session ID to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param zp the Z coordinate to assign - */ - TuioContainer(long si, float xp, float yp, float zp) { - super(xp,yp,zp); - - session_id = si; - x_speed = 0.0f; - y_speed = 0.0f; - motion_speed = 0.0f; - motion_accel = 0.0f; - - path = new Vector(); - path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); - state = TUIO_ADDED; - } - - /** - * This constructor takes the atttibutes of the provided TuioContainer - * and assigs these values to the newly created TuioContainer. - * - * @param tcon the TuioContainer to assign - */ - TuioContainer(TuioContainer tcon) { - super(tcon); - - session_id = tcon.getSessionID(); - x_speed = 0.0f; - y_speed = 0.0f; - motion_speed = 0.0f; - motion_accel = 0.0f; - - path = new Vector(); - path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); - state = TUIO_ADDED; - } - - /** - * Takes a TuioTime argument and assigns it along with the provided - * X and Y coordinate to the private TuioContainer attributes. - * The speed and accleration values are calculated accordingly. - * - * @param ttime the TuioTime to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - */ - public void update(TuioTime ttime, float xp, float yp) { - TuioPoint lastPoint = path.lastElement(); - super.update(ttime,xp,yp); - - TuioTime diffTime = currentTime.subtract(lastPoint.getTuioTime()); - float dt = diffTime.getTotalMilliseconds()/1000.0f; - float dx = this.xpos - lastPoint.getX(); - float dy = this.ypos - lastPoint.getY(); - float dist = (float)Math.sqrt(dx*dx+dy*dy); - float last_motion_speed = this.motion_speed; - - this.x_speed = dx/dt; - this.y_speed = dy/dt; - this.motion_speed = dist/dt; - this.motion_accel = (motion_speed - last_motion_speed)/dt; - - path.addElement(new TuioPoint(currentTime,xpos,ypos)); - if (motion_accel>0) state = TUIO_ACCELERATING; - else if (motion_accel<0) state = TUIO_DECELERATING; - else state = TUIO_STOPPED; - } - - /** - * Takes a TuioTime argument and assigns it along with the provided - * X, Y and Z coordinate to the private TuioContainer attributes. - * The speed and accleration values are calculated accordingly. - * - * @param ttime the TuioTime to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param zp the Z coordinate to assign - */ - public void update(TuioTime ttime, float xp, float yp, float zp) { - TuioPoint lastPoint = path.lastElement(); - super.update(ttime,xp,yp,zp); - - TuioTime diffTime = currentTime.subtract(lastPoint.getTuioTime()); - float dt = diffTime.getTotalMilliseconds()/1000.0f; - float dx = this.xpos - lastPoint.getX(); - float dy = this.ypos - lastPoint.getY(); - float dz = this.zpos - lastPoint.getZ(); - float dist = (float)Math.sqrt(dx*dx+dy*dy+dz*dz); - float last_motion_speed = this.motion_speed; - - this.x_speed = dx/dt; - this.y_speed = dy/dt; - this.motion_speed = dist/dt; - this.motion_accel = (motion_speed - last_motion_speed)/dt; - - path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); - if (motion_accel>0) state = TUIO_ACCELERATING; - else if (motion_accel<0) state = TUIO_DECELERATING; - else state = TUIO_STOPPED; - } - - /** - * This method is used to calculate the speed and acceleration values of - * TuioContainers with unchanged positions. - */ - public void stop(TuioTime ttime) { - update(ttime,xpos,ypos,zpos); - } - - /** - * Takes a TuioTime argument and assigns it along with the provided - * X and Y coordinate, X and Y velocity and acceleration - * to the private TuioContainer attributes. - * - * @param ttime the TuioTime to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param xs the X velocity to assign - * @param ys the Y velocity to assign - * @param ma the acceleration to assign - */ - public void update(TuioTime ttime, float xp, float yp , float xs, float ys, float ma) { - super.update(ttime,xp,yp); - x_speed = xs; - y_speed = ys; - motion_speed = (float)Math.sqrt(x_speed*x_speed+y_speed*y_speed); - motion_accel = ma; - path.addElement(new TuioPoint(currentTime,xpos,ypos)); - if (motion_accel>0) state = TUIO_ACCELERATING; - else if (motion_accel<0) state = TUIO_DECELERATING; - else state = TUIO_STOPPED; - } - - /** - * Takes a TuioTime argument and assigns it along with the provided - * X, Y and Z coordinate, X and Y velocity and acceleration - * to the private TuioContainer attributes. - * - * @param ttime the TuioTime to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param zp the Z coordinate to assign - * @param xs the X velocity to assign - * @param ys the Y velocity to assign - * @param ma the acceleration to assign - */ - public void update(TuioTime ttime, float xp, float yp, float zp , float xs, float ys, float ma) { - super.update(ttime,xp,yp,zp); - x_speed = xs; - y_speed = ys; - motion_speed = (float)Math.sqrt(x_speed*x_speed+y_speed*y_speed); - motion_accel = ma; - path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); - if (motion_accel>0) state = TUIO_ACCELERATING; - else if (motion_accel<0) state = TUIO_DECELERATING; - else state = TUIO_STOPPED; - } - - /** - * Assigns the provided X and Y coordinate, X and Y velocity and acceleration - * to the private TuioContainer attributes. The TuioTime time stamp remains unchanged. - * - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param xs the X velocity to assign - * @param ys the Y velocity to assign - * @param ma the acceleration to assign - */ - public void update(float xp, float yp,float xs,float ys,float ma) { - super.update(xp,yp); - x_speed = xs; - y_speed = ys; - motion_speed = (float)Math.sqrt(x_speed*x_speed+y_speed*y_speed); - motion_accel = ma; - path.addElement(new TuioPoint(currentTime,xpos,ypos)); - if (motion_accel>0) state = TUIO_ACCELERATING; - else if (motion_accel<0) state = TUIO_DECELERATING; - else state = TUIO_STOPPED; - } - - /** - * Assigns the provided X, Y and Z coordinate, X and Y velocity and acceleration - * to the private TuioContainer attributes. The TuioTime time stamp remains unchanged. - * - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param zp the Z coordinate to assign - * @param xs the X velocity to assign - * @param ys the Y velocity to assign - * @param ma the acceleration to assign - */ - public void update(float xp, float yp, float zp,float xs,float ys,float ma) { - super.update(xp,yp,zp); - x_speed = xs; - y_speed = ys; - motion_speed = (float)Math.sqrt(x_speed*x_speed+y_speed*y_speed); - motion_accel = ma; - path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); - if (motion_accel>0) state = TUIO_ACCELERATING; - else if (motion_accel<0) state = TUIO_DECELERATING; - else state = TUIO_STOPPED; - } - - /** - * Takes the atttibutes of the provided TuioContainer - * and assigs these values to this TuioContainer. - * The TuioTime time stamp of this TuioContainer remains unchanged. - * - * @param tcon the TuioContainer to assign - */ - public void update (TuioContainer tcon) { - super.update(tcon); - x_speed = tcon.getXSpeed(); - y_speed = tcon.getYSpeed(); - motion_speed = tcon.getMotionSpeed(); - motion_accel = tcon.getMotionAccel(); - path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); - if (motion_accel>0) state = TUIO_ACCELERATING; - else if (motion_accel<0) state = TUIO_DECELERATING; - else state = TUIO_STOPPED; - } - - /** - * Assigns the REMOVE state to this TuioContainer and sets - * its TuioTime time stamp to the provided TuioTime argument. - * - * @param ttime the TuioTime to assign - */ - public void remove(TuioTime ttime) { - currentTime = new TuioTime(ttime); - state = TUIO_REMOVED; - } - - /** - * Returns the Session ID of this TuioContainer. - * @return the Session ID of this TuioContainer - */ - public long getSessionID() { - return session_id; - } - - /** - * Returns the X velocity of this TuioContainer. - * @return the X velocity of this TuioContainer - */ - public float getXSpeed() { - return x_speed; - } - - /** - * Returns the Y velocity of this TuioContainer. - * @return the Y velocity of this TuioContainer - */ - public float getYSpeed() { - return y_speed; - } - - /** - * Returns the position of this TuioContainer. - * @return the position of this TuioContainer - */ - public TuioPoint getPosition() { - return new TuioPoint(xpos,ypos,zpos); - } - - /** - * Returns the path of this TuioContainer. - * @return the path of this TuioContainer - */ - public Vector getPath() { - return path; - } - - /** - * Returns the motion speed of this TuioContainer. - * @return the motion speed of this TuioContainer - */ - public float getMotionSpeed() { - return motion_speed; - } - - /** - * Returns the motion acceleration of this TuioContainer. - * @return the motion acceleration of this TuioContainer - */ - public float getMotionAccel() { - return motion_accel; - } - - /** - * Returns the TUIO state of this TuioContainer. - * @return the TUIO state of this TuioContainer - */ - public int getTuioState() { - return state; - } - - /** - * Returns true of this TuioContainer is moving. - * @return true of this TuioContainer is moving - */ - public boolean isMoving() { - if ((state==TUIO_ACCELERATING) || (state==TUIO_DECELERATING)) return true; - else return false; - } - -} +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + /* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage 3D. +*/ + +package TUIO; + +import java.util.*; + +/** + * The abstract TuioContainer class defines common attributes that apply to both subclasses {@link TuioObject} and {@link TuioCursor}. + * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +abstract class TuioContainer extends TuioPoint { + + /** + * The unique session ID number that is assigned to each TUIO object or cursor. + */ + protected long session_id; + /** + * The X-axis velocity value. + */ + protected float x_speed; + /** + * The Y-axis velocity value. + */ + protected float y_speed; + /** + * The motion speed value. + */ + protected float motion_speed; + /** + * The motion acceleration value. + */ + protected float motion_accel; + /** + * A Vector of TuioPoints containing all the previous positions of the TUIO component. + */ + protected Vector path; + /** + * Defines the ADDED state. + */ + public static final int TUIO_ADDED = 0; + /** + * Defines the ACCELERATING state. + */ + public static final int TUIO_ACCELERATING = 1; + /** + * Defines the DECELERATING state. + */ + public static final int TUIO_DECELERATING = 2; + /** + * Defines the STOPPED state. + */ + public static final int TUIO_STOPPED = 3; + /** + * Defines the REMOVED state. + */ + public static final int TUIO_REMOVED = 4; + /** + * Reflects the current state of the TuioComponent + */ + protected int state; + + /** + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, X and Y coordinate to the newly created TuioContainer. + * + * @param ttime the TuioTime to assign + * @param si the Session ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + TuioContainer(TuioTime ttime, long si, float xp, float yp) { + super(ttime,xp,yp); + + session_id = si; + x_speed = 0.0f; + y_speed = 0.0f; + motion_speed = 0.0f; + motion_accel = 0.0f; + + path = new Vector(); + path.addElement(new TuioPoint(currentTime,xpos,ypos)); + state = TUIO_ADDED; + } + + /** + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, X, Y and Z coordinate to the newly created TuioContainer. + * + * @param ttime the TuioTime to assign + * @param si the Session ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param zp the Z coordinate to assign + */ + TuioContainer(TuioTime ttime, long si, float xp, float yp, float zp) { + super(ttime,xp,yp, zp); + + session_id = si; + x_speed = 0.0f; + y_speed = 0.0f; + motion_speed = 0.0f; + motion_accel = 0.0f; + + path = new Vector(); + path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); + state = TUIO_ADDED; + } + + /** + * This constructor takes the provided Session ID, X and Y coordinate + * and assigs these values to the newly created TuioContainer. + * + * @param si the Session ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + TuioContainer(long si, float xp, float yp) { + super(xp,yp); + + session_id = si; + x_speed = 0.0f; + y_speed = 0.0f; + motion_speed = 0.0f; + motion_accel = 0.0f; + + path = new Vector(); + path.addElement(new TuioPoint(currentTime,xpos,ypos)); + state = TUIO_ADDED; + } + + /** + * This constructor takes the provided Session ID, X, Y and Z coordinate + * and assigs these values to the newly created TuioContainer. + * + * @param si the Session ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param zp the Z coordinate to assign + */ + TuioContainer(long si, float xp, float yp, float zp) { + super(xp,yp,zp); + + session_id = si; + x_speed = 0.0f; + y_speed = 0.0f; + motion_speed = 0.0f; + motion_accel = 0.0f; + + path = new Vector(); + path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); + state = TUIO_ADDED; + } + + /** + * This constructor takes the atttibutes of the provided TuioContainer + * and assigs these values to the newly created TuioContainer. + * + * @param tcon the TuioContainer to assign + */ + TuioContainer(TuioContainer tcon) { + super(tcon); + + session_id = tcon.getSessionID(); + x_speed = 0.0f; + y_speed = 0.0f; + motion_speed = 0.0f; + motion_accel = 0.0f; + + path = new Vector(); + path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); + state = TUIO_ADDED; + } + + /** + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate to the private TuioContainer attributes. + * The speed and accleration values are calculated accordingly. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public void update(TuioTime ttime, float xp, float yp) { + TuioPoint lastPoint = path.lastElement(); + super.update(ttime,xp,yp); + + TuioTime diffTime = currentTime.subtract(lastPoint.getTuioTime()); + float dt = diffTime.getTotalMilliseconds()/1000.0f; + float dx = this.xpos - lastPoint.getX(); + float dy = this.ypos - lastPoint.getY(); + float dist = (float)Math.sqrt(dx*dx+dy*dy); + float last_motion_speed = this.motion_speed; + + this.x_speed = dx/dt; + this.y_speed = dy/dt; + this.motion_speed = dist/dt; + this.motion_accel = (motion_speed - last_motion_speed)/dt; + + path.addElement(new TuioPoint(currentTime,xpos,ypos)); + if (motion_accel>0) state = TUIO_ACCELERATING; + else if (motion_accel<0) state = TUIO_DECELERATING; + else state = TUIO_STOPPED; + } + + /** + * Takes a TuioTime argument and assigns it along with the provided + * X, Y and Z coordinate to the private TuioContainer attributes. + * The speed and accleration values are calculated accordingly. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param zp the Z coordinate to assign + */ + public void update(TuioTime ttime, float xp, float yp, float zp) { + TuioPoint lastPoint = path.lastElement(); + super.update(ttime,xp,yp,zp); + + TuioTime diffTime = currentTime.subtract(lastPoint.getTuioTime()); + float dt = diffTime.getTotalMilliseconds()/1000.0f; + float dx = this.xpos - lastPoint.getX(); + float dy = this.ypos - lastPoint.getY(); + float dz = this.zpos - lastPoint.getZ(); + float dist = (float)Math.sqrt(dx*dx+dy*dy+dz*dz); + float last_motion_speed = this.motion_speed; + + this.x_speed = dx/dt; + this.y_speed = dy/dt; + this.motion_speed = dist/dt; + this.motion_accel = (motion_speed - last_motion_speed)/dt; + + path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); + if (motion_accel>0) state = TUIO_ACCELERATING; + else if (motion_accel<0) state = TUIO_DECELERATING; + else state = TUIO_STOPPED; + } + + /** + * This method is used to calculate the speed and acceleration values of + * TuioContainers with unchanged positions. + */ + public void stop(TuioTime ttime) { + update(ttime,xpos,ypos,zpos); + } + + /** + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate, X and Y velocity and acceleration + * to the private TuioContainer attributes. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param xs the X velocity to assign + * @param ys the Y velocity to assign + * @param ma the acceleration to assign + */ + public void update(TuioTime ttime, float xp, float yp , float xs, float ys, float ma) { + super.update(ttime,xp,yp); + x_speed = xs; + y_speed = ys; + motion_speed = (float)Math.sqrt(x_speed*x_speed+y_speed*y_speed); + motion_accel = ma; + path.addElement(new TuioPoint(currentTime,xpos,ypos)); + if (motion_accel>0) state = TUIO_ACCELERATING; + else if (motion_accel<0) state = TUIO_DECELERATING; + else state = TUIO_STOPPED; + } + + /** + * Takes a TuioTime argument and assigns it along with the provided + * X, Y and Z coordinate, X and Y velocity and acceleration + * to the private TuioContainer attributes. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param zp the Z coordinate to assign + * @param xs the X velocity to assign + * @param ys the Y velocity to assign + * @param ma the acceleration to assign + */ + public void update(TuioTime ttime, float xp, float yp, float zp , float xs, float ys, float ma) { + super.update(ttime,xp,yp,zp); + x_speed = xs; + y_speed = ys; + motion_speed = (float)Math.sqrt(x_speed*x_speed+y_speed*y_speed); + motion_accel = ma; + path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); + if (motion_accel>0) state = TUIO_ACCELERATING; + else if (motion_accel<0) state = TUIO_DECELERATING; + else state = TUIO_STOPPED; + } + + /** + * Assigns the provided X and Y coordinate, X and Y velocity and acceleration + * to the private TuioContainer attributes. The TuioTime time stamp remains unchanged. + * + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param xs the X velocity to assign + * @param ys the Y velocity to assign + * @param ma the acceleration to assign + */ + public void update(float xp, float yp,float xs,float ys,float ma) { + super.update(xp,yp); + x_speed = xs; + y_speed = ys; + motion_speed = (float)Math.sqrt(x_speed*x_speed+y_speed*y_speed); + motion_accel = ma; + path.addElement(new TuioPoint(currentTime,xpos,ypos)); + if (motion_accel>0) state = TUIO_ACCELERATING; + else if (motion_accel<0) state = TUIO_DECELERATING; + else state = TUIO_STOPPED; + } + + /** + * Assigns the provided X, Y and Z coordinate, X and Y velocity and acceleration + * to the private TuioContainer attributes. The TuioTime time stamp remains unchanged. + * + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param zp the Z coordinate to assign + * @param xs the X velocity to assign + * @param ys the Y velocity to assign + * @param ma the acceleration to assign + */ + public void update(float xp, float yp, float zp,float xs,float ys,float ma) { + super.update(xp,yp,zp); + x_speed = xs; + y_speed = ys; + motion_speed = (float)Math.sqrt(x_speed*x_speed+y_speed*y_speed); + motion_accel = ma; + path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); + if (motion_accel>0) state = TUIO_ACCELERATING; + else if (motion_accel<0) state = TUIO_DECELERATING; + else state = TUIO_STOPPED; + } + + /** + * Takes the atttibutes of the provided TuioContainer + * and assigs these values to this TuioContainer. + * The TuioTime time stamp of this TuioContainer remains unchanged. + * + * @param tcon the TuioContainer to assign + */ + public void update (TuioContainer tcon) { + super.update(tcon); + x_speed = tcon.getXSpeed(); + y_speed = tcon.getYSpeed(); + motion_speed = tcon.getMotionSpeed(); + motion_accel = tcon.getMotionAccel(); + path.addElement(new TuioPoint(currentTime,xpos,ypos,zpos)); + if (motion_accel>0) state = TUIO_ACCELERATING; + else if (motion_accel<0) state = TUIO_DECELERATING; + else state = TUIO_STOPPED; + } + + /** + * Assigns the REMOVE state to this TuioContainer and sets + * its TuioTime time stamp to the provided TuioTime argument. + * + * @param ttime the TuioTime to assign + */ + public void remove(TuioTime ttime) { + currentTime = new TuioTime(ttime); + state = TUIO_REMOVED; + } + + /** + * Returns the Session ID of this TuioContainer. + * @return the Session ID of this TuioContainer + */ + public long getSessionID() { + return session_id; + } + + /** + * Returns the X velocity of this TuioContainer. + * @return the X velocity of this TuioContainer + */ + public float getXSpeed() { + return x_speed; + } + + /** + * Returns the Y velocity of this TuioContainer. + * @return the Y velocity of this TuioContainer + */ + public float getYSpeed() { + return y_speed; + } + + /** + * Returns the position of this TuioContainer. + * @return the position of this TuioContainer + */ + public TuioPoint getPosition() { + return new TuioPoint(xpos,ypos,zpos); + } + + /** + * Returns the path of this TuioContainer. + * @return the path of this TuioContainer + */ + public Vector getPath() { + return path; + } + + /** + * Returns the motion speed of this TuioContainer. + * @return the motion speed of this TuioContainer + */ + public float getMotionSpeed() { + return motion_speed; + } + + /** + * Returns the motion acceleration of this TuioContainer. + * @return the motion acceleration of this TuioContainer + */ + public float getMotionAccel() { + return motion_accel; + } + + /** + * Returns the TUIO state of this TuioContainer. + * @return the TUIO state of this TuioContainer + */ + public int getTuioState() { + return state; + } + + /** + * Returns true of this TuioContainer is moving. + * @return true of this TuioContainer is moving + */ + public boolean isMoving() { + if ((state==TUIO_ACCELERATING) || (state==TUIO_DECELERATING)) return true; + else return false; + } + +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TUIO/TuioCursor.java --- a/front_processing/extern/TUIO_JAVA/src/TUIO/TuioCursor.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioCursor.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,115 +1,120 @@ -/* - TUIO Java backend - part of the reacTIVision project - http://reactivision.sourceforge.net/ - - Copyright (c) 2005-2009 Martin Kaltenbrunner - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -package TUIO; - -/** - * The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors. - * - * @author Martin Kaltenbrunner - * @version 1.4 - */ -public class TuioCursor extends TuioContainer { - - /** - * The individual cursor ID number that is assigned to each TuioCursor. - */ - protected int cursor_id; - - /** - * This constructor takes a TuioTime argument and assigns it along with the provided - * Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor. - * - * @param ttime the TuioTime to assign - * @param si the Session ID to assign - * @param ci the Cursor ID to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - */ - public TuioCursor (TuioTime ttime, long si, int ci, float xp, float yp) { - super(ttime, si,xp,yp); - this.cursor_id = ci; - } - - /** - * This constructor takes a TuioTime argument and assigns it along with the provided - * Session ID, Cursor ID, X, Y and Z coordinate to the newly created TuioCursor. - * - * @param ttime the TuioTime to assign - * @param si the Session ID to assign - * @param ci the Cursor ID to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param zp the Z coordinate to assign - */ - public TuioCursor (TuioTime ttime, long si, int ci, float xp, float yp, float zp) { - super(ttime, si,xp,yp,zp); - this.cursor_id = ci; - } - - /** - * This constructor takes the provided Session ID, Cursor ID, X and Y coordinate - * and assigs these values to the newly created TuioCursor. - * - * @param si the Session ID to assign - * @param ci the Cursor ID to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - */ - public TuioCursor (long si, int ci, float xp, float yp) { - super(si,xp,yp); - this.cursor_id = ci; - } - - /** - * This constructor takes the provided Session ID, Cursor ID, X, Y and Z coordinate - * and assigs these values to the newly created TuioCursor. - * - * @param si the Session ID to assign - * @param ci the Cursor ID to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param zp the Z coordinate to assign - */ - public TuioCursor (long si, int ci, float xp, float yp, float zp) { - super(si,xp,yp,zp); - this.cursor_id = ci; - } - - /** - * This constructor takes the atttibutes of the provided TuioCursor - * and assigs these values to the newly created TuioCursor. - * - * @param tcur the TuioCursor to assign - */ - public TuioCursor (TuioCursor tcur) { - super(tcur); - this.cursor_id = tcur.getCursorID(); - } - - /** - * Returns the Cursor ID of this TuioCursor. - * @return the Cursor ID of this TuioCursor - */ - public int getCursorID() { - return cursor_id; - } - -} +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage 3D. +*/ + +package TUIO; + +/** + * The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors. + * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +public class TuioCursor extends TuioContainer { + + /** + * The individual cursor ID number that is assigned to each TuioCursor. + */ + protected int cursor_id; + + /** + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor. + * + * @param ttime the TuioTime to assign + * @param si the Session ID to assign + * @param ci the Cursor ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public TuioCursor (TuioTime ttime, long si, int ci, float xp, float yp) { + super(ttime, si,xp,yp); + this.cursor_id = ci; + } + + /** + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, Cursor ID, X, Y and Z coordinate to the newly created TuioCursor. + * + * @param ttime the TuioTime to assign + * @param si the Session ID to assign + * @param ci the Cursor ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param zp the Z coordinate to assign + */ + public TuioCursor (TuioTime ttime, long si, int ci, float xp, float yp, float zp) { + super(ttime, si,xp,yp,zp); + this.cursor_id = ci; + } + + /** + * This constructor takes the provided Session ID, Cursor ID, X and Y coordinate + * and assigs these values to the newly created TuioCursor. + * + * @param si the Session ID to assign + * @param ci the Cursor ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public TuioCursor (long si, int ci, float xp, float yp) { + super(si,xp,yp); + this.cursor_id = ci; + } + + /** + * This constructor takes the provided Session ID, Cursor ID, X, Y and Z coordinate + * and assigs these values to the newly created TuioCursor. + * + * @param si the Session ID to assign + * @param ci the Cursor ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param zp the Z coordinate to assign + */ + public TuioCursor (long si, int ci, float xp, float yp, float zp) { + super(si,xp,yp,zp); + this.cursor_id = ci; + } + + /** + * This constructor takes the atttibutes of the provided TuioCursor + * and assigs these values to the newly created TuioCursor. + * + * @param tcur the TuioCursor to assign + */ + public TuioCursor (TuioCursor tcur) { + super(tcur); + this.cursor_id = tcur.getCursorID(); + } + + /** + * Returns the Cursor ID of this TuioCursor. + * @return the Cursor ID of this TuioCursor + */ + public int getCursorID() { + return cursor_id; + } + +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TUIO/TuioListener.java --- a/front_processing/extern/TUIO_JAVA/src/TUIO/TuioListener.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioListener.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,111 +1,116 @@ -/* - TUIO Java backend - part of the reacTIVision project - http://reactivision.sourceforge.net/ - - Copyright (c) 2005-2009 Martin Kaltenbrunner - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -package TUIO; - -/** - * The TuioListener interface provides a simple callback infrastructure which is used by the {@link TuioClient} class - * to dispatch TUIO events to all registered instances of classes that implement the TuioListener interface defined here.

- * Any class that implements the TuioListener interface is required to implement all of the callback methods defined here. - * The {@link TuioClient} makes use of these interface methods in order to dispatch TUIO events to all registered TuioListener implementations.

- * - * public class MyTuioListener implements TuioListener
- * ...

- * MyTuioListener listener = new MyTuioListener();
- * TuioClient client = new TuioClient();
- * client.addTuioListener(listener);
- * client.start();
- *
- * - * @author Martin Kaltenbrunner - * @version 1.4 - */ -public interface TuioListener { - - /** - * This callback method is invoked by the TuioClient when a new TuioObject is added to the session. - * - * @param tobj the TuioObject reference associated to the addTuioObject event - */ - public void addTuioObject(TuioObject tobj); - - /** - * This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session. - * - * @param tobj the TuioObject reference associated to the updateTuioObject event - */ - public void updateTuioObject(TuioObject tobj); - - /** - * This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session. - * - * @param tobj the TuioObject reference associated to the removeTuioObject event - */ - public void removeTuioObject(TuioObject tobj); - - /** - * This callback method is invoked by the TuioClient when a new TuioCursor is added to the session. - * - * @param tcur the TuioCursor reference associated to the addTuioCursor event - */ - public void addTuioCursor(TuioCursor tcur); - - /** - * This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session. - * - * @param tcur the TuioCursor reference associated to the updateTuioCursor event - */ - public void updateTuioCursor(TuioCursor tcur); - - /** - * This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session. - * - * @param tcur the TuioCursor reference associated to the removeTuioCursor event - */ - public void removeTuioCursor(TuioCursor tcur); - - /** - * This callback method is invoked by the TuioClient when a new TuioString is added to the session. - * - * @param tstr the TuioString reference associated to the addTuioString event - */ - public void addTuioString(TuioString tstr); - - /** - * This callback method is invoked by the TuioClient when an existing TuioString is updated during the session. - * - * @param tstr the TuioString reference associated to the updateTuioString event - */ - public void updateTuioString(TuioString tstr); - - /** - * This callback method is invoked by the TuioClient when an existing TuioString is removed from the session. - * - * @param tstr the TuioString reference associated to the removeTuioString event - */ - public void removeTuioString(TuioString tstr); - - /** - * This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle. - * - * @param ftime the TuioTime associated to the current TUIO message bundle - */ - public void refresh(TuioTime ftime); -} +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + /* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ + +package TUIO; + +/** + * The TuioListener interface provides a simple callback infrastructure which is used by the {@link TuioClient} class + * to dispatch TUIO events to all registered instances of classes that implement the TuioListener interface defined here.

+ * Any class that implements the TuioListener interface is required to implement all of the callback methods defined here. + * The {@link TuioClient} makes use of these interface methods in order to dispatch TUIO events to all registered TuioListener implementations.

+ * + * public class MyTuioListener implements TuioListener
+ * ...

+ * MyTuioListener listener = new MyTuioListener();
+ * TuioClient client = new TuioClient();
+ * client.addTuioListener(listener);
+ * client.start();
+ *
+ * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +public interface TuioListener { + + /** + * This callback method is invoked by the TuioClient when a new TuioObject is added to the session. + * + * @param tobj the TuioObject reference associated to the addTuioObject event + */ + public void addTuioObject(TuioObject tobj); + + /** + * This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session. + * + * @param tobj the TuioObject reference associated to the updateTuioObject event + */ + public void updateTuioObject(TuioObject tobj); + + /** + * This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session. + * + * @param tobj the TuioObject reference associated to the removeTuioObject event + */ + public void removeTuioObject(TuioObject tobj); + + /** + * This callback method is invoked by the TuioClient when a new TuioCursor is added to the session. + * + * @param tcur the TuioCursor reference associated to the addTuioCursor event + */ + public void addTuioCursor(TuioCursor tcur); + + /** + * This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session. + * + * @param tcur the TuioCursor reference associated to the updateTuioCursor event + */ + public void updateTuioCursor(TuioCursor tcur); + + /** + * This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session. + * + * @param tcur the TuioCursor reference associated to the removeTuioCursor event + */ + public void removeTuioCursor(TuioCursor tcur); + + /** + * This callback method is invoked by the TuioClient when a new TuioString is added to the session. + * + * @param tstr the TuioString reference associated to the addTuioString event + */ + public void addTuioString(TuioString tstr); + + /** + * This callback method is invoked by the TuioClient when an existing TuioString is updated during the session. + * + * @param tstr the TuioString reference associated to the updateTuioString event + */ + public void updateTuioString(TuioString tstr); + + /** + * This callback method is invoked by the TuioClient when an existing TuioString is removed from the session. + * + * @param tstr the TuioString reference associated to the removeTuioString event + */ + public void removeTuioString(TuioString tstr); + + /** + * This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle. + * + * @param ftime the TuioTime associated to the current TUIO message bundle + */ + public void refresh(TuioTime ftime); +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TUIO/TuioObject.java --- a/front_processing/extern/TUIO_JAVA/src/TUIO/TuioObject.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioObject.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,251 +1,251 @@ -/* - TUIO Java backend - part of the reacTIVision project - http://reactivision.sourceforge.net/ - - Copyright (c) 2005-2009 Martin Kaltenbrunner - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -package TUIO; - -/** - * The TuioObject class encapsulates /tuio/2Dobj TUIO objects. - * - * @author Martin Kaltenbrunner - * @version 1.4 - */ -public class TuioObject extends TuioContainer { - - /** - * The individual symbol ID number that is assigned to each TuioObject. - */ - protected int symbol_id; - /** - * The rotation angle value. - */ - protected float angle; - /** - * The rotation speed value. - */ - protected float rotation_speed; - /** - * The rotation acceleration value. - */ - protected float rotation_accel; - /** - * Defines the ROTATING state. - */ - public static final int TUIO_ROTATING = 5; - - /** - * This constructor takes a TuioTime argument and assigns it along with the provided - * Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject. - * - * @param ttime the TuioTime to assign - * @param si the Session ID to assign - * @param sym the Symbol ID to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param a the angle to assign - */ - public TuioObject (TuioTime ttime, long si, int sym, float xp, float yp, float a) { - super(ttime, si,xp,yp); - symbol_id = sym; - angle = a; - rotation_speed = 0.0f; - rotation_accel = 0.0f; - } - - /** - * This constructor takes the provided Session ID, Symbol ID, X and Y coordinate - * and angle, and assigs these values to the newly created TuioObject. - * - * @param si the Session ID to assign - * @param sym the Symbol ID to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param a the angle to assign - */ - public TuioObject (long si, int sym, float xp, float yp, float a) { - super(si,xp,yp); - symbol_id = sym; - angle = angle; - rotation_speed = 0.0f; - rotation_accel = 0.0f; - } - - /** - * This constructor takes the atttibutes of the provided TuioObject - * and assigs these values to the newly created TuioObject. - * - * @param tobj the TuioObject to assign - */ - public TuioObject (TuioObject tobj) { - super(tobj); - symbol_id = tobj.getSymbolID(); - angle = tobj.getAngle(); - rotation_speed = 0.0f; - rotation_accel = 0.0f; - } - - /** - * Takes a TuioTime argument and assigns it along with the provided - * X and Y coordinate, angle, X and Y velocity, motion acceleration, - * rotation speed and rotation acceleration to the private TuioObject attributes. - * - * @param ttime the TuioTime to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param a the angle coordinate to assign - * @param xs the X velocity to assign - * @param ys the Y velocity to assign - * @param rs the rotation velocity to assign - * @param ma the motion acceleration to assign - * @param ra the rotation acceleration to assign - */ - public void update (TuioTime ttime, float xp, float yp, float a, float xs, float ys, float rs, float ma, float ra) { - super.update(ttime,xp,yp,xs,ys,ma); - angle = a; - rotation_speed = rs; - rotation_accel = ra; - if ((rotation_accel!=0) && (state!=TUIO_STOPPED)) state = TUIO_ROTATING; - } - - /** - * Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration - * rotation velocity and rotation acceleration to the private TuioContainer attributes. - * The TuioTime time stamp remains unchanged. - * - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param a the angle coordinate to assign - * @param xs the X velocity to assign - * @param ys the Y velocity to assign - * @param rs the rotation velocity to assign - * @param ma the motion acceleration to assign - * @param ra the rotation acceleration to assign - */ - public void update (float xp, float yp, float a, float xs, float ys, float rs, float ma, float ra) { - super.update(xp,yp,xs,ys,ma); - angle = a; - rotation_speed = rs; - rotation_accel = ra; - if ((rotation_accel!=0) && (state!=TUIO_STOPPED)) state = TUIO_ROTATING; - } - - /** - * Takes a TuioTime argument and assigns it along with the provided - * X and Y coordinate and angle to the private TuioObject attributes. - * The speed and accleration values are calculated accordingly. - * - * @param ttime the TuioTime to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param a the angle coordinate to assign - */ - public void update (TuioTime ttime, float xp, float yp, float a) { - TuioPoint lastPoint = path.lastElement(); - super.update(ttime,xp,yp); - - TuioTime diffTime = currentTime.subtract(lastPoint.getTuioTime()); - float dt = diffTime.getTotalMilliseconds()/1000.0f; - float last_angle = angle; - float last_rotation_speed = rotation_speed; - angle = a; - - float da = (this.angle-last_angle)/(2.0f*(float)Math.PI); - if (da>0.75f) da-=1.0f; - else if (da<-0.75f) da+=1.0f; - - rotation_speed = da/dt; - rotation_accel = (rotation_speed - last_rotation_speed)/dt; - if ((rotation_accel!=0) && (state!=TUIO_STOPPED)) state = TUIO_ROTATING; - } - - /** - * Takes the atttibutes of the provided TuioObject - * and assigs these values to this TuioObject. - * The TuioTime time stamp of this TuioContainer remains unchanged. - * - * @param tobj the TuioContainer to assign - */ - public void update (TuioObject tobj) { - super.update(tobj); - angle = tobj.getAngle(); - rotation_speed = tobj.getRotationSpeed(); - rotation_accel = tobj.getRotationAccel(); - if ((rotation_accel!=0) && (state!=TUIO_STOPPED)) state = TUIO_ROTATING; - } - - /** - * This method is used to calculate the speed and acceleration values of a - * TuioObject with unchanged position and angle. - * - * @param ttime the TuioTime to assign - */ - public void stop (TuioTime ttime) { - update(ttime,xpos,ypos, angle); - } - - /** - * Returns the symbol ID of this TuioObject. - * @return the symbol ID of this TuioObject - */ - public int getSymbolID() { - return symbol_id; - } - - /** - * Returns the rotation angle of this TuioObject. - * @return the rotation angle of this TuioObject - */ - public float getAngle() { - return angle; - } - - /** - * Returns the rotation angle in degrees of this TuioObject. - * @return the rotation angle in degrees of this TuioObject - */ - public float getAngleDegrees() { - return angle/(float)Math.PI*180.0f; - } - - /** - * Returns the rotation speed of this TuioObject. - * @return the rotation speed of this TuioObject - */ - public float getRotationSpeed() { - return rotation_speed; - } - - /** - * Returns the rotation acceleration of this TuioObject. - * @return the rotation acceleration of this TuioObject - */ - public float getRotationAccel() { - return rotation_accel; - } - - /** - * Returns true of this TuioObject is moving. - * @return true of this TuioObject is moving - */ - public boolean isMoving() { - if ((state==TUIO_ACCELERATING) || (state==TUIO_DECELERATING) || (state==TUIO_ROTATING)) return true; - else return false; - } - -} +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +package TUIO; + +/** + * The TuioObject class encapsulates /tuio/2Dobj TUIO objects. + * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +public class TuioObject extends TuioContainer { + + /** + * The individual symbol ID number that is assigned to each TuioObject. + */ + protected int symbol_id; + /** + * The rotation angle value. + */ + protected float angle; + /** + * The rotation speed value. + */ + protected float rotation_speed; + /** + * The rotation acceleration value. + */ + protected float rotation_accel; + /** + * Defines the ROTATING state. + */ + public static final int TUIO_ROTATING = 5; + + /** + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject. + * + * @param ttime the TuioTime to assign + * @param si the Session ID to assign + * @param sym the Symbol ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param a the angle to assign + */ + public TuioObject (TuioTime ttime, long si, int sym, float xp, float yp, float a) { + super(ttime, si,xp,yp); + symbol_id = sym; + angle = a; + rotation_speed = 0.0f; + rotation_accel = 0.0f; + } + + /** + * This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + * and angle, and assigs these values to the newly created TuioObject. + * + * @param si the Session ID to assign + * @param sym the Symbol ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param a the angle to assign + */ + public TuioObject (long si, int sym, float xp, float yp, float a) { + super(si,xp,yp); + symbol_id = sym; + angle = angle; + rotation_speed = 0.0f; + rotation_accel = 0.0f; + } + + /** + * This constructor takes the atttibutes of the provided TuioObject + * and assigs these values to the newly created TuioObject. + * + * @param tobj the TuioObject to assign + */ + public TuioObject (TuioObject tobj) { + super(tobj); + symbol_id = tobj.getSymbolID(); + angle = tobj.getAngle(); + rotation_speed = 0.0f; + rotation_accel = 0.0f; + } + + /** + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate, angle, X and Y velocity, motion acceleration, + * rotation speed and rotation acceleration to the private TuioObject attributes. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param a the angle coordinate to assign + * @param xs the X velocity to assign + * @param ys the Y velocity to assign + * @param rs the rotation velocity to assign + * @param ma the motion acceleration to assign + * @param ra the rotation acceleration to assign + */ + public void update (TuioTime ttime, float xp, float yp, float a, float xs, float ys, float rs, float ma, float ra) { + super.update(ttime,xp,yp,xs,ys,ma); + angle = a; + rotation_speed = rs; + rotation_accel = ra; + if ((rotation_accel!=0) && (state!=TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + * rotation velocity and rotation acceleration to the private TuioContainer attributes. + * The TuioTime time stamp remains unchanged. + * + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param a the angle coordinate to assign + * @param xs the X velocity to assign + * @param ys the Y velocity to assign + * @param rs the rotation velocity to assign + * @param ma the motion acceleration to assign + * @param ra the rotation acceleration to assign + */ + public void update (float xp, float yp, float a, float xs, float ys, float rs, float ma, float ra) { + super.update(xp,yp,xs,ys,ma); + angle = a; + rotation_speed = rs; + rotation_accel = ra; + if ((rotation_accel!=0) && (state!=TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate and angle to the private TuioObject attributes. + * The speed and accleration values are calculated accordingly. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param a the angle coordinate to assign + */ + public void update (TuioTime ttime, float xp, float yp, float a) { + TuioPoint lastPoint = path.lastElement(); + super.update(ttime,xp,yp); + + TuioTime diffTime = currentTime.subtract(lastPoint.getTuioTime()); + float dt = diffTime.getTotalMilliseconds()/1000.0f; + float last_angle = angle; + float last_rotation_speed = rotation_speed; + angle = a; + + float da = (this.angle-last_angle)/(2.0f*(float)Math.PI); + if (da>0.75f) da-=1.0f; + else if (da<-0.75f) da+=1.0f; + + rotation_speed = da/dt; + rotation_accel = (rotation_speed - last_rotation_speed)/dt; + if ((rotation_accel!=0) && (state!=TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * Takes the atttibutes of the provided TuioObject + * and assigs these values to this TuioObject. + * The TuioTime time stamp of this TuioContainer remains unchanged. + * + * @param tobj the TuioContainer to assign + */ + public void update (TuioObject tobj) { + super.update(tobj); + angle = tobj.getAngle(); + rotation_speed = tobj.getRotationSpeed(); + rotation_accel = tobj.getRotationAccel(); + if ((rotation_accel!=0) && (state!=TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * This method is used to calculate the speed and acceleration values of a + * TuioObject with unchanged position and angle. + * + * @param ttime the TuioTime to assign + */ + public void stop (TuioTime ttime) { + update(ttime,xpos,ypos, angle); + } + + /** + * Returns the symbol ID of this TuioObject. + * @return the symbol ID of this TuioObject + */ + public int getSymbolID() { + return symbol_id; + } + + /** + * Returns the rotation angle of this TuioObject. + * @return the rotation angle of this TuioObject + */ + public float getAngle() { + return angle; + } + + /** + * Returns the rotation angle in degrees of this TuioObject. + * @return the rotation angle in degrees of this TuioObject + */ + public float getAngleDegrees() { + return angle/(float)Math.PI*180.0f; + } + + /** + * Returns the rotation speed of this TuioObject. + * @return the rotation speed of this TuioObject + */ + public float getRotationSpeed() { + return rotation_speed; + } + + /** + * Returns the rotation acceleration of this TuioObject. + * @return the rotation acceleration of this TuioObject + */ + public float getRotationAccel() { + return rotation_accel; + } + + /** + * Returns true of this TuioObject is moving. + * @return true of this TuioObject is moving + */ + public boolean isMoving() { + if ((state==TUIO_ACCELERATING) || (state==TUIO_DECELERATING) || (state==TUIO_ROTATING)) return true; + else return false; + } + +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TUIO/TuioPoint.java --- a/front_processing/extern/TUIO_JAVA/src/TUIO/TuioPoint.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioPoint.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,363 +1,367 @@ -/* - TUIO Java backend - part of the reacTIVision project - http://reactivision.sourceforge.net/ - - Copyright (c) 2005-2009 Martin Kaltenbrunner - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -package TUIO; - -/** - * The TuioPoint class on the one hand is a simple container and utility class to handle TUIO positions in general, - * on the other hand the TuioPoint is the base class for the TuioCursor and TuioObject classes. - * - * @author Martin Kaltenbrunner - * @version 1.4 - */ -public class TuioPoint { - - public String comm; - - /** - * X coordinate, representated as a floating point value in a range of 0..1 - */ - protected float xpos; - /** - * Y coordinate, representated as a floating point value in a range of 0..1 - */ - protected float ypos; - /** - * Z coordinate, representated as a floating point value in a range of 0..1 - */ - protected float zpos; - /** - * The time stamp of the last update represented as TuioTime (time since session start) - */ - protected TuioTime currentTime; - /** - * The creation time of this TuioPoint represented as TuioTime (time since session start) - */ - protected TuioTime startTime; - - /** - * The default constructor takes no arguments and sets - * its coordinate attributes to zero and its time stamp to the current session time. - */ - public TuioPoint() { - xpos = 0.0f; - ypos = 0.0f; - zpos = 0.0f; - currentTime = TuioTime.getSessionTime(); - startTime = new TuioTime(currentTime); - } - - /** - * This constructor takes two floating point coordinate arguments and sets - * its coordinate attributes to these values and its time stamp to the current session time. - * - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - */ - public TuioPoint(float xp, float yp) { - xpos = xp; - ypos = yp; - zpos = 0.0f; - currentTime = TuioTime.getSessionTime(); - startTime = new TuioTime(currentTime); - } - - /** - * This constructor takes three floating point coordinate arguments and sets - * its coordinate attributes to these values and its time stamp to the current session time. - * - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param zp the Z coordinate to assign - */ - public TuioPoint(float xp, float yp, float zp) { - xpos = xp; - ypos = yp; - zpos = zp; - currentTime = TuioTime.getSessionTime(); - startTime = new TuioTime(currentTime); - } - - /** - * This constructor takes a TuioPoint argument and sets its coordinate attributes - * to the coordinates of the provided TuioPoint and its time stamp to the current session time. - * - * @param tpoint the TuioPoint to assign - */ - public TuioPoint(TuioPoint tpoint) { - xpos = tpoint.getX(); - ypos = tpoint.getY(); - zpos = tpoint.getZ(); - currentTime = TuioTime.getSessionTime(); - startTime = new TuioTime(currentTime); - } - - /** - * This constructor takes a TuioTime object and two floating point coordinate arguments and sets - * its coordinate attributes to these values and its time stamp to the provided TUIO time object. - * - * @param ttime the TuioTime to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - */ - public TuioPoint(TuioTime ttime, float xp, float yp) { - xpos = xp; - ypos = yp; - zpos = 0.0f; - currentTime = new TuioTime(ttime); - startTime = new TuioTime(currentTime); - } - - /** - * This constructor takes a TuioTime object and three floating point coordinate arguments and sets - * its coordinate attributes to these values and its time stamp to the provided TUIO time object. - * - * @param ttime the TuioTime to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param zp the Z coordinate to assign - */ - public TuioPoint(TuioTime ttime, float xp, float yp, float zp) { - xpos = xp; - ypos = yp; - zpos = zp; - currentTime = new TuioTime(ttime); - startTime = new TuioTime(currentTime); - } - - /** - * Takes a TuioPoint argument and updates its coordinate attributes - * to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. - * - * @param tpoint the TuioPoint to assign - */ - public void update(TuioPoint tpoint) { - xpos = tpoint.getX(); - ypos = tpoint.getY(); - zpos = tpoint.getZ(); - } - - /** - * Takes two floating point coordinate arguments and updates its coordinate attributes - * to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. - * - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - */ - public void update(float xp, float yp) { - xpos = xp; - ypos = yp; - } - - /** - * Takes three floating point coordinate arguments and updates its coordinate attributes - * to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. - * - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param zp the Z coordinate to assign - */ - public void update(float xp, float yp, float zp) { - xpos = xp; - ypos = yp; - zpos = zp; - } - - /** - * Takes a TuioTime object and two floating point coordinate arguments and updates its coordinate attributes - * to the coordinates of the provided TuioPoint and its time stamp to the provided TUIO time object. - * - * @param ttime the TuioTime to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - */ - public void update(TuioTime ttime, float xp, float yp) { - xpos = xp; - ypos = yp; - currentTime = new TuioTime(ttime); - } - - /** - * Takes a TuioTime object and three floating point coordinate arguments and updates its coordinate attributes - * to the coordinates of the provided TuioPoint and its time stamp to the provided TUIO time object. - * - * @param ttime the TuioTime to assign - * @param xp the X coordinate to assign - * @param yp the Y coordinate to assign - * @param zp the Z coordinate to assign - */ - public void update(TuioTime ttime, float xp, float yp, float zp) { - xpos = xp; - ypos = yp; - zpos = zp; - currentTime = new TuioTime(ttime); - } - - /** - * Returns the X coordinate of this TuioPoint. - * @return the X coordinate of this TuioPoint - */ - public float getX() { - return xpos; - } - - /** - * Returns the Y coordinate of this TuioPoint. - * @return the Y coordinate of this TuioPoint - */ - public float getY() { - return ypos; - } - - /** - * Returns the Z coordinate of this TuioPoint. - * @return the Z coordinate of this TuioPoint - */ - public float getZ() { - return zpos; - } - - /** - * Returns the distance to the provided coordinates - * - * @param xp the X coordinate of the distant point - * @param yp the Y coordinate of the distant point - * @return the distance to the provided coordinates - */ - public float getDistance(float xp, float yp) { - float dx = xpos-xp; - float dy = ypos-yp; - return (float)Math.sqrt(dx*dx+dy*dy); - } - - /** - * Returns the distance to the provided coordinates - * - * @param xp the X coordinate of the distant point - * @param yp the Y coordinate of the distant point - * @param zp the Y coordinate of the distant point - * @return the distance to the provided coordinates - */ - public float getDistance(float xp, float yp, float zp) { - float dx = xpos-xp; - float dy = ypos-yp; - float dz = zpos-zp; - return (float)Math.sqrt(dx*dx+dy*dy+dz*dz); - } - - /** - * Returns the distance to the provided TuioPoint - * - * @param tpoint the distant TuioPoint - * @return the distance to the provided TuioPoint - */ - public float getDistance(TuioPoint tpoint) { - return getDistance(tpoint.getX(),tpoint.getY(), tpoint.getZ()); - } - - /** - * Returns the angle to the provided coordinates - * - * @param xp the X coordinate of the distant point - * @param yp the Y coordinate of the distant point - * @return the angle to the provided coordinates - */ - public float getAngle(float xp, float yp) { - - float side = xpos-xp; - float height = ypos-yp; - float distance = getDistance(xp,yp); - - float angle = (float)(Math.asin(side/distance)+Math.PI/2); - if (height<0) angle = 2.0f*(float)Math.PI-angle; - - return angle; - } - - /** - * Returns the angle to the provided TuioPoint - * - * @param tpoint the distant TuioPoint - * @return the angle to the provided TuioPoint - */ - public float getAngle(TuioPoint tpoint) { - return getAngle(tpoint.getX(),tpoint.getY()); - } - - /** - * Returns the angle in degrees to the provided coordinates - * - * @param xp the X coordinate of the distant point - * @param yp the Y coordinate of the distant point - * @return the angle in degrees to the provided TuioPoint - */ - public float getAngleDegrees(float xp, float yp) { - return (getAngle(xp,yp)/(float)Math.PI)*180.0f; - } - - /** - * Returns the angle in degrees to the provided TuioPoint - * - * @param tpoint the distant TuioPoint - * @return the angle in degrees to the provided TuioPoint - */ - public float getAngleDegrees(TuioPoint tpoint) { - return (getAngle(tpoint)/(float)Math.PI)*180.0f; - } - - /** - * Returns the X coordinate in pixels relative to the provided screen width. - * - * @param width the screen width - * @return the X coordinate of this TuioPoint in pixels relative to the provided screen width - */ - public int getScreenX(int width) { - return (int)Math.round(xpos*width); - } - - /** - * Returns the Y coordinate in pixels relative to the provided screen height. - * - * @param height the screen height - * @return the Y coordinate of this TuioPoint in pixels relative to the provided screen height - */ - public int getScreenY(int height) { - return (int)Math.round(ypos*height); - } - - /** - * Returns the time stamp of this TuioPoint as TuioTime. - * - * @return the time stamp of this TuioPoint as TuioTime - */ - public TuioTime getTuioTime() { - return new TuioTime(currentTime); - } - - /** - * Returns the start time of this TuioPoint as TuioTime. - * - * @return the start time of this TuioPoint as TuioTime - */ - public TuioTime getStartTime() { - return new TuioTime(startTime); - } -} +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage 3D. +*/ + +package TUIO; + +/** + * The TuioPoint class on the one hand is a simple container and utility class to handle TUIO positions in general, + * on the other hand the TuioPoint is the base class for the TuioCursor and TuioObject classes. + * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +public class TuioPoint { + + public String comm; + + /** + * X coordinate, representated as a floating point value in a range of 0..1 + */ + protected float xpos; + /** + * Y coordinate, representated as a floating point value in a range of 0..1 + */ + protected float ypos; + /** + * Z coordinate, representated as a floating point value in a range of 0..1 + */ + protected float zpos; + /** + * The time stamp of the last update represented as TuioTime (time since session start) + */ + protected TuioTime currentTime; + /** + * The creation time of this TuioPoint represented as TuioTime (time since session start) + */ + protected TuioTime startTime; + + /** + * The default constructor takes no arguments and sets + * its coordinate attributes to zero and its time stamp to the current session time. + */ + public TuioPoint() { + xpos = 0.0f; + ypos = 0.0f; + zpos = 0.0f; + currentTime = TuioTime.getSessionTime(); + startTime = new TuioTime(currentTime); + } + + /** + * This constructor takes two floating point coordinate arguments and sets + * its coordinate attributes to these values and its time stamp to the current session time. + * + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public TuioPoint(float xp, float yp) { + xpos = xp; + ypos = yp; + zpos = 0.0f; + currentTime = TuioTime.getSessionTime(); + startTime = new TuioTime(currentTime); + } + + /** + * This constructor takes three floating point coordinate arguments and sets + * its coordinate attributes to these values and its time stamp to the current session time. + * + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param zp the Z coordinate to assign + */ + public TuioPoint(float xp, float yp, float zp) { + xpos = xp; + ypos = yp; + zpos = zp; + currentTime = TuioTime.getSessionTime(); + startTime = new TuioTime(currentTime); + } + + /** + * This constructor takes a TuioPoint argument and sets its coordinate attributes + * to the coordinates of the provided TuioPoint and its time stamp to the current session time. + * + * @param tpoint the TuioPoint to assign + */ + public TuioPoint(TuioPoint tpoint) { + xpos = tpoint.getX(); + ypos = tpoint.getY(); + zpos = tpoint.getZ(); + currentTime = TuioTime.getSessionTime(); + startTime = new TuioTime(currentTime); + } + + /** + * This constructor takes a TuioTime object and two floating point coordinate arguments and sets + * its coordinate attributes to these values and its time stamp to the provided TUIO time object. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public TuioPoint(TuioTime ttime, float xp, float yp) { + xpos = xp; + ypos = yp; + zpos = 0.0f; + currentTime = new TuioTime(ttime); + startTime = new TuioTime(currentTime); + } + + /** + * This constructor takes a TuioTime object and three floating point coordinate arguments and sets + * its coordinate attributes to these values and its time stamp to the provided TUIO time object. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param zp the Z coordinate to assign + */ + public TuioPoint(TuioTime ttime, float xp, float yp, float zp) { + xpos = xp; + ypos = yp; + zpos = zp; + currentTime = new TuioTime(ttime); + startTime = new TuioTime(currentTime); + } + + /** + * Takes a TuioPoint argument and updates its coordinate attributes + * to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. + * + * @param tpoint the TuioPoint to assign + */ + public void update(TuioPoint tpoint) { + xpos = tpoint.getX(); + ypos = tpoint.getY(); + zpos = tpoint.getZ(); + } + + /** + * Takes two floating point coordinate arguments and updates its coordinate attributes + * to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. + * + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public void update(float xp, float yp) { + xpos = xp; + ypos = yp; + } + + /** + * Takes three floating point coordinate arguments and updates its coordinate attributes + * to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. + * + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param zp the Z coordinate to assign + */ + public void update(float xp, float yp, float zp) { + xpos = xp; + ypos = yp; + zpos = zp; + } + + /** + * Takes a TuioTime object and two floating point coordinate arguments and updates its coordinate attributes + * to the coordinates of the provided TuioPoint and its time stamp to the provided TUIO time object. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public void update(TuioTime ttime, float xp, float yp) { + xpos = xp; + ypos = yp; + currentTime = new TuioTime(ttime); + } + + /** + * Takes a TuioTime object and three floating point coordinate arguments and updates its coordinate attributes + * to the coordinates of the provided TuioPoint and its time stamp to the provided TUIO time object. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param zp the Z coordinate to assign + */ + public void update(TuioTime ttime, float xp, float yp, float zp) { + xpos = xp; + ypos = yp; + zpos = zp; + currentTime = new TuioTime(ttime); + } + + /** + * Returns the X coordinate of this TuioPoint. + * @return the X coordinate of this TuioPoint + */ + public float getX() { + return xpos; + } + + /** + * Returns the Y coordinate of this TuioPoint. + * @return the Y coordinate of this TuioPoint + */ + public float getY() { + return ypos; + } + + /** + * Returns the Z coordinate of this TuioPoint. + * @return the Z coordinate of this TuioPoint + */ + public float getZ() { + return zpos; + } + + /** + * Returns the distance to the provided coordinates + * + * @param xp the X coordinate of the distant point + * @param yp the Y coordinate of the distant point + * @return the distance to the provided coordinates + */ + public float getDistance(float xp, float yp) { + float dx = xpos-xp; + float dy = ypos-yp; + return (float)Math.sqrt(dx*dx+dy*dy); + } + + /** + * Returns the distance to the provided coordinates + * + * @param xp the X coordinate of the distant point + * @param yp the Y coordinate of the distant point + * @param zp the Y coordinate of the distant point + * @return the distance to the provided coordinates + */ + public float getDistance(float xp, float yp, float zp) { + float dx = xpos-xp; + float dy = ypos-yp; + float dz = zpos-zp; + return (float)Math.sqrt(dx*dx+dy*dy+dz*dz); + } + + /** + * Returns the distance to the provided TuioPoint + * + * @param tpoint the distant TuioPoint + * @return the distance to the provided TuioPoint + */ + public float getDistance(TuioPoint tpoint) { + return getDistance(tpoint.getX(),tpoint.getY(), tpoint.getZ()); + } + + /** + * Returns the angle to the provided coordinates + * + * @param xp the X coordinate of the distant point + * @param yp the Y coordinate of the distant point + * @return the angle to the provided coordinates + */ + public float getAngle(float xp, float yp) { + + float side = xpos-xp; + float height = ypos-yp; + float distance = getDistance(xp,yp); + + float angle = (float)(Math.asin(side/distance)+Math.PI/2); + if (height<0) angle = 2.0f*(float)Math.PI-angle; + + return angle; + } + + /** + * Returns the angle to the provided TuioPoint + * + * @param tpoint the distant TuioPoint + * @return the angle to the provided TuioPoint + */ + public float getAngle(TuioPoint tpoint) { + return getAngle(tpoint.getX(),tpoint.getY()); + } + + /** + * Returns the angle in degrees to the provided coordinates + * + * @param xp the X coordinate of the distant point + * @param yp the Y coordinate of the distant point + * @return the angle in degrees to the provided TuioPoint + */ + public float getAngleDegrees(float xp, float yp) { + return (getAngle(xp,yp)/(float)Math.PI)*180.0f; + } + + /** + * Returns the angle in degrees to the provided TuioPoint + * + * @param tpoint the distant TuioPoint + * @return the angle in degrees to the provided TuioPoint + */ + public float getAngleDegrees(TuioPoint tpoint) { + return (getAngle(tpoint)/(float)Math.PI)*180.0f; + } + + /** + * Returns the X coordinate in pixels relative to the provided screen width. + * + * @param width the screen width + * @return the X coordinate of this TuioPoint in pixels relative to the provided screen width + */ + public int getScreenX(int width) { + return (int)Math.round(xpos*width); + } + + /** + * Returns the Y coordinate in pixels relative to the provided screen height. + * + * @param height the screen height + * @return the Y coordinate of this TuioPoint in pixels relative to the provided screen height + */ + public int getScreenY(int height) { + return (int)Math.round(ypos*height); + } + + /** + * Returns the time stamp of this TuioPoint as TuioTime. + * + * @return the time stamp of this TuioPoint as TuioTime + */ + public TuioTime getTuioTime() { + return new TuioTime(currentTime); + } + + /** + * Returns the start time of this TuioPoint as TuioTime. + * + * @return the start time of this TuioPoint as TuioTime + */ + public TuioTime getStartTime() { + return new TuioTime(startTime); + } +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TUIO/TuioString.java --- a/front_processing/extern/TUIO_JAVA/src/TUIO/TuioString.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioString.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,189 +1,194 @@ -/* -Added by alexandre.bastien@iri.centrepompidou.fr -*/ - -package TUIO; - -/** - * The TuioCursor class encapsulates /tuio/_siP TUIO strings. - * - */ -public class TuioString { - - /** - * The unique session ID number that is assigned to each TUIO string. - */ - protected long session_id; - - /** - * The individual string ID number that is assigned to each TuioString. - */ - protected int string_id; - - /** - * The individual string message that is assigned to each TuioString. - */ - protected String message; - - /** - * The time stamp of the last update represented as TuioTime (time since session start) - */ - protected TuioTime currentTime; - /** - * The creation time of this TuioString represented as TuioTime (time since session start) - */ - protected TuioTime startTime; - - /** - * Defines the ADDED state. - */ - public static final int TUIO_ADDED = 0; - /** - * Defines the REMOVED state. - */ - public static final int TUIO_REMOVED = 4; - /** - * Reflects the current state of the TuioString - */ - protected int state; - - /** - * This constructor takes a TuioTime argument and assigns it along with the provided - * Session ID, String ID and a message to the newly created TuioString. - * - * @param ttime the TuioTime to assign - * @param si the Session ID to assign - * @param sti the String ID to assign - * @param msg the message to assign - */ - public TuioString (TuioTime ttime, long si, int sti, String msg) { - this.session_id = si; - this.string_id = sti; - this.message = msg; - currentTime = new TuioTime(ttime); - startTime = new TuioTime(currentTime); - } - - /** - * This constructor takes the provided Session ID, String ID and message - * and assigs these values to the newly created TuioString. - * - * @param si the Session ID to assign - * @param sti the String ID to assign - * @param msg the message to assign - */ - public TuioString (long si, int sti, String msg) { - this.session_id = si; - this.string_id = sti; - this.message = msg; - currentTime = TuioTime.getSessionTime(); - startTime = new TuioTime(currentTime); - } - - /** - * This constructor takes the atttibutes of the provided TuioCursor - * and assigs these values to the newly created TuioCursor. - * - * @param tcur the TuioCursor to assign - */ - public TuioString (TuioString tstr) { - this.session_id = tstr.getSessionID(); - this.string_id = tstr.getStringID(); - this.message = tstr.getMessage(); - currentTime = new TuioTime(tstr.getCurrentTime()); - startTime = new TuioTime(currentTime); - } - - /** - * Takes a TuioTime argument and assigns it along with the provided - * message to the private TuioString attributes. - * The speed and accleration values are calculated accordingly. - * - * @param ttime the TuioTime to assign - * @param message2 the message to assign - */ - public void update(TuioTime ttime, String message2) { - currentTime = new TuioTime(ttime); - message = message2; - } - - /** - * This method is used to update the TuioTime of a TuioString while keeping the same * * * message. - */ - public void stop(TuioTime ttime) { - update(ttime,message); - } - - /** - * Takes the atttibutes of the provided TuioString - * and assigs these values to this TuioString. - * The TuioTime time stamp of this TuioString remains unchanged. - * - * @param tstr the TuioString to assign - */ - public void update (TuioString tstr) { - message = tstr.getMessage(); - } - - /** - * Takes the message provided - * and assigs its value to this TuioString. - * The TuioTime time stamp of this TuioString remains unchanged. - * - * @param msg the message to assign - */ - public void update (String msg) { - message = msg; - } - - /** - * Assigns the REMOVE state to this TuioString and sets - * its TuioTime time stamp to the provided TuioTime argument. - * - * @param ttime the TuioTime to assign - */ - public void remove(TuioTime ttime) { - currentTime = new TuioTime(ttime); - state = TUIO_REMOVED; - } - - /** - * Returns the Session ID of this TuioString. - * @return the Session ID of this TuioString - */ - public long getSessionID() { - return session_id; - } - - /** - * Returns the String ID of this TuioString. - * @return the String ID of this TuioString - */ - public int getStringID() { - return string_id; - } - - /** - * Returns the Message of this TuioString. - * @return the Message of this TuioString - */ - public String getMessage() { - return message; - } - - /** - * Returns the Current Time of this TuioString. - * @return the Current Time of this TuioString - */ - public TuioTime getCurrentTime() { - return currentTime; - } - - /** - * Returns the TUIO state of this TuioString. - * @return the TUIO state of this TuioString - */ - public int getTuioState() { - return state; - } -} +/* +Added by alexandre.bastien@iri.centrepompidou.fr +*/ + +package TUIO; + +/** + * The TuioCursor class encapsulates /tuio/_siP TUIO strings. + * + */ + + /* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ + +public class TuioString { + + /** + * The unique session ID number that is assigned to each TUIO string. + */ + protected long session_id; + + /** + * The individual string ID number that is assigned to each TuioString. + */ + protected int string_id; + + /** + * The individual string message that is assigned to each TuioString. + */ + protected String message; + + /** + * The time stamp of the last update represented as TuioTime (time since session start) + */ + protected TuioTime currentTime; + /** + * The creation time of this TuioString represented as TuioTime (time since session start) + */ + protected TuioTime startTime; + + /** + * Defines the ADDED state. + */ + public static final int TUIO_ADDED = 0; + /** + * Defines the REMOVED state. + */ + public static final int TUIO_REMOVED = 4; + /** + * Reflects the current state of the TuioString + */ + protected int state; + + /** + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, String ID and a message to the newly created TuioString. + * + * @param ttime the TuioTime to assign + * @param si the Session ID to assign + * @param sti the String ID to assign + * @param msg the message to assign + */ + public TuioString (TuioTime ttime, long si, int sti, String msg) { + this.session_id = si; + this.string_id = sti; + this.message = msg; + currentTime = new TuioTime(ttime); + startTime = new TuioTime(currentTime); + } + + /** + * This constructor takes the provided Session ID, String ID and message + * and assigs these values to the newly created TuioString. + * + * @param si the Session ID to assign + * @param sti the String ID to assign + * @param msg the message to assign + */ + public TuioString (long si, int sti, String msg) { + this.session_id = si; + this.string_id = sti; + this.message = msg; + currentTime = TuioTime.getSessionTime(); + startTime = new TuioTime(currentTime); + } + + /** + * This constructor takes the atttibutes of the provided TuioCursor + * and assigs these values to the newly created TuioCursor. + * + * @param tcur the TuioCursor to assign + */ + public TuioString (TuioString tstr) { + this.session_id = tstr.getSessionID(); + this.string_id = tstr.getStringID(); + this.message = tstr.getMessage(); + currentTime = new TuioTime(tstr.getCurrentTime()); + startTime = new TuioTime(currentTime); + } + + /** + * Takes a TuioTime argument and assigns it along with the provided + * message to the private TuioString attributes. + * The speed and accleration values are calculated accordingly. + * + * @param ttime the TuioTime to assign + * @param message2 the message to assign + */ + public void update(TuioTime ttime, String message2) { + currentTime = new TuioTime(ttime); + message = message2; + } + + /** + * This method is used to update the TuioTime of a TuioString while keeping the same * * * message. + */ + public void stop(TuioTime ttime) { + update(ttime,message); + } + + /** + * Takes the atttibutes of the provided TuioString + * and assigs these values to this TuioString. + * The TuioTime time stamp of this TuioString remains unchanged. + * + * @param tstr the TuioString to assign + */ + public void update (TuioString tstr) { + message = tstr.getMessage(); + } + + /** + * Takes the message provided + * and assigs its value to this TuioString. + * The TuioTime time stamp of this TuioString remains unchanged. + * + * @param msg the message to assign + */ + public void update (String msg) { + message = msg; + } + + /** + * Assigns the REMOVE state to this TuioString and sets + * its TuioTime time stamp to the provided TuioTime argument. + * + * @param ttime the TuioTime to assign + */ + public void remove(TuioTime ttime) { + currentTime = new TuioTime(ttime); + state = TUIO_REMOVED; + } + + /** + * Returns the Session ID of this TuioString. + * @return the Session ID of this TuioString + */ + public long getSessionID() { + return session_id; + } + + /** + * Returns the String ID of this TuioString. + * @return the String ID of this TuioString + */ + public int getStringID() { + return string_id; + } + + /** + * Returns the Message of this TuioString. + * @return the Message of this TuioString + */ + public String getMessage() { + return message; + } + + /** + * Returns the Current Time of this TuioString. + * @return the Current Time of this TuioString + */ + public TuioTime getCurrentTime() { + return currentTime; + } + + /** + * Returns the TUIO state of this TuioString. + * @return the TUIO state of this TuioString + */ + public int getTuioState() { + return state; + } +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TUIO/TuioTime.java --- a/front_processing/extern/TUIO_JAVA/src/TUIO/TuioTime.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioTime.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,236 +1,236 @@ -/* - TUIO Java backend - part of the reacTIVision project - http://reactivision.sourceforge.net/ - - Copyright (c) 2005-2009 Martin Kaltenbrunner - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -package TUIO; - -/** - * The TuioTime class is a simple structure that is used to reprent the time that has elapsed since the session start. - * The time is internally represented as seconds and fractions of microseconds which should be more than sufficient for gesture related timing requirements. - * Therefore at the beginning of a typical TUIO session the static method initSession() will set the reference time for the session. - * Another important static method getSessionTime will return a TuioTime object representing the time elapsed since the session start. - * The class also provides various addtional convience method, which allow some simple time arithmetics. - * - * @author Martin Kaltenbrunner - * @version 1.4 - */ -public class TuioTime { - - /** - * the time since session start in seconds - */ - private long seconds = 0; - /** - * time fraction in microseconds - */ - private long micro_seconds = 0; - /** - * the session start time in seconds - */ - private static long start_seconds = 0; - /** - * start time fraction in microseconds - */ - private static long start_micro_seconds = 0; - - /** - * The default constructor takes no arguments and sets - * the Seconds and Microseconds attributes of the newly created TuioTime both to zero. - */ - public TuioTime () { - this.seconds = 0; - this.micro_seconds = 0; - } - - /** - * This constructor takes the provided time represented in total Milliseconds - * and assigs this value to the newly created TuioTime. - * - * @param msec the total time in Millseconds - */ - public TuioTime (long msec) { - this.seconds = msec/1000; - this.micro_seconds = 1000*(msec%1000); - } - - /** - * This constructor takes the provided time represented in Seconds and Microseconds - * and assigs these value to the newly created TuioTime. - * - * @param sec the total time in seconds - * @param usec the microseconds time component - */ - public TuioTime (long sec, long usec) { - this.seconds = sec; - this.micro_seconds = usec; - } - - /** - * This constructor takes the provided TuioTime - * and assigs its Seconds and Microseconds values to the newly created TuioTime. - * - * @param ttime the TuioTime used to copy - */ - public TuioTime (TuioTime ttime) { - this.seconds = ttime.getSeconds(); - this.micro_seconds = ttime.getMicroseconds(); - } - - /** - * Sums the provided time value represented in total Microseconds to this TuioTime. - * - * @param us the total time to add in Microseconds - * @return the sum of this TuioTime with the provided argument in microseconds - */ - public TuioTime add(long us) { - long sec = seconds + us/1000000; - long usec = micro_seconds + us%1000000; - return new TuioTime(sec,usec); - } - - /** - * Sums the provided TuioTime to the private Seconds and Microseconds attributes. - * - * @param ttime the TuioTime to add - * @return the sum of this TuioTime with the provided TuioTime argument - */ - public TuioTime add(TuioTime ttime) { - long sec = seconds + ttime.getSeconds(); - long usec = micro_seconds + ttime.getMicroseconds(); - sec += usec/1000000; - usec = usec%1000000; - return new TuioTime(sec,usec); - } - - /** - * Subtracts the provided time represented in Microseconds from the private Seconds and Microseconds attributes. - * - * @param us the total time to subtract in Microseconds - * @return the subtraction result of this TuioTime minus the provided time in Microseconds - */ - public TuioTime subtract(long us) { - long sec = seconds - us/1000000; - long usec = micro_seconds - us%1000000; - - if (usec<0) { - usec += 1000000; - sec--; - } - - return new TuioTime(sec,usec); - } - - /** - * Subtracts the provided TuioTime from the private Seconds and Microseconds attributes. - * - * @param ttime the TuioTime to subtract - * @return the subtraction result of this TuioTime minus the provided TuioTime - */ - public TuioTime subtract(TuioTime ttime) { - long sec = seconds - ttime.getSeconds(); - long usec = micro_seconds - ttime.getMicroseconds(); - - if (usec<0) { - usec += 1000000; - sec--; - } - - return new TuioTime(sec,usec); - } - - /** - * Takes a TuioTime argument and compares the provided TuioTime to the private Seconds and Microseconds attributes. - * - * @param ttime the TuioTime to compare - * @return true if the two TuioTime have equal Seconds and Microseconds attributes - */ - public boolean equals(TuioTime ttime) { - if ((seconds==ttime.getSeconds()) && (micro_seconds==ttime.getMicroseconds())) return true; - else return false; - } - - /** - * Resets the seconds and micro_seconds attributes to zero. - */ - public void reset() { - seconds = 0; - micro_seconds = 0; - } - - /** - * Returns the TuioTime Seconds component. - * @return the TuioTime Seconds component - */ - public long getSeconds() { - return seconds; - } - - /** - * Returns the TuioTime Microseconds component. - * @return the TuioTime Microseconds component - */ - public long getMicroseconds() { - return micro_seconds; - } - - /** - * Returns the total TuioTime in Milliseconds. - * @return the total TuioTime in Milliseconds - */ - public long getTotalMilliseconds() { - return seconds*1000+micro_seconds/1000; - } - - /** - * This static method globally resets the TUIO session time. - */ - public static void initSession() { - TuioTime startTime = getSystemTime(); - start_seconds = startTime.getSeconds(); - start_micro_seconds = startTime.getMicroseconds(); - } - - /** - * Returns the present TuioTime representing the time since session start. - * @return the present TuioTime representing the time since session start - */ - public static TuioTime getSessionTime() { - TuioTime sessionTime = getSystemTime().subtract(getStartTime()); - return sessionTime; - - } - - /** - * Returns the absolut TuioTime representing the session start. - * @return the absolut TuioTime representing the session start - */ - public static TuioTime getStartTime() { - return new TuioTime(start_seconds,start_micro_seconds); - } - - /** - * Returns the absolut TuioTime representing the current system time. - * @return the absolut TuioTime representing the current system time - */ - public static TuioTime getSystemTime() { - long usec = System.nanoTime()/1000; - return new TuioTime(usec/1000000,usec%1000000); - } -} +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package TUIO; + +/** + * The TuioTime class is a simple structure that is used to reprent the time that has elapsed since the session start. + * The time is internally represented as seconds and fractions of microseconds which should be more than sufficient for gesture related timing requirements. + * Therefore at the beginning of a typical TUIO session the static method initSession() will set the reference time for the session. + * Another important static method getSessionTime will return a TuioTime object representing the time elapsed since the session start. + * The class also provides various addtional convience method, which allow some simple time arithmetics. + * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +public class TuioTime { + + /** + * the time since session start in seconds + */ + private long seconds = 0; + /** + * time fraction in microseconds + */ + private long micro_seconds = 0; + /** + * the session start time in seconds + */ + private static long start_seconds = 0; + /** + * start time fraction in microseconds + */ + private static long start_micro_seconds = 0; + + /** + * The default constructor takes no arguments and sets + * the Seconds and Microseconds attributes of the newly created TuioTime both to zero. + */ + public TuioTime () { + this.seconds = 0; + this.micro_seconds = 0; + } + + /** + * This constructor takes the provided time represented in total Milliseconds + * and assigs this value to the newly created TuioTime. + * + * @param msec the total time in Millseconds + */ + public TuioTime (long msec) { + this.seconds = msec/1000; + this.micro_seconds = 1000*(msec%1000); + } + + /** + * This constructor takes the provided time represented in Seconds and Microseconds + * and assigs these value to the newly created TuioTime. + * + * @param sec the total time in seconds + * @param usec the microseconds time component + */ + public TuioTime (long sec, long usec) { + this.seconds = sec; + this.micro_seconds = usec; + } + + /** + * This constructor takes the provided TuioTime + * and assigs its Seconds and Microseconds values to the newly created TuioTime. + * + * @param ttime the TuioTime used to copy + */ + public TuioTime (TuioTime ttime) { + this.seconds = ttime.getSeconds(); + this.micro_seconds = ttime.getMicroseconds(); + } + + /** + * Sums the provided time value represented in total Microseconds to this TuioTime. + * + * @param us the total time to add in Microseconds + * @return the sum of this TuioTime with the provided argument in microseconds + */ + public TuioTime add(long us) { + long sec = seconds + us/1000000; + long usec = micro_seconds + us%1000000; + return new TuioTime(sec,usec); + } + + /** + * Sums the provided TuioTime to the private Seconds and Microseconds attributes. + * + * @param ttime the TuioTime to add + * @return the sum of this TuioTime with the provided TuioTime argument + */ + public TuioTime add(TuioTime ttime) { + long sec = seconds + ttime.getSeconds(); + long usec = micro_seconds + ttime.getMicroseconds(); + sec += usec/1000000; + usec = usec%1000000; + return new TuioTime(sec,usec); + } + + /** + * Subtracts the provided time represented in Microseconds from the private Seconds and Microseconds attributes. + * + * @param us the total time to subtract in Microseconds + * @return the subtraction result of this TuioTime minus the provided time in Microseconds + */ + public TuioTime subtract(long us) { + long sec = seconds - us/1000000; + long usec = micro_seconds - us%1000000; + + if (usec<0) { + usec += 1000000; + sec--; + } + + return new TuioTime(sec,usec); + } + + /** + * Subtracts the provided TuioTime from the private Seconds and Microseconds attributes. + * + * @param ttime the TuioTime to subtract + * @return the subtraction result of this TuioTime minus the provided TuioTime + */ + public TuioTime subtract(TuioTime ttime) { + long sec = seconds - ttime.getSeconds(); + long usec = micro_seconds - ttime.getMicroseconds(); + + if (usec<0) { + usec += 1000000; + sec--; + } + + return new TuioTime(sec,usec); + } + + /** + * Takes a TuioTime argument and compares the provided TuioTime to the private Seconds and Microseconds attributes. + * + * @param ttime the TuioTime to compare + * @return true if the two TuioTime have equal Seconds and Microseconds attributes + */ + public boolean equals(TuioTime ttime) { + if ((seconds==ttime.getSeconds()) && (micro_seconds==ttime.getMicroseconds())) return true; + else return false; + } + + /** + * Resets the seconds and micro_seconds attributes to zero. + */ + public void reset() { + seconds = 0; + micro_seconds = 0; + } + + /** + * Returns the TuioTime Seconds component. + * @return the TuioTime Seconds component + */ + public long getSeconds() { + return seconds; + } + + /** + * Returns the TuioTime Microseconds component. + * @return the TuioTime Microseconds component + */ + public long getMicroseconds() { + return micro_seconds; + } + + /** + * Returns the total TuioTime in Milliseconds. + * @return the total TuioTime in Milliseconds + */ + public long getTotalMilliseconds() { + return seconds*1000+micro_seconds/1000; + } + + /** + * This static method globally resets the TUIO session time. + */ + public static void initSession() { + TuioTime startTime = getSystemTime(); + start_seconds = startTime.getSeconds(); + start_micro_seconds = startTime.getMicroseconds(); + } + + /** + * Returns the present TuioTime representing the time since session start. + * @return the present TuioTime representing the time since session start + */ + public static TuioTime getSessionTime() { + TuioTime sessionTime = getSystemTime().subtract(getStartTime()); + return sessionTime; + + } + + /** + * Returns the absolut TuioTime representing the session start. + * @return the absolut TuioTime representing the session start + */ + public static TuioTime getStartTime() { + return new TuioTime(start_seconds,start_micro_seconds); + } + + /** + * Returns the absolut TuioTime representing the current system time. + * @return the absolut TuioTime representing the current system time + */ + public static TuioTime getSystemTime() { + long usec = System.nanoTime()/1000; + return new TuioTime(usec/1000000,usec%1000000); + } +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TuioApplet.java --- a/front_processing/extern/TUIO_JAVA/src/TuioApplet.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TuioApplet.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,67 +1,67 @@ -/* - TUIO Java Demo - part of the reacTIVision project - http://reactivision.sourceforge.net/ - - Copyright (c) 2005-2009 Martin Kaltenbrunner - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -import java.applet.*; -import java.awt.*; -import javax.swing.*; -import java.io.*; -import java.net.*; -import TUIO.*; - -public class TuioApplet extends JApplet { - - TuioDemoComponent demo; - TuioClient client; - int port = 3333; - - public void init() { - try { - port = Integer.parseInt(getParameter("port")); - } catch (Exception e) {} - - Dimension size = this.getSize(); - - TuioDemoComponent demo = new TuioDemoComponent(); - demo.setSize(size.width,size.height); - - client = new TuioClient(); - client.addTuioListener(demo); - - add(demo); - repaint(); - } - - public void start() { - if (!client.isConnected()) client.connect(); - } - - public void stop() { - if (client.isConnected()) client.disconnect(); - } - - public void destroy() { - if (client.isConnected()) client.disconnect(); - client = null; - } - - public void paint( Graphics g ) { - } -} +/* + TUIO Java Demo - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +import java.applet.*; +import java.awt.*; +import javax.swing.*; +import java.io.*; +import java.net.*; +import TUIO.*; + +public class TuioApplet extends JApplet { + + TuioDemoComponent demo; + TuioClient client; + int port = 3333; + + public void init() { + try { + port = Integer.parseInt(getParameter("port")); + } catch (Exception e) {} + + Dimension size = this.getSize(); + + TuioDemoComponent demo = new TuioDemoComponent(); + demo.setSize(size.width,size.height); + + client = new TuioClient(); + client.addTuioListener(demo); + + add(demo); + repaint(); + } + + public void start() { + if (!client.isConnected()) client.connect(); + } + + public void stop() { + if (client.isConnected()) client.disconnect(); + } + + public void destroy() { + if (client.isConnected()) client.disconnect(); + client = null; + } + + public void paint( Graphics g ) { + } +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TuioDemo.java --- a/front_processing/extern/TUIO_JAVA/src/TuioDemo.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TuioDemo.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,142 +1,142 @@ -/* - TUIO Java Demo - part of the reacTIVision project - http://reactivision.sourceforge.net/ - - Copyright (c) 2005-2009 Martin Kaltenbrunner - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -import java.awt.*; -import java.awt.geom.*; -import java.awt.event.*; -import java.awt.image.*; -import java.util.*; -import javax.swing.*; -import TUIO.*; - -public class TuioDemo { - private final int window_width = 640; - private final int window_height = 480; - - private boolean fullscreen = false; - - private TuioDemoComponent demo; - private JFrame frame; - private GraphicsDevice device; - - public TuioDemo() { - demo = new TuioDemoComponent(); - device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); - setupWindow(); - showWindow(); - } - - public TuioListener getTuioListener() { - return demo; - } - - public void setupWindow() { - - frame = new JFrame(); - frame.add(demo); - - frame.setTitle("TuioDemo"); - frame.setResizable(false); - - frame.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent evt) { - System.exit(0); - } }); - - frame.addKeyListener( new KeyAdapter() { public void keyPressed(KeyEvent evt) { - if (evt.getKeyCode()==KeyEvent.VK_ESCAPE) System.exit(0); - else if (evt.getKeyCode()==KeyEvent.VK_F1) { - destroyWindow(); - setupWindow(); - fullscreen = !fullscreen; - showWindow(); - } - else if (evt.getKeyCode()==KeyEvent.VK_V) demo.verbose=!demo.verbose; - } }); - } - - public void destroyWindow() { - - frame.setVisible(false); - if (fullscreen) { - device.setFullScreenWindow(null); - } - frame = null; - } - - public void showWindow() { - - if (fullscreen) { - int width = (int)Toolkit.getDefaultToolkit().getScreenSize().getWidth(); - int height = (int)Toolkit.getDefaultToolkit().getScreenSize().getHeight(); - demo.setSize(width,height); - - frame.setSize(width,height); - frame.setUndecorated(true); - device.setFullScreenWindow(frame); - } else { - int width = window_width; - int height = window_height; - demo.setSize(width,height); - - frame.pack(); - Insets insets = frame.getInsets(); - frame.setSize(width,height +insets.top); - - } - - frame.setVisible(true); - frame.repaint(); - - } - - public static void main(String argv[]) { - - TuioDemo demo = new TuioDemo(); - TuioClient client = null; - - switch (argv.length) { - case 1: - try { - client = new TuioClient( Integer.parseInt(argv[0])); - } catch (Exception e) { - System.out.println("usage: java TuioDemo [port]"); - System.exit(0); - } - break; - case 0: - client = new TuioClient(80); - break; - default: - System.out.println("usage: java TuioDemo [port]"); - System.exit(0); - break; - } - - if (client!=null) { - client.addTuioListener(demo.getTuioListener()); - client.connect(); - } else { - System.out.println("usage: java TuioDemo [port]"); - System.exit(0); - } - } - -} +/* + TUIO Java Demo - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +import java.awt.*; +import java.awt.geom.*; +import java.awt.event.*; +import java.awt.image.*; +import java.util.*; +import javax.swing.*; +import TUIO.*; + +public class TuioDemo { + private final int window_width = 640; + private final int window_height = 480; + + private boolean fullscreen = false; + + private TuioDemoComponent demo; + private JFrame frame; + private GraphicsDevice device; + + public TuioDemo() { + demo = new TuioDemoComponent(); + device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); + setupWindow(); + showWindow(); + } + + public TuioListener getTuioListener() { + return demo; + } + + public void setupWindow() { + + frame = new JFrame(); + frame.add(demo); + + frame.setTitle("TuioDemo"); + frame.setResizable(false); + + frame.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent evt) { + System.exit(0); + } }); + + frame.addKeyListener( new KeyAdapter() { public void keyPressed(KeyEvent evt) { + if (evt.getKeyCode()==KeyEvent.VK_ESCAPE) System.exit(0); + else if (evt.getKeyCode()==KeyEvent.VK_F1) { + destroyWindow(); + setupWindow(); + fullscreen = !fullscreen; + showWindow(); + } + else if (evt.getKeyCode()==KeyEvent.VK_V) demo.verbose=!demo.verbose; + } }); + } + + public void destroyWindow() { + + frame.setVisible(false); + if (fullscreen) { + device.setFullScreenWindow(null); + } + frame = null; + } + + public void showWindow() { + + if (fullscreen) { + int width = (int)Toolkit.getDefaultToolkit().getScreenSize().getWidth(); + int height = (int)Toolkit.getDefaultToolkit().getScreenSize().getHeight(); + demo.setSize(width,height); + + frame.setSize(width,height); + frame.setUndecorated(true); + device.setFullScreenWindow(frame); + } else { + int width = window_width; + int height = window_height; + demo.setSize(width,height); + + frame.pack(); + Insets insets = frame.getInsets(); + frame.setSize(width,height +insets.top); + + } + + frame.setVisible(true); + frame.repaint(); + + } + + public static void main(String argv[]) { + + TuioDemo demo = new TuioDemo(); + TuioClient client = null; + + switch (argv.length) { + case 1: + try { + client = new TuioClient( Integer.parseInt(argv[0])); + } catch (Exception e) { + System.out.println("usage: java TuioDemo [port]"); + System.exit(0); + } + break; + case 0: + client = new TuioClient(80); + break; + default: + System.out.println("usage: java TuioDemo [port]"); + System.exit(0); + break; + } + + if (client!=null) { + client.addTuioListener(demo.getTuioListener()); + client.connect(); + } else { + System.out.println("usage: java TuioDemo [port]"); + System.exit(0); + } + } + +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TuioDemoComponent.java --- a/front_processing/extern/TUIO_JAVA/src/TuioDemoComponent.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TuioDemoComponent.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,182 +1,186 @@ -/* - TUIO Java Demo - part of the reacTIVision project - http://reactivision.sourceforge.net/ - - Copyright (c) 2005-2009 Martin Kaltenbrunner - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -import java.awt.*; -import java.awt.geom.*; -import java.awt.event.*; -import java.awt.image.*; -import java.util.*; -import javax.swing.*; -import TUIO.*; - -public class TuioDemoComponent extends JComponent implements TuioListener { - - private Hashtable objectList = new Hashtable(); - private Hashtable cursorList = new Hashtable(); - private Hashtable stringList = new Hashtable(); - - public static final int finger_size = 15; - public static final int object_size = 60; - public static final int table_size = 760; - - public static int width, height; - private float scale = 1.0f; - public boolean verbose = false; - - public void setSize(int w, int h) { - super.setSize(w,h); - width = w; - height = h; - scale = height/(float)TuioDemoComponent.table_size; - } - - public void addTuioObject(TuioObject tobj) { - TuioDemoObject demo = new TuioDemoObject(tobj); - objectList.put(tobj.getSessionID(),demo); - - if (verbose) - System.out.println("add obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()); - } - - public void updateTuioObject(TuioObject tobj) { - - TuioDemoObject demo = (TuioDemoObject)objectList.get(tobj.getSessionID()); - demo.update(tobj); - - if (verbose) - System.out.println("set obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()+" "+tobj.getMotionSpeed()+" "+tobj.getRotationSpeed()+" "+tobj.getMotionAccel()+" "+tobj.getRotationAccel()); - } - - public void removeTuioObject(TuioObject tobj) { - objectList.remove(tobj.getSessionID()); - - if (verbose) - System.out.println("del obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+")"); - } - - public void addTuioCursor(TuioCursor tcur) { - - if (!cursorList.containsKey(tcur.getSessionID())) { - cursorList.put(tcur.getSessionID(), tcur); - repaint(); - } - - if (verbose) - System.out.println("add cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()); - } - - public void updateTuioCursor(TuioCursor tcur) { - - repaint(); - - if (verbose) - System.out.println("set cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()+" "+tcur.getMotionSpeed()+" "+tcur.getMotionAccel()); - } - - public void removeTuioCursor(TuioCursor tcur) { - - cursorList.remove(tcur.getSessionID()); - repaint(); - - if (verbose) - System.out.println("del cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+")"); - } - - public void addTuioString(TuioString tstr) { - - if (!stringList.containsKey(tstr.getSessionID())) { - stringList.put(tstr.getSessionID(), tstr); - repaint(); - } - - if (verbose) - System.out.println("add str "+tstr.getStringID()+" ("+tstr.getSessionID()+") "+tstr.getMessage()); - } - - public void updateTuioString(TuioString tstr) { - - repaint(); - - if (verbose) - System.out.println("set str "+tstr.getStringID()+" ("+tstr.getSessionID()+") "+tstr.getMessage()); - } - - public void removeTuioString(TuioString tstr) { - - stringList.remove(tstr.getSessionID()); - repaint(); - - if (verbose) - System.out.println("del str "+tstr.getStringID()+" ("+tstr.getSessionID()+")"); - } - - public void refresh(TuioTime frameTime) { - repaint(); - } - - public void paint(Graphics g) { - update(g); - } - - public void update(Graphics g) { - - Graphics2D g2 = (Graphics2D)g; - g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); - - g2.setColor(Color.white); - g2.fillRect(0,0,width,height); - - int w = (int)Math.round(width-scale*finger_size/2.0f); - int h = (int)Math.round(height-scale*finger_size/2.0f); - - Enumeration cursors = cursorList.elements(); - while (cursors.hasMoreElements()) { - TuioCursor tcur = cursors.nextElement(); - if (tcur==null) continue; - Vector path = tcur.getPath(); - TuioPoint current_point = path.elementAt(0); - if (current_point!=null) { - // draw the cursor path - g2.setPaint(Color.blue); - for (int i=0;i objects = objectList.elements(); - while (objects.hasMoreElements()) { - TuioDemoObject tobj = objects.nextElement(); - if (tobj!=null) tobj.paint(g2, width,height); - } - } -} +/* + TUIO Java Demo - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ + +import java.awt.*; +import java.awt.geom.*; +import java.awt.event.*; +import java.awt.image.*; +import java.util.*; +import javax.swing.*; +import TUIO.*; + +public class TuioDemoComponent extends JComponent implements TuioListener { + + private Hashtable objectList = new Hashtable(); + private Hashtable cursorList = new Hashtable(); + private Hashtable stringList = new Hashtable(); + + public static final int finger_size = 15; + public static final int object_size = 60; + public static final int table_size = 760; + + public static int width, height; + private float scale = 1.0f; + public boolean verbose = false; + + public void setSize(int w, int h) { + super.setSize(w,h); + width = w; + height = h; + scale = height/(float)TuioDemoComponent.table_size; + } + + public void addTuioObject(TuioObject tobj) { + TuioDemoObject demo = new TuioDemoObject(tobj); + objectList.put(tobj.getSessionID(),demo); + + if (verbose) + System.out.println("add obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()); + } + + public void updateTuioObject(TuioObject tobj) { + + TuioDemoObject demo = (TuioDemoObject)objectList.get(tobj.getSessionID()); + demo.update(tobj); + + if (verbose) + System.out.println("set obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()+" "+tobj.getMotionSpeed()+" "+tobj.getRotationSpeed()+" "+tobj.getMotionAccel()+" "+tobj.getRotationAccel()); + } + + public void removeTuioObject(TuioObject tobj) { + objectList.remove(tobj.getSessionID()); + + if (verbose) + System.out.println("del obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+")"); + } + + public void addTuioCursor(TuioCursor tcur) { + + if (!cursorList.containsKey(tcur.getSessionID())) { + cursorList.put(tcur.getSessionID(), tcur); + repaint(); + } + + if (verbose) + System.out.println("add cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()); + } + + public void updateTuioCursor(TuioCursor tcur) { + + repaint(); + + if (verbose) + System.out.println("set cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()+" "+tcur.getMotionSpeed()+" "+tcur.getMotionAccel()); + } + + public void removeTuioCursor(TuioCursor tcur) { + + cursorList.remove(tcur.getSessionID()); + repaint(); + + if (verbose) + System.out.println("del cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+")"); + } + + public void addTuioString(TuioString tstr) { + + if (!stringList.containsKey(tstr.getSessionID())) { + stringList.put(tstr.getSessionID(), tstr); + repaint(); + } + + if (verbose) + System.out.println("add str "+tstr.getStringID()+" ("+tstr.getSessionID()+") "+tstr.getMessage()); + } + + public void updateTuioString(TuioString tstr) { + + repaint(); + + if (verbose) + System.out.println("set str "+tstr.getStringID()+" ("+tstr.getSessionID()+") "+tstr.getMessage()); + } + + public void removeTuioString(TuioString tstr) { + + stringList.remove(tstr.getSessionID()); + repaint(); + + if (verbose) + System.out.println("del str "+tstr.getStringID()+" ("+tstr.getSessionID()+")"); + } + + public void refresh(TuioTime frameTime) { + repaint(); + } + + public void paint(Graphics g) { + update(g); + } + + public void update(Graphics g) { + + Graphics2D g2 = (Graphics2D)g; + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); + + g2.setColor(Color.white); + g2.fillRect(0,0,width,height); + + int w = (int)Math.round(width-scale*finger_size/2.0f); + int h = (int)Math.round(height-scale*finger_size/2.0f); + + Enumeration cursors = cursorList.elements(); + while (cursors.hasMoreElements()) { + TuioCursor tcur = cursors.nextElement(); + if (tcur==null) continue; + Vector path = tcur.getPath(); + TuioPoint current_point = path.elementAt(0); + if (current_point!=null) { + // draw the cursor path + g2.setPaint(Color.blue); + for (int i=0;i objects = objectList.elements(); + while (objects.hasMoreElements()) { + TuioDemoObject tobj = objects.nextElement(); + if (tobj!=null) tobj.paint(g2, width,height); + } + } +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TuioDemoObject.java --- a/front_processing/extern/TUIO_JAVA/src/TuioDemoObject.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TuioDemoObject.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,81 +1,81 @@ -/* - TUIO Java Demo - part of the reacTIVision project - http://reactivision.sourceforge.net/ - - Copyright (c) 2005-2009 Martin Kaltenbrunner - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -import javax.swing.*; -import java.awt.geom.*; -import java.awt.*; -import java.awt.event.*; -import java.util.*; -import TUIO.*; - -public class TuioDemoObject extends TuioObject { - - private Shape square; - - public TuioDemoObject(TuioObject tobj) { - super(tobj); - int size = TuioDemoComponent.object_size; - square = new Rectangle2D.Float(-size/2,-size/2,size,size); - - AffineTransform transform = new AffineTransform(); - transform.translate(xpos,ypos); - transform.rotate(angle,xpos,ypos); - square = transform.createTransformedShape(square); - } - - public void paint(Graphics2D g, int width, int height) { - - float Xpos = xpos*width; - float Ypos = ypos*height; - float scale = height/(float)TuioDemoComponent.table_size; - - AffineTransform trans = new AffineTransform(); - trans.translate(-xpos,-ypos); - trans.translate(Xpos,Ypos); - trans.scale(scale,scale); - Shape s = trans.createTransformedShape(square); - - g.setPaint(Color.black); - g.fill(s); - g.setPaint(Color.white); - g.drawString(symbol_id+"",Xpos-10,Ypos); - } - - public void update(TuioObject tobj) { - - float dx = tobj.getX() - xpos; - float dy = tobj.getY() - ypos; - float da = tobj.getAngle() - angle; - - if ((dx!=0) || (dy!=0)) { - AffineTransform trans = AffineTransform.getTranslateInstance(dx,dy); - square = trans.createTransformedShape(square); - } - - if (da!=0) { - AffineTransform trans = AffineTransform.getRotateInstance(da,tobj.getX(),tobj.getY()); - square = trans.createTransformedShape(square); - } - - super.update(tobj); - } - -} +/* + TUIO Java Demo - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +import javax.swing.*; +import java.awt.geom.*; +import java.awt.*; +import java.awt.event.*; +import java.util.*; +import TUIO.*; + +public class TuioDemoObject extends TuioObject { + + private Shape square; + + public TuioDemoObject(TuioObject tobj) { + super(tobj); + int size = TuioDemoComponent.object_size; + square = new Rectangle2D.Float(-size/2,-size/2,size,size); + + AffineTransform transform = new AffineTransform(); + transform.translate(xpos,ypos); + transform.rotate(angle,xpos,ypos); + square = transform.createTransformedShape(square); + } + + public void paint(Graphics2D g, int width, int height) { + + float Xpos = xpos*width; + float Ypos = ypos*height; + float scale = height/(float)TuioDemoComponent.table_size; + + AffineTransform trans = new AffineTransform(); + trans.translate(-xpos,-ypos); + trans.translate(Xpos,Ypos); + trans.scale(scale,scale); + Shape s = trans.createTransformedShape(square); + + g.setPaint(Color.black); + g.fill(s); + g.setPaint(Color.white); + g.drawString(symbol_id+"",Xpos-10,Ypos); + } + + public void update(TuioObject tobj) { + + float dx = tobj.getX() - xpos; + float dy = tobj.getY() - ypos; + float da = tobj.getAngle() - angle; + + if ((dx!=0) || (dy!=0)) { + AffineTransform trans = AffineTransform.getTranslateInstance(dx,dy); + square = trans.createTransformedShape(square); + } + + if (da!=0) { + AffineTransform trans = AffineTransform.getRotateInstance(da,tobj.getX(),tobj.getY()); + square = trans.createTransformedShape(square); + } + + super.update(tobj); + } + +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/TuioDump.java --- a/front_processing/extern/TUIO_JAVA/src/TuioDump.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/TuioDump.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,86 +1,90 @@ -/* - TUIO Java Example - part of the reacTIVision project - http://reactivision.sourceforge.net/ - - Copyright (c) 2005-2009 Martin Kaltenbrunner - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program;if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -import javax.swing.*; -import java.awt.geom.*; -import java.awt.*; -import java.awt.event.*; -import TUIO.*; - -public class TuioDump implements TuioListener { - - public void addTuioObject(TuioObject tobj) { - System.out.println("add obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()); - } - - public void updateTuioObject(TuioObject tobj) { - System.out.println("set obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()+" "+tobj.getMotionSpeed()+" "+tobj.getRotationSpeed()+" "+tobj.getMotionAccel()+" "+tobj.getRotationAccel()); - } - - public void removeTuioObject(TuioObject tobj) { - System.out.println("del obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+")"); - } - - public void addTuioCursor(TuioCursor tcur) { - System.out.println("add cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()); - } - - public void updateTuioCursor(TuioCursor tcur) { - System.out.println("set cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()+" "+tcur.getMotionSpeed()+" "+tcur.getMotionAccel()); - } - - public void removeTuioCursor(TuioCursor tcur) { - System.out.println("del cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+")"); - } - - public void addTuioString(TuioString tstr) { - System.out.println("add str "+tstr.getStringID()+" ("+tstr.getSessionID()+") "+tstr.getMessage()); - } - - public void updateTuioString(TuioString tstr) { - System.out.println("set str "+tstr.getStringID()+" ("+tstr.getSessionID()+") "+tstr.getMessage()); - } - - public void removeTuioString(TuioString tstr) { - System.out.println("del str "+tstr.getStringID()+" ("+tstr.getSessionID()+")"); - } - - public void refresh(TuioTime frameTime) { - //System.out.println("refresh "+frameTime.getTotalMilliseconds()); - } - - public static void main(String argv[]) { - - int port = 3333; - - if (argv.length==1) { - try { port = Integer.parseInt(argv[0]); } - catch (Exception e) { System.out.println("usage: java TuioDump [port]"); } - } - - TuioDump demo = new TuioDump(); - TuioClient client = new TuioClient(port); - - System.out.println("listening to TUIO messages at port "+port); - client.addTuioListener(demo); - client.connect(); - } -} +/* + TUIO Java Example - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program;if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ + +import javax.swing.*; +import java.awt.geom.*; +import java.awt.*; +import java.awt.event.*; +import TUIO.*; + +public class TuioDump implements TuioListener { + + public void addTuioObject(TuioObject tobj) { + System.out.println("add obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()); + } + + public void updateTuioObject(TuioObject tobj) { + System.out.println("set obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()+" "+tobj.getMotionSpeed()+" "+tobj.getRotationSpeed()+" "+tobj.getMotionAccel()+" "+tobj.getRotationAccel()); + } + + public void removeTuioObject(TuioObject tobj) { + System.out.println("del obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+")"); + } + + public void addTuioCursor(TuioCursor tcur) { + System.out.println("add cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()); + } + + public void updateTuioCursor(TuioCursor tcur) { + System.out.println("set cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()+" "+tcur.getMotionSpeed()+" "+tcur.getMotionAccel()); + } + + public void removeTuioCursor(TuioCursor tcur) { + System.out.println("del cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+")"); + } + + public void addTuioString(TuioString tstr) { + System.out.println("add str "+tstr.getStringID()+" ("+tstr.getSessionID()+") "+tstr.getMessage()); + } + + public void updateTuioString(TuioString tstr) { + System.out.println("set str "+tstr.getStringID()+" ("+tstr.getSessionID()+") "+tstr.getMessage()); + } + + public void removeTuioString(TuioString tstr) { + System.out.println("del str "+tstr.getStringID()+" ("+tstr.getSessionID()+")"); + } + + public void refresh(TuioTime frameTime) { + //System.out.println("refresh "+frameTime.getTotalMilliseconds()); + } + + public static void main(String argv[]) { + + int port = 3333; + + if (argv.length==1) { + try { port = Integer.parseInt(argv[0]); } + catch (Exception e) { System.out.println("usage: java TuioDump [port]"); } + } + + TuioDump demo = new TuioDump(); + TuioClient client = new TuioClient(port); + + System.out.println("listening to TUIO messages at port "+port); + client.addTuioListener(demo); + client.connect(); + } +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCBundle.java --- a/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCBundle.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCBundle.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,140 +1,140 @@ - -/** - * @author cramakrishnan - * - * Copyright (C) 2003, C. Ramakrishnan / Illposed Software - * All rights reserved. - * - * See license.txt (or license.rtf) for license information. - * - * - * OscBundle represents a collection of OscPackets. - * - * Use this when you want to send a bunch of OscPackets - * in one go. - * - * Internally, I use Vector to maintain jdk1.1 compatability - */ - -package com.illposed.osc; -import java.math.BigInteger; -import java.util.Date; -import java.util.Enumeration; -import java.util.GregorianCalendar; -import java.util.Vector; - -import com.illposed.osc.utility.*; - -public class OSCBundle extends OSCPacket { - - protected Date timestamp; - // protected OSCPacket[] packets; - protected Vector packets; - public static final BigInteger SECONDS_FROM_1900_to_1970 = - new BigInteger("2208988800"); - // 17 leap years - - /** - * Create a new OSCBundle, with a timestamp of now. - * You can add packets to the bundle with addPacket() - */ - public OSCBundle() { - this(null, GregorianCalendar.getInstance().getTime()); - } - - /** - * Create an OSCBundle with the specified timestamp - * @param timestamp - */ - public OSCBundle(Date timestamp) { - this(null, timestamp); - } - - /** - * @param newPackets Array of OSCPackets to initialize this object with - */ - public OSCBundle(OSCPacket[] newPackets) { - this(newPackets, GregorianCalendar.getInstance().getTime()); - } - - /** - * @param newPackets OscPacket[] - * @param time java.lang.Time - */ - public OSCBundle(OSCPacket[] newPackets, Date newTimestamp) { - super(); - if (null != newPackets) { - packets = new Vector(newPackets.length); - for (int i = 0; i < newPackets.length; i++) { - packets.add(newPackets[i]); - } - } else - packets = new Vector(); - timestamp = newTimestamp; - init(); - } - - /** - * Return the timestamp for this bundle - * @return a Date - */ - public Date getTimestamp() { - return timestamp; - } - - /** - * Set the timestamp for this bundle - * @param timestamp - */ - public void setTimestamp(Date timestamp) { - this.timestamp = timestamp; - } - - /** - * Add a packet to the list of packets in this bundle - * @param packet - */ - public void addPacket(OSCPacket packet) { - packets.add(packet); - } - - /** - * Get the packets contained in this bundle - * @return an array of packets - */ - public OSCPacket[] getPackets() { - OSCPacket[] packetArray = new OSCPacket[packets.size()]; - packets.toArray(packetArray); - return packetArray; - } - - protected void computeTimeTagByteArray(OSCJavaToByteArrayConverter stream) { - long millisecs = timestamp.getTime(); - long secsSince1970 = (long) (millisecs / 1000); - long secs = secsSince1970 + SECONDS_FROM_1900_to_1970.longValue(); - long picosecs = (long) (millisecs - (secsSince1970 * 1000)) * 1000; - - stream.write((int) secs); - stream.write((int) picosecs); - - } - - /** - * @param stream OscPacketByteArrayConverter - */ - protected void computeByteArray(OSCJavaToByteArrayConverter stream) { - stream.write("#bundle"); - computeTimeTagByteArray(stream); - Enumeration enm = packets.elements(); - OSCPacket nextElement; - byte[] packetBytes; - while (enm.hasMoreElements()) { - nextElement = (OSCPacket) enm.nextElement(); - packetBytes = nextElement.getByteArray(); - stream.write(packetBytes.length); - stream.write(packetBytes); - } - byteArray = stream.toByteArray(); - } - + +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * OscBundle represents a collection of OscPackets. + * + * Use this when you want to send a bunch of OscPackets + * in one go. + * + * Internally, I use Vector to maintain jdk1.1 compatability + */ + +package com.illposed.osc; +import java.math.BigInteger; +import java.util.Date; +import java.util.Enumeration; +import java.util.GregorianCalendar; +import java.util.Vector; + +import com.illposed.osc.utility.*; + +public class OSCBundle extends OSCPacket { + + protected Date timestamp; + // protected OSCPacket[] packets; + protected Vector packets; + public static final BigInteger SECONDS_FROM_1900_to_1970 = + new BigInteger("2208988800"); + // 17 leap years + + /** + * Create a new OSCBundle, with a timestamp of now. + * You can add packets to the bundle with addPacket() + */ + public OSCBundle() { + this(null, GregorianCalendar.getInstance().getTime()); + } + + /** + * Create an OSCBundle with the specified timestamp + * @param timestamp + */ + public OSCBundle(Date timestamp) { + this(null, timestamp); + } + + /** + * @param newPackets Array of OSCPackets to initialize this object with + */ + public OSCBundle(OSCPacket[] newPackets) { + this(newPackets, GregorianCalendar.getInstance().getTime()); + } + + /** + * @param newPackets OscPacket[] + * @param time java.lang.Time + */ + public OSCBundle(OSCPacket[] newPackets, Date newTimestamp) { + super(); + if (null != newPackets) { + packets = new Vector(newPackets.length); + for (int i = 0; i < newPackets.length; i++) { + packets.add(newPackets[i]); + } + } else + packets = new Vector(); + timestamp = newTimestamp; + init(); + } + + /** + * Return the timestamp for this bundle + * @return a Date + */ + public Date getTimestamp() { + return timestamp; + } + + /** + * Set the timestamp for this bundle + * @param timestamp + */ + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + /** + * Add a packet to the list of packets in this bundle + * @param packet + */ + public void addPacket(OSCPacket packet) { + packets.add(packet); + } + + /** + * Get the packets contained in this bundle + * @return an array of packets + */ + public OSCPacket[] getPackets() { + OSCPacket[] packetArray = new OSCPacket[packets.size()]; + packets.toArray(packetArray); + return packetArray; + } + + protected void computeTimeTagByteArray(OSCJavaToByteArrayConverter stream) { + long millisecs = timestamp.getTime(); + long secsSince1970 = (long) (millisecs / 1000); + long secs = secsSince1970 + SECONDS_FROM_1900_to_1970.longValue(); + long picosecs = (long) (millisecs - (secsSince1970 * 1000)) * 1000; + + stream.write((int) secs); + stream.write((int) picosecs); + + } + + /** + * @param stream OscPacketByteArrayConverter + */ + protected void computeByteArray(OSCJavaToByteArrayConverter stream) { + stream.write("#bundle"); + computeTimeTagByteArray(stream); + Enumeration enm = packets.elements(); + OSCPacket nextElement; + byte[] packetBytes; + while (enm.hasMoreElements()) { + nextElement = (OSCPacket) enm.nextElement(); + packetBytes = nextElement.getByteArray(); + stream.write(packetBytes.length); + stream.write(packetBytes); + } + byteArray = stream.toByteArray(); + } + } \ No newline at end of file diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCCanNotListenException.java --- a/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCCanNotListenException.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCCanNotListenException.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,49 +1,49 @@ -/* $Id: OSCCanNotListenException.java,v 1.1.1.1 2006/11/13 14:47:21 modin Exp $ - * Created on 21.02.2004 - */ -package com.illposed.osc; - -/** - * @author cramakrishnan - * - * Copyright (C) 2004, C. Ramakrishnan / Auracle - * All rights reserved. - * - * See license.txt (or license.rtf) for license information. - */ -public class OSCCanNotListenException extends Exception { - - /** - * - */ - public OSCCanNotListenException() { - super(); - // TODO Auto-generated constructor stub - } - - /** - * @param message - */ - public OSCCanNotListenException(String message) { - super(message); - // TODO Auto-generated constructor stub - } - - /** - * @param message - * @param cause - */ -/* public OSCCanNotListenException(String message, Throwable cause) { - super(message, cause); - // TODO Auto-generated constructor stub - } -*/ - /** - * @param cause - */ -/* public OSCCanNotListenException(Throwable cause) { - super(cause); - // TODO Auto-generated constructor stub - } -*/ -} +/* $Id: OSCCanNotListenException.java,v 1.1.1.1 2006/11/13 14:47:21 modin Exp $ + * Created on 21.02.2004 + */ +package com.illposed.osc; + +/** + * @author cramakrishnan + * + * Copyright (C) 2004, C. Ramakrishnan / Auracle + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + */ +public class OSCCanNotListenException extends Exception { + + /** + * + */ + public OSCCanNotListenException() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @param message + */ + public OSCCanNotListenException(String message) { + super(message); + // TODO Auto-generated constructor stub + } + + /** + * @param message + * @param cause + */ +/* public OSCCanNotListenException(String message, Throwable cause) { + super(message, cause); + // TODO Auto-generated constructor stub + } +*/ + /** + * @param cause + */ +/* public OSCCanNotListenException(Throwable cause) { + super(cause); + // TODO Auto-generated constructor stub + } +*/ +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCListener.java --- a/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCListener.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCListener.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,27 +1,27 @@ -/* $Id: OSCListener.java,v 1.1.1.1 2006/11/13 14:47:21 modin Exp $ - * Created on 28.10.2003 - */ -package com.illposed.osc; - -import java.util.Date; - -/** - * @author cramakrishnan - * - * Copyright (C) 2003, C. Ramakrishnan / Auracle - * All rights reserved. - * - * See license.txt (or license.rtf) for license information. - * - * Interface for things that listen for incoming OSC Messages - */ -public interface OSCListener { - - /** - * Accept an incoming OSCMessage - * @param time the time this message is to be executed. null means execute now - * @param message the message - */ - public void acceptMessage(Date time, OSCMessage message); - -} +/* $Id: OSCListener.java,v 1.1.1.1 2006/11/13 14:47:21 modin Exp $ + * Created on 28.10.2003 + */ +package com.illposed.osc; + +import java.util.Date; + +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Auracle + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * Interface for things that listen for incoming OSC Messages + */ +public interface OSCListener { + + /** + * Accept an incoming OSCMessage + * @param time the time this message is to be executed. null means execute now + * @param message the message + */ + public void acceptMessage(Date time, OSCMessage message); + +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCMessage.java --- a/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCMessage.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCMessage.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,118 +1,118 @@ -/** - * @author cramakrishnan - * - * Copyright (C) 2003, C. Ramakrishnan / Illposed Software - * All rights reserved. - * - * See license.txt (or license.rtf) for license information. - * - * - * An simple (non-bundle) OSC message. An OSC message is made up of - * an address (who is this message sent to) - * and arguments (what is the contents of this message). - */ - -package com.illposed.osc; - -import java.util.Enumeration; -import java.util.Vector; - -import com.illposed.osc.utility.*; - -public class OSCMessage extends OSCPacket { - - protected String address; - protected Vector arguments; - - /** - * Create an empty OSC Message - * In order to send this osc message, you need to set the address - * and, perhaps, some arguments. - */ - public OSCMessage() { - super(); - arguments = new Vector(); - } - - /** - * Create an OSCMessage with an address already initialized - * @param newAddress The recepient of this OSC message - */ - public OSCMessage(String newAddress) { - this(newAddress, null); - } - - /** - * Create an OSCMessage with an address and arguments already initialized - * @param newAddress The recepient of this OSC message - * @param newArguments The data sent to the receiver - */ - public OSCMessage(String newAddress, Object[] newArguments) { - super(); - address = newAddress; - if (null != newArguments) { - arguments = new Vector(newArguments.length); - for (int i = 0; i < newArguments.length; i++) { - arguments.add(newArguments[i]); - } - } else - arguments = new Vector(); - init(); - } - - /** - * @return the address of this OSC Message - */ - public String getAddress() { - return address; - } - - /** - * Set the address of this messsage - * @param anAddress - */ - public void setAddress(String anAddress) { - address = anAddress; - } - - public void addArgument(Object argument) { - arguments.add(argument); - } - - public Object[] getArguments() { - return arguments.toArray(); - } - - /** - * @param stream OscPacketByteArrayConverter - */ - protected void computeAddressByteArray(OSCJavaToByteArrayConverter stream) { - stream.write(address); - } - - /** - * @param stream OscPacketByteArrayConverter - */ - protected void computeArgumentsByteArray(OSCJavaToByteArrayConverter stream) { - // SC starting at version 2.2.10 wants a comma at the beginning - // of the arguments array. - stream.write(','); - if (null == arguments) - return; - stream.writeTypes(arguments); - Enumeration enm = arguments.elements(); - while (enm.hasMoreElements()) { - stream.write(enm.nextElement()); - } - } - - /** - * @param stream OscPacketByteArrayConverter - */ - protected void computeByteArray(OSCJavaToByteArrayConverter stream) { - computeAddressByteArray(stream); - computeArgumentsByteArray(stream); - byteArray = stream.toByteArray(); - } - +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * An simple (non-bundle) OSC message. An OSC message is made up of + * an address (who is this message sent to) + * and arguments (what is the contents of this message). + */ + +package com.illposed.osc; + +import java.util.Enumeration; +import java.util.Vector; + +import com.illposed.osc.utility.*; + +public class OSCMessage extends OSCPacket { + + protected String address; + protected Vector arguments; + + /** + * Create an empty OSC Message + * In order to send this osc message, you need to set the address + * and, perhaps, some arguments. + */ + public OSCMessage() { + super(); + arguments = new Vector(); + } + + /** + * Create an OSCMessage with an address already initialized + * @param newAddress The recepient of this OSC message + */ + public OSCMessage(String newAddress) { + this(newAddress, null); + } + + /** + * Create an OSCMessage with an address and arguments already initialized + * @param newAddress The recepient of this OSC message + * @param newArguments The data sent to the receiver + */ + public OSCMessage(String newAddress, Object[] newArguments) { + super(); + address = newAddress; + if (null != newArguments) { + arguments = new Vector(newArguments.length); + for (int i = 0; i < newArguments.length; i++) { + arguments.add(newArguments[i]); + } + } else + arguments = new Vector(); + init(); + } + + /** + * @return the address of this OSC Message + */ + public String getAddress() { + return address; + } + + /** + * Set the address of this messsage + * @param anAddress + */ + public void setAddress(String anAddress) { + address = anAddress; + } + + public void addArgument(Object argument) { + arguments.add(argument); + } + + public Object[] getArguments() { + return arguments.toArray(); + } + + /** + * @param stream OscPacketByteArrayConverter + */ + protected void computeAddressByteArray(OSCJavaToByteArrayConverter stream) { + stream.write(address); + } + + /** + * @param stream OscPacketByteArrayConverter + */ + protected void computeArgumentsByteArray(OSCJavaToByteArrayConverter stream) { + // SC starting at version 2.2.10 wants a comma at the beginning + // of the arguments array. + stream.write(','); + if (null == arguments) + return; + stream.writeTypes(arguments); + Enumeration enm = arguments.elements(); + while (enm.hasMoreElements()) { + stream.write(enm.nextElement()); + } + } + + /** + * @param stream OscPacketByteArrayConverter + */ + protected void computeByteArray(OSCJavaToByteArrayConverter stream) { + computeAddressByteArray(stream); + computeArgumentsByteArray(stream); + byteArray = stream.toByteArray(); + } + } \ No newline at end of file diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPacket.java --- a/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPacket.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPacket.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,60 +1,60 @@ -/** - * @author cramakrishnan - * - * Copyright (C) 2003, C. Ramakrishnan / Illposed Software - * All rights reserved. - * - * See license.txt (or license.rtf) for license information. - * - * - * OscPacket is the abstract superclass for the various - * kinds of OSC Messages. Its direct subclasses are: - * OscMessage, OscBundle - * - * Subclasses need to know how to produce a byte array - * in the format specified by the OSC spec (or SuperCollider - * documentation, as the case may be). - * - * This implementation is based on Markus Gaelli and - * Iannis Zannos' OSC implementation in Squeak: - * http://www.emergent.de/Goodies/ - */ - -package com.illposed.osc; - -import com.illposed.osc.utility.*; - -public abstract class OSCPacket { - - protected byte[] byteArray; - - public OSCPacket() { - super(); - } - - protected void computeByteArray() { - OSCJavaToByteArrayConverter stream = new OSCJavaToByteArrayConverter(); - computeByteArray(stream); - } - - /** - * @param stream OscPacketByteArrayConverter - * - * Subclasses should implement this method to product a byte array - * formatted according to the OSC/SuperCollider specification. - */ - protected abstract void computeByteArray(OSCJavaToByteArrayConverter stream); - - /** - * @return byte[] - */ - public byte[] getByteArray() { - computeByteArray(); - return byteArray; - } - - protected void init() { - - } - +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * OscPacket is the abstract superclass for the various + * kinds of OSC Messages. Its direct subclasses are: + * OscMessage, OscBundle + * + * Subclasses need to know how to produce a byte array + * in the format specified by the OSC spec (or SuperCollider + * documentation, as the case may be). + * + * This implementation is based on Markus Gaelli and + * Iannis Zannos' OSC implementation in Squeak: + * http://www.emergent.de/Goodies/ + */ + +package com.illposed.osc; + +import com.illposed.osc.utility.*; + +public abstract class OSCPacket { + + protected byte[] byteArray; + + public OSCPacket() { + super(); + } + + protected void computeByteArray() { + OSCJavaToByteArrayConverter stream = new OSCJavaToByteArrayConverter(); + computeByteArray(stream); + } + + /** + * @param stream OscPacketByteArrayConverter + * + * Subclasses should implement this method to product a byte array + * formatted according to the OSC/SuperCollider specification. + */ + protected abstract void computeByteArray(OSCJavaToByteArrayConverter stream); + + /** + * @return byte[] + */ + public byte[] getByteArray() { + computeByteArray(); + return byteArray; + } + + protected void init() { + + } + } \ No newline at end of file diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPort.java --- a/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPort.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPort.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,51 +1,51 @@ -/** - * @author cramakrishnan - * - * Copyright (C) 2004, C. Ramakrishnan / Illposed Software - * All rights reserved. - * - * See license.txt (or license.rtf) for license information. - * - * - * OSCPort is an abstract superclass. To send OSC messages, use OSCPortOut. - * To listen for OSC messages, use OSCPortIn. - * - */ - -package com.illposed.osc; - -import java.net.*; -import java.io.IOException; - -public abstract class OSCPort { - - protected DatagramSocket socket; - protected int port; - - /** - * The port that the SuperCollider synth engine ususally listens too - */ - public static final int defaultSCOSCPort = 57110; - - /** - * The port that the SuperCollider language engine ususally listens too - */ - public static final int defaultSCLangOSCPort = 57120; - - /** - * @see java.lang.Object#finalize() - */ - protected void finalize() throws Throwable { - super.finalize(); - socket.close(); - } - - /** - * Close the socket and free-up resources. It's recommended that clients call - * this when they are done with the port. - */ - public void close() { - socket.close(); - } - -} +/** + * @author cramakrishnan + * + * Copyright (C) 2004, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * OSCPort is an abstract superclass. To send OSC messages, use OSCPortOut. + * To listen for OSC messages, use OSCPortIn. + * + */ + +package com.illposed.osc; + +import java.net.*; +import java.io.IOException; + +public abstract class OSCPort { + + protected DatagramSocket socket; + protected int port; + + /** + * The port that the SuperCollider synth engine ususally listens too + */ + public static final int defaultSCOSCPort = 57110; + + /** + * The port that the SuperCollider language engine ususally listens too + */ + public static final int defaultSCLangOSCPort = 57120; + + /** + * @see java.lang.Object#finalize() + */ + protected void finalize() throws Throwable { + super.finalize(); + socket.close(); + } + + /** + * Close the socket and free-up resources. It's recommended that clients call + * this when they are done with the port. + */ + public void close() { + socket.close(); + } + +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortIn.java --- a/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortIn.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortIn.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,114 +1,114 @@ -/** - * @author cramakrishnan - * - * Copyright (C) 2004, C. Ramakrishnan / Illposed Software - * All rights reserved. - * - * See license.txt (or license.rtf) for license information. - * - * - * OSCPortIn is the class that listens for OSC messages. - * - * To receive OSC, you need to construct the OSCPort with a - * - * An example based on com.illposed.osc.test.OSCPortTest::testReceiving() : - - receiver = new OSCPort(OSCPort.defaultSCOSCPort()); - OSCListener listener = new OSCListener() { - public void acceptMessage(java.util.Date time, OSCMessage message) { - System.out.println("Message received!"); - } - }; - receiver.addListener("/message/receiving", listener); - receiver.startListening(); - - * Then, using a program such as SuperCollider or sendOSC, send a message - * to this computer, port 57110 (defaultSCOSCPort), with the address /message/receiving - */ - -package com.illposed.osc; - -import java.net.*; -import java.io.IOException; -import com.illposed.osc.utility.OSCByteArrayToJavaConverter; -import com.illposed.osc.utility.OSCPacketDispatcher; - -public class OSCPortIn extends OSCPort implements Runnable { - - // state for listening - protected boolean isListening; - protected OSCByteArrayToJavaConverter converter = new OSCByteArrayToJavaConverter(); - protected OSCPacketDispatcher dispatcher = new OSCPacketDispatcher(); - - /** - * Create an OSCPort that listens on port - * @param port - * @throws SocketException - */ - public OSCPortIn(int port) throws SocketException { - socket = new DatagramSocket(port); - this.port = port; - } - - /** - * @see java.lang.Runnable#run() - */ - public void run() { - //maximum UDP packet size - byte[] buffer = new byte[65536]; - DatagramPacket packet = new DatagramPacket(buffer, 65536); - while (isListening) { - try { - packet.setLength(65536); - socket.receive(packet); - OSCPacket oscPacket = converter.convert(buffer, packet.getLength()); - dispatcher.dispatchPacket(oscPacket); - } catch (java.net.SocketException e) { - if (isListening) e.printStackTrace(); - } catch (IOException e) { - if (isListening) e.printStackTrace(); - } - } - } - - /** - * Start listening for incoming OSCPackets - */ - public void startListening() { - isListening = true; - Thread thread = new Thread(this); - thread.start(); - } - - /** - * Stop listening for incoming OSCPackets - */ - public void stopListening() { - isListening = false; - } - - /** - * Am I listening for packets? - */ - public boolean isListening() { - return isListening; - } - - /** - * Register the listener for incoming OSCPackets addressed to an Address - * @param anAddress the address to listen for - * @param listener the object to invoke when a message comes in - */ - public void addListener(String anAddress, OSCListener listener) { - dispatcher.addListener(anAddress, listener); - } - - /** - * Close the socket and free-up resources. It's recommended that clients call - * this when they are done with the port. - */ - public void close() { - socket.close(); - } - -} +/** + * @author cramakrishnan + * + * Copyright (C) 2004, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * OSCPortIn is the class that listens for OSC messages. + * + * To receive OSC, you need to construct the OSCPort with a + * + * An example based on com.illposed.osc.test.OSCPortTest::testReceiving() : + + receiver = new OSCPort(OSCPort.defaultSCOSCPort()); + OSCListener listener = new OSCListener() { + public void acceptMessage(java.util.Date time, OSCMessage message) { + System.out.println("Message received!"); + } + }; + receiver.addListener("/message/receiving", listener); + receiver.startListening(); + + * Then, using a program such as SuperCollider or sendOSC, send a message + * to this computer, port 57110 (defaultSCOSCPort), with the address /message/receiving + */ + +package com.illposed.osc; + +import java.net.*; +import java.io.IOException; +import com.illposed.osc.utility.OSCByteArrayToJavaConverter; +import com.illposed.osc.utility.OSCPacketDispatcher; + +public class OSCPortIn extends OSCPort implements Runnable { + + // state for listening + protected boolean isListening; + protected OSCByteArrayToJavaConverter converter = new OSCByteArrayToJavaConverter(); + protected OSCPacketDispatcher dispatcher = new OSCPacketDispatcher(); + + /** + * Create an OSCPort that listens on port + * @param port + * @throws SocketException + */ + public OSCPortIn(int port) throws SocketException { + socket = new DatagramSocket(port); + this.port = port; + } + + /** + * @see java.lang.Runnable#run() + */ + public void run() { + //maximum UDP packet size + byte[] buffer = new byte[65536]; + DatagramPacket packet = new DatagramPacket(buffer, 65536); + while (isListening) { + try { + packet.setLength(65536); + socket.receive(packet); + OSCPacket oscPacket = converter.convert(buffer, packet.getLength()); + dispatcher.dispatchPacket(oscPacket); + } catch (java.net.SocketException e) { + if (isListening) e.printStackTrace(); + } catch (IOException e) { + if (isListening) e.printStackTrace(); + } + } + } + + /** + * Start listening for incoming OSCPackets + */ + public void startListening() { + isListening = true; + Thread thread = new Thread(this); + thread.start(); + } + + /** + * Stop listening for incoming OSCPackets + */ + public void stopListening() { + isListening = false; + } + + /** + * Am I listening for packets? + */ + public boolean isListening() { + return isListening; + } + + /** + * Register the listener for incoming OSCPackets addressed to an Address + * @param anAddress the address to listen for + * @param listener the object to invoke when a message comes in + */ + public void addListener(String anAddress, OSCListener listener) { + dispatcher.addListener(anAddress, listener); + } + + /** + * Close the socket and free-up resources. It's recommended that clients call + * this when they are done with the port. + */ + public void close() { + socket.close(); + } + +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortOut.java --- a/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortOut.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortOut.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,79 +1,79 @@ -/** - * @author cramakrishnan - * - * Copyright (C) 2004, C. Ramakrishnan / Illposed Software - * All rights reserved. - * - * See license.txt (or license.rtf) for license information. - * - * - * OSCPortOut is the class that sends OSC messages. - * - * To send OSC, in your code you should instantiate and hold onto an OSCPort - * pointing at the address and port number for the receiver. - * - * When you want to send an OSC message, call send(). - * - * An example based on com.illposed.osc.test.OSCPortTest::testMessageWithArgs() : - OSCPort sender = new OSCPort(); - Object args[] = new Object[2]; - args[0] = new Integer(3); - args[1] = "hello"; - OSCMessage msg = new OSCMessage("/sayhello", args); - try { - sender.send(msg); - } catch (Exception e) { - showError("Couldn't send"); - } - */ - -package com.illposed.osc; - -import java.net.*; -import java.io.IOException; -import com.illposed.osc.utility.OSCByteArrayToJavaConverter; - -public class OSCPortOut extends OSCPort { - - protected InetAddress address; - - /** - * Create an OSCPort that sends to newAddress, newPort - * @param newAddress InetAddress - * @param newPort int - */ - public OSCPortOut(InetAddress newAddress, int newPort) throws SocketException { - socket = new DatagramSocket(); - address = newAddress; - port = newPort; - } - - /** - * Create an OSCPort that sends to newAddress, on the standard SuperCollider port - * @param newAddress InetAddress - * - * Default the port to the standard one for SuperCollider - */ - public OSCPortOut(InetAddress newAddress) throws SocketException { - this(newAddress, defaultSCOSCPort); - } - - /** - * Create an OSCPort that sends to localhost, on the standard SuperCollider port - * Default the address to localhost - * Default the port to the standard one for SuperCollider - */ - public OSCPortOut() throws UnknownHostException, SocketException { - this(InetAddress.getLocalHost(), defaultSCOSCPort); - } - - /** - * @param aPacket OSCPacket - */ - public void send(OSCPacket aPacket) throws IOException { - byte[] byteArray = aPacket.getByteArray(); - DatagramPacket packet = - new DatagramPacket(byteArray, byteArray.length,address,port); - socket.send(packet); - } -} +/** + * @author cramakrishnan + * + * Copyright (C) 2004, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * OSCPortOut is the class that sends OSC messages. + * + * To send OSC, in your code you should instantiate and hold onto an OSCPort + * pointing at the address and port number for the receiver. + * + * When you want to send an OSC message, call send(). + * + * An example based on com.illposed.osc.test.OSCPortTest::testMessageWithArgs() : + OSCPort sender = new OSCPort(); + Object args[] = new Object[2]; + args[0] = new Integer(3); + args[1] = "hello"; + OSCMessage msg = new OSCMessage("/sayhello", args); + try { + sender.send(msg); + } catch (Exception e) { + showError("Couldn't send"); + } + */ + +package com.illposed.osc; + +import java.net.*; +import java.io.IOException; +import com.illposed.osc.utility.OSCByteArrayToJavaConverter; + +public class OSCPortOut extends OSCPort { + + protected InetAddress address; + + /** + * Create an OSCPort that sends to newAddress, newPort + * @param newAddress InetAddress + * @param newPort int + */ + public OSCPortOut(InetAddress newAddress, int newPort) throws SocketException { + socket = new DatagramSocket(); + address = newAddress; + port = newPort; + } + + /** + * Create an OSCPort that sends to newAddress, on the standard SuperCollider port + * @param newAddress InetAddress + * + * Default the port to the standard one for SuperCollider + */ + public OSCPortOut(InetAddress newAddress) throws SocketException { + this(newAddress, defaultSCOSCPort); + } + + /** + * Create an OSCPort that sends to localhost, on the standard SuperCollider port + * Default the address to localhost + * Default the port to the standard one for SuperCollider + */ + public OSCPortOut() throws UnknownHostException, SocketException { + this(InetAddress.getLocalHost(), defaultSCOSCPort); + } + + /** + * @param aPacket OSCPacket + */ + public void send(OSCPacket aPacket) throws IOException { + byte[] byteArray = aPacket.getByteArray(); + DatagramPacket packet = + new DatagramPacket(byteArray, byteArray.length,address,port); + socket.send(packet); + } +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCByteArrayToJavaConverter.java --- a/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCByteArrayToJavaConverter.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCByteArrayToJavaConverter.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,280 +1,280 @@ -/* $Id: OSCByteArrayToJavaConverter.java,v 1.1.1.1 2006/11/13 14:47:22 modin Exp $ - * Created on 28.10.2003 - */ -package com.illposed.osc.utility; - -import java.math.BigInteger; -import java.util.Date; - -import com.illposed.osc.*; - -/** - * @author cramakrishnan - * - * Copyright (C) 2003, C. Ramakrishnan / Auracle - * All rights reserved. - * - * See license.txt (or license.rtf) for license information. - */ -public class OSCByteArrayToJavaConverter { - - byte[] bytes; - int bytesLength; - int streamPosition; - - private byte[] intBytes = new byte[4]; - private byte[] floatBytes = new byte[4]; - - private byte[] secondBytes = new byte[8]; - private byte[] picosecBytes = new byte[8]; - - /** - * Helper object for converting from a byte array to Java objects - */ - /*public OSCByteArrayToJavaConverter() { - super(); - }*/ - - public OSCPacket convert(byte[] byteArray, int bytesLength) { - bytes = byteArray; - this.bytesLength = bytesLength; - streamPosition = 0; - if (isBundle()) - return convertBundle(); - else - return convertMessage(); - } - - private boolean isBundle() { - // only need the first 7 to check if it is a bundle - String bytesAsString = new String(bytes, 0, 7); - return bytesAsString.startsWith("#bundle"); - } - - private OSCBundle convertBundle() { - // skip the "#bundle " stuff - streamPosition = 8; - Date timestamp = readTimeTag(); - OSCBundle bundle = new OSCBundle(timestamp); - OSCByteArrayToJavaConverter myConverter = new OSCByteArrayToJavaConverter(); - while (streamPosition < bytesLength) { - // recursively read through the stream and convert packets you find - int packetLength = ((Integer) readInteger()).intValue(); - byte[] packetBytes = new byte[packetLength]; - //streamPosition++; - System.arraycopy(bytes,streamPosition,packetBytes,0,packetLength); - streamPosition+=packetLength; - //for (int i = 0; i < packetLength; i++) - // packetBytes[i] = bytes[streamPosition++]; - OSCPacket packet = myConverter.convert(packetBytes, packetLength); - bundle.addPacket(packet); - } - return bundle; - } - - private OSCMessage convertMessage() { - OSCMessage message = new OSCMessage(); - message.setAddress(readString()); - char[] types = readTypes(); - if (null == types) { - // we are done - return message; - } - moveToFourByteBoundry(); - for (int i = 0; i < types.length; i++) { - if ('[' == types[i]) { - // we're looking at an array -- read it in - message.addArgument(readArray(types, i)); - // then increment i to the end of the array - while (']' != types[i]) - i++; - } else - message.addArgument(readArgument(types[i])); - } - return message; - } - - private String readString() { - int strLen = lengthOfCurrentString(); - char[] stringChars = new char[strLen]; - //System.arraycopy(bytes,streamPosition,stringChars,0,strLen); - //streamPosition+=strLen; - for (int i = 0; i < strLen; i++) - stringChars[i] = (char) bytes[streamPosition++]; - moveToFourByteBoundry(); - return new String(stringChars); - } - - /** - * @return a char array with the types of the arguments - */ - private char[] readTypes() { - // the next byte should be a "," - if (bytes[streamPosition] != 0x2C) - return null; - streamPosition++; - // find out how long the list of types is - int typesLen = lengthOfCurrentString(); - if (0 == typesLen) { - return null; - } - // read in the types - char[] typesChars = new char[typesLen]; - for (int i = 0; i < typesLen; i++) { - typesChars[i] = (char) bytes[streamPosition++]; - } - return typesChars; - } - - /** - * @param c type of argument - * @return a Java representation of the argument - */ - private Object readArgument(char c) { - switch (c) { - case 'i' : - return readInteger(); - case 'h' : - return readBigInteger(); - case 'f' : - return readFloat(); - case 'd' : - return readDouble(); - case 's' : - return readString(); - case 'c' : - return readChar(); - case 'T' : - return Boolean.TRUE; - case 'F' : - return Boolean.FALSE; - } - - return null; - } - - /** - * @return a Character - */ - private Object readChar() { - return new Character((char) bytes[streamPosition++]); - } - - /** - * @return a Double - */ - private Object readDouble() { - return readFloat(); - } - - /** - * @return a Float - */ - private Object readFloat() { - //byte[] floatBytes = new byte[4]; - floatBytes[0] = bytes[streamPosition++]; - floatBytes[1] = bytes[streamPosition++]; - floatBytes[2] = bytes[streamPosition++]; - floatBytes[3] = bytes[streamPosition++]; - - int floatBits = - ((floatBytes[3] & 0xFF) ) + - ((floatBytes[2] & 0xFF) << 8) + - ((floatBytes[1] & 0xFF) << 16) + - ((floatBytes[0] & 0xFF) << 24); - - return new Float(Float.intBitsToFloat(floatBits)); - } - - /** - * @return a BigInteger - */ - private Object readBigInteger() { - //byte[] intBytes = new byte[4]; - intBytes[0] = bytes[streamPosition++]; - intBytes[1] = bytes[streamPosition++]; - intBytes[2] = bytes[streamPosition++]; - intBytes[3] = bytes[streamPosition++]; - - int intBits = - ((intBytes[3] & 0xFF) ) + - ((intBytes[2] & 0xFF) << 8) + - ((intBytes[1] & 0xFF) << 16) + - ((intBytes[0] & 0xFF) << 24); - - return new Integer(intBits); - } - - /** - * @return an Integer - */ - private Object readInteger() { - //byte[] intBytes = new byte[4]; - intBytes[0] = bytes[streamPosition++]; - intBytes[1] = bytes[streamPosition++]; - intBytes[2] = bytes[streamPosition++]; - intBytes[3] = bytes[streamPosition++]; - - int intBits = - ((intBytes[3] & 0xFF) ) + - ((intBytes[2] & 0xFF) << 8) + - ((intBytes[1] & 0xFF) << 16) + - ((intBytes[0] & 0xFF) << 24); - - return new Integer(intBits); - } - - /** - * @return a Date - */ - private Date readTimeTag() { - //byte[] secondBytes = new byte[8]; - //byte[] picosecBytes = new byte[8]; - /*for (int i = 4; i < 8; i++) - secondBytes[i] = bytes[streamPosition++]; - for (int i = 4; i < 8; i++) - picosecBytes[i] = bytes[streamPosition++];*/ - System.arraycopy(bytes,streamPosition,secondBytes,4,4); - streamPosition+=4; - System.arraycopy(bytes,streamPosition,picosecBytes,4,4); - streamPosition+=4; - - BigInteger secsSince1900 = new BigInteger(secondBytes); - long secsSince1970 = secsSince1900.longValue() - OSCBundle.SECONDS_FROM_1900_to_1970.longValue(); - if (secsSince1970 < 0) secsSince1970 = 0; // no point maintaining times in the distant past - BigInteger picosecs = new BigInteger(picosecBytes); - long millisecs = (secsSince1970 * 1000) + (picosecs.longValue() / 1000); - return new Date(millisecs); - } - - /** - * @param types - * @param i - * @return an Array - */ - private Object[] readArray(char[] types, int i) { - int arrayLen = 0; - while (types[i + arrayLen] != ']') - arrayLen++; - Object[] array = new Object[arrayLen]; - for (int j = 0; i < arrayLen; j++) { - array[j] = readArgument(types[i + j]); - } - return array; - } - - private int lengthOfCurrentString() { - int i = 0; - while (bytes[streamPosition + i] != 0) - i++; - return i; - } - - private void moveToFourByteBoundry() { - // If i'm already at a 4 byte boundry, I need to move to the next one - int mod = streamPosition % 4; - streamPosition += (4 - mod); - } - -} - +/* $Id: OSCByteArrayToJavaConverter.java,v 1.1.1.1 2006/11/13 14:47:22 modin Exp $ + * Created on 28.10.2003 + */ +package com.illposed.osc.utility; + +import java.math.BigInteger; +import java.util.Date; + +import com.illposed.osc.*; + +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Auracle + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + */ +public class OSCByteArrayToJavaConverter { + + byte[] bytes; + int bytesLength; + int streamPosition; + + private byte[] intBytes = new byte[4]; + private byte[] floatBytes = new byte[4]; + + private byte[] secondBytes = new byte[8]; + private byte[] picosecBytes = new byte[8]; + + /** + * Helper object for converting from a byte array to Java objects + */ + /*public OSCByteArrayToJavaConverter() { + super(); + }*/ + + public OSCPacket convert(byte[] byteArray, int bytesLength) { + bytes = byteArray; + this.bytesLength = bytesLength; + streamPosition = 0; + if (isBundle()) + return convertBundle(); + else + return convertMessage(); + } + + private boolean isBundle() { + // only need the first 7 to check if it is a bundle + String bytesAsString = new String(bytes, 0, 7); + return bytesAsString.startsWith("#bundle"); + } + + private OSCBundle convertBundle() { + // skip the "#bundle " stuff + streamPosition = 8; + Date timestamp = readTimeTag(); + OSCBundle bundle = new OSCBundle(timestamp); + OSCByteArrayToJavaConverter myConverter = new OSCByteArrayToJavaConverter(); + while (streamPosition < bytesLength) { + // recursively read through the stream and convert packets you find + int packetLength = ((Integer) readInteger()).intValue(); + byte[] packetBytes = new byte[packetLength]; + //streamPosition++; + System.arraycopy(bytes,streamPosition,packetBytes,0,packetLength); + streamPosition+=packetLength; + //for (int i = 0; i < packetLength; i++) + // packetBytes[i] = bytes[streamPosition++]; + OSCPacket packet = myConverter.convert(packetBytes, packetLength); + bundle.addPacket(packet); + } + return bundle; + } + + private OSCMessage convertMessage() { + OSCMessage message = new OSCMessage(); + message.setAddress(readString()); + char[] types = readTypes(); + if (null == types) { + // we are done + return message; + } + moveToFourByteBoundry(); + for (int i = 0; i < types.length; i++) { + if ('[' == types[i]) { + // we're looking at an array -- read it in + message.addArgument(readArray(types, i)); + // then increment i to the end of the array + while (']' != types[i]) + i++; + } else + message.addArgument(readArgument(types[i])); + } + return message; + } + + private String readString() { + int strLen = lengthOfCurrentString(); + char[] stringChars = new char[strLen]; + //System.arraycopy(bytes,streamPosition,stringChars,0,strLen); + //streamPosition+=strLen; + for (int i = 0; i < strLen; i++) + stringChars[i] = (char) bytes[streamPosition++]; + moveToFourByteBoundry(); + return new String(stringChars); + } + + /** + * @return a char array with the types of the arguments + */ + private char[] readTypes() { + // the next byte should be a "," + if (bytes[streamPosition] != 0x2C) + return null; + streamPosition++; + // find out how long the list of types is + int typesLen = lengthOfCurrentString(); + if (0 == typesLen) { + return null; + } + // read in the types + char[] typesChars = new char[typesLen]; + for (int i = 0; i < typesLen; i++) { + typesChars[i] = (char) bytes[streamPosition++]; + } + return typesChars; + } + + /** + * @param c type of argument + * @return a Java representation of the argument + */ + private Object readArgument(char c) { + switch (c) { + case 'i' : + return readInteger(); + case 'h' : + return readBigInteger(); + case 'f' : + return readFloat(); + case 'd' : + return readDouble(); + case 's' : + return readString(); + case 'c' : + return readChar(); + case 'T' : + return Boolean.TRUE; + case 'F' : + return Boolean.FALSE; + } + + return null; + } + + /** + * @return a Character + */ + private Object readChar() { + return new Character((char) bytes[streamPosition++]); + } + + /** + * @return a Double + */ + private Object readDouble() { + return readFloat(); + } + + /** + * @return a Float + */ + private Object readFloat() { + //byte[] floatBytes = new byte[4]; + floatBytes[0] = bytes[streamPosition++]; + floatBytes[1] = bytes[streamPosition++]; + floatBytes[2] = bytes[streamPosition++]; + floatBytes[3] = bytes[streamPosition++]; + + int floatBits = + ((floatBytes[3] & 0xFF) ) + + ((floatBytes[2] & 0xFF) << 8) + + ((floatBytes[1] & 0xFF) << 16) + + ((floatBytes[0] & 0xFF) << 24); + + return new Float(Float.intBitsToFloat(floatBits)); + } + + /** + * @return a BigInteger + */ + private Object readBigInteger() { + //byte[] intBytes = new byte[4]; + intBytes[0] = bytes[streamPosition++]; + intBytes[1] = bytes[streamPosition++]; + intBytes[2] = bytes[streamPosition++]; + intBytes[3] = bytes[streamPosition++]; + + int intBits = + ((intBytes[3] & 0xFF) ) + + ((intBytes[2] & 0xFF) << 8) + + ((intBytes[1] & 0xFF) << 16) + + ((intBytes[0] & 0xFF) << 24); + + return new Integer(intBits); + } + + /** + * @return an Integer + */ + private Object readInteger() { + //byte[] intBytes = new byte[4]; + intBytes[0] = bytes[streamPosition++]; + intBytes[1] = bytes[streamPosition++]; + intBytes[2] = bytes[streamPosition++]; + intBytes[3] = bytes[streamPosition++]; + + int intBits = + ((intBytes[3] & 0xFF) ) + + ((intBytes[2] & 0xFF) << 8) + + ((intBytes[1] & 0xFF) << 16) + + ((intBytes[0] & 0xFF) << 24); + + return new Integer(intBits); + } + + /** + * @return a Date + */ + private Date readTimeTag() { + //byte[] secondBytes = new byte[8]; + //byte[] picosecBytes = new byte[8]; + /*for (int i = 4; i < 8; i++) + secondBytes[i] = bytes[streamPosition++]; + for (int i = 4; i < 8; i++) + picosecBytes[i] = bytes[streamPosition++];*/ + System.arraycopy(bytes,streamPosition,secondBytes,4,4); + streamPosition+=4; + System.arraycopy(bytes,streamPosition,picosecBytes,4,4); + streamPosition+=4; + + BigInteger secsSince1900 = new BigInteger(secondBytes); + long secsSince1970 = secsSince1900.longValue() - OSCBundle.SECONDS_FROM_1900_to_1970.longValue(); + if (secsSince1970 < 0) secsSince1970 = 0; // no point maintaining times in the distant past + BigInteger picosecs = new BigInteger(picosecBytes); + long millisecs = (secsSince1970 * 1000) + (picosecs.longValue() / 1000); + return new Date(millisecs); + } + + /** + * @param types + * @param i + * @return an Array + */ + private Object[] readArray(char[] types, int i) { + int arrayLen = 0; + while (types[i + arrayLen] != ']') + arrayLen++; + Object[] array = new Object[arrayLen]; + for (int j = 0; i < arrayLen; j++) { + array[j] = readArgument(types[i + j]); + } + return array; + } + + private int lengthOfCurrentString() { + int i = 0; + while (bytes[streamPosition + i] != 0) + i++; + return i; + } + + private void moveToFourByteBoundry() { + // If i'm already at a 4 byte boundry, I need to move to the next one + int mod = streamPosition % 4; + streamPosition += (4 - mod); + } + +} + diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCJavaToByteArrayConverter.java --- a/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCJavaToByteArrayConverter.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCJavaToByteArrayConverter.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,310 +1,310 @@ -/** - * @author cramakrishnan - * - * Copyright (C) 2003, C. Ramakrishnan / Illposed Software - * All rights reserved. - * - * See license.txt (or license.rtf) for license information. - * - * - * OSCJavaToByteArrayConverter is a helper class that translates - * from Java types to the format the OSC spec specifies for those - * types. - * - * This implementation is based on Markus Gaelli and - * Iannis Zannos' OSC implementation in Squeak: - * http://www.emergent.de/Goodies/ - */ - -package com.illposed.osc.utility; - -import java.io.IOException; -import java.io.ByteArrayOutputStream; -import java.math.BigInteger; -import java.util.Enumeration; -import java.util.Vector; - - -public class OSCJavaToByteArrayConverter { - - protected ByteArrayOutputStream stream = new ByteArrayOutputStream(); - private byte[] intBytes = new byte[4]; - - /*public OSCJavaToByteArrayConverter() { - super(); - }*/ - - /** - * Creation date: (2/23/2001 2:43:25 AM) - * @param anArray java.lang.Object[] - * - */ - public void appendNullCharToAlignStream() { - int mod = stream.size() % 4; - int pad = 4 - mod; - for (int i = 0; i < pad; i++) - stream.write(0); - } - - /** - * Creation date: (2/23/2001 2:21:53 AM) - * @return byte[] - */ - public byte[] toByteArray() { - return stream.toByteArray(); - } - - /** - * Creation date: (2/23/2001 2:14:23 AM) - * @param bytes byte[] - */ - public void write(byte[] bytes) { - writeBigEndToFourByteBoundry(bytes); - } - - /** - * Creation date: (2/23/2001 2:21:04 AM) - * @param i int - */ - public void write(int i) { - writeIntegerToByteArray(i); - } - - /** - * Creation date: (2/23/2001 2:03:57 AM) - * @param f java.lang.Float - */ - public void write(Float f) { - writeIntegerToByteArray(Float.floatToIntBits(f.floatValue())); - } - - /** - * Creation date: (2/23/2001 2:08:36 AM) - * @param i java.lang.Integer - */ - public void write(Integer i) { - writeIntegerToByteArray(i.intValue()); - } - - /** - * Creation date: (2/23/2001 1:57:35 AM) - * @param str java.lang.String - */ - public void write(String str) { - writeLittleEndToFourByteBoundry(str.getBytes()); - } - - /** - * Creation date: (2/23/2001 2:08:36 AM) - * @param c char - */ - public void write(char c) { - stream.write(c); - } - - /** - * Creation date: (2/23/2001 2:02:54 AM) - * @param anObject java.lang.Object - */ - public void write(Object anObject) { - // Can't do switch on class - if (null == anObject) - return; - if (anObject instanceof Float) { - write((Float) anObject); - return; - } - if (anObject instanceof String) { - write((String) anObject); - return; - } - if (anObject instanceof Integer) { - write((Integer) anObject); - return; - } - } - - /** - * Creation date: (2/23/2001 2:43:25 AM) - * @param aClass Class - */ - public void writeType(Class c) { - // A big ol' case statement -- what's polymorphism mean, again? - // I really wish I could extend the base classes! - - // use the appropriate flags to tell SuperCollider what kind of - // thing it is looking at - - if (Integer.class.equals(c)) { - stream.write('i'); - return; - } - if (java.math.BigInteger.class.equals(c)) { - stream.write('h'); - return; - } - if (Float.class.equals(c)) { - stream.write('f'); - return; - } - if (Double.class.equals(c)) { - stream.write('d'); - return; - } - if (String.class.equals(c)) { - stream.write('s'); - return; - } - if (Character.class.equals(c)) { - stream.write('c'); - return; - } - } - - /** - * Creation date: (2/23/2001 2:43:25 AM) - * @param anArray java.lang.Object[] - */ - public void writeTypesArray(Object[] array) { - // A big ol' case statement in a for loop -- what's polymorphism mean, again? - // I really wish I could extend the base classes! - - for (int i = 0; i < array.length; i++) { - if (null == array[i]) - continue; - // if the array at i is a type of array write a [ - // This is used for nested arguments - if (array[i].getClass().isArray()) { - stream.write('['); - // fill the [] with the SuperCollider types corresponding to the object - // (i.e. Object of type String needs -s). - writeTypesArray((Object[]) array[i]); - // close the array - stream.write(']'); - continue; - } - // Create a way to deal with Boolean type objects - if (Boolean.TRUE.equals(array[i])) { - stream.write('T'); - continue; - } - if (Boolean.FALSE.equals(array[i])) { - stream.write('F'); - continue; - } - // go through the array and write the superCollider types as shown in the - // above method. the Classes derived here are used as the arg to the above method - writeType(array[i].getClass()); - } - // align the stream with padded bytes - appendNullCharToAlignStream(); - } - - /** - * Same as writeSuperColliderTypes(Object[]), just that it takes a vector (for jdk1.1 - * compatibility), rather than an array. - * @param vector the collection I am to write out types for - */ - public void writeTypes(Vector vector) { - // A big ol' case statement in a for loop -- what's polymorphism mean, again? - // I really wish I could extend the base classes! - - Enumeration enm = vector.elements(); - Object nextObject; - while (enm.hasMoreElements()) { - nextObject = enm.nextElement(); - if (null == nextObject) - continue; - // if the array at i is a type of array write a [ - // This is used for nested arguments - if (nextObject.getClass().isArray()) { - stream.write('['); - // fill the [] with the SuperCollider types corresponding to the object - // (e.g., Object of type String needs -s). - writeTypesArray((Object[]) nextObject); - // close the array - stream.write(']'); - continue; - } - // Create a way to deal with Boolean type objects - if (Boolean.TRUE.equals(nextObject)) { - stream.write('T'); - continue; - } - if (Boolean.FALSE.equals(nextObject)) { - stream.write('F'); - continue; - } - // go through the array and write the superCollider types as shown in the - // above method. the Classes derived here are used as the arg to the above method - writeType(nextObject.getClass()); - } - // align the stream with padded bytes - appendNullCharToAlignStream(); - } - - /** - * convert an integer to byte array - * - * @param value int - */ - private void writeIntegerToByteArray(int value) { - byte[] intBytes = new byte[4]; - - intBytes[3] = (byte)value; value>>>=8; - intBytes[2] = (byte)value; value>>>=8; - intBytes[1] = (byte)value; value>>>=8; - intBytes[0] = (byte)value; - - try { - stream.write(intBytes); - } catch (IOException e) { - throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); - } - } - - /** - * Line up the BigEnd of the bytes to a 4 byte boundry - * - * @param bytes byte[] - */ - private void writeBigEndToFourByteBoundry(byte[] bytes) { - int mod = bytes.length % 4; - // if the remainder == 0 write the bytes - if (mod == 0) { - try { stream.write(bytes); } catch (IOException e) - { throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); } - return; - } - // pad the bytes to lineup correctly - int pad = 4 - mod; - byte[] newBytes = new byte[pad + bytes.length]; - System.arraycopy(bytes,0,newBytes,pad,bytes.length); - - try { stream.write(newBytes); } catch (IOException e) - { throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); } - } - - /** - * Line up the LittleEnd of the bytes to a 4 byte boundry - * - * @param bytes byte[] - */ - private void writeLittleEndToFourByteBoundry(byte[] bytes) { - int mod = bytes.length % 4; - // if the remainder == 0 write the bytes - if (mod == 4) { - try { stream.write(bytes); } catch (IOException e) - { throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); } - return; - } - // pad the bytes to lineup correctly - int pad = 4 - mod; - byte[] newBytes = new byte[pad + bytes.length]; - System.arraycopy(bytes,0,newBytes,0,bytes.length); - - try { stream.write(newBytes); } catch (IOException e) - { throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); } - } - -} +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * OSCJavaToByteArrayConverter is a helper class that translates + * from Java types to the format the OSC spec specifies for those + * types. + * + * This implementation is based on Markus Gaelli and + * Iannis Zannos' OSC implementation in Squeak: + * http://www.emergent.de/Goodies/ + */ + +package com.illposed.osc.utility; + +import java.io.IOException; +import java.io.ByteArrayOutputStream; +import java.math.BigInteger; +import java.util.Enumeration; +import java.util.Vector; + + +public class OSCJavaToByteArrayConverter { + + protected ByteArrayOutputStream stream = new ByteArrayOutputStream(); + private byte[] intBytes = new byte[4]; + + /*public OSCJavaToByteArrayConverter() { + super(); + }*/ + + /** + * Creation date: (2/23/2001 2:43:25 AM) + * @param anArray java.lang.Object[] + * + */ + public void appendNullCharToAlignStream() { + int mod = stream.size() % 4; + int pad = 4 - mod; + for (int i = 0; i < pad; i++) + stream.write(0); + } + + /** + * Creation date: (2/23/2001 2:21:53 AM) + * @return byte[] + */ + public byte[] toByteArray() { + return stream.toByteArray(); + } + + /** + * Creation date: (2/23/2001 2:14:23 AM) + * @param bytes byte[] + */ + public void write(byte[] bytes) { + writeBigEndToFourByteBoundry(bytes); + } + + /** + * Creation date: (2/23/2001 2:21:04 AM) + * @param i int + */ + public void write(int i) { + writeIntegerToByteArray(i); + } + + /** + * Creation date: (2/23/2001 2:03:57 AM) + * @param f java.lang.Float + */ + public void write(Float f) { + writeIntegerToByteArray(Float.floatToIntBits(f.floatValue())); + } + + /** + * Creation date: (2/23/2001 2:08:36 AM) + * @param i java.lang.Integer + */ + public void write(Integer i) { + writeIntegerToByteArray(i.intValue()); + } + + /** + * Creation date: (2/23/2001 1:57:35 AM) + * @param str java.lang.String + */ + public void write(String str) { + writeLittleEndToFourByteBoundry(str.getBytes()); + } + + /** + * Creation date: (2/23/2001 2:08:36 AM) + * @param c char + */ + public void write(char c) { + stream.write(c); + } + + /** + * Creation date: (2/23/2001 2:02:54 AM) + * @param anObject java.lang.Object + */ + public void write(Object anObject) { + // Can't do switch on class + if (null == anObject) + return; + if (anObject instanceof Float) { + write((Float) anObject); + return; + } + if (anObject instanceof String) { + write((String) anObject); + return; + } + if (anObject instanceof Integer) { + write((Integer) anObject); + return; + } + } + + /** + * Creation date: (2/23/2001 2:43:25 AM) + * @param aClass Class + */ + public void writeType(Class c) { + // A big ol' case statement -- what's polymorphism mean, again? + // I really wish I could extend the base classes! + + // use the appropriate flags to tell SuperCollider what kind of + // thing it is looking at + + if (Integer.class.equals(c)) { + stream.write('i'); + return; + } + if (java.math.BigInteger.class.equals(c)) { + stream.write('h'); + return; + } + if (Float.class.equals(c)) { + stream.write('f'); + return; + } + if (Double.class.equals(c)) { + stream.write('d'); + return; + } + if (String.class.equals(c)) { + stream.write('s'); + return; + } + if (Character.class.equals(c)) { + stream.write('c'); + return; + } + } + + /** + * Creation date: (2/23/2001 2:43:25 AM) + * @param anArray java.lang.Object[] + */ + public void writeTypesArray(Object[] array) { + // A big ol' case statement in a for loop -- what's polymorphism mean, again? + // I really wish I could extend the base classes! + + for (int i = 0; i < array.length; i++) { + if (null == array[i]) + continue; + // if the array at i is a type of array write a [ + // This is used for nested arguments + if (array[i].getClass().isArray()) { + stream.write('['); + // fill the [] with the SuperCollider types corresponding to the object + // (i.e. Object of type String needs -s). + writeTypesArray((Object[]) array[i]); + // close the array + stream.write(']'); + continue; + } + // Create a way to deal with Boolean type objects + if (Boolean.TRUE.equals(array[i])) { + stream.write('T'); + continue; + } + if (Boolean.FALSE.equals(array[i])) { + stream.write('F'); + continue; + } + // go through the array and write the superCollider types as shown in the + // above method. the Classes derived here are used as the arg to the above method + writeType(array[i].getClass()); + } + // align the stream with padded bytes + appendNullCharToAlignStream(); + } + + /** + * Same as writeSuperColliderTypes(Object[]), just that it takes a vector (for jdk1.1 + * compatibility), rather than an array. + * @param vector the collection I am to write out types for + */ + public void writeTypes(Vector vector) { + // A big ol' case statement in a for loop -- what's polymorphism mean, again? + // I really wish I could extend the base classes! + + Enumeration enm = vector.elements(); + Object nextObject; + while (enm.hasMoreElements()) { + nextObject = enm.nextElement(); + if (null == nextObject) + continue; + // if the array at i is a type of array write a [ + // This is used for nested arguments + if (nextObject.getClass().isArray()) { + stream.write('['); + // fill the [] with the SuperCollider types corresponding to the object + // (e.g., Object of type String needs -s). + writeTypesArray((Object[]) nextObject); + // close the array + stream.write(']'); + continue; + } + // Create a way to deal with Boolean type objects + if (Boolean.TRUE.equals(nextObject)) { + stream.write('T'); + continue; + } + if (Boolean.FALSE.equals(nextObject)) { + stream.write('F'); + continue; + } + // go through the array and write the superCollider types as shown in the + // above method. the Classes derived here are used as the arg to the above method + writeType(nextObject.getClass()); + } + // align the stream with padded bytes + appendNullCharToAlignStream(); + } + + /** + * convert an integer to byte array + * + * @param value int + */ + private void writeIntegerToByteArray(int value) { + byte[] intBytes = new byte[4]; + + intBytes[3] = (byte)value; value>>>=8; + intBytes[2] = (byte)value; value>>>=8; + intBytes[1] = (byte)value; value>>>=8; + intBytes[0] = (byte)value; + + try { + stream.write(intBytes); + } catch (IOException e) { + throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); + } + } + + /** + * Line up the BigEnd of the bytes to a 4 byte boundry + * + * @param bytes byte[] + */ + private void writeBigEndToFourByteBoundry(byte[] bytes) { + int mod = bytes.length % 4; + // if the remainder == 0 write the bytes + if (mod == 0) { + try { stream.write(bytes); } catch (IOException e) + { throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); } + return; + } + // pad the bytes to lineup correctly + int pad = 4 - mod; + byte[] newBytes = new byte[pad + bytes.length]; + System.arraycopy(bytes,0,newBytes,pad,bytes.length); + + try { stream.write(newBytes); } catch (IOException e) + { throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); } + } + + /** + * Line up the LittleEnd of the bytes to a 4 byte boundry + * + * @param bytes byte[] + */ + private void writeLittleEndToFourByteBoundry(byte[] bytes) { + int mod = bytes.length % 4; + // if the remainder == 0 write the bytes + if (mod == 4) { + try { stream.write(bytes); } catch (IOException e) + { throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); } + return; + } + // pad the bytes to lineup correctly + int pad = 4 - mod; + byte[] newBytes = new byte[pad + bytes.length]; + System.arraycopy(bytes,0,newBytes,0,bytes.length); + + try { stream.write(newBytes); } catch (IOException e) + { throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); } + } + +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCPacketDispatcher.java --- a/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCPacketDispatcher.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCPacketDispatcher.java Thu Apr 12 15:33:25 2012 +0200 @@ -1,77 +1,77 @@ -/* $Id: OSCPacketDispatcher.java,v 1.2 2008/07/01 15:29:46 modin Exp $ - * Created on 28.10.2003 - */ -package com.illposed.osc.utility; - -import com.illposed.osc.*; - -import java.util.Date; -import java.util.Enumeration; -import java.util.Hashtable; - -/** - * @author cramakrishnan - * - * Copyright (C) 2003, C. Ramakrishnan / Auracle - * All rights reserved. - * - * See license.txt (or license.rtf) for license information. - * - * Dispatches OSCMessages to registered listeners. - * - */ - -public class OSCPacketDispatcher { - private Hashtable addressToClassTable = new Hashtable(); - - /** - * - */ - public OSCPacketDispatcher() { - super(); - } - - public void addListener(String address, OSCListener listener) { - addressToClassTable.put(address, listener); - } - - public void dispatchPacket(OSCPacket packet) { - if (packet instanceof OSCBundle) - dispatchBundle((OSCBundle) packet); - else - dispatchMessage((OSCMessage) packet); - } - - public void dispatchPacket(OSCPacket packet, Date timestamp) { - if (packet instanceof OSCBundle) - dispatchBundle((OSCBundle) packet); - else - dispatchMessage((OSCMessage) packet, timestamp); - } - - private void dispatchBundle(OSCBundle bundle) { - Date timestamp = bundle.getTimestamp(); - OSCPacket[] packets = bundle.getPackets(); - for (int i = 0; i < packets.length; i++) { - dispatchPacket(packets[i], timestamp); - } - } - - private void dispatchMessage(OSCMessage message) { - dispatchMessage(message, null); - } - - private void dispatchMessage(OSCMessage message, Date time) { - Enumeration keys = addressToClassTable.keys(); - while (keys.hasMoreElements()) { - String key = (String) keys.nextElement(); - // this supports the OSC regexp facility, but it - // only works in JDK 1.4, so don't support it right now - // if (key.matches(message.getAddress())) { - if (key.equals(message.getAddress())) { - OSCListener listener = (OSCListener) addressToClassTable.get(key); - listener.acceptMessage(time, message); - } - } - } -} +/* $Id: OSCPacketDispatcher.java,v 1.2 2008/07/01 15:29:46 modin Exp $ + * Created on 28.10.2003 + */ +package com.illposed.osc.utility; + +import com.illposed.osc.*; + +import java.util.Date; +import java.util.Enumeration; +import java.util.Hashtable; + +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Auracle + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * Dispatches OSCMessages to registered listeners. + * + */ + +public class OSCPacketDispatcher { + private Hashtable addressToClassTable = new Hashtable(); + + /** + * + */ + public OSCPacketDispatcher() { + super(); + } + + public void addListener(String address, OSCListener listener) { + addressToClassTable.put(address, listener); + } + + public void dispatchPacket(OSCPacket packet) { + if (packet instanceof OSCBundle) + dispatchBundle((OSCBundle) packet); + else + dispatchMessage((OSCMessage) packet); + } + + public void dispatchPacket(OSCPacket packet, Date timestamp) { + if (packet instanceof OSCBundle) + dispatchBundle((OSCBundle) packet); + else + dispatchMessage((OSCMessage) packet, timestamp); + } + + private void dispatchBundle(OSCBundle bundle) { + Date timestamp = bundle.getTimestamp(); + OSCPacket[] packets = bundle.getPackets(); + for (int i = 0; i < packets.length; i++) { + dispatchPacket(packets[i], timestamp); + } + } + + private void dispatchMessage(OSCMessage message) { + dispatchMessage(message, null); + } + + private void dispatchMessage(OSCMessage message, Date time) { + Enumeration keys = addressToClassTable.keys(); + while (keys.hasMoreElements()) { + String key = (String) keys.nextElement(); + // this supports the OSC regexp facility, but it + // only works in JDK 1.4, so don't support it right now + // if (key.matches(message.getAddress())) { + if (key.equals(message.getAddress())) { + OSCListener listener = (OSCListener) addressToClassTable.get(key); + listener.acceptMessage(time, message); + } + } + } +} diff -r 6c08d4d7219e -r 9ccef81f02ab front_processing/extern/TUIO_PROCESSING/src/TUIO/TuioProcessing.java --- a/front_processing/extern/TUIO_PROCESSING/src/TUIO/TuioProcessing.java Thu Apr 12 13:09:46 2012 +0200 +++ b/front_processing/extern/TUIO_PROCESSING/src/TUIO/TuioProcessing.java Thu Apr 12 15:33:25 2012 +0200 @@ -19,6 +19,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* + Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings. +*/ + package TUIO; import java.awt.event.*; diff -r 6c08d4d7219e -r 9ccef81f02ab middleware/Communication/Properties/AssemblyInfo.cs --- a/middleware/Communication/Properties/AssemblyInfo.cs Thu Apr 12 13:09:46 2012 +0200 +++ b/middleware/Communication/Properties/AssemblyInfo.cs Thu Apr 12 15:33:25 2012 +0200 @@ -1,4 +1,4 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff -r 6c08d4d7219e -r 9ccef81f02ab middleware/Communication/Server.cs --- a/middleware/Communication/Server.cs Thu Apr 12 13:09:46 2012 +0200 +++ b/middleware/Communication/Server.cs Thu Apr 12 15:33:25 2012 +0200 @@ -1,4 +1,4 @@ -/* +/* * This file is part of the TraKERS\Middleware package. * * (c) IRI diff -r 6c08d4d7219e -r 9ccef81f02ab middleware/Debug/App.config --- a/middleware/Debug/App.config Thu Apr 12 13:09:46 2012 +0200 +++ b/middleware/Debug/App.config Thu Apr 12 15:33:25 2012 +0200 @@ -1,4 +1,4 @@ - + diff -r 6c08d4d7219e -r 9ccef81f02ab middleware/Debug/Debug.csproj --- a/middleware/Debug/Debug.csproj Thu Apr 12 13:09:46 2012 +0200 +++ b/middleware/Debug/Debug.csproj Thu Apr 12 15:33:25 2012 +0200 @@ -1,4 +1,4 @@ - + Debug diff -r 6c08d4d7219e -r 9ccef81f02ab middleware/Debug/Debug.csproj.user --- a/middleware/Debug/Debug.csproj.user Thu Apr 12 13:09:46 2012 +0200 +++ b/middleware/Debug/Debug.csproj.user Thu Apr 12 15:33:25 2012 +0200 @@ -1,4 +1,4 @@ - + publish\ diff -r 6c08d4d7219e -r 9ccef81f02ab middleware/Debug/DebugParameters.xaml --- a/middleware/Debug/DebugParameters.xaml Thu Apr 12 13:09:46 2012 +0200 +++ b/middleware/Debug/DebugParameters.xaml Thu Apr 12 15:33:25 2012 +0200 @@ -1,4 +1,4 @@ -