Instances of AbstractDispatcher dispatch incoming messages (e.g. MIDI, OSC), to registered instances of AbstractResponderFunc. There will be a default dispatcher for each message type, but one can have multiple dispatchers per type in order to implement custom dispatching for groups of ResponderFuncs. (The main example of this is OSC pattern matching with OSCMessagePatternDispatcher.) Normally users do not need to access dispatcher instances directly.
Dispatchers must be registered at the appropriate central point (e.g. Main:recvOSCfunc for OSC messages). In this capacity their interfaces mimic Function and FunctionList.
Make a new dispatcher.
A new instance.
Add a responder func to this dispatcher. Subclasses should override this to do any necessary bookkeeping. Generally this method should add this dispatcher as a dependant of the responder func, so that it can respond to any changes.
funcProxy |
An instance of a subclass of AbstractResponderFunc to add. |
Remove a responder func from this dispatcher.
funcProxy |
An instance of a subclass of AbstractResponderFunc to remove. |
Evaluate an incoming message to see if it matches. Subclasses should override this message to take appropriate arguments. If a matching responder func is found, this method should call value on it, passing the message.
As -value above, but with the arguments passed as a single Array. This method is needed so that subclasses can work in FunctionLists in central message registration points such as Main:recvOSCMessage.
args |
An Array containing the message and appropriate arguments. |
Register this dispatcher at the appropriate central point (e.g. Main:recvOSCfunc) to receive its message type. Subclasses should take care to not override any other registered objects. (So for example use Main:addOSCFunc for OSC messages rather than Main:recvOSCfunc_.) Generally speaking, dispatchers should register themselves automatically if needed when a responder func is added.
Remove this dispatcher from the appropriate central registration point, i.e. deactivate it. Generally speaking a dispatcher should unregister itself automatically when its last responder func is removed.
-unregister this dispatcher and remove it from *all. After this the dispatcher should be discarded.
Subclasses should override this method to return a key indicating the type of message this dispatcher responds to, e.g. 'OSC matched'
or 'MIDI control'
.
A Symbol.
Subclasses should override this to do any necessary updating when a dispatchers responder funcs indicate they have changed via the standard dependancy mechanism. The default implementation does nothing.