OscBundle

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.OscBundle.OscBundle" [URL="../api/supriya/osc/OscBundle.html#supriya.osc.OscBundle.OscBundle", color=black, fontcolor=white, label="Osc\nBundle", 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]; "supriya.system.SupriyaValueObject.SupriyaValueObject" [URL="../api/supriya/osc/../system/SupriyaValueObject.html#supriya.system.SupriyaValueObject.SupriyaValueObject", label="Supriya\nValue\nObject", target=_top]; "supriya.system.SupriyaObject.SupriyaObject" -> "supriya.system.SupriyaValueObject.SupriyaValueObject"; } "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "supriya.system.SupriyaValueObject.SupriyaValueObject" -> "supriya.osc.OscBundle.OscBundle"; }

class supriya.osc.OscBundle.OscBundle(timestamp=None, contents=None)[source]

An OSC bundle.

>>> import supriya.osc
>>> message_one = supriya.osc.OscMessage('/one', 1)
>>> message_two = supriya.osc.OscMessage('/two', 2)
>>> message_three = supriya.osc.OscMessage('/three', 3)
>>> inner_bundle = supriya.osc.OscBundle(
...     timestamp=1401557034.5,
...     contents=(message_one, message_two),
...     )
>>> inner_bundle
OscBundle(
    contents=(
        OscMessage('/one', 1),
        OscMessage('/two', 2),
        ),
    timestamp=1401557034.5,
    )
>>> outer_bundle = supriya.osc.OscBundle(
...     contents=(inner_bundle, message_three),
...     )
>>> outer_bundle
OscBundle(
    contents=(
        OscBundle(
            contents=(
                OscMessage('/one', 1),
                OscMessage('/two', 2),
                ),
            timestamp=1401557034.5,
            ),
        OscMessage('/three', 3),
        ),
    )
>>> datagram = outer_bundle.to_datagram()
>>> decoded_bundle = supriya.osc.OscBundle.from_datagram(datagram)
>>> decoded_bundle
OscBundle(
    contents=(
        OscBundle(
            contents=(
                OscMessage('/one', 1),
                OscMessage('/two', 2),
                ),
            timestamp=1401557034.5,
            ),
        OscMessage('/three', 3),
        ),
    )
>>> decoded_bundle == outer_bundle
True

Attributes Summary

__str__ Return str(self).
contents
datagram_is_bundle
from_datagram
timestamp
to_datagram
to_list

Special methods

(SupriyaValueObject).__copy__(*args)
(SupriyaValueObject).__eq__(expr)

Return self==value.

(SupriyaValueObject).__hash__()

Return hash(self).

(SupriyaObject).__repr__()

Return repr(self).

__str__()[source]

Return str(self).


Methods

to_datagram(realtime=True)[source]
to_list()[source]

Class & static methods

static datagram_is_bundle(datagram, offset=0)[source]
static from_datagram(datagram)[source]

Read-only properties

contents
timestamp