JACK-AUDIO-CONNECTION-KIT  0.124.1
transport.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002 Paul Davis
3  Copyright (C) 2003 Jack O'Quin
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation; either version 2.1 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 */
20 
21 #ifndef __jack_transport_h__
22 #define __jack_transport_h__
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #include <jack/types.h>
29 #include <jack/weakmacros.h>
30 
31 #ifndef
32 #ifdef __GNUC__
33 #ifndef __arm__
34 /* needs to be a macro which
35  expands into a compiler directive. The directive must
36  tell the compiler to arrange the preceding structure
37  declaration so that it is packed on byte-boundaries rather
38  than use the natural alignment of the processor and/or
39  compiler.
40 */
41 #define __attribute__((__packed__))
42 #else
43 #define
44 #endif
45 #else
46 /* Add other things here for non-gcc platforms */
47 #endif
48 #endif
49 
50 
54 typedef enum {
55 
56  /* the order matters for binary compatibility */
63 
64 typedef uint64_t jack_unique_t;
69 typedef enum {
70 
71  JackPositionBBT = 0x10,
75  JackVideoFrameOffset = 0x100
77 
79 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode|JackBBTFrameOffset|JackAudioVideoRatio|JackVideoFrameOffset)
80 #define EXTENDED_TIME_INFO
81 
85 typedef struct {
86 
90  jack_unique_t unique_1;
91  jack_time_t usecs;
99  jack_nframes_t frame_rate;
100  /*}@*/
101 
105  jack_nframes_t frame;
111  jack_position_bits_t valid;
114  /*}@*/
115 
123  int32_t bar;
127  int32_t beat;
132  int32_t tick;
136  double bar_start_tick;
140  float beats_per_bar;
141  float beat_type;
142  double ticks_per_beat;
147  double beats_per_minute;
155  /*}@*/
156 
160  double frame_time;
161  double next_time;
163  /*}@*/
164 
166  /* JackBBTFrameOffset fields */
167  jack_nframes_t bbt_offset;
181  /*}@*/
182 
184  /* JACK video positional data
185  * EXPERIMENTAL: could change */
186  float audio_frames_per_video_frame;
193  jack_nframes_t video_offset;
199  /*}@*/
200 
203  /* For binary compatibility, new fields should be allocated from
204  * this padding area with new valid bits controlling access, so
205  * the existing structure size and offsets are preserved. */
206  int32_t padding[7];
207  /*}@*/
208 
209  /* When (unique_1 == unique_2) the contents are consistent. */
210  jack_unique_t unique_2;
213 
235 int jack_release_timebase (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
236 
258 typedef int (*JackSyncCallback)(jack_transport_state_t state,
259  jack_position_t *pos,
260  void *arg);
261 
283  JackSyncCallback sync_callback,
284  void *arg) JACK_OPTIONAL_WEAK_EXPORT;
285 
304  jack_time_t timeout) JACK_OPTIONAL_WEAK_EXPORT;
305 
335 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
336  jack_nframes_t nframes,
337  jack_position_t *pos,
338  int new_pos,
339  void *arg);
340 
369  int conditional,
370  JackTimebaseCallback timebase_callback,
371  void *arg) JACK_OPTIONAL_WEAK_EXPORT;
372 
390  jack_nframes_t frame) JACK_OPTIONAL_WEAK_EXPORT;
391 
408  jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT;
409 
417 jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
418 
438  const jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT;
439 
451 void jack_transport_start (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
452 
461 void jack_transport_stop (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
462 
465 /*********************************************************************
466  * The following interfaces are DEPRECATED. They are only provided
467  * for compatibility with the earlier JACK transport implementation.
468  *********************************************************************/
469 
475 typedef enum {
481  JackTransportBBT = 0x10
484 
491 typedef struct {
492 
493  /* these two cannot be set from clients: the server sets them */
495  jack_nframes_t frame_rate;
496  jack_time_t usecs;
499  jack_transport_state_t transport_state;
501  jack_nframes_t loop_start;
502  jack_nframes_t loop_end;
504  long smpte_offset;
505  float smpte_frame_rate;
507  int bar;
508  int beat;
509  int tick;
510  double bar_start_tick;
512  float beats_per_bar;
513  float beat_type;
514  double ticks_per_beat;
515  double beats_per_minute;
516 
518 
532  jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
533 
542  jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
543 
544 #ifdef __cplusplus
545 }
546 #endif
547 
548 #endif /* __jack_transport_h__ */
struct _jack_client jack_client_t
Definition: types.h:72
Definition: transport.h:480
Definition: transport.h:479
void jack_get_transport_info(jack_client_t *client, jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
Definition: transport.h:70
Definition: transport.h:490
jack_transport_state_t jack_transport_query(const jack_client_t *client, jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT
void jack_set_transport_info(jack_client_t *client, jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
jack_transport_bits_t
Definition: transport.h:474
int jack_release_timebase(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
Definition: transport.h:84
void jack_transport_start(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
int jack_set_sync_timeout(jack_client_t *client, jack_time_t timeout) JACK_OPTIONAL_WEAK_EXPORT
jack_position_bits_t
Definition: transport.h:68
int jack_transport_locate(jack_client_t *client, jack_nframes_t frame) JACK_OPTIONAL_WEAK_EXPORT
void jack_transport_stop(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
uint64_t jack_time_t
Definition: types.h:47
jack_transport_state_t
Definition: transport.h:53
uint64_t jack_unique_t
Definition: transport.h:63
int jack_transport_reposition(jack_client_t *client, const jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT
Definition: transport.h:73
uint32_t jack_nframes_t
Definition: types.h:35
int jack_set_timebase_callback(jack_client_t *client, int conditional, JackTimebaseCallback timebase_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT
int jack_set_sync_callback(jack_client_t *client, JackSyncCallback sync_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT
Definition: transport.h:72
Definition: transport.h:58
Definition: transport.h:478
Definition: transport.h:74
Definition: transport.h:477
Definition: transport.h:59
int(* JackSyncCallback)(jack_transport_state_t state, jack_position_t *pos, void *arg)
Definition: transport.h:257
Definition: transport.h:57
jack_nframes_t jack_get_current_transport_frame(const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
Definition: transport.h:71
Definition: transport.h:476
void(* JackTimebaseCallback)(jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos, void *arg)
Definition: transport.h:334
Definition: transport.h:56
jack_client_t * client
Definition: simple_client.c:17