|
FreeJ scripting | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object
|
+--Controller
|
+--OscController
The OscController holds a list of defined methods scripted to
execute actions when they are called from a OSC client across the
network.
// open an OSC listener on port 9696
// please note the port is a number in quotes
osc = new OscController("9696");
// create the callback function that will be called
osc.test_callback = function test_callback(i,f,s) {
echo("OSC remote call to my test function");
echo("int argument is: " + i);
echo("float argument is: " + f);
echo("string argument is: " + s);
return true;
};
// assign my test_callback to an OSC method, declaring the arguments that will
// be passed in a string sequence: i -> int32 , f -> float , s -> string
osc.add_method("/test","ifs","test_callback");
// starts the osc listener thread
osc.start();
// to stop it during execution use osc.stop();
// and don't forget to register the controller
register_controller(osc);
// now you can call the method /test with arguments, for example:
// using the OSC message "/test,123,6.66,hello_world" on port 9696
| Constructor Summary | |
OscController()
The OscController constructor creates a scriptable network listener for OSC protocol commands |
|
| Method Summary | |
Object
|
add_method(<string> osc_method, <string> prototype, <string> js_method)
Add a method that will be called from OSC |
| Methods inherited from class Controller |
activate, get_name
|
| Constructor Detail |
OscController()
| Method Detail |
Object add_method(<string> osc_method, <string> prototype, <string> js_method)
osc_method - The name of the OSC method to be served
prototype - A string listing the arguments accepted: i=int, f=float, s=string
js_method - The javascript function that will be called and passed the arguments
|
FreeJ scripting | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
FreeJ scripting documentation is Copyleft (C) 2000 - 2007 dyne.org foundation. Verbatim copying and distribution of this entire page is permitted in any medium, provided this notice is preserved.