Skip to content

Commit 439d37d

Browse files
SpotlightKidmgeier
authored andcommitted
Add 'release_timebase' method to Client class
Signed-off-by: Christopher Arndt <[email protected]>
1 parent d96bf46 commit 439d37d

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

jack_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
209209
/* transport.h */
210210
211-
/* TODO: jack_release_timebase */
211+
int jack_release_timebase(jack_client_t* client);
212212
int jack_set_sync_callback(jack_client_t* client, JackSyncCallback sync_callback, void* arg);
213213
int jack_set_sync_timeout(jack_client_t* client, jack_time_t timeout);
214214
int jack_set_timebase_callback(jack_client_t* client, int conditional, JackTimebaseCallback timebase_callback, void* arg);

src/jack.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,34 @@ def callback_wrapper(state, pos, _):
12571257
self._ptr, callback_wrapper, _ffi.NULL),
12581258
'Error setting sync callback')
12591259

1260+
def release_timebase(self):
1261+
"""De-register as timebase master.
1262+
1263+
Should be called by the current timebase master to release
1264+
itself from that responsibility and to stop the callback
1265+
registered with `set_timebase_callback()` from being called.
1266+
1267+
If the timebase master releases the timebase or leaves the JACK
1268+
graph for any reason, the JACK engine takes over at the start of
1269+
the next process cycle. The transport state does not change. If
1270+
rolling, it continues to play, with frame numbers as the only
1271+
available position information.
1272+
1273+
Raises
1274+
------
1275+
JackError
1276+
If the client is not the current timebase master or
1277+
releasing the timebase failed for another reason
1278+
1279+
See Also
1280+
--------
1281+
set_timebase_callback
1282+
1283+
"""
1284+
_check(
1285+
_lib.jack_release_timebase(self._ptr),
1286+
'Error releasing timebase')
1287+
12601288
def set_timebase_callback(self, callback=None, conditional=False):
12611289
"""Register as timebase master for the JACK subsystem.
12621290

0 commit comments

Comments
 (0)