OscCallback

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph cluster_builtins { graph [label=builtins]; node [color=1]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } subgraph "cluster_supriya.osc" { graph [label="supriya.osc"]; node [color=2]; "supriya.osc.OscCallback.OscCallback" [URL="../api/supriya/osc/OscCallback.html#supriya.osc.OscCallback.OscCallback", color=black, fontcolor=white, label="Osc\nCallback", target=_top]; } subgraph "cluster_supriya.system" { graph [label="supriya.system"]; node [color=3]; "supriya.system.SupriyaObject.SupriyaObject" [URL="../api/supriya/osc/../system/SupriyaObject.html#supriya.system.SupriyaObject.SupriyaObject", label="Supriya\nObject", target=_top]; } "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "supriya.system.SupriyaObject.SupriyaObject" -> "supriya.osc.OscCallback.OscCallback"; }

class supriya.osc.OscCallback.OscCallback(address_pattern=None, argument_template=None, is_one_shot=False, procedure=None)[source]

An OSC callback.

>>> import supriya.osc
>>> callback = supriya.osc.OscCallback(
...     address_pattern='/*',
...     procedure=lambda x: print('GOT:', x),
...     )

Attributes Summary

__call__ Call self as a function.
address_pattern The address pattern of the callback.
argument_template
is_one_shot Is true when the callback should be unregistered after being called.
procedure Gets the procedure to be called.

Special methods

__call__(message)[source]

Call self as a function.

(SupriyaObject).__repr__()

Return repr(self).


Read-only properties

address_pattern

The address pattern of the callback.

>>> callback = supriya.osc.OscCallback(
...     address_pattern='/*',
...     procedure=lambda x: print('GOT:', x),
...     )
>>> callback.address_pattern
'/*'

Returns string.

argument_template
is_one_shot

Is true when the callback should be unregistered after being called.

>>> callback = supriya.osc.OscCallback(
...     address_pattern='/*',
...     procedure=lambda x: print('GOT:', x),
...     )
>>> callback.is_one_shot
False

Returns boolean.

procedure

Gets the procedure to be called.

Returns callable.