|
28 | 28 | import errno as _errno |
29 | 29 | import platform as _platform |
30 | 30 | from cffi import FFI as _FFI |
| 31 | +import warnings as _warnings |
31 | 32 |
|
32 | 33 | _ffi = _FFI() |
33 | 34 | _ffi.cdef(""" |
@@ -685,18 +686,34 @@ def transport_state(self): |
685 | 686 | """ |
686 | 687 | return TransportState(_lib.jack_transport_query(self._ptr, _ffi.NULL)) |
687 | 688 |
|
688 | | - def transport_locate(self, frame): |
689 | | - """Reposition the JACK transport to a new frame number. |
| 689 | + @property |
| 690 | + def transport_frame(self): |
| 691 | + """Get/set current JACK transport frame. |
690 | 692 |
|
691 | | - Parameters |
692 | | - ---------- |
693 | | - frame : int |
694 | | - Frame number. |
| 693 | + Return an estimate of the current transport frame, including any |
| 694 | + time elapsed since the last transport positional update. |
| 695 | + Assigning a frame number repositions the JACK transport. |
695 | 696 |
|
696 | 697 | """ |
| 698 | + return _lib.jack_get_current_transport_frame(self._ptr) |
| 699 | + |
| 700 | + @transport_frame.setter |
| 701 | + def transport_frame(self, frame): |
697 | 702 | _check(_lib.jack_transport_locate(self._ptr, frame), |
698 | 703 | "Error locating JACK transport") |
699 | 704 |
|
| 705 | + def transport_locate(self, frame): |
| 706 | + """ |
| 707 | +
|
| 708 | + .. deprecated:: 0.4.1 |
| 709 | + Use :attr:`transport_frame` instead |
| 710 | +
|
| 711 | + """ |
| 712 | + _warnings.warn( |
| 713 | + 'transport_locate() is deprecated, use transport_frame', |
| 714 | + DeprecationWarning) |
| 715 | + self.transport_frame = frame |
| 716 | + |
700 | 717 | def transport_query(self): |
701 | 718 | """Query the current transport state and position. |
702 | 719 |
|
|
0 commit comments