Charset set to UTF-8 without bom
tab replaced by 4 spaces
\r\n replaced by \n in non cs files
--- 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)
- {
- }
- }
-}
--- 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")]
--- 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 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>8f32aa72-b821-4da2-86c1-cb32c9bca196</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>TestClient</RootNamespace>
- <AssemblyName>TestClient</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <TargetFrameworkProfile>Client</TargetFrameworkProfile>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
\ No newline at end of file
Binary file front_idill/extern/fajran-npTuioClient/English.lproj/InfoPlist.strings has changed
--- 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} $+
--- 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 <cstdlib>
-#include <cstdio>
-#include <iostream>
-#include <Windows.h>
-
-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 <cstdlib>
+#include <cstdio>
+#include <iostream>
+#include <Windows.h>
+
+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
--- 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 <mkalten@iua.upf.edu>
+ Copyright (c) 2005-2008 Martin Kaltenbrunner <mkalten@iua.upf.edu>
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<TuioClient*>(obj)->socket->Run();
- return 0;
+ static_cast<TuioClient*>(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 ((currentFrame<lastFrame) && (currentFrame>0)) return;
+ if( strcmp( msg.AddressPattern(), "/tuio/2Dobj" ) == 0 )
+ {
+ const char* cmd;
+ args >> cmd;
+
+ if( strcmp( cmd, "set" ) == 0 )
+ {
+ if ((currentFrame<lastFrame) && (currentFrame>0)) 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<TuioObject*>::iterator tobj;
- for (tobj=objectList.begin(); tobj!= objectList.end(); tobj++)
- if((*tobj)->getSessionID()==(long)s_id) break;
+ std::list<TuioObject*>::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<TuioListener*>::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<TuioListener*>::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<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
- (*listener)->updateTuioObject((*tobj));
- }
- }
- else if( strcmp( cmd, "alive" ) == 0 )
- {
- if ((currentFrame<lastFrame) && (currentFrame>0)) return;
+ for (std::list<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
+ (*listener)->updateTuioObject((*tobj));
+ }
+ }
+ else if( strcmp( cmd, "alive" ) == 0 )
+ {
+ if ((currentFrame<lastFrame) && (currentFrame>0)) return;
- int32 s_id;
- while(!args.Eos())
- {
- args >> s_id;
- objectBuffer.push_back((long)s_id);
- std::list<long>::iterator iter;
- iter = find(aliveObjectList.begin(), aliveObjectList.end(), (long)s_id);
- if (iter != aliveObjectList.end()) aliveObjectList.erase(iter);
- }
- args >> EndMessage;
-
- std::list<long>::iterator alive_iter;
- for (alive_iter=aliveObjectList.begin(); alive_iter != aliveObjectList.end(); alive_iter++)
- {
- std::list<TuioObject*>::iterator tobj;
- for (tobj=objectList.begin(); tobj!=objectList.end(); tobj++)
- {
- TuioObject *deleteObject = (*tobj);
- if(deleteObject->getSessionID()==*alive_iter)
- {
- deleteObject->remove();
- for (std::list<TuioListener*>::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<long>::iterator iter;
+ iter = find(aliveObjectList.begin(), aliveObjectList.end(), (long)s_id);
+ if (iter != aliveObjectList.end()) aliveObjectList.erase(iter);
+ }
+ args >> EndMessage;
+
+ std::list<long>::iterator alive_iter;
+ for (alive_iter=aliveObjectList.begin(); alive_iter != aliveObjectList.end(); alive_iter++)
+ {
+ std::list<TuioObject*>::iterator tobj;
+ for (tobj=objectList.begin(); tobj!=objectList.end(); tobj++)
+ {
+ TuioObject *deleteObject = (*tobj);
+ if(deleteObject->getSessionID()==*alive_iter)
+ {
+ deleteObject->remove();
+ for (std::list<TuioListener*>::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<TuioObject*>::iterator refreshObject=objectList.begin(); refreshObject!=objectList.end(); refreshObject++)
- if ((*refreshObject)->getUpdateTime()==TUIO_UNDEFINED) (*refreshObject)->setUpdateTime(currentTime);
-
- for (std::list<TuioListener*>::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 ((currentFrame<lastFrame) && (currentFrame>0)) return;
+ if ((currentFrame>=lastFrame) || (currentFrame<0))
+ {
+ long currentTime = lastTime;
+ if (currentFrame>lastFrame)
+ {
+ currentTime = getCurrentTime()-startTime;
+ lastTime = currentTime;
+ }
+
+ for (std::list<TuioObject*>::iterator refreshObject=objectList.begin(); refreshObject!=objectList.end(); refreshObject++)
+ if ((*refreshObject)->getUpdateTime()==TUIO_UNDEFINED) (*refreshObject)->setUpdateTime(currentTime);
+
+ for (std::list<TuioListener*>::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 ((currentFrame<lastFrame) && (currentFrame>0)) 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<TuioCursor*>::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<TuioCursor*>::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<TuioCursor*>::iterator closestCursor = freeCursorList.begin();
- //Modifié par alexandre.bastien@iri.centrepompidou.fr
- for(std::list<TuioCursor*>::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<TuioListener*>::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<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
- (*listener)->updateTuioCursor((*tcur));
- }
- }
- else if( strcmp( cmd, "alive" ) == 0 )
- {
- if ((currentFrame<lastFrame) && (currentFrame>0)) return;
+ if (tcur == cursorList.end())
+ {
+ int f_id = (int)cursorList.size();
+ if ((int)(cursorList.size())<=maxFingerID)
+ {
+ std::list<TuioCursor*>::iterator closestCursor = freeCursorList.begin();
+ //Modifié par alexandre.bastien@iri.centrepompidou.fr
+ for(std::list<TuioCursor*>::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<TuioListener*>::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<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
+ (*listener)->updateTuioCursor((*tcur));
+ }
+ }
+ else if( strcmp( cmd, "alive" ) == 0 )
+ {
+ if ((currentFrame<lastFrame) && (currentFrame>0)) return;
- int32 s_id;
- while(!args.Eos())
- {
- args >> s_id;
- cursorBuffer.push_back((long)s_id);
- std::list<long>::iterator iter;
- iter = find(aliveCursorList.begin(), aliveCursorList.end(), (long)s_id);
- if (iter != aliveCursorList.end()) aliveCursorList.erase(iter);
- }
- args >> EndMessage;
- std::list<long>::iterator alive_iter;
- for (alive_iter=aliveCursorList.begin(); alive_iter != aliveCursorList.end(); alive_iter++)
- {
- std::list<TuioCursor*>::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<TuioListener*>::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<TuioCursor*>::iterator clist;
- for (clist=cursorList.begin(); clist != cursorList.end(); clist++)
- {
- int f_id = (*clist)->getFingerID();
- if (f_id>maxFingerID) maxFingerID=f_id;
- }
- std::list<TuioCursor*>::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()<maxFingerID) freeCursorList.push_back(deleteCursor);
- break;
- }
- }
- }
- aliveCursorList = cursorBuffer;
- cursorBuffer.clear();
- }
- else if( strcmp( cmd, "fseq" ) == 0 )
- {
- if(currentFrame>0) lastFrame = currentFrame;
- args >> currentFrame >> EndMessage;
+ int32 s_id;
+ while(!args.Eos())
+ {
+ args >> s_id;
+ cursorBuffer.push_back((long)s_id);
+ std::list<long>::iterator iter;
+ iter = find(aliveCursorList.begin(), aliveCursorList.end(), (long)s_id);
+ if (iter != aliveCursorList.end()) aliveCursorList.erase(iter);
+ }
+ args >> EndMessage;
+ std::list<long>::iterator alive_iter;
+ for (alive_iter=aliveCursorList.begin(); alive_iter != aliveCursorList.end(); alive_iter++)
+ {
+ std::list<TuioCursor*>::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<TuioListener*>::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<TuioCursor*>::iterator clist;
+ for (clist=cursorList.begin(); clist != cursorList.end(); clist++)
+ {
+ int f_id = (*clist)->getFingerID();
+ if (f_id>maxFingerID) maxFingerID=f_id;
+ }
+ std::list<TuioCursor*>::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()<maxFingerID) freeCursorList.push_back(deleteCursor);
+ break;
+ }
+ }
+ }
+ aliveCursorList = cursorBuffer;
+ cursorBuffer.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<TuioCursor*>::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<TuioCursor*>::iterator refreshCursor=cursorList.begin(); refreshCursor!=cursorList.end(); refreshCursor++)
+ if ((*refreshCursor)->getUpdateTime()==TUIO_UNDEFINED) (*refreshCursor)->setUpdateTime(currentTime);
- for (std::list<TuioListener*>::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 ((currentFrame<lastFrame) && (currentFrame>0)) return;
+ for (std::list<TuioListener*>::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 ((currentFrame<lastFrame) && (currentFrame>0)) return;
- int32 s_id;
- const char* code;
- args >> s_id >> code >> EndMessage;
- std::list<TuioString*>::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<TuioString*>::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<TuioString*>::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<TuioString*>::iterator closestString = freeStringList.begin();//
+ //Modifié par alexandre.bastien@iri.centrepompidou.fr
- //for(std::list<TuioString*>::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<TuioListener*>::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<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
- (*listener)->updateTuioString((*tstr));
- }
- }
- else if( strcmp( cmd, "alive" ) == 0 )
- {
- if ((currentFrame<lastFrame) && (currentFrame>0)) return;
+ //for(std::list<TuioString*>::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<TuioListener*>::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<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
+ (*listener)->updateTuioString((*tstr));
+ }
+ }
+ else if( strcmp( cmd, "alive" ) == 0 )
+ {
+ if ((currentFrame<lastFrame) && (currentFrame>0)) return;
- int32 s_id;
- while(!args.Eos())
- {
- args >> s_id;
- stringBuffer.push_back((long)s_id);
- std::list<long>::iterator iter;
- iter = find(aliveStringList.begin(), aliveStringList.end(), (long)s_id);
- if (iter != aliveStringList.end()) aliveStringList.erase(iter);
- }
- args >> EndMessage;
- std::list<long>::iterator alive_iter;
- for (alive_iter=aliveStringList.begin(); alive_iter != aliveStringList.end(); alive_iter++)
- {
- std::list<TuioString*>::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<TuioListener*>::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<TuioString*>::iterator clist;//
- for (clist=stringList.begin(); clist != stringList.end(); clist++)//
- {//
- int s_id = (*clist)->getStringID();//
- if (s_id>maxStringID) maxStringID=s_id;//
- }//
- std::list<TuioString*>::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()<maxStringID) freeStringList.push_back(deleteString);//
- break;
- }
- }
- }
- aliveStringList = stringBuffer;
- stringBuffer.clear();
- }
- else if( strcmp( cmd, "fseq" ) == 0 )
- {
- if(currentFrame>0) lastFrame = currentFrame;
- args >> currentFrame >> EndMessage;
+ int32 s_id;
+ while(!args.Eos())
+ {
+ args >> s_id;
+ stringBuffer.push_back((long)s_id);
+ std::list<long>::iterator iter;
+ iter = find(aliveStringList.begin(), aliveStringList.end(), (long)s_id);
+ if (iter != aliveStringList.end()) aliveStringList.erase(iter);
+ }
+ args >> EndMessage;
+ std::list<long>::iterator alive_iter;
+ for (alive_iter=aliveStringList.begin(); alive_iter != aliveStringList.end(); alive_iter++)
+ {
+ std::list<TuioString*>::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<TuioListener*>::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<TuioString*>::iterator clist;//
+ for (clist=stringList.begin(); clist != stringList.end(); clist++)//
+ {//
+ int s_id = (*clist)->getStringID();//
+ if (s_id>maxStringID) maxStringID=s_id;//
+ }//
+ std::list<TuioString*>::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()<maxStringID) freeStringList.push_back(deleteString);//
+ 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<TuioString*>::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<TuioString*>::iterator refreshString=stringList.begin(); refreshString!=stringList.end(); refreshString++)
+ if ((*refreshString)->getUpdateTime()==TUIO_UNDEFINED) (*refreshString)->setUpdateTime(currentTime);
- for (std::list<TuioListener*>::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 ((currentFrame<lastFrame) && (currentFrame>0)) return;
- int32 s_id;
- const char* code;
- args >> s_id >> code >> EndMessage;
- std::list<TuioString*>::iterator tstr;
- for (tstr=stringList.begin(); tstr != stringList.end(); tstr++)
- if((*tstr)->getSessionID()==(long)s_id) break;
+ for (std::list<TuioListener*>::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 ((currentFrame<lastFrame) && (currentFrame>0)) return;
+ int32 s_id;
+ const char* code;
+ args >> s_id >> code >> EndMessage;
+ std::list<TuioString*>::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<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
- (*listener)->addTuioString(addString);
-
-
- }
- else if ( ((*tstr)->getCode()!=code) )
- {
- (*tstr)->update(code);
- for (std::list<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
- (*listener)->updateTuioString((*tstr));
- }
- }
- else if( strcmp( cmd, "alive" ) == 0 )
- {
- if ((currentFrame<lastFrame) && (currentFrame>0)) return;
-
- int32 s_id;
- while(!args.Eos())
- {
- args >> s_id;
- stringBuffer.push_back((long)s_id);
- std::list<long>::iterator iter;
- iter = find(aliveStringList.begin(), aliveStringList.end(), (long)s_id);
- if (iter != aliveStringList.end()) aliveStringList.erase(iter);
- }
- args >> EndMessage;
-
- std::list<long>::iterator alive_iter;
- for (alive_iter=aliveStringList.begin(); alive_iter != aliveStringList.end(); alive_iter++)
- {
- std::list<TuioString*>::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<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
- (*listener)->removeTuioString(deleteString);
-
- if (stringList.size()>0)
- {
- std::list<TuioString*>::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<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
+ (*listener)->addTuioString(addString);
+
+
+ }
+ else if ( ((*tstr)->getCode()!=code) )
+ {
+ (*tstr)->update(code);
+ for (std::list<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
+ (*listener)->updateTuioString((*tstr));
+ }
+ }
+ else if( strcmp( cmd, "alive" ) == 0 )
+ {
+ if ((currentFrame<lastFrame) && (currentFrame>0)) return;
+
+ int32 s_id;
+ while(!args.Eos())
+ {
+ args >> s_id;
+ stringBuffer.push_back((long)s_id);
+ std::list<long>::iterator iter;
+ iter = find(aliveStringList.begin(), aliveStringList.end(), (long)s_id);
+ if (iter != aliveStringList.end()) aliveStringList.erase(iter);
+ }
+ args >> EndMessage;
+
+ std::list<long>::iterator alive_iter;
+ for (alive_iter=aliveStringList.begin(); alive_iter != aliveStringList.end(); alive_iter++)
+ {
+ std::list<TuioString*>::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<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
+ (*listener)->removeTuioString(deleteString);
+
+ if (stringList.size()>0)
+ {
+ std::list<TuioString*>::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<TuioString*>::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<TuioString*>::iterator refreshString=stringList.begin(); refreshString!=stringList.end(); refreshString++)
+ if ((*refreshString)->getUpdateTime()==TUIO_UNDEFINED) (*refreshString)->setUpdateTime(currentTime);
- for (std::list<TuioListener*>::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<TuioListener*>::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<TuioListener*>::iterator result = find(listenerList.begin(),listenerList.end(),listener);
- if (result!=listenerList.end()) listenerList.remove(listener);
+ std::list<TuioListener*>::iterator result = find(listenerList.begin(),listenerList.end(),listener);
+ if (result!=listenerList.end()) listenerList.remove(listener);
}
TuioObject* TuioClient::getTuioObject(long s_id) {
- for (std::list<TuioObject*>::iterator iter=objectList.begin(); iter != objectList.end(); iter++)
- if((*iter)->getSessionID()==s_id) return (*iter);
-
- return NULL;
+ for (std::list<TuioObject*>::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<TuioCursor*>::iterator iter=cursorList.begin(); iter != cursorList.end(); iter++)
- if((*iter)->getSessionID()==s_id) return (*iter);
-
- return NULL;
+ for (std::list<TuioCursor*>::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<TuioString*>::iterator iter=stringList.begin(); iter != stringList.end(); iter++)
- if((*iter)->getSessionID()==s_id) return (*iter);
-
- return NULL;
+ for (std::list<TuioString*>::iterator iter=stringList.begin(); iter != stringList.end(); iter++)
+ if((*iter)->getSessionID()==s_id) return (*iter);
+
+ return NULL;
}
std::list<TuioObject*> TuioClient::getTuioObjects() {
- return objectList;
+ return objectList;
}
std::list<TuioCursor*> TuioClient::getTuioCursors() {
- return cursorList;
+ return cursorList;
}
std::list<TuioString*> 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;
}
--- 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 <mkalten@iua.upf.edu>
+ Copyright (c) 2005-2008 Martin Kaltenbrunner <mkalten@iua.upf.edu>
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<TuioObject*> getTuioObjects();
- std::list<TuioCursor*> getTuioCursors();
- /*
- * Ajouté par alexandre.bastien@iri.centrepompidou.fr
- */
- std::list<TuioString*> 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<TuioObject*> getTuioObjects();
+ std::list<TuioCursor*> getTuioCursors();
+ /*
+ * Ajouté par alexandre.bastien@iri.centrepompidou.fr
+ */
+ std::list<TuioString*> 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<TuioListener*> listenerList;
+ private:
+ std::list<TuioListener*> listenerList;
- std::list<TuioObject*> objectList;
- std::list<long> aliveObjectList, objectBuffer;
- std::list<TuioCursor*> cursorList;
- std::list<long> aliveCursorList, cursorBuffer;
- /*
- * Ajouté par alexandre.bastien@iri.centrepompidou.fr
- */
- std::list<TuioString*> stringList;
- std::list<long> aliveStringList, stringBuffer;
-
- int32 currentFrame, lastFrame;
-
- long startTime;
- long lastTime;
- long getCurrentTime();
-
- std::list<TuioCursor*> freeCursorList, freeCursorBuffer;
- /*
- * Ajouté par alexandre.bastien@iri.centrepompidou.fr
- */
- std::list<TuioString*> freeStringList, freeStringBuffer;
- int maxFingerID, maxStringID;
-
- #ifndef WIN32
- pthread_t thread;
- #else
- HANDLE thread;
- #endif
+ std::list<TuioObject*> objectList;
+ std::list<long> aliveObjectList, objectBuffer;
+ std::list<TuioCursor*> cursorList;
+ std::list<long> aliveCursorList, cursorBuffer;
+ /*
+ * Ajouté par alexandre.bastien@iri.centrepompidou.fr
+ */
+ std::list<TuioString*> stringList;
+ std::list<long> aliveStringList, stringBuffer;
+
+ int32 currentFrame, lastFrame;
+
+ long startTime;
+ long lastTime;
+ long getCurrentTime();
+
+ std::list<TuioCursor*> freeCursorList, freeCursorBuffer;
+ /*
+ * Ajouté par alexandre.bastien@iri.centrepompidou.fr
+ */
+ std::list<TuioString*> 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 */
--- 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 <mkalten@iua.upf.edu>
-
+ Copyright (c) 2005-2008 Martin Kaltenbrunner <mkalten@iua.upf.edu>
+
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<TuioPoint> 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<TuioPoint> 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<TuioPoint> 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<TuioPoint> 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);
+ };
};
--- 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;
--- 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 <mkalten@iua.upf.edu>
-
+ Copyright (c) 2005-2008 Martin Kaltenbrunner <mkalten@iua.upf.edu>
+
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 */
--- 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 <mkalten@iua.upf.edu>
-
+ Copyright (c) 2005-2008 Martin Kaltenbrunner <mkalten@iua.upf.edu>
+
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 <list>
@@ -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<TuioPoint> 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<TuioPoint> 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
--- 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 <mkalten@iua.upf.edu>
-
+ Copyright (c) 2005-2008 Martin Kaltenbrunner <mkalten@iua.upf.edu>
+
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; };
};
--- 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
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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, "<any>" );
- }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, "<any>" );
+ }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, "<any>:<any>" );
- }else{
- sprintf( s, "%d.%d.%d.%d:<any>",
- (int)((address >> 24) & 0xFF),
- (int)((address >> 16) & 0xFF),
- (int)((address >> 8) & 0xFF),
- (int)(address & 0xFF) );
- }
- }else{
- if( address == ANY_ADDRESS ){
- sprintf( s, "<any>:%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, "<any>:<any>" );
+ }else{
+ sprintf( s, "%d.%d.%d.%d:<any>",
+ (int)((address >> 24) & 0xFF),
+ (int)((address >> 16) & 0xFF),
+ (int)((address >> 8) & 0xFF),
+ (int)(address & 0xFF) );
+ }
+ }else{
+ if( address == ANY_ADDRESS ){
+ sprintf( s, "<any>:%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 );
+ }
+ }
}
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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 */
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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 */
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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(); }
};
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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() )
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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"
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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();
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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;
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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');
}
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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<unsigned long>(typeTagsEnd_ - typeTagsBegin_); }
+ unsigned long ArgumentCount() const { return static_cast<unsigned long>(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_ );
}
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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"
--- 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 <rossb@audiomulch.com>
+ Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
- 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
--- 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 @@
<script type="text/javascript">
function log(text) {
- document.getElementById('log').innerHTML += text + "\n";
+ document.getElementById('log').innerHTML += text + "\n";
}
tuio.object_add(function(data) {
- log("[object] add: x=" + data.x + ", y=" + data.y);
+ log("[object] add: x=" + data.x + ", y=" + data.y);
});
tuio.object_update(function(data) {
- log("[object] update: x=" + data.x + ", y=" + data.y);
+ log("[object] update: x=" + data.x + ", y=" + data.y);
});
tuio.object_remove(function(data) {
- log("[object] remove: x=" + data.x + ", y=" + data.y);
+ log("[object] remove: x=" + data.x + ", y=" + data.y);
});
tuio.cursor_add(function(data) {
- log("[cursor] add: x=" + data.x + ", y=" + data.y);
+ log("[cursor] add: x=" + data.x + ", y=" + data.y);
});
tuio.cursor_update(function(data) {
- log("[cursor] update: x=" + data.x + ", y=" + data.y);
+ log("[cursor] update: x=" + data.x + ", y=" + data.y);
});
tuio.cursor_remove(function(data) {
- log("[cursor] remove: x=" + data.x + ", y=" + data.y);
+ log("[cursor] remove: x=" + data.x + ", y=" + data.y);
});
</script>
</head>
<body>
-
+
<object id="tuio" type="application/x-tuio">Plugin FAILED to load</object>
<pre id="log"></pre>
--- 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');
}
</script>
</head>
<body onload="ol()">
-
+
<canvas id="c" width="300" height="300" style="top:0px; left:0px; width: 300px; height: 300px;"></canvas>
<object id="tuio" type="application/x-tuio">Plugin FAILED to load</object>
--- 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<len; i++) {
- var obj = tuio.cursors[i];
- var x = obj.x;
- var y = obj.y;
- var px = x * w;
- var py = y * h;
+ var i, len = tuio.cursors.length;
+ for (i=0; i<len; i++) {
+ var obj = tuio.cursors[i];
+ var x = obj.x;
+ var y = obj.y;
+ var px = x * w;
+ var py = y * h;
- ctx.beginPath();
- ctx.arc(px, py, 20, 0, 2*Math.PI, true);
+ ctx.beginPath();
+ ctx.arc(px, py, 20, 0, 2*Math.PI, true);
- ctx.fillStyle = "rgba(0, 0, 200, 0.2)";
- ctx.fill();
+ ctx.fillStyle = "rgba(0, 0, 200, 0.2)";
+ ctx.fill();
- ctx.lineWidth = 2.0;
- ctx.strokeStyle = "rgba(0, 0, 200, 0.8)";
- ctx.stroke();
- }
+ ctx.lineWidth = 2.0;
+ ctx.strokeStyle = "rgba(0, 0, 200, 0.8)";
+ ctx.stroke();
+ }
- updateStarted = false;
+ updateStarted = false;
}
function ol() {
- canvas = document.getElementById('canvas');
- ctx = canvas.getContext('2d');
- timer = setInterval(update, 15);
+ canvas = document.getElementById('canvas');
+ ctx = canvas.getContext('2d');
+ timer = setInterval(update, 15);
};
</script>
</head>
<body onload="ol()">
-
+
<canvas id="canvas" width="300" height="300" style="top:0px; left:0px; width: 300px; height: 300px;"></canvas>
<object id="tuio" type="application/x-tuio">Plugin FAILED to load</object>
--- 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);
}
--- 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 <http://www.gnu.org/licenses/>.
//
+/*
+ Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
+*/
+
#include "client.h"
#include <TuioClient.h>
@@ -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
--- 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 <http://www.gnu.org/licenses/>.
//
+/*
+ Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
+*/
+
#ifndef CLIENT_H_
#define CLIENT_H_
#include <string>
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
--- 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
--- 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);
}
--- 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)
--- 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 <cstring>
@@ -40,10 +44,10 @@
void tuio_callback(TuioEventData data)
{
- std::set<nsPluginInstance*>::iterator iter;
- for (iter = instances.begin(); iter != instances.end(); iter++) {
- (*iter)->event(data);
- }
+ std::set<nsPluginInstance*>::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; i<n; ++i)
{
@@ -215,13 +219,13 @@
}
}
- instances.insert(this);
+ instances.insert(this);
}
/// \brief Destructor
nsPluginInstance::~nsPluginInstance()
{
- instances.erase(this);
+ instances.erase(this);
}
/// \brief Initialize an instance of the plugin object
@@ -232,7 +236,7 @@
NPBool
nsPluginInstance::init(NPWindow* aWindow)
{
- D("[ns] init");
+ D("[ns] init");
return TRUE;
}
@@ -244,26 +248,26 @@
void
nsPluginInstance::shut()
{
- D("[ns] shut");
+ D("[ns] shut");
}
NPError
nsPluginInstance::SetWindow(NPWindow* aWindow)
{
- D("[ns] SetWindow");
+ D("[ns] SetWindow");
- if(!aWindow)
- {
- return NPERR_INVALID_PARAM;
- }
+ if(!aWindow)
+ {
+ return NPERR_INVALID_PARAM;
+ }
- return NPERR_NO_ERROR;
+ return NPERR_NO_ERROR;
}
NPError
nsPluginInstance::GetValue(NPPVariable aVariable, void *aValue)
{
- return NS_PluginGetValue(aVariable, aValue);
+ return NS_PluginGetValue(aVariable, aValue);
}
/// \brief Write a status message
@@ -273,84 +277,84 @@
NPError
nsPluginInstance::WriteStatus(const char *msg) const
{
- NPN_Status(_instance, msg);
- std::cout << msg << std::endl;
+ NPN_Status(_instance, msg);
+ std::cout << msg << std::endl;
- return NPERR_NO_ERROR;
+ return NPERR_NO_ERROR;
}
NPError
nsPluginInstance::NewStream(NPMIMEType /*type*/, NPStream* stream,
NPBool /*seekable*/, uint16* /*stype*/)
{
- D("[ns] NewStream");
- return NPERR_NO_ERROR;
+ D("[ns] NewStream");
+ return NPERR_NO_ERROR;
}
NPError
nsPluginInstance::DestroyStream(NPStream* /*stream*/, NPError /*reason*/)
{
- D("[ns] DestroyStream");
- return NPERR_NO_ERROR;
+ D("[ns] DestroyStream");
+ return NPERR_NO_ERROR;
}
int32_t
nsPluginInstance::WriteReady(NPStream* /* stream */ )
{
- D("[ns] WriteReady");
- return 0x0fffffff;
+ D("[ns] WriteReady");
+ return 0x0fffffff;
}
int32_t
nsPluginInstance::Write(NPStream* /*stream*/, int32_t /*offset*/, int32_t len,
void* buffer)
{
- D("[ns] Write: len=" << len);
- return len;
+ D("[ns] Write: len=" << len);
+ return len;
}
typedef struct {
- NPP instance;
- TuioEventData data;
+ NPP instance;
+ TuioEventData data;
} Event;
void test(void* ev)
{
- 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");
+ 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:
--- 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__
--- 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);
}
--- 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 @@
-
-<html><head>
-<meta charset="UTF-8" />
-<script type="text/javascript" src="../../src/tuio.js"></script>
-<script type="text/javascript" src="../../connector/npTuioClient/tuiojs.npTuioClient.js"></script>
-<script type="text/javascript" src="processing.js"></script>
-<script type="text/javascript" src="tuio.processing.js"></script>
-<script type="text/javascript" src="init.js"></script>
-</head>
-<body>
-<center>
- <script type="application/processing">
- <!--// All Examples Written by Casey Reas and Ben Fry
- // unless otherwise stated.
- var tuioClient;
- //Indique s'il s'agit de la main gauche.
- var oneHandLeft;
-
- //Taille de la fenêtre
- var WIDTH = 640, HEIGHT = 480;
-
- //Port du Client TUIO
- var port = 80;
- var minDistHands = 1;
- var maxDistHands = 1.5;
-
- /*FONCTION D'INITIALISATION
- Entrée :
- Sortie : Cr�ation de la fenêtre et du client TUIO*/
- void setup()
- {
- size (WIDTH, HEIGHT);
- showMask();
- tuioClient = new tuio.TuioProcessing(this);
- textAlign(CENTER);
- imageMode(CENTER);
- smooth();
- }
-
- /*FONCTION DE DESSIN
- Entrée :
- Sortie : Appel à la fonction de traitement d'input du serveur toutes les n millisecondes*/
- void draw()
- {
- fill(0);
- tuioInput();
- noStroke();
- }
-
- /*FONCTION DE RECEPTION DES MESSAGES OSC
- Entrée :
- Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
- void tuioInput()
- {
- noFill();
- var tuioCursorList = tuioClient.getTuioCursors();
-
- if(tuioCursorList.length() <= 0)
- {
- showMask();
- refreshText("Les mains sont trop loin ou trop près.", "Je ne détecte aucune main.");
- }
-
- if(tuioCursorList.length() == 1)
- {
- handleOneHand(tuioCursorList[0]);
- fill(255);
- refreshText("Les mains sont dans la zone de captation.", "Je détecte une main.");
- }
- else if(tuioCursorList.length() == 2)
- {
- handleBothHands(tuioCursorList);
- fill(255);
- refreshText("Les mains sont dans la zone de captation.", "Je détecte les deux mains.");
- }
- }
-
- /*FONCTION DE GESTION DES COURBES POUR UNE MAIN DETECTEE
- Entrée : Un curseur TUIO
- Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
- void handleOneHand(var handCursor)
- {
- var pt = handCursor.getPosition();
- drawEllipse(pt.getX(), pt.getY(), pt.getZ(), !oneHandLeft);
- }
-
- /*FONCTION DE GESTION DES COURBES POUR DEUX MAINS DETECTEES
- Entrée : La liste des curseurs TUIO
- Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
- void handleBothHands(var tuioCursorList)
- {
- var handLeftCursor = tuioCursorList[0];
- var handRightCursor = tuioCursorList[1];
- var pt;
-
- pt = handLeftCursor.getPosition();
- drawEllipse(pt.getX(), pt.getY(), pt.getZ(), true);
- pt = handRightCursor.getPosition();
- drawEllipse(pt.getX(), pt.getY(), pt.getZ(), false);
- }
-
- /*FONCTION DE GENERATION DU MASQUE
- Entrée :
- Sortie : Place des rectangles autour de la zone de dessin*/
- void showMask()
- {
- background(0);
- fill(255);
- rect(0, 80, width, height-130);
- }
-
- /*FONCTION DE RAFFRACHISSEMENT DU TEXTE SUPERIEUR
- Entrée : Texte à afficher
- Sortie : Place un rectangle au dessus de la zone de dessin et raffraichit le texte*/
- void refreshText(String txt1, String txt2)
- {
- fill(0);
- rect(0, 0, width, 80);
- fill(255);
- text(txt1, width/2 - 20, 20);
- text(txt2, width/2 - 20, 40);
- }
-
- /*FONCTION DE DESSIN D'UN POINT DE COURBE
- Entrée : Coordonnées X, Y et Z d'un point
- Sortie : Le point est dessiné avec une épaisseur et une luminosité dépendant de Z*/
- void drawEllipse(float x, float y, float z, boolean leftHand)
- {
-
- fill(0, 0, 255);
- stroke(0,0,0);
-
- float weight = map(z, minDistHands, maxDistHands, 50, 1);
- float redColor = map(z, minDistHands, maxDistHands, 255, 80);
-
- if(leftHand)
- fill(redColor,0,0);
- else
- fill(0,redColor,0);
-
- if(weight >= 30)
- fill(0, 0, redColor);
-
- ellipse(x+20, y+100, weight, weight);
- }
- </script>
- <canvas></canvas>
-</center>
-</body></html>
+<!--
+ Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
+-->
+
+<html><head>
+<meta charset="UTF-8" />
+<script type="text/javascript" src="../../src/tuio.js"></script>
+<script type="text/javascript" src="../../connector/npTuioClient/tuiojs.npTuioClient.js"></script>
+<script type="text/javascript" src="processing.js"></script>
+<script type="text/javascript" src="tuio.processing.js"></script>
+<script type="text/javascript" src="init.js"></script>
+</head>
+<body>
+<center>
+ <script type="application/processing">
+ <!--// All Examples Written by Casey Reas and Ben Fry
+ // unless otherwise stated.
+ var tuioClient;
+ //Indique s'il s'agit de la main gauche.
+ var oneHandLeft;
+
+ //Taille de la fenêtre
+ var WIDTH = 640, HEIGHT = 480;
+
+ //Port du Client TUIO
+ var port = 80;
+ var minDistHands = 1;
+ var maxDistHands = 1.5;
+
+ /*FONCTION D'INITIALISATION
+ Entrée :
+ Sortie : Cr�ation de la fenêtre et du client TUIO*/
+ void setup()
+ {
+ size (WIDTH, HEIGHT);
+ showMask();
+ tuioClient = new tuio.TuioProcessing(this);
+ textAlign(CENTER);
+ imageMode(CENTER);
+ smooth();
+ }
+
+ /*FONCTION DE DESSIN
+ Entrée :
+ Sortie : Appel à la fonction de traitement d'input du serveur toutes les n millisecondes*/
+ void draw()
+ {
+ fill(0);
+ tuioInput();
+ noStroke();
+ }
+
+ /*FONCTION DE RECEPTION DES MESSAGES OSC
+ Entrée :
+ Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
+ void tuioInput()
+ {
+ noFill();
+ var tuioCursorList = tuioClient.getTuioCursors();
+
+ if(tuioCursorList.length() <= 0)
+ {
+ showMask();
+ refreshText("Les mains sont trop loin ou trop près.", "Je ne détecte aucune main.");
+ }
+
+ if(tuioCursorList.length() == 1)
+ {
+ handleOneHand(tuioCursorList[0]);
+ fill(255);
+ refreshText("Les mains sont dans la zone de captation.", "Je détecte une main.");
+ }
+ else if(tuioCursorList.length() == 2)
+ {
+ handleBothHands(tuioCursorList);
+ fill(255);
+ refreshText("Les mains sont dans la zone de captation.", "Je détecte les deux mains.");
+ }
+ }
+
+ /*FONCTION DE GESTION DES COURBES POUR UNE MAIN DETECTEE
+ Entrée : Un curseur TUIO
+ Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
+ void handleOneHand(var handCursor)
+ {
+ var pt = handCursor.getPosition();
+ drawEllipse(pt.getX(), pt.getY(), pt.getZ(), !oneHandLeft);
+ }
+
+ /*FONCTION DE GESTION DES COURBES POUR DEUX MAINS DETECTEES
+ Entrée : La liste des curseurs TUIO
+ Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
+ void handleBothHands(var tuioCursorList)
+ {
+ var handLeftCursor = tuioCursorList[0];
+ var handRightCursor = tuioCursorList[1];
+ var pt;
+
+ pt = handLeftCursor.getPosition();
+ drawEllipse(pt.getX(), pt.getY(), pt.getZ(), true);
+ pt = handRightCursor.getPosition();
+ drawEllipse(pt.getX(), pt.getY(), pt.getZ(), false);
+ }
+
+ /*FONCTION DE GENERATION DU MASQUE
+ Entrée :
+ Sortie : Place des rectangles autour de la zone de dessin*/
+ void showMask()
+ {
+ background(0);
+ fill(255);
+ rect(0, 80, width, height-130);
+ }
+
+ /*FONCTION DE RAFFRACHISSEMENT DU TEXTE SUPERIEUR
+ Entrée : Texte à afficher
+ Sortie : Place un rectangle au dessus de la zone de dessin et raffraichit le texte*/
+ void refreshText(String txt1, String txt2)
+ {
+ fill(0);
+ rect(0, 0, width, 80);
+ fill(255);
+ text(txt1, width/2 - 20, 20);
+ text(txt2, width/2 - 20, 40);
+ }
+
+ /*FONCTION DE DESSIN D'UN POINT DE COURBE
+ Entrée : Coordonnées X, Y et Z d'un point
+ Sortie : Le point est dessiné avec une épaisseur et une luminosité dépendant de Z*/
+ void drawEllipse(float x, float y, float z, boolean leftHand)
+ {
+
+ fill(0, 0, 255);
+ stroke(0,0,0);
+
+ float weight = map(z, minDistHands, maxDistHands, 50, 1);
+ float redColor = map(z, minDistHands, maxDistHands, 255, 80);
+
+ if(leftHand)
+ fill(redColor,0,0);
+ else
+ fill(0,redColor,0);
+
+ if(weight >= 30)
+ fill(0, 0, redColor);
+
+ ellipse(x+20, y+100, weight, weight);
+ }
+ </script>
+ <canvas></canvas>
+</center>
+</body></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<len; i++) {
- var o = list[i];
- arc(o.getScreenX(width), o.getScreenY(height), 15, 15, 0, 2*PI);
+ var o = list[i];
+ arc(o.getScreenX(width), o.getScreenY(height), 15, 15, 0, 2*PI);
}
}
--- a/front_idill/extern/fajran-tuiojs/examples/processingjs/show_gestures.html Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-tuiojs/examples/processingjs/show_gestures.html Thu Apr 12 15:33:25 2012 +0200
@@ -1,79 +1,82 @@
-
-<html><head>
-<meta charset="UTF-8" />
-<script type="text/javascript" src="../../src/tuio.js"></script>
-<script type="text/javascript" src="../../connector/npTuioClient/tuiojs.npTuioClient.js"></script>
-<script type="text/javascript" src="processing.js"></script>
-<script type="text/javascript" src="tuio.processing.js"></script>
-<script type="text/javascript" src="init.js"></script>
-</head>
-<body>
-<center>
- <script type="application/processing">
- <!--// All Examples Written by Casey Reas and Ben Fry
- // unless otherwise stated.
- var tuioClient;
-
- /*FONCTION D'INITIALISATION
- Entrée :
- Sortie : Cr�ation de la fenêtre et du client TUIO*/
- void setup()
- {
- size (640, 480);
- showMask();
- tuioClient = new tuio.TuioProcessing(this);
- textAlign(CENTER);
- imageMode(CENTER);
- smooth();
- }
-
- /*FONCTION DE DESSIN
- Entrée :
- Sortie : Appel à la fonction de traitement d'input du serveur toutes les n millisecondes*/
- void draw()
- {
- fill(0);
- tuioInput();
- noStroke();
- }
-
- /*FONCTION DE RECEPTION DES MESSAGES OSC
- Entrée :
- Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
- void tuioInput()
- {
- fill(255);
- var tuioStringList = tuioClient.getTuioStrings();
- if(tuioStringList.length() <= 0)
- {
- showMask();
- text("Gesture non détectée.", width/2 - 20, 20);
- }
- else
- {
- showMask();
- showGestureMessage(tuioStringList[0]);
- }
- }
-
- /*FONCTION DE GENERATION DU MASQUE
- Entrée :
- Sortie : Place des rectangles autour de la zone de dessin*/
- void showMask()
- {
- background(0);
- fill(255);
- rect(0, 80, width, height-130);
- }
-
- /*FONCTION D'AFFICHAGE DU CODE DE LA GESTURE DETECTEE
- Entree :
- Sortie : Affichage du code de la gesture*/
- void showGestureMessage(var tstr)
- {
- text("Gesture détectée : " + tstr.getCode(), width/2 - 20, 20);
- }
- </script>
- <canvas></canvas>
-</center>
-</body></html>
+<!--
+ Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
+-->
+
+<html><head>
+<meta charset="UTF-8" />
+<script type="text/javascript" src="../../src/tuio.js"></script>
+<script type="text/javascript" src="../../connector/npTuioClient/tuiojs.npTuioClient.js"></script>
+<script type="text/javascript" src="processing.js"></script>
+<script type="text/javascript" src="tuio.processing.js"></script>
+<script type="text/javascript" src="init.js"></script>
+</head>
+<body>
+<center>
+ <script type="application/processing">
+ <!--// All Examples Written by Casey Reas and Ben Fry
+ // unless otherwise stated.
+ var tuioClient;
+
+ /*FONCTION D'INITIALISATION
+ Entrée :
+ Sortie : Cr�ation de la fenêtre et du client TUIO*/
+ void setup()
+ {
+ size (640, 480);
+ showMask();
+ tuioClient = new tuio.TuioProcessing(this);
+ textAlign(CENTER);
+ imageMode(CENTER);
+ smooth();
+ }
+
+ /*FONCTION DE DESSIN
+ Entrée :
+ Sortie : Appel à la fonction de traitement d'input du serveur toutes les n millisecondes*/
+ void draw()
+ {
+ fill(0);
+ tuioInput();
+ noStroke();
+ }
+
+ /*FONCTION DE RECEPTION DES MESSAGES OSC
+ Entrée :
+ Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
+ void tuioInput()
+ {
+ fill(255);
+ var tuioStringList = tuioClient.getTuioStrings();
+ if(tuioStringList.length() <= 0)
+ {
+ showMask();
+ text("Gesture non détectée.", width/2 - 20, 20);
+ }
+ else
+ {
+ showMask();
+ showGestureMessage(tuioStringList[0]);
+ }
+ }
+
+ /*FONCTION DE GENERATION DU MASQUE
+ Entrée :
+ Sortie : Place des rectangles autour de la zone de dessin*/
+ void showMask()
+ {
+ background(0);
+ fill(255);
+ rect(0, 80, width, height-130);
+ }
+
+ /*FONCTION D'AFFICHAGE DU CODE DE LA GESTURE DETECTEE
+ Entree :
+ Sortie : Affichage du code de la gesture*/
+ void showGestureMessage(var tstr)
+ {
+ text("Gesture détectée : " + tstr.getCode(), width/2 - 20, 20);
+ }
+ </script>
+ <canvas></canvas>
+</center>
+</body></html>
--- 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<len; i++) {
- var pos = d.path[i];
- res.push({
- getX: function() { return pos[0]; },
- getY: function() { return pos[1]; },
- getZ: function() { return pos[2]; },
+ var i, len = d.path.length;
+ var res = [];
+ for (i=0; i<len; i++) {
+ var pos = d.path[i];
+ res.push({
+ getX: function() { return pos[0]; },
+ getY: function() { return pos[1]; },
+ getZ: function() { return pos[2]; },
- getScreenX: function(width) { return width * pos[0]; },
- getScreenY: function(height) { return height * pos[1]; },
- });
- }
- return res;
+ getScreenX: function(width) { return width * pos[0]; },
+ getScreenY: function(height) { return height * pos[1]; },
+ });
+ }
+ return res;
}
function wrapObject(d) {
- return {
- getSessionID: function() { return d.sid; },
- getSymbolID: function() { return d.fid; },
- getX: function() { return d.x; },
- getY: function() { return d.y; },
- getAngle: function() { return d.angle; },
+ return {
+ getSessionID: function() { return d.sid; },
+ getSymbolID: function() { return d.fid; },
+ getX: function() { return d.x; },
+ getY: function() { return d.y; },
+ getAngle: function() { return d.angle; },
- getScreenX: function(width) { return width * d.x; },
- getScreenY: function(height) { return height * d.y; },
+ getScreenX: function(width) { return width * d.x; },
+ getScreenY: function(height) { return height * d.y; },
- getPath: function() { return wrapPath(d); },
- };
+ getPath: function() { return wrapPath(d); },
+ };
}
/*
* Modifié par alexandre.bastien@iri.centrepompidou.fr
*/
function wrapCursor(d) {
- return {
- getSessionID: function() { return d.sid; },
- getCursorId: function() { return d.fid; },
- getX: function() { return d.x; },
- getY: function() { return d.y; },
- getZ: function() { return d.z; },
+ return {
+ getSessionID: function() { return d.sid; },
+ getCursorId: function() { return d.fid; },
+ getX: function() { return d.x; },
+ getY: function() { return d.y; },
+ getZ: function() { return d.z; },
- getScreenX: function(width) { return width * d.x; },
- getScreenY: function(height) { return height * d.y; },
+ getScreenX: function(width) { return width * d.x; },
+ getScreenY: function(height) { return height * d.y; },
- getPath: function() { return wrapPath(d); },
- getPosition: function() { return wrapPosition(d); },
- };
+ getPath: function() { return wrapPath(d); },
+ getPosition: function() { return wrapPosition(d); },
+ };
}
/*
* Ajouté par alexandre.bastien@iri.centrepompidou.fr
*/
function wrapPosition(d) {
- return {
- getX: function() { return d.x; },
- getY: function() { return d.y; },
- getZ: function() { return d.z; },
- };
+ return {
+ getX: function() { return d.x; },
+ getY: function() { return d.y; },
+ getZ: function() { return d.z; },
+ };
}
/*
* Ajouté par alexandre.bastien@iri.centrepompidou.fr
*/
function wrapString(d) {
- return {
- getCode: function() { return d.code; },
- };
+ return {
+ getCode: function() { return d.code; },
+ };
}
tuio.TuioProcessing = function(p) {
- var listener = new tuio.Listener({
- object_add: function(d) { if (p.addTuioObject) p.addTuioObject(wrapObject(d)); },
- object_update: function(d) { if (p.updateTuioObject) p.updateTuioObject(wrapObject(d)); },
- object_remove: function(d) { if (p.removeTuioObject) p.removeTuioObject(wrapObject(d)); },
- cursor_add: function(d) { if (p.addTuioCursor) p.addTuioCursor(wrapCursor(d)); },
- cursor_update: function(d) { if (p.updateTuioCursor) p.updateTuioCursor(wrapCursor(d)); },
- cursor_remove: function(d) { if (p.removeTuioCursor) p.removeTuioCursor(wrapCursor(d)); },
- string_add: function(d) { if (p.addTuioString) p.addTuioString(wrapString(d)); },
- string_update: function(d) { if (p.updateTuioString) p.updateTuioString(wrapString(d)); },
- string_remove: function(d) { if (p.removeTuioString) p.removeTuioString(wrapString(d)); }
- });
- tuio.addListener(listener);
- tuio.start();
+ var listener = new tuio.Listener({
+ object_add: function(d) { if (p.addTuioObject) p.addTuioObject(wrapObject(d)); },
+ object_update: function(d) { if (p.updateTuioObject) p.updateTuioObject(wrapObject(d)); },
+ object_remove: function(d) { if (p.removeTuioObject) p.removeTuioObject(wrapObject(d)); },
+ cursor_add: function(d) { if (p.addTuioCursor) p.addTuioCursor(wrapCursor(d)); },
+ cursor_update: function(d) { if (p.updateTuioCursor) p.updateTuioCursor(wrapCursor(d)); },
+ cursor_remove: function(d) { if (p.removeTuioCursor) p.removeTuioCursor(wrapCursor(d)); },
+ string_add: function(d) { if (p.addTuioString) p.addTuioString(wrapString(d)); },
+ string_update: function(d) { if (p.updateTuioString) p.updateTuioString(wrapString(d)); },
+ string_remove: function(d) { if (p.removeTuioString) p.removeTuioString(wrapString(d)); }
+ });
+ tuio.addListener(listener);
+ tuio.start();
};
tuio.TuioProcessing.prototype = {
- getTuioObjects: function() {
- var res = [];
- var i, len = tuio.objects.length;
- for (i=0; i<len; i++) {
- res.push(wrapObject(tuio.objects[i]));
- }
- return res;
- },
+ getTuioObjects: function() {
+ var res = [];
+ var i, len = tuio.objects.length;
+ for (i=0; i<len; i++) {
+ res.push(wrapObject(tuio.objects[i]));
+ }
+ return res;
+ },
- getTuioCursors: function() {
- var res = [];
- var i, len = tuio.cursors.length;
- for (i=0; i<len; i++) {
- res.push(wrapCursor(tuio.cursors[i]));
- }
- return res;
- },
-
- getTuioStrings: function() {
- var res = [];
- var i, len = tuio.strings.length;
- for (i=0; i<len; i++) {
- res.push(wrapString(tuio.strings[i]));
- }
- return res;
- }
+ getTuioCursors: function() {
+ var res = [];
+ var i, len = tuio.cursors.length;
+ for (i=0; i<len; i++) {
+ res.push(wrapCursor(tuio.cursors[i]));
+ }
+ return res;
+ },
+
+ getTuioStrings: function() {
+ var res = [];
+ var i, len = tuio.strings.length;
+ for (i=0; i<len; i++) {
+ res.push(wrapString(tuio.strings[i]));
+ }
+ return res;
+ }
};
})();
--- a/front_idill/extern/fajran-tuiojs/src/tuio.js Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-tuiojs/src/tuio.js Thu Apr 12 15:33:25 2012 +0200
@@ -1,216 +1,219 @@
+/*
+ Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
+*/
var test = 0;
(function() {
- var TUIO = function() {
- // Listener class
+ var TUIO = function() {
+ // Listener class
- this.Listener = function(impl) {
- if (impl != undefined) {
- // override original method implementation
- for (var key in impl) {
- this[key] = impl[key];
- }
- }
- }
- this.Listener.prototype = {
- object_add: function(data) { },
- object_update: function(data) { },
- object_remove: function(data) { },
- cursor_add: function(data) { },
- cursor_update: function(data) { },
- cursor_remove: function(data) { },
- string_add: function(data) { },
- string_update: function(data) { },
- string_remove: function(data) { }
- }
+ this.Listener = function(impl) {
+ if (impl != undefined) {
+ // override original method implementation
+ for (var key in impl) {
+ this[key] = impl[key];
+ }
+ }
+ }
+ this.Listener.prototype = {
+ object_add: function(data) { },
+ object_update: function(data) { },
+ object_remove: function(data) { },
+ cursor_add: function(data) { },
+ cursor_update: function(data) { },
+ cursor_remove: function(data) { },
+ string_add: function(data) { },
+ string_update: function(data) { },
+ string_remove: function(data) { }
+ }
- // Instance variables
+ // Instance variables
- this.objects = [];
- this.cursors = [];
- this.strings = [];
+ this.objects = [];
+ this.cursors = [];
+ this.strings = [];
- this._data = {};
+ this._data = {};
- this._default_listener = new this.Listener();
- this._listeners = [this._default_listener];
+ this._default_listener = new this.Listener();
+ this._listeners = [this._default_listener];
- this._connector = undefined;
+ this._connector = undefined;
- };
- TUIO.prototype = {
- start: function(name) {
- var c = this._connector;
- if (c != undefined) {
- if (c.start != undefined) {
- c.start();
- }
- }
- },
+ };
+ TUIO.prototype = {
+ start: function(name) {
+ var c = this._connector;
+ if (c != undefined) {
+ if (c.start != undefined) {
+ c.start();
+ }
+ }
+ },
- stop: function() {
- var c = this._connector;
- if (c != undefined) {
- if (c.stop != undefined) {
- c.stop();
- }
- }
- },
+ stop: function() {
+ var c = this._connector;
+ if (c != undefined) {
+ if (c.stop != undefined) {
+ c.stop();
+ }
+ }
+ },
- setConnector: function(connector) {
- this._connector = connector;
- },
-
- addListener: function(listener) {
- this._listeners.push(listener);
- },
- removeListener: function(listener) {
- this._listeners.splice(this._listeners.indexOf(listener), 1);
- },
+ setConnector: function(connector) {
+ this._connector = connector;
+ },
+
+ addListener: function(listener) {
+ this._listeners.push(listener);
+ },
+ removeListener: function(listener) {
+ this._listeners.splice(this._listeners.indexOf(listener), 1);
+ },
- _invoke: function(method, data) {
- var i, len = this._listeners.length;
- for (i=0; i<len; i++) {
- var listener = this._listeners[i];
- listener[method](data);
- }
- },
+ _invoke: function(method, data) {
+ var i, len = this._listeners.length;
+ for (i=0; i<len; i++) {
+ var listener = this._listeners[i];
+ listener[method](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;
- }
+ 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();
})();
--- 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 <mkalten@iua.upf.edu>
-
- 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.<P>
- * <code>
- * TuioClient client = new TuioClient();<br/>
- * client.addTuioListener(myTuioListener);<br/>
- * client.connect();<br/>
- * </code>
- *
- * @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<Long,TuioObject> objectList = new Hashtable<Long,TuioObject>();
- private Vector<Long> aliveObjectList = new Vector<Long>();
- private Vector<Long> newObjectList = new Vector<Long>();
- private Hashtable<Long,TuioCursor> cursorList = new Hashtable<Long,TuioCursor>();
- private Vector<Long> aliveCursorList = new Vector<Long>();
- private Vector<Long> newCursorList = new Vector<Long>();
- private Hashtable<Long,TuioString> stringList = new Hashtable<Long,TuioString>();
- private Vector<Long> aliveStringList = new Vector<Long>();
- private Vector<Long> newStringList = new Vector<Long>();
-
- private Vector<TuioObject> frameObjects = new Vector<TuioObject>();
- private Vector<TuioCursor> frameCursors = new Vector<TuioCursor>();
- private Vector<TuioString> frameStrings = new Vector<TuioString>();
-
- private Vector<TuioCursor> freeCursorList = new Vector<TuioCursor>();
- private int maxCursorID = -1;
-
- private Vector<TuioString> freeStringList = new Vector<TuioString>();
- private int maxStringID = -1;
-
- private long currentFrame = 0;
- private TuioTime currentTime;
-
- private Vector<TuioListener> listenerList = new Vector<TuioListener>();
-
- /**
- * 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<TuioObject> getTuioObjects() {
- return new Vector<TuioObject>(objectList.values());
- }
-
- /**
- * Returns a Vector of all currently active TuioCursors
- *
- * @return a Vector of all currently active TuioCursors
- */
- public Vector<TuioCursor> getTuioCursors() {
- return new Vector<TuioCursor>(cursorList.values());
- }
-
- /**
- * Returns a Vector of all currently active TuioStrings
- *
- * @return a Vector of all currently active TuioStrings
- */
- public Vector<TuioString> getTuioStrings() {
- return new Vector<TuioString>(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;i<args.length;i++) {
- // get the message content
- long s_id = ((Integer)args[i]).longValue();
- newObjectList.addElement(s_id);
- // reduce the object list to the lost objects
- if (aliveObjectList.contains(s_id))
- aliveObjectList.removeElement(s_id);
- }
-
- // remove the remaining objects
- for (int i=0;i<aliveObjectList.size();i++) {
- TuioObject removeObject = objectList.get(aliveObjectList.elementAt(i));
- if (removeObject==null) continue;
- removeObject.remove(currentTime);
- frameObjects.addElement(removeObject);
- }
-
- } else if (command.equals("fseq")) {
-
- long fseq = ((Integer)args[1]).longValue();
- boolean lateFrame = false;
-
- if (fseq>0) {
- 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<TuioObject> 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<listenerList.size();i++) {
- TuioListener listener = (TuioListener)listenerList.elementAt(i);
- if (listener!=null) listener.removeTuioObject(removeObject);
- }
- objectList.remove(removeObject.getSessionID());
- break;
-
- case TuioObject.TUIO_ADDED:
- TuioObject addObject = new TuioObject(currentTime,tobj.getSessionID(),tobj.getSymbolID(),tobj.getX(),tobj.getY(),tobj.getAngle());
- objectList.put(addObject.getSessionID(),addObject);
- for (int i=0;i<listenerList.size();i++) {
- TuioListener listener = (TuioListener)listenerList.elementAt(i);
- if (listener!=null) listener.addTuioObject(addObject);
- }
- break;
-
- default:
- TuioObject updateObject = objectList.get(tobj.getSessionID());
- if ( (tobj.getX()!=updateObject.getX() && tobj.getXSpeed()==0) || (tobj.getY()!=updateObject.getY() && tobj.getYSpeed()==0) )
- updateObject.update(currentTime,tobj.getX(),tobj.getY(),tobj.getAngle());
- else
- updateObject.update(currentTime,tobj.getX(),tobj.getY(),tobj.getAngle(),tobj.getXSpeed(),tobj.getYSpeed(),tobj.getRotationSpeed(),tobj.getMotionAccel(),tobj.getRotationAccel());
-
- for (int i=0;i<listenerList.size();i++) {
- TuioListener listener = (TuioListener)listenerList.elementAt(i);
- if (listener!=null) listener.updateTuioObject(updateObject);
- }
- }
- }
-
- for (int i=0;i<listenerList.size();i++) {
- TuioListener listener = (TuioListener)listenerList.elementAt(i);
- if (listener!=null) listener.refresh(new TuioTime(currentTime));
- }
-
- Vector<Long> 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;i<args.length;i++) {
- // get the message content
- long s_id = ((Integer)args[i]).longValue();
- newCursorList.addElement(s_id);
- // reduce the cursor list to the lost cursors
- if (aliveCursorList.contains(s_id))
- aliveCursorList.removeElement(s_id);
- }
-
- // remove the remaining cursors
- for (int i=0;i<aliveCursorList.size();i++) {
- TuioCursor removeCursor = cursorList.get(aliveCursorList.elementAt(i));
- if (removeCursor==null) continue;
- removeCursor.remove(currentTime);
- frameCursors.addElement(removeCursor);
- }
-
- } else if (command.equals("fseq")) {
- long fseq = ((Integer)args[1]).longValue();
- boolean lateFrame = false;
-
- if (fseq>0) {
- 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<TuioCursor> 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;i<listenerList.size();i++) {
- TuioListener listener = (TuioListener)listenerList.elementAt(i);
- if (listener!=null) listener.removeTuioCursor(removeCursor);
- }
-
- cursorList.remove(removeCursor.getSessionID());
-
- if (removeCursor.getCursorID()==maxCursorID) {
- maxCursorID = -1;
- if (cursorList.size()>0) {
- Enumeration<TuioCursor> clist = cursorList.elements();
- while (clist.hasMoreElements()) {
- int c_id = clist.nextElement().getCursorID();
- if (c_id>maxCursorID) maxCursorID=c_id;
- }
-
- Enumeration<TuioCursor> 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()<maxCursorID) {
- freeCursorList.addElement(removeCursor);
- }
-
- break;
-
- case TuioCursor.TUIO_ADDED:
-
- int c_id = cursorList.size();
- if ((cursorList.size()<=maxCursorID) && (freeCursorList.size()>0)) {
- TuioCursor closestCursor = freeCursorList.firstElement();
- Enumeration<TuioCursor> testList = freeCursorList.elements();
- while (testList.hasMoreElements()) {
- TuioCursor testCursor = testList.nextElement();
- if (testCursor.getDistance(tcur)<closestCursor.getDistance(tcur)) closestCursor = testCursor;
- }
- c_id = closestCursor.getCursorID();
- freeCursorList.removeElement(closestCursor);
- } else maxCursorID = c_id;
-
- TuioCursor addCursor = new TuioCursor(currentTime,tcur.getSessionID(),c_id,tcur.getX(),tcur.getY(),tcur.getZ());
- cursorList.put(addCursor.getSessionID(),addCursor);
-
- for (int i=0;i<listenerList.size();i++) {
- TuioListener listener = (TuioListener)listenerList.elementAt(i);
- if (listener!=null) listener.addTuioCursor(addCursor);
- }
- break;
-
- default:
-
- TuioCursor updateCursor = cursorList.get(tcur.getSessionID());
- if ( (tcur.getX()!=updateCursor.getX() && tcur.getXSpeed()==0) || (tcur.getY()!=updateCursor.getY() && tcur.getYSpeed()==0) || (tcur.getZ()!=updateCursor.getZ()) )
- updateCursor.update(currentTime,tcur.getX(),tcur.getY(),tcur.getZ());
- else
- updateCursor.update(currentTime,tcur.getX(),tcur.getY(),tcur.getZ(),tcur.getXSpeed(),tcur.getYSpeed(),tcur.getMotionAccel());
-
- for (int i=0;i<listenerList.size();i++) {
- TuioListener listener = (TuioListener)listenerList.elementAt(i);
- if (listener!=null) listener.updateTuioCursor(updateCursor);
- }
- }
- }
-
- for (int i=0;i<listenerList.size();i++) {
- TuioListener listener = (TuioListener)listenerList.elementAt(i);
- if (listener!=null) listener.refresh(new TuioTime(currentTime));
- }
-
- Vector<Long> 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;i<args.length;i++) {
- // get the message content
- long s_id = ((Integer)args[i]).longValue();
- newStringList.addElement(s_id);
- // reduce the cursor list to the lost cursors
- if (aliveStringList.contains(s_id))
- aliveStringList.removeElement(s_id);
- }
-
- // remove the remaining cursors
- for (int i=0;i<aliveStringList.size();i++) {
- TuioString removeString = stringList.get(aliveStringList.elementAt(i));
- if (removeString==null) continue;
- removeString.remove(currentTime);
- frameStrings.addElement(removeString);
- }
-
- } else if (command.equals("fseq")) {
- long fseq = ((Integer)args[1]).longValue();
- boolean lateFrame = false;
-
- if (fseq>0) {
- 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<TuioString> 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;i<listenerList.size();i++) {
- TuioListener listener = (TuioListener)listenerList.elementAt(i);
- if (listener!=null) listener.removeTuioString(removeString);
- }
-
- stringList.remove(removeString.getSessionID());
-
- if (removeString.getStringID()==maxStringID) {
- maxStringID = -1;
- if (stringList.size()>0) {
- Enumeration<TuioString> slist = stringList.elements();
- while (slist.hasMoreElements()) {
- int sl_id = slist.nextElement().getStringID();
- if (sl_id>maxStringID) maxStringID=sl_id;
- }
-
- Enumeration<TuioString> 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()<maxStringID) {
- freeStringList.addElement(removeString);
- }
-
- break;
-
- case TuioString.TUIO_ADDED:
-
- int sl_id = stringList.size();
- if ((stringList.size()<=maxStringID) && (freeStringList.size()>0)) {
- TuioString closestString = freeStringList.firstElement();
- Enumeration<TuioString> testList = freeStringList.elements();
- while (testList.hasMoreElements()) {
- TuioString testString = testList.nextElement();
- //if (testString.getDistance(tstr)<closestString.getDistance(tstr))
- closestString = testString;
- }
- sl_id = closestString.getStringID();
- freeStringList.removeElement(closestString);
- } else maxStringID = sl_id;
-
- TuioString addString = new TuioString(currentTime,tstr.getSessionID(),sl_id,tstr.getMessage());
- stringList.put(addString.getSessionID(),addString);
-
- for (int i=0;i<listenerList.size();i++) {
- TuioListener listener = (TuioListener)listenerList.elementAt(i);
- if (listener!=null) listener.addTuioString(addString);
- }
- break;
-
- default:
-
- TuioString updateString = stringList.get(tstr.getSessionID());
- if ( tstr.getMessage()!=updateString.getMessage() )
- updateString.update(currentTime,tstr.getMessage());
- else
- updateString.update(currentTime,tstr.getMessage());
-
- for (int i=0;i<listenerList.size();i++) {
- TuioListener listener = (TuioListener)listenerList.elementAt(i);
- if (listener!=null) listener.updateTuioString(updateString);
- }
- }
- }
-
- for (int i=0;i<listenerList.size();i++) {
- TuioListener listener = (TuioListener)listenerList.elementAt(i);
- if (listener!=null) listener.refresh(new TuioTime(currentTime));
- }
-
- Vector<Long> 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 <mkalten@iua.upf.edu>
+
+ 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.<P>
+ * <code>
+ * TuioClient client = new TuioClient();<br/>
+ * client.addTuioListener(myTuioListener);<br/>
+ * client.connect();<br/>
+ * </code>
+ *
+ * @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<Long,TuioObject> objectList = new Hashtable<Long,TuioObject>();
+ private Vector<Long> aliveObjectList = new Vector<Long>();
+ private Vector<Long> newObjectList = new Vector<Long>();
+ private Hashtable<Long,TuioCursor> cursorList = new Hashtable<Long,TuioCursor>();
+ private Vector<Long> aliveCursorList = new Vector<Long>();
+ private Vector<Long> newCursorList = new Vector<Long>();
+ private Hashtable<Long,TuioString> stringList = new Hashtable<Long,TuioString>();
+ private Vector<Long> aliveStringList = new Vector<Long>();
+ private Vector<Long> newStringList = new Vector<Long>();
+
+ private Vector<TuioObject> frameObjects = new Vector<TuioObject>();
+ private Vector<TuioCursor> frameCursors = new Vector<TuioCursor>();
+ private Vector<TuioString> frameStrings = new Vector<TuioString>();
+
+ private Vector<TuioCursor> freeCursorList = new Vector<TuioCursor>();
+ private int maxCursorID = -1;
+
+ private Vector<TuioString> freeStringList = new Vector<TuioString>();
+ private int maxStringID = -1;
+
+ private long currentFrame = 0;
+ private TuioTime currentTime;
+
+ private Vector<TuioListener> listenerList = new Vector<TuioListener>();
+
+ /**
+ * 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<TuioObject> getTuioObjects() {
+ return new Vector<TuioObject>(objectList.values());
+ }
+
+ /**
+ * Returns a Vector of all currently active TuioCursors
+ *
+ * @return a Vector of all currently active TuioCursors
+ */
+ public Vector<TuioCursor> getTuioCursors() {
+ return new Vector<TuioCursor>(cursorList.values());
+ }
+
+ /**
+ * Returns a Vector of all currently active TuioStrings
+ *
+ * @return a Vector of all currently active TuioStrings
+ */
+ public Vector<TuioString> getTuioStrings() {
+ return new Vector<TuioString>(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;i<args.length;i++) {
+ // get the message content
+ long s_id = ((Integer)args[i]).longValue();
+ newObjectList.addElement(s_id);
+ // reduce the object list to the lost objects
+ if (aliveObjectList.contains(s_id))
+ aliveObjectList.removeElement(s_id);
+ }
+
+ // remove the remaining objects
+ for (int i=0;i<aliveObjectList.size();i++) {
+ TuioObject removeObject = objectList.get(aliveObjectList.elementAt(i));
+ if (removeObject==null) continue;
+ removeObject.remove(currentTime);
+ frameObjects.addElement(removeObject);
+ }
+
+ } else if (command.equals("fseq")) {
+
+ long fseq = ((Integer)args[1]).longValue();
+ boolean lateFrame = false;
+
+ if (fseq>0) {
+ 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<TuioObject> 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<listenerList.size();i++) {
+ TuioListener listener = (TuioListener)listenerList.elementAt(i);
+ if (listener!=null) listener.removeTuioObject(removeObject);
+ }
+ objectList.remove(removeObject.getSessionID());
+ break;
+
+ case TuioObject.TUIO_ADDED:
+ TuioObject addObject = new TuioObject(currentTime,tobj.getSessionID(),tobj.getSymbolID(),tobj.getX(),tobj.getY(),tobj.getAngle());
+ objectList.put(addObject.getSessionID(),addObject);
+ for (int i=0;i<listenerList.size();i++) {
+ TuioListener listener = (TuioListener)listenerList.elementAt(i);
+ if (listener!=null) listener.addTuioObject(addObject);
+ }
+ break;
+
+ default:
+ TuioObject updateObject = objectList.get(tobj.getSessionID());
+ if ( (tobj.getX()!=updateObject.getX() && tobj.getXSpeed()==0) || (tobj.getY()!=updateObject.getY() && tobj.getYSpeed()==0) )
+ updateObject.update(currentTime,tobj.getX(),tobj.getY(),tobj.getAngle());
+ else
+ updateObject.update(currentTime,tobj.getX(),tobj.getY(),tobj.getAngle(),tobj.getXSpeed(),tobj.getYSpeed(),tobj.getRotationSpeed(),tobj.getMotionAccel(),tobj.getRotationAccel());
+
+ for (int i=0;i<listenerList.size();i++) {
+ TuioListener listener = (TuioListener)listenerList.elementAt(i);
+ if (listener!=null) listener.updateTuioObject(updateObject);
+ }
+ }
+ }
+
+ for (int i=0;i<listenerList.size();i++) {
+ TuioListener listener = (TuioListener)listenerList.elementAt(i);
+ if (listener!=null) listener.refresh(new TuioTime(currentTime));
+ }
+
+ Vector<Long> 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;i<args.length;i++) {
+ // get the message content
+ long s_id = ((Integer)args[i]).longValue();
+ newCursorList.addElement(s_id);
+ // reduce the cursor list to the lost cursors
+ if (aliveCursorList.contains(s_id))
+ aliveCursorList.removeElement(s_id);
+ }
+
+ // remove the remaining cursors
+ for (int i=0;i<aliveCursorList.size();i++) {
+ TuioCursor removeCursor = cursorList.get(aliveCursorList.elementAt(i));
+ if (removeCursor==null) continue;
+ removeCursor.remove(currentTime);
+ frameCursors.addElement(removeCursor);
+ }
+
+ } else if (command.equals("fseq")) {
+ long fseq = ((Integer)args[1]).longValue();
+ boolean lateFrame = false;
+
+ if (fseq>0) {
+ 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<TuioCursor> 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;i<listenerList.size();i++) {
+ TuioListener listener = (TuioListener)listenerList.elementAt(i);
+ if (listener!=null) listener.removeTuioCursor(removeCursor);
+ }
+
+ cursorList.remove(removeCursor.getSessionID());
+
+ if (removeCursor.getCursorID()==maxCursorID) {
+ maxCursorID = -1;
+ if (cursorList.size()>0) {
+ Enumeration<TuioCursor> clist = cursorList.elements();
+ while (clist.hasMoreElements()) {
+ int c_id = clist.nextElement().getCursorID();
+ if (c_id>maxCursorID) maxCursorID=c_id;
+ }
+
+ Enumeration<TuioCursor> 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()<maxCursorID) {
+ freeCursorList.addElement(removeCursor);
+ }
+
+ break;
+
+ case TuioCursor.TUIO_ADDED:
+
+ int c_id = cursorList.size();
+ if ((cursorList.size()<=maxCursorID) && (freeCursorList.size()>0)) {
+ TuioCursor closestCursor = freeCursorList.firstElement();
+ Enumeration<TuioCursor> testList = freeCursorList.elements();
+ while (testList.hasMoreElements()) {
+ TuioCursor testCursor = testList.nextElement();
+ if (testCursor.getDistance(tcur)<closestCursor.getDistance(tcur)) closestCursor = testCursor;
+ }
+ c_id = closestCursor.getCursorID();
+ freeCursorList.removeElement(closestCursor);
+ } else maxCursorID = c_id;
+
+ TuioCursor addCursor = new TuioCursor(currentTime,tcur.getSessionID(),c_id,tcur.getX(),tcur.getY(),tcur.getZ());
+ cursorList.put(addCursor.getSessionID(),addCursor);
+
+ for (int i=0;i<listenerList.size();i++) {
+ TuioListener listener = (TuioListener)listenerList.elementAt(i);
+ if (listener!=null) listener.addTuioCursor(addCursor);
+ }
+ break;
+
+ default:
+
+ TuioCursor updateCursor = cursorList.get(tcur.getSessionID());
+ if ( (tcur.getX()!=updateCursor.getX() && tcur.getXSpeed()==0) || (tcur.getY()!=updateCursor.getY() && tcur.getYSpeed()==0) || (tcur.getZ()!=updateCursor.getZ()) )
+ updateCursor.update(currentTime,tcur.getX(),tcur.getY(),tcur.getZ());
+ else
+ updateCursor.update(currentTime,tcur.getX(),tcur.getY(),tcur.getZ(),tcur.getXSpeed(),tcur.getYSpeed(),tcur.getMotionAccel());
+
+ for (int i=0;i<listenerList.size();i++) {
+ TuioListener listener = (TuioListener)listenerList.elementAt(i);
+ if (listener!=null) listener.updateTuioCursor(updateCursor);
+ }
+ }
+ }
+
+ for (int i=0;i<listenerList.size();i++) {
+ TuioListener listener = (TuioListener)listenerList.elementAt(i);
+ if (listener!=null) listener.refresh(new TuioTime(currentTime));
+ }
+
+ Vector<Long> 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;i<args.length;i++) {
+ // get the message content
+ long s_id = ((Integer)args[i]).longValue();
+ newStringList.addElement(s_id);
+ // reduce the cursor list to the lost cursors
+ if (aliveStringList.contains(s_id))
+ aliveStringList.removeElement(s_id);
+ }
+
+ // remove the remaining cursors
+ for (int i=0;i<aliveStringList.size();i++) {
+ TuioString removeString = stringList.get(aliveStringList.elementAt(i));
+ if (removeString==null) continue;
+ removeString.remove(currentTime);
+ frameStrings.addElement(removeString);
+ }
+
+ } else if (command.equals("fseq")) {
+ long fseq = ((Integer)args[1]).longValue();
+ boolean lateFrame = false;
+
+ if (fseq>0) {
+ 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<TuioString> 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;i<listenerList.size();i++) {
+ TuioListener listener = (TuioListener)listenerList.elementAt(i);
+ if (listener!=null) listener.removeTuioString(removeString);
+ }
+
+ stringList.remove(removeString.getSessionID());
+
+ if (removeString.getStringID()==maxStringID) {
+ maxStringID = -1;
+ if (stringList.size()>0) {
+ Enumeration<TuioString> slist = stringList.elements();
+ while (slist.hasMoreElements()) {
+ int sl_id = slist.nextElement().getStringID();
+ if (sl_id>maxStringID) maxStringID=sl_id;
+ }
+
+ Enumeration<TuioString> 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()<maxStringID) {
+ freeStringList.addElement(removeString);
+ }
+
+ break;
+
+ case TuioString.TUIO_ADDED:
+
+ int sl_id = stringList.size();
+ if ((stringList.size()<=maxStringID) && (freeStringList.size()>0)) {
+ TuioString closestString = freeStringList.firstElement();
+ Enumeration<TuioString> testList = freeStringList.elements();
+ while (testList.hasMoreElements()) {
+ TuioString testString = testList.nextElement();
+ //if (testString.getDistance(tstr)<closestString.getDistance(tstr))
+ closestString = testString;
+ }
+ sl_id = closestString.getStringID();
+ freeStringList.removeElement(closestString);
+ } else maxStringID = sl_id;
+
+ TuioString addString = new TuioString(currentTime,tstr.getSessionID(),sl_id,tstr.getMessage());
+ stringList.put(addString.getSessionID(),addString);
+
+ for (int i=0;i<listenerList.size();i++) {
+ TuioListener listener = (TuioListener)listenerList.elementAt(i);
+ if (listener!=null) listener.addTuioString(addString);
+ }
+ break;
+
+ default:
+
+ TuioString updateString = stringList.get(tstr.getSessionID());
+ if ( tstr.getMessage()!=updateString.getMessage() )
+ updateString.update(currentTime,tstr.getMessage());
+ else
+ updateString.update(currentTime,tstr.getMessage());
+
+ for (int i=0;i<listenerList.size();i++) {
+ TuioListener listener = (TuioListener)listenerList.elementAt(i);
+ if (listener!=null) listener.updateTuioString(updateString);
+ }
+ }
+ }
+
+ for (int i=0;i<listenerList.size();i++) {
+ TuioListener listener = (TuioListener)listenerList.elementAt(i);
+ if (listener!=null) listener.refresh(new TuioTime(currentTime));
+ }
+
+ Vector<Long> buffer = aliveStringList;
+ aliveStringList = newStringList;
+ // recycling the vector
+ newStringList = buffer;
+ }
+
+ frameStrings.clear();
+ }
+ }
+
+
+ }
+}
--- 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 <mkalten@iua.upf.edu>
-
- 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<TuioPoint> 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<TuioPoint>();
- 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<TuioPoint>();
- 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<TuioPoint>();
- 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<TuioPoint>();
- 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<TuioPoint>();
- 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<TuioPoint> 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 <mkalten@iua.upf.edu>
+
+ 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<TuioPoint> 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<TuioPoint>();
+ 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<TuioPoint>();
+ 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<TuioPoint>();
+ 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<TuioPoint>();
+ 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<TuioPoint>();
+ 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<TuioPoint> 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;
+ }
+
+}
--- 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 <mkalten@iua.upf.edu>
-
- 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 <mkalten@iua.upf.edu>
+
+ 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;
+ }
+
+}
--- 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 <mkalten@iua.upf.edu>
-
- 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.<P>
- * 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.<P>
- * <code>
- * public class MyTuioListener implements TuioListener<br/>
- * ...</code><p><code>
- * MyTuioListener listener = new MyTuioListener();<br/>
- * TuioClient client = new TuioClient();<br/>
- * client.addTuioListener(listener);<br/>
- * client.start();<br/>
- * </code>
- *
- * @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 <mkalten@iua.upf.edu>
+
+ 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.<P>
+ * 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.<P>
+ * <code>
+ * public class MyTuioListener implements TuioListener<br/>
+ * ...</code><p><code>
+ * MyTuioListener listener = new MyTuioListener();<br/>
+ * TuioClient client = new TuioClient();<br/>
+ * client.addTuioListener(listener);<br/>
+ * client.start();<br/>
+ * </code>
+ *
+ * @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);
+}
--- 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 <mkalten@iua.upf.edu>
-
- 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 <mkalten@iua.upf.edu>
+
+ 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;
+ }
+
+}
--- 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 <mkalten@iua.upf.edu>
-
- 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 <mkalten@iua.upf.edu>
+
+ 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);
+ }
+}
--- 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;
+ }
+}
--- 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 <mkalten@iua.upf.edu>
-
- 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 <mkalten@iua.upf.edu>
+
+ 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);
+ }
+}
--- 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 <mkalten@iua.upf.edu>
-
- 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 <mkalten@iua.upf.edu>
+
+ 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 ) {
+ }
+}
--- 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 <mkalten@iua.upf.edu>
-
- 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 <mkalten@iua.upf.edu>
+
+ 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);
+ }
+ }
+
+}
--- 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 <mkalten@iua.upf.edu>
-
- 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<Long,TuioDemoObject> objectList = new Hashtable<Long,TuioDemoObject>();
- private Hashtable<Long,TuioCursor> cursorList = new Hashtable<Long,TuioCursor>();
- private Hashtable<Long,TuioString> stringList = new Hashtable<Long,TuioString>();
-
- 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<TuioCursor> cursors = cursorList.elements();
- while (cursors.hasMoreElements()) {
- TuioCursor tcur = cursors.nextElement();
- if (tcur==null) continue;
- Vector<TuioPoint> 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<path.size();i++) {
- TuioPoint next_point = path.elementAt(i);
- g2.drawLine(current_point.getScreenX(w), current_point.getScreenY(h), next_point.getScreenX(w), next_point.getScreenY(h));
- current_point = next_point;
- }
- }
-
- // draw the finger tip
- g2.setPaint(Color.lightGray);
- int s = (int)(scale*finger_size);
- g2.fillOval(current_point.getScreenX(w-s/2),current_point.getScreenY(h-s/2),s,s);
- g2.setPaint(Color.black);
- g2.drawString(tcur.getCursorID()+"",current_point.getScreenX(w),current_point.getScreenY(h));
- }
-
- // draw the objects
- Enumeration<TuioDemoObject> 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 <mkalten@iua.upf.edu>
+
+ 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<Long,TuioDemoObject> objectList = new Hashtable<Long,TuioDemoObject>();
+ private Hashtable<Long,TuioCursor> cursorList = new Hashtable<Long,TuioCursor>();
+ private Hashtable<Long,TuioString> stringList = new Hashtable<Long,TuioString>();
+
+ 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<TuioCursor> cursors = cursorList.elements();
+ while (cursors.hasMoreElements()) {
+ TuioCursor tcur = cursors.nextElement();
+ if (tcur==null) continue;
+ Vector<TuioPoint> 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<path.size();i++) {
+ TuioPoint next_point = path.elementAt(i);
+ g2.drawLine(current_point.getScreenX(w), current_point.getScreenY(h), next_point.getScreenX(w), next_point.getScreenY(h));
+ current_point = next_point;
+ }
+ }
+
+ // draw the finger tip
+ g2.setPaint(Color.lightGray);
+ int s = (int)(scale*finger_size);
+ g2.fillOval(current_point.getScreenX(w-s/2),current_point.getScreenY(h-s/2),s,s);
+ g2.setPaint(Color.black);
+ g2.drawString(tcur.getCursorID()+"",current_point.getScreenX(w),current_point.getScreenY(h));
+ }
+
+ // draw the objects
+ Enumeration<TuioDemoObject> objects = objectList.elements();
+ while (objects.hasMoreElements()) {
+ TuioDemoObject tobj = objects.nextElement();
+ if (tobj!=null) tobj.paint(g2, width,height);
+ }
+ }
+}
--- 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 <mkalten@iua.upf.edu>
-
- 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 <mkalten@iua.upf.edu>
+
+ 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);
+ }
+
+}
--- 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 <mkalten@iua.upf.edu>
-
- 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 <mkalten@iua.upf.edu>
+
+ 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();
+ }
+}
--- 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<OSCPacket> 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<OSCPacket>(newPackets.length);
- for (int i = 0; i < newPackets.length; i++) {
- packets.add(newPackets[i]);
- }
- } else
- packets = new Vector<OSCPacket>();
- 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<OSCPacket> 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<OSCPacket>(newPackets.length);
+ for (int i = 0; i < newPackets.length; i++) {
+ packets.add(newPackets[i]);
+ }
+ } else
+ packets = new Vector<OSCPacket>();
+ 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
--- 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
+ }
+*/
+}
--- 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);
+
+}
--- 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<Object> 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<Object>();
- }
-
- /**
- * 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<Object>(newArguments.length);
- for (int i = 0; i < newArguments.length; i++) {
- arguments.add(newArguments[i]);
- }
- } else
- arguments = new Vector<Object>();
- 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<Object> 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<Object>();
+ }
+
+ /**
+ * 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<Object>(newArguments.length);
+ for (int i = 0; i < newArguments.length; i++) {
+ arguments.add(newArguments[i]);
+ }
+ } else
+ arguments = new Vector<Object>();
+ 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
--- 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
--- 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();
+ }
+
+}
--- 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();
+ }
+
+}
--- 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);
+ }
+}
--- 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);
+ }
+
+}
+
--- 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"); }
+ }
+
+}
--- 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<String,OSCListener> addressToClassTable = new Hashtable<String,OSCListener>();
-
- /**
- *
- */
- 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<String,OSCListener> addressToClassTable = new Hashtable<String,OSCListener>();
+
+ /**
+ *
+ */
+ 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);
+ }
+ }
+ }
+}
--- 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.*;
--- 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;
--- 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 <http://www.iri.centrepompidou.fr/>
--- 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 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
--- 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 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
--- 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 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
--- 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 @@
-<!--
+<!--
/*
* This file is part of the TraKERS\Middleware package.
*
--- a/middleware/Debug/DebugParameters.xaml.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Debug/DebugParameters.xaml.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/Debug/DebugWindow.xaml Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Debug/DebugWindow.xaml Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-<!--
+<!--
/*
* This file is part of the TraKERS\Middleware package.
*
--- a/middleware/Debug/DebugWindow.xaml.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Debug/DebugWindow.xaml.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/Debug/Properties/AssemblyInfo.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Debug/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;
--- a/middleware/Debug/Properties/Resources.Designer.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Debug/Properties/Resources.Designer.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.261
--- a/middleware/Debug/Properties/Resources.resx Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Debug/Properties/Resources.resx Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
--- a/middleware/Debug/Properties/Settings.Designer.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Debug/Properties/Settings.Designer.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.261
--- a/middleware/Debug/Properties/Settings.settings Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Debug/Properties/Settings.settings Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='utf-8'?>
+<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Trakers.Debug.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
--- a/middleware/Debug/Settings.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Debug/Settings.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/Tracking/Search/Comparator.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Tracking/Search/Comparator.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/Tracking/Search/Constructor.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Tracking/Search/Constructor.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/Tracking/Search/Curve.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Tracking/Search/Curve.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/Tracking/Search/Dictionnary.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Tracking/Search/Dictionnary.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/Tracking/Search/Segment.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Tracking/Search/Segment.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/Tracking/Search/Segmenter.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Tracking/Search/Segmenter.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/Tracking/Search/Structure.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/Tracking/Search/Structure.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/extern/TuioServer/Tuio.Test/App.xaml Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/Tuio.Test/App.xaml Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-<Application x:Class="Tuio.Test.App"
+<Application x:Class="Tuio.Test.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
--- a/middleware/extern/TuioServer/Tuio.Test/App.xaml.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/Tuio.Test/App.xaml.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
--- a/middleware/extern/TuioServer/Tuio.Test/MainWindow.xaml Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/Tuio.Test/MainWindow.xaml Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-<Window x:Class="Tuio.Test.MainWindow"
+<Window x:Class="Tuio.Test.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="480" Width="640"
--- a/middleware/extern/TuioServer/Tuio.Test/MainWindow.xaml.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/Tuio.Test/MainWindow.xaml.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
--- a/middleware/extern/TuioServer/Tuio.Test/Properties/AssemblyInfo.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/Tuio.Test/Properties/AssemblyInfo.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-using System.Reflection;
+using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
--- a/middleware/extern/TuioServer/Tuio.Test/Properties/Resources.Designer.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/Tuio.Test/Properties/Resources.Designer.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
--- a/middleware/extern/TuioServer/Tuio.Test/Properties/Resources.resx Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/Tuio.Test/Properties/Resources.resx Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
--- a/middleware/extern/TuioServer/Tuio.Test/Properties/Settings.Designer.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/Tuio.Test/Properties/Settings.Designer.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
--- a/middleware/extern/TuioServer/Tuio.Test/Properties/Settings.settings Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/Tuio.Test/Properties/Settings.settings Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='utf-8'?>
+<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
--- a/middleware/extern/TuioServer/Tuio.Test/Tuio.Test.csproj Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/Tuio.Test/Tuio.Test.csproj Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
--- a/middleware/extern/TuioServer/TuioServer/Properties/AssemblyInfo.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/TuioServer/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;
--- a/middleware/extern/TuioServer/TuioServer/TuioCursor.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/TuioServer/TuioCursor.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
@@ -11,13 +11,15 @@
/// TUIO cursor.
///
/// (c) 2010 by Dominik Schmidt (schmidtd@comp.lancs.ac.uk)
+ /// Modified by alexandre.bastien@iri.centrepompidou.fr
+ /// Location function added.
/// </summary>
public class TuioCursor
{
#region properties
public int Id { get; private set; }
-
+
public Point3D Location { get; set; }
public PointF Speed { get; set; }
--- a/middleware/extern/TuioServer/TuioServer/TuioServer.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/TuioServer/TuioServer.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
@@ -20,6 +20,7 @@
/// Allways commits all cursors.
///
/// (c) 2010 by Dominik Schmidt (schmidtd@comp.lancs.ac.uk)
+ /// Modified by alexandre.bastien@iri.centrepompidou.fr
/// </summary>
public class TuioServer
{
--- a/middleware/extern/TuioServer/TuioServer/TuioString.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/extern/TuioServer/TuioServer/TuioString.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
@@ -11,6 +11,7 @@
/// TUIO cursor.
///
/// (c) 2010 by Dominik Schmidt (schmidtd@comp.lancs.ac.uk)
+ /// Class added by alexandre.bastien@iri.centrepompidou.fr
/// </summary>
public class TuioString
{
--- a/middleware/src/MainClass.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainClass.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/BendEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/BendEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/BendListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/BendListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/CircleEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/CircleEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/CircleListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/CircleListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/CrossEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/CrossEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/CrossListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/CrossListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/JumpEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/JumpEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/JumpListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/JumpListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/KneeUpEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/KneeUpEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/KneeUpListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/KneeUpListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/LeftHandQuitEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/LeftHandQuitEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/LeftHandQuitListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/LeftHandQuitListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/LeftHandTrackedEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/LeftHandTrackedEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/LeftHandTrackedListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/LeftHandTrackedListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/MainEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/MainEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/ModChangeEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/ModChangeEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/ModChangeListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/ModChangeListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/PushEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/PushEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/PushListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/PushListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/RightHandQuitEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/RightHandQuitEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/RightHandQuitListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/RightHandQuitListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/RightHandTrackedEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/RightHandTrackedEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/RightHandTrackedListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/RightHandTrackedListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/SwipeEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/SwipeEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/SwipeListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/SwipeListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/UserPositionEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/UserPositionEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/UserPositionListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/UserPositionListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/WaveEventArgs.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/WaveEventArgs.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/Events/WaveListener.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/Events/WaveListener.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/KinectMain.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/KinectMain.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/MainModule/ModeManagement.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/MainModule/ModeManagement.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* This file is part of the TraKERS\Middleware package.
*
* (c) IRI <http://www.iri.centrepompidou.fr/>
--- a/middleware/src/Properties/AssemblyInfo.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/Properties/AssemblyInfo.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-using System.Reflection;
+using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
--- a/middleware/src/Properties/Resources.Designer.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/Properties/Resources.Designer.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.261
--- a/middleware/src/Properties/Resources.resx Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/Properties/Resources.resx Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
--- a/middleware/src/Properties/Settings.Designer.cs Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/Properties/Settings.Designer.cs Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.239
--- a/middleware/src/Properties/Settings.settings Thu Apr 12 13:09:46 2012 +0200
+++ b/middleware/src/Properties/Settings.settings Thu Apr 12 15:33:25 2012 +0200
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='utf-8'?>
+<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />