OSCFunc (and its subclass OSCdef) registers one or more functions to respond to an incoming OSC message which matches a specified OSC Address. Many of its methods are inherited from its superclass AbstractResponderFunc. OSCFunc supports pattern matching of wildcards etc. in incoming messages. For efficiency reasons you must specify that an OSCFunc will employ pattern matching by creating it with the *newMatching method, or by passing a matching dispatcher to *new. For details on the Open Sound Control protocol, see http://opensoundcontrol.org/spec-1_0.html
Get or set the default dispatcher object for OSCFuncs (this is what you get if you pass nil as the dispatcher argument to *new). This object will decide if any of its registered OSCFuncs should respond to an incoming OSC message.
By default this will be an OSCMessageDispatcher, but it can be set to any instance of an appropriate subclass of AbstractDispatcher.
Get or set the default matching dispatcher object for OSCFuncs (this is what you get if when you create an OSCFunc using *newMatching). This object will decide if any of its registered OSCFuncs should respond to an incoming OSC message using pattern matching.
By default this will be an OSCMessagePatternDispatcher, but it can be set to any instance of an appropriate subclass of AbstractDispatcher.
Create a new, enabled OSCFunc.
func |
A Function or similar object which will respond to the incoming message. When evaluated it will be passed the following arguments:
| ||||||||
path |
A Symbol indicating the path of the OSC address of this object. Note that OSCFunc demands OSC compliant addresses. If the path does not begin with a / one will be added automatically. | ||||||||
srcID |
An optional instance of NetAddr indicating the IP address of the sender. If set this object will only respond to messages from that source. | ||||||||
recvPort |
An optional Integer indicating the port on which messages will be received. If set this object will only respond to message received on that port. This method calls Main: -openUDPPort to ensure that the port is opened. | ||||||||
argTemplate |
An optional Array composed of instances of Integer or Function (or objects which respond to the method Methods: matchItem) used to match the arguments of an incoming OSC message. If a Function, it will be evaluated with the corresponding message arg as an argument, and should return a Boolean indicating whether the argument matches and this OSCFunc should respond (providing all other arguments match). Template values of nil will match any incoming argument value. | ||||||||
dispatcher |
An optional instance of an appropriate subclass of AbstractDispatcher. This can be used to allow for customised dispatching. Normally this should not be needed. |
A new instance of OSCFunc.
A convenience method to create a new, enabled OSCFunc whose dispatcher will perform pattern matching on incoming OSC messages to see if their address patterns match this object's path.
func |
A Function or similar object which will respond to the incoming message. When evaluated it will be passed the arguments msg, time, addr, and recvPort, corresponding to the message as an Array [OSCAddress, other args], the time that the message was sent, a NetAddr corresponding to the IP address of the sender, and an Integer corresponding to the port on which the message was received. |
path |
A Symbol indicating the path of the OSC address of this object. Note that OSCFunc demands OSC compliant addresses. If the path does not begin with a / one will be added automatically. Pattern matching will be applied to any incoming messages to see if they match this address. Note that according to the OSC spec, regular expression wildcards are only permitted in the incoming message's address pattern. Thus path should not contain wildcards. For more details on OSC pattern matching, see http://opensoundcontrol.org/spec-1_0 |
srcID |
An optional instance of NetAddr indicating the IP address of the sender. If set this object will only respond to messages from that source. |
recvPort |
An optional Integer indicating the port on which messages will be received. |
argTemplate |
An optional Array composed of instances of Integer or Function (or objects which respond to the method Methods: matchItem) used to match the arguments of an incoming OSC message. If a Function, it will be evaluated with the corresponding message arg as an argument, and should return a Boolean indicating whether the argument matches and this OSCFunc should respond (providing all other arguments match). Template values of nil will match any incoming argument value. |
A new instance of OSCFunc.
A convenience method which dumps all incoming OSC messages.
bool |
A Boolean indicating whether dumping is on or off. |
hideStatusMsg |
A Boolean indicating whether server status messages are excluded from the dump or not. |