FreeJ scripting

Class OscController

Object
   |
   +--Controller
         |
         +--OscController

class OscController
extends Controller


The OscController holds a list of defined methods scripted to execute actions when they are called from a OSC client across the network.

Define new methods, their name will be exposed as OSC methods:
 // 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

 

Author: Steve Harris (liblo), Jaromil
Defined in Controller.js


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

OscController()

Method Detail

add_method

Object add_method(<string> osc_method, <string> prototype, <string> js_method)

FreeJ scripting

| 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.
Send inquiries & questions to dyne.org's hackers.
Documentation generated by JSDoc on Tue Aug 31 21:14:44 2010