From a6a13ba31cd8dba21a0a7a191452e9304b0701ff Mon Sep 17 00:00:00 2001 From: trutkin Date: Thu, 15 Jul 2004 03:07:28 +0000 Subject: [PATCH] Add jack_last_frame(). git-svn-id: svn+ssh://jackaudio.org/trunk/jack@730 0c269be4-1314-0410-8aa9-9f06e86f4224 --- configure.in | 2 +- jack/jack.h | 10 ++++++++++ libjack/transclient.c | 10 ++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 92c46d4..47081ca 100644 --- a/configure.in +++ b/configure.in @@ -15,7 +15,7 @@ dnl changes are made dnl --- JACK_MAJOR_VERSION=0 JACK_MINOR_VERSION=98 -JACK_MICRO_VERSION=4 +JACK_MICRO_VERSION=5 dnl --- dnl HOWTO: updating the jack protocol version diff --git a/jack/jack.h b/jack/jack.h index 97ef1cb..3704378 100644 --- a/jack/jack.h +++ b/jack/jack.h @@ -671,6 +671,16 @@ jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *); */ jack_nframes_t jack_frame_time (const jack_client_t *); +/** + * @return the frame_time after the last processing of the graph + * this is only to be used from the process callback. + * + * This function can be used to put timestamps generated by + * jack_frame_time() in correlation to the current process cycle. + */ +jack_nframes_t jack_last_frame_time (const jack_client_t *client); + + /** * @return the current CPU load estimated by JACK. This is a running * average of the time it takes to execute a full process cycle for diff --git a/libjack/transclient.c b/libjack/transclient.c index ef1b0a7..2677d78 100644 --- a/libjack/transclient.c +++ b/libjack/transclient.c @@ -61,6 +61,16 @@ jack_read_frame_time (const jack_client_t *client, jack_frame_timer_t *copy) } while (copy->guard1 != copy->guard2); } + +jack_nframes_t +jack_last_frame_time (const jack_client_t *client) +{ + jack_frame_timer_t current; + jack_read_frame_time (client, ¤t); + return current.frames; +} + + /* copy a JACK transport position structure (thread-safe) */ void jack_transport_copy_position (jack_position_t *from, jack_position_t *to)