Skip to content

Commit 4e0ab49

Browse files
committed
Update docstring of transport_query()
1 parent 2bbaaf6 commit 4e0ab49

1 file changed

Lines changed: 15 additions & 36 deletions

File tree

‎jack.py‎

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -657,49 +657,28 @@ def transport_locate(self, frame):
657657
"Error locating JACK transport")
658658

659659
def transport_query(self):
660-
"""return current transport state and position.
660+
"""Query the current transport state and position.
661661
662-
Return a tuple with current transport state and position informations
662+
This function is realtime-safe, and can be called from any
663+
thread. If called from the process thread, the returned
664+
position corresponds to the first frame of the current cycle and
665+
the state returned is valid for the entire cycle.
663666
664-
Transport state
665-
---------------
666-
Transport state can take following values:
667+
Returns
668+
-------
669+
state : int
670+
The transport state can take following values:
667671
:attr:`STOPPED`, :attr:`ROLLING`, :attr:`STARTING` and
668672
:attr:`NETSTARTING`.
673+
position : CFFI struct object
674+
See the `JACK transport documentation`__ for the available
675+
fields.
669676
670-
Position informations
671-
---------------------
672-
Position information are stored in CFFI object. This object have
673-
following attribute :
674-
* usecs : monotonic, free-rolling
675-
* frame_rate : current frame rate (per second)
676-
* frame : frame number (frame count since transport start)
677-
* valid : indicate which fields are present and valid (see below)
678-
* bar: current bar
679-
* beat: current beat-within-bar
680-
* tick: current tick-within-beat
681-
* bar_start_tick
682-
* bbt_offset : frame offset for the BBT fields (see below)
683-
* beats_per_bar : time signature "numerator"
684-
* beat_type : time signature "denominator"
685-
* ticks_per_beat : ticks per beat
686-
* beats_per_minute : current tempo (BPM)
687-
* frame_time : current time in seconds
688-
* next_time : next sequential frame_time (unless repositioned)
689-
* audio_frames_per_video_frame
690-
* video_offset
691-
692-
valid field is can take following values (bit flag) :
693-
* 0x10 : bar, beat, tick, bar_start_tick, beats_per_bar,
694-
beat_type, ticks_per_beat, beats_per_minute
695-
* 0x20 : frame_time, next_time
696-
* 0x40 : bbt_offset
697-
* 0x80 : audio_frames_per_video_frame
698-
* 0x100 : video_offset
677+
__ http://jackaudio.org/files/docs/html/structjack__position__t.html
699678
700679
"""
701-
transport_state = _lib.jack_transport_query(self._ptr, self._position)
702-
return transport_state, self._position
680+
state = _lib.jack_transport_query(self._ptr, self._position)
681+
return state, self._position
703682

704683
def set_freewheel(self, onoff):
705684
"""Start/Stop JACK's "freewheel" mode.

0 commit comments

Comments
 (0)