inheritance tree
DumpOSC
class definition
Implements an Oz interface to dumpOSC for receiving OSC packets at a given port. Ineternally, the textual output of dumpOSC is parsed into Oz values, and a stream of OSC messages in the format described above is provided.
Please note that dumpOSC is called in a terminal (xterm), and its output is send by netcat via a socket to Oz (on MacOS X, X11 is started if not already running). See above for an explanation.
Also, note that several clients can send to dumpOSC, but no information who sends is transmitted (e.g., no sender IP). If knowing the sender is important, just include your sender in your OSC messages :)
class DumpOSC (Inheritance-free)
feat defaultResponderAddr dumpOSC myParser myScanner netcatPort oscs pipe responders
attr bundleResponder counter
- DecrCounter()
Decrement the brackets (i.e. bundles nesting) counter by 1.
- ExistsOpenBundle($)
- IncrCounter()
Increment the brackets (i.e. bundles nesting) counter by 1.
- ParseAll($ prevLines:PrevLines)
Parses any textual output of OSC messages and bundles and returns it as a stream of values in the OSC format (see above). The arg prevLines is only for internal use (accumulation of lines).
NB: ParseAll must be called in its own thread.
- ParseVS(Result VS)
Transforms a VS of valid OSC messages (output of dumpOSC) into a list of values in the OSC format (see above).
- ProcessResponders()
- addResponder(Address Proc)
Installs a new responder for any OSC message with the address pattern Address (an atom). Whenever such a message is received, Proc (a binary procedure) is called. The first argument is a timetag (the timetag of the bundle in which the message was contained, or 1), and the second argument is the Message (in internal OSC format, that is a record whose label is the message address, see above for details).
In contrast to a SuperCollider OSCresponder, the sender address is not added, as the information about the sender is not provided by dumpOSC (if required, consider enclosing the address in the message).
Multiple responders can be installed for the same Address, in which case all their Procs will be applied to each matching message (last applied responder first).
- close()
Stop dumpOSC interface and close its ressources.
- getOSCs($)
Returns a stream of OSC messages received by dumpOSC in the internal OSC format described above. Many receivers can call this method for accessing the OSC packages.
- init(port:Port)
Initialises dumpOSC interface to receive at port Port (defaults to 7777).
- removeResponder(Address)
Deinstalls all responders for Address.
- setBundleResponder(Proc)
Installs a new bundle responder: The unary procedure proc will be called whenever a bundle (a list) is received, with the timetag as first list element. The timetag is obligatory, but it may be 1 (meaning now).
Please note that there is always only a single bundleResponder installed. Setting a new responder overwrites the old one.
- setDefaultResponder(Proc)
Installs a new responder like addResponder. However, this responder Proc is called always whenever no responder installed with addResponder matches.
Please note that there is always only a single default responder installed. Setting a new default responder overwrites the old one.
- setResponder(Address Proc)
Deinstalls all responders for Address and adds the new responder Proc. See addResponder for details.
end