Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/chatty_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def graph_order():


@client.set_xrun_callback
def xrun():
print("xrun; delay", client.xrun_delayed_usecs, "microseconds")
def xrun(delay):
print("xrun; delay", delay, "microseconds")


print("activating JACK")
Expand Down
16 changes: 4 additions & 12 deletions jack.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,16 +483,6 @@ def last_frame_time(self):
"""
return _lib.jack_last_frame_time(self._ptr)

@property
def xrun_delayed_usecs(self):
"""Delay in microseconds due to the most recent XRUN occurrence.

This probably only makes sense when queried from a callback
defined using :meth:`set_xrun_callback`.

"""
return _lib.jack_get_xrun_delayed_usecs(self._ptr)

@property
def inports(self):
"""A list of audio input :class:`Ports`.
Expand Down Expand Up @@ -1260,8 +1250,10 @@ def set_xrun_callback(self, callback):
User-supplied function that is called whenever an xrun has
occured. It must have this signature::

callback() -> None
callback(delayed_usecs:float) -> None

The callback argument is the delay in microseconds due to
the most recent XRUN occurrence.
The `callback` is supposed to raise :class:`CallbackExit` on
error.

Expand All @@ -1273,7 +1265,7 @@ def set_xrun_callback(self, callback):
@self._callback("JackXRunCallback", error=_FAILURE)
def callback_wrapper(_):
try:
callback()
callback(_lib.jack_get_xrun_delayed_usecs(self._ptr))
except CallbackExit:
return _FAILURE
return _SUCCESS
Expand Down