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
25extern "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
50typedef enum {
51
52 /* the order matters for binary compatibility */
60typedef uint64_t jack_unique_t;
65typedef enum {
70 JackAudioVideoRatio = 0x80,
73
75#define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode|JackBBTFrameOffset|JackAudioVideoRatio|JackVideoFrameOffset)
76#define EXTENDED_TIME_INFO
77
81typedef 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;
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
231int jack_release_timebase (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
232
254typedef 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
331typedef 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
414
434 const jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT;
435
447void jack_transport_start (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
448
457void 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
471typedef enum {
476 JackTransportSMPTE = 0x8,
477 JackTransportBBT = 0x10
480
487typedef 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__ */
int jack_set_timebase_callback(jack_client_t *client, int conditional, JackTimebaseCallback timebase_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT
jack_transport_bits_t
Definition transport.h:470
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_timeout(jack_client_t *client, jack_time_t timeout) JACK_OPTIONAL_WEAK_EXPORT
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
jack_transport_state_t jack_transport_query(const jack_client_t *client, jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT
@ JackPositionTimecode
Definition transport.h:67
@ JackAudioVideoRatio
Definition transport.h:69
@ JackBBTFrameOffset
Definition transport.h:68
@ JackPositionBBT
Definition transport.h:66
@ JackVideoFrameOffset
Definition transport.h:70
@ JackTransportLooping
Definition transport.h:54
@ JackTransportStopped
Definition transport.h:52
@ JackTransportRolling
Definition transport.h:53
@ JackTransportStarting
Definition transport.h:55
void jack_transport_stop(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
void jack_get_transport_info(jack_client_t *client, jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
int jack_transport_locate(jack_client_t *client, jack_nframes_t frame) JACK_OPTIONAL_WEAK_EXPORT
void jack_transport_start(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
void jack_set_transport_info(jack_client_t *client, jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
int jack_set_sync_callback(jack_client_t *client, JackSyncCallback sync_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT
int jack_release_timebase(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
jack_nframes_t jack_get_current_transport_frame(const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
@ JackTransportPosition
Definition transport.h:473
@ JackTransportLoop
Definition transport.h:474
@ JackTransportSMPTE
Definition transport.h:475
@ JackTransportState
Definition transport.h:472
@ JackTransportBBT
Definition transport.h:476
jack_client_t * client
Definition simple_client.c:17
Definition transport.h:80
Definition transport.h:486
jack_position_bits_t
Definition transport.h:64
jack_transport_state_t
Definition transport.h:49
uint64_t jack_unique_t
Definition transport.h:59
struct _jack_client jack_client_t
Definition types.h:71
uint32_t jack_nframes_t
Definition types.h:35
uint64_t jack_time_t
Definition types.h:46