BufferProxy

class supriya.tools.servertools.BufferProxy(buffer_id=None, channel_count=0, frame_count=0, sample_rate=0, server=None)[source]

A buffer proxy.

Acts as a singleton reference to a buffer on the server, tracking the state of a single buffer id and responding to /b_info messages. Multiple Buffer instances reference a single BufferProxy.

BufferProxy instances are created internally by the server, and should be treated as an implementation detail.

>>> server = servertools.Server()
>>> buffer_proxy = servertools.BufferProxy(
...     buffer_id=0,
...     server=server,
...     channel_count=2,
...     frame_count=441,
...     sample_rate=44100,
...     )
>>> buffer_proxy
BufferProxy(
    buffer_id=0,
    channel_count=2,
    frame_count=441,
    sample_rate=44100,
    server=Server(
        ip_address='127.0.0.1',
        port=57751
        )
    )

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=1, group=0, label=object, shape=box]; } subgraph cluster_servertools { graph [label=servertools]; "supriya.tools.servertools.BufferProxy.BufferProxy" [color=black, fontcolor=white, group=1, label=<<B>BufferProxy</B>>, shape=box, style="filled, rounded"]; } subgraph cluster_systemtools { graph [label=systemtools]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" [color=3, group=2, label=AbstractBase, shape=box]; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" [color=3, group=2, label=SupriyaObject, shape=box]; "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject" [color=3, group=2, label=SupriyaValueObject, shape=box]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" -> "supriya.tools.systemtools.SupriyaObject.SupriyaObject"; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" -> "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject"; } "builtins.object" -> "supriya.tools.systemtools.SupriyaObject.AbstractBase"; "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject" -> "supriya.tools.servertools.BufferProxy.BufferProxy"; }

Bases

Attribute summary

buffer_id Gets buffer id of buffer proxy.
channel_count Gets channel count of buffer proxy.
duration_in_seconds Gets duration in seconds of buffer proxy.
frame_count Gets frame count of buffer proxy.
sample_count Gets sample count of buffer proxy.
sample_rate Gets sample-rate of buffer proxy.
server Gets server of buffer proxy.
__copy__(*args)
__eq__(expr)
__float__() Gets float representation of buffer proxy.
__format__([format_specification]) Formats Supriya object.
__hash__()
__int__() Gets integer representation of buffer proxy.
__repr__() Gets interpreter representation of Supriya object.

Read-only properties

BufferProxy.buffer_id

Gets buffer id of buffer proxy.

>>> buffer_proxy.buffer_id
0

Returns integer.

BufferProxy.channel_count

Gets channel count of buffer proxy.

>>> buffer_proxy.channel_count
2

Returns integer.

BufferProxy.duration_in_seconds

Gets duration in seconds of buffer proxy.

>>> buffer_proxy.duration_in_seconds
0.01

Returns float.

BufferProxy.frame_count

Gets frame count of buffer proxy.

>>> buffer_proxy.frame_count
441

Returns integer.

BufferProxy.sample_count

Gets sample count of buffer proxy.

>>> buffer_proxy.sample_count
882

Returns integer.

BufferProxy.sample_rate

Gets sample-rate of buffer proxy.

>>> buffer_proxy.sample_rate
44100

Returns integer.

BufferProxy.server

Gets server of buffer proxy.

>>> buffer_proxy.server
<Server: udp://127.0.0.1:57751, 8i8o>

Returns server.

Special methods

(SupriyaValueObject).__copy__(*args)
(SupriyaValueObject).__eq__(expr)
BufferProxy.__float__()[source]

Gets float representation of buffer proxy.

>>> float(buffer_proxy)
0.0

Returns float.

(SupriyaObject).__format__(format_specification='')

Formats Supriya object.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘storage’.

Returns string.

(SupriyaValueObject).__hash__()
BufferProxy.__int__()[source]

Gets integer representation of buffer proxy.

>>> int(buffer_proxy)
0

Returns integer.

(SupriyaObject).__repr__()

Gets interpreter representation of Supriya object.

Returns string.