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 /* needs to be a macro which
34  expands into a compiler directive. The directive must
35  tell the compiler to arrange the preceding structure
36  declaration so that it is packed on byte-boundaries rather
37  than use the natural alignment of the processor and/or
38  compiler.
39 */
40 #define __attribute__((__packed__))
41 #else
42 /* Add other things here for non-gcc platforms */
43 #endif
44 #endif
45 
46 
50 typedef enum {
51 
52  /* the order matters for binary compatibility */
59 
60 typedef uint64_t jack_unique_t;
65 typedef enum {
66 
67  JackPositionBBT = 0x10,
71  JackVideoFrameOffset = 0x100
73 
75 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode|JackBBTFrameOffset|JackAudioVideoRatio|JackVideoFrameOffset)
76 #define EXTENDED_TIME_INFO
77 
81 typedef struct {
82 
86  jack_unique_t unique_1;
87  jack_time_t usecs;
95  jack_nframes_t frame_rate;
96  /*}@*/
97 
101  jack_nframes_t frame;
107  jack_position_bits_t valid;
110  /*}@*/
111 
119  int32_t bar;
123  int32_t beat;
128  int32_t tick;
132  double bar_start_tick;
136  float beats_per_bar;
137  float beat_type;
138  double ticks_per_beat;
143  double beats_per_minute;
151  /*}@*/
152 
156  double frame_time;
157  double next_time;
159  /*}@*/
160 
162  /* JackBBTFrameOffset fields */
163  jack_nframes_t bbt_offset;
177  /*}@*/
178 
180  /* JACK video positional data
181  * EXPERIMENTAL: could change */
182  float audio_frames_per_video_frame;
189  jack_nframes_t video_offset;
195  /*}@*/
196 
199  /* For binary compatibility, new fields should be allocated from
200  * this padding area with new valid bits controlling access, so
201  * the existing structure size and offsets are preserved. */
202  int32_t padding[7];
203  /*}@*/
204 
205  /* When (unique_1 == unique_2) the contents are consistent. */
206  jack_unique_t unique_2;
209 
231 int jack_release_timebase (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
232 
254 typedef int (*JackSyncCallback)(jack_transport_state_t state,
255  jack_position_t *pos,
256  void *arg);
257 
279  JackSyncCallback sync_callback,
280  void *arg) JACK_OPTIONAL_WEAK_EXPORT;
281 
300  jack_time_t timeout) JACK_OPTIONAL_WEAK_EXPORT;
301 
331 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
332  jack_nframes_t nframes,
333  jack_position_t *pos,
334  int new_pos,
335  void *arg);
336 
365  int conditional,
366  JackTimebaseCallback timebase_callback,
367  void *arg) JACK_OPTIONAL_WEAK_EXPORT;
368 
386  jack_nframes_t frame) JACK_OPTIONAL_WEAK_EXPORT;
387 
404  jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT;
405 
413 jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
414 
434  const jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT;
435 
447 void jack_transport_start (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
448 
457 void jack_transport_stop (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
458 
461 /*********************************************************************
462  * The following interfaces are DEPRECATED. They are only provided
463  * for compatibility with the earlier JACK transport implementation.
464  *********************************************************************/
465 
471 typedef enum {
477  JackTransportBBT = 0x10
480 
487 typedef struct {
488 
489  /* these two cannot be set from clients: the server sets them */
491  jack_nframes_t frame_rate;
492  jack_time_t usecs;
495  jack_transport_state_t transport_state;
497  jack_nframes_t loop_start;
498  jack_nframes_t loop_end;
500  long smpte_offset;
501  float smpte_frame_rate;
503  int bar;
504  int beat;
505  int tick;
506  double bar_start_tick;
508  float beats_per_bar;
509  float beat_type;
510  double ticks_per_beat;
511  double beats_per_minute;
512 
514 
528  jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
529 
538  jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
539 
540 #ifdef __cplusplus
541 }
542 #endif
543 
544 #endif /* __jack_transport_h__ */
struct _jack_client jack_client_t
Definition: types.h:72
Definition: transport.h:476
Definition: transport.h:475
void jack_get_transport_info(jack_client_t *client, jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
Definition: transport.h:66
Definition: transport.h:486
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:470
int jack_release_timebase(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
Definition: transport.h:80
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:64
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:49
uint64_t jack_unique_t
Definition: transport.h:59
int jack_transport_reposition(jack_client_t *client, const jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT
int(* JackSyncCallback)(jack_transport_state_t state, jack_position_t *pos, void *arg)
Definition: transport.h:253
Definition: transport.h:69
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
void(* JackTimebaseCallback)(jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos, void *arg)
Definition: transport.h:330
int jack_set_sync_callback(jack_client_t *client, JackSyncCallback sync_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT
Definition: transport.h:68
Definition: transport.h:54
Definition: transport.h:474
Definition: transport.h:70
Definition: transport.h:473
Definition: transport.h:55
Definition: transport.h:53
jack_nframes_t jack_get_current_transport_frame(const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
Definition: transport.h:67
Definition: transport.h:472
Definition: transport.h:52
jack_client_t * client
Definition: simple_client.c:17