JACK-AUDIO-CONNECTION-KIT 0.124.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

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 */
53 JackTransportStopped = 0,
54 JackTransportRolling = 1,
55 JackTransportLooping = 2,
56 JackTransportStarting = 3
58 } jack_transport_state_t;
59
60 typedef uint64_t jack_unique_t;
65 typedef enum {
66
67 JackPositionBBT = 0x10,
68 JackPositionTimecode = 0x20,
69 JackBBTFrameOffset = 0x40,
70 JackAudioVideoRatio = 0x80,
71 JackVideoFrameOffset = 0x100
72 } jack_position_bits_t;
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;
208 } jack_position_t;
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
278 int jack_set_sync_callback (jack_client_t *client,
279 JackSyncCallback sync_callback,
280 void *arg) JACK_OPTIONAL_WEAK_EXPORT;
281
299 int jack_set_sync_timeout (jack_client_t *client,
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
364 int jack_set_timebase_callback (jack_client_t *client,
365 int conditional,
366 JackTimebaseCallback timebase_callback,
367 void *arg) JACK_OPTIONAL_WEAK_EXPORT;
368
385 int jack_transport_locate (jack_client_t *client,
386 jack_nframes_t frame) JACK_OPTIONAL_WEAK_EXPORT;
387
403 jack_transport_state_t jack_transport_query (const jack_client_t *client,
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
433 int jack_transport_reposition (jack_client_t *client,
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 {
472
473 JackTransportState = 0x1,
474 JackTransportPosition = 0x2,
475 JackTransportLoop = 0x4,
476 JackTransportSMPTE = 0x8,
477 JackTransportBBT = 0x10
479 } jack_transport_bits_t;
480
487 typedef struct {
488
489 /* these two cannot be set from clients: the server sets them */
490
491 jack_nframes_t frame_rate;
492 jack_time_t usecs;
494 jack_transport_bits_t valid;
495 jack_transport_state_t transport_state;
496 jack_nframes_t frame;
497 jack_nframes_t loop_start;
498 jack_nframes_t loop_end;
499
500 long smpte_offset;
501 float smpte_frame_rate;
503 int bar;
504 int beat;
505 int tick;
506 double bar_start_tick;
507
508 float beats_per_bar;
509 float beat_type;
510 double ticks_per_beat;
511 double beats_per_minute;
512
513 } jack_transport_info_t;
514
527 void jack_get_transport_info (jack_client_t *client,
528 jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
529
537 void jack_set_transport_info (jack_client_t *client,
538 jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
539
540 #ifdef __cplusplus
541 }
542 #endif
543
544 #endif /* __jack_transport_h__ */
jack_client_t
struct _jack_client jack_client_t
Definition: types.h:72
JackTransportBBT
Definition: transport.h:476
JackTransportSMPTE
Definition: transport.h:475
types.h
jack_get_transport_info
void jack_get_transport_info(jack_client_t *client, jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
JackPositionBBT
Definition: transport.h:66
jack_transport_info_t
Definition: transport.h:486
jack_transport_query
jack_transport_state_t jack_transport_query(const jack_client_t *client, jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT
jack_set_transport_info
void jack_set_transport_info(jack_client_t *client, jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
jack_transport_bits_t
jack_transport_bits_t
Definition: transport.h:470
jack_release_timebase
int jack_release_timebase(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
jack_position_t
Definition: transport.h:80
jack_transport_start
void jack_transport_start(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
jack_set_sync_timeout
int jack_set_sync_timeout(jack_client_t *client, jack_time_t timeout) JACK_OPTIONAL_WEAK_EXPORT
jack_position_bits_t
jack_position_bits_t
Definition: transport.h:64
jack_transport_locate
int jack_transport_locate(jack_client_t *client, jack_nframes_t frame) JACK_OPTIONAL_WEAK_EXPORT
jack_transport_stop
void jack_transport_stop(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
jack_time_t
uint64_t jack_time_t
Definition: types.h:47
jack_transport_state_t
jack_transport_state_t
Definition: transport.h:49
jack_unique_t
uint64_t jack_unique_t
Definition: transport.h:59
jack_transport_reposition
int jack_transport_reposition(jack_client_t *client, const jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT
JackSyncCallback
int(* JackSyncCallback)(jack_transport_state_t state, jack_position_t *pos, void *arg)
Definition: transport.h:253
JackAudioVideoRatio
Definition: transport.h:69
jack_nframes_t
uint32_t jack_nframes_t
Definition: types.h:35
jack_set_timebase_callback
int jack_set_timebase_callback(jack_client_t *client, int conditional, JackTimebaseCallback timebase_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT
JackTimebaseCallback
void(* JackTimebaseCallback)(jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos, void *arg)
Definition: transport.h:330
jack_set_sync_callback
int jack_set_sync_callback(jack_client_t *client, JackSyncCallback sync_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT
JackBBTFrameOffset
Definition: transport.h:68
JackTransportLooping
Definition: transport.h:54
JackTransportLoop
Definition: transport.h:474
JackVideoFrameOffset
Definition: transport.h:70
JackTransportPosition
Definition: transport.h:473
JackTransportStarting
Definition: transport.h:55
JackTransportRolling
Definition: transport.h:53
jack_get_current_transport_frame
jack_nframes_t jack_get_current_transport_frame(const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
JackPositionTimecode
Definition: transport.h:67
JackTransportState
Definition: transport.h:472
JackTransportStopped
Definition: transport.h:52
client
jack_client_t * client
Definition: simple_client.c:17