SETO_OSCServer

superclass: SETOServer


/*

Author: 

2004, 2005, 2006, 2007, 2008

Till Bovermann 

Neuroinformatics Group 

Faculty of Technology 

Bielefeld University

Germany

*/


a server fullfilling the TUIO-Specs (bielefeld flavour).

For a server to be used with e.g. reacTIVision, see SETO_OSCTUIOServer

drawbacks:

no 'P' symbols are yet handled...




*new(formatString, netaddr, setoClass)

formatString a format String (explained in [SETObject])

netaddr a netaddr default nothing, listening to all. 

setoClass the Class of the created objects. 

Must be a subclass of [SETObject], defaults to SETObject.


start

starts listening

stop

stops litening

gui

creates a gui representing recognized objects




Examples / Tests:


// create a server and start it...

(

// ... listening to all messages from priamos

//t = SETO_OSCServer('_ixya', NetAddr("priamos.techfak.uni-bielefeld.de", nil)); 

// ... or

t = SETO_OSCServer("_ixya", nil, SETObject); // listen to all messages from anywhere

t.start;

// inspect its behavior

//i = t.inspect;


g = t.gui;



// send him messages

a = NetAddr.localAddr;


a.sendMsg("/tuio/_ixya", \set, 1, 42, 0.5, 0.5, 2pi.rand, 0, 0, 0); 

a.sendMsg('/tuio/_ixya', \alive, 1);

i.update;


)


a.sendMsg('/tuio/_ixya', \set, 2, 42, 0.5, 0.8, 2pi.rand, 0, 0, 0);

a.sendMsg('/tuio/_ixya', \alive, 1, 2);

i.update;


a.sendMsg('/tuio/_ixya', \set, 3, 42, 0.5, 0.6, 2pi.rand, 0, 0, 0);

a.sendMsg('/tuio/_ixya', \alive, 1, 2, 3);

i.update;


a.sendMsg('/tuio/_ixya', \set, 4, 42, 0.5, 0.5, 2pi.rand, 0, 0, 0);

a.sendMsg('/tuio/_ixya', \alive, 1, 2, 3, 4);

i.update;




// send alive messages

a.sendMsg('/tuio/_ixya', \alive, 1, 2);

i.update

// 5 does not exist

a.sendMsg('/tuio/_ixya', \alive, 1, 2, 5);

i.update


a.sendMsg('/tuio/_ixya', \alive);

i.update;




t.stop





// create a server and start it... now using 3D axis notation

(

// ... listening to all messages from priamos

//t = SETO_OSCServer('_ixya', NetAddr("priamos.techfak.uni-bielefeld.de", nil)); 

// ... or

t = SETO_OSCServer("_ixyzuvw", nil, SETObject); // listen to all messages from anywhere

t.start;

// inspect its behavior

i = t.inspect;


g = t.gui;



// send him messages

n = NetAddr.localAddr;


n.sendMsg('/tuio/_ixyzuvw', \set, 1, 42, 0.7.rand, 0.5, 2pi.rand, 10, 20, 30.rand); 

n.sendMsg('/tuio/_ixyzuvw', \alive, 1);

i.update;


)