Skip to content
Merged
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
29 changes: 23 additions & 6 deletions jack.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import errno as _errno
import platform as _platform
from cffi import FFI as _FFI
import warnings as _warnings

_ffi = _FFI()
_ffi.cdef("""
Expand Down Expand Up @@ -685,18 +686,34 @@ def transport_state(self):
"""
return TransportState(_lib.jack_transport_query(self._ptr, _ffi.NULL))

def transport_locate(self, frame):
"""Reposition the JACK transport to a new frame number.
@property
def transport_frame(self):
"""Get/set current JACK transport frame.

Parameters
----------
frame : int
Frame number.
Return an estimate of the current transport frame, including any
time elapsed since the last transport positional update.
Assigning a frame number repositions the JACK transport.

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

@transport_frame.setter
def transport_frame(self, frame):
_check(_lib.jack_transport_locate(self._ptr, frame),
"Error locating JACK transport")

def transport_locate(self, frame):
"""

.. deprecated:: 0.4.1
Use :attr:`transport_frame` instead

"""
_warnings.warn(
'transport_locate() is deprecated, use transport_frame',
DeprecationWarning)
self.transport_frame = frame

def transport_query(self):
"""Query the current transport state and position.

Expand Down