diff --git a/examples/chatty_client.py b/examples/chatty_client.py index b0fd594..33f6439 100755 --- a/examples/chatty_client.py +++ b/examples/chatty_client.py @@ -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") diff --git a/jack.py b/jack.py index d35f407..7aa38bd 100644 --- a/jack.py +++ b/jack.py @@ -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`. @@ -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. @@ -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