diff -r f4303074311f -r e4e5f02787a1 front_idill/extern/fajran-npTuioClient/TuioClient/TuioClient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/TuioClient.h Fri Apr 06 10:44:54 2012 +0200 @@ -0,0 +1,103 @@ +/* + TUIO C++ Library - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2008 Martin Kaltenbrunner + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (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 +*/ + +#ifndef INCLUDED_TUIOCLIENT_H +#define INCLUDED_TUIOCLIENT_H + +#ifndef WIN32 +#include +#include +#else +#include +#endif + +#include +#include +#include + +#include "osc/OscReceivedElements.h" +#include "osc/OscPrintReceivedElements.h" + +#include "ip/UdpSocket.h" +#include "ip/PacketListener.h" + +#include "TuioListener.h" +#include "TuioObject.h" +#include "TuioCursor.h" + +using namespace osc; + +class TuioClient : public PacketListener { + + 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); + std::list getTuioObjects(); + std::list getTuioCursors(); + + void addTuioListener(TuioListener *listener); + void removeTuioListener(TuioListener *listener); + + void ProcessPacket( const char *data, int size, const IpEndpointName& remoteEndpoint ); + + UdpListeningReceiveSocket *socket; + + protected: + void ProcessBundle( const ReceivedBundle& b, const IpEndpointName& remoteEndpoint); + void ProcessMessage( const ReceivedMessage& m, const IpEndpointName& remoteEndpoint); + + private: + std::list listenerList; + + std::list objectList; + std::list aliveObjectList, objectBuffer; + std::list cursorList; + std::list aliveCursorList, cursorBuffer; + + int32 currentFrame, lastFrame; + + long startTime; + long lastTime; + long getCurrentTime(); + + std::list freeCursorList, freeCursorBuffer; + int maxFingerID; + + #ifndef WIN32 + pthread_t thread; + #else + HANDLE thread; + #endif + + bool locked; + bool running; +}; + +#endif /* INCLUDED_TUIOCLIENT_H */