JACK-AUDIO-CONNECTION-KIT: transport.h Source File

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 #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 */
57 JackTransportStopped = 0,
58 JackTransportRolling = 1,
59 JackTransportLooping = 2,
60 JackTransportStarting = 3
62 } jack_transport_state_t;
63
64 typedef uint64_t jack_unique_t;
69 typedef enum {
70
71 JackPositionBBT = 0x10,
72 JackPositionTimecode = 0x20,
73 JackBBTFrameOffset = 0x40,
74 JackAudioVideoRatio = 0x80,
75 JackVideoFrameOffset = 0x100
76 } jack_position_bits_t;
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;
212 } jack_position_t;
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
282 int jack_set_sync_callback (jack_client_t *client,
283 JackSyncCallback sync_callback,
284 void *arg) JACK_OPTIONAL_WEAK_EXPORT;
285
303 int jack_set_sync_timeout (jack_client_t *client,
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
368 int jack_set_timebase_callback (jack_client_t *client,
369 int conditional,
370 JackTimebaseCallback timebase_callback,
371 void *arg) JACK_OPTIONAL_WEAK_EXPORT;
372
389 int jack_transport_locate (jack_client_t *client,
390 jack_nframes_t frame) JACK_OPTIONAL_WEAK_EXPORT;
391
407 jack_transport_state_t jack_transport_query (const jack_client_t *client,
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
437 int jack_transport_reposition (jack_client_t *client,
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 {
476
477 JackTransportState = 0x1,
478 JackTransportPosition = 0x2,
479 JackTransportLoop = 0x4,
480 JackTransportSMPTE = 0x8,
481 JackTransportBBT = 0x10
483 } jack_transport_bits_t;
484
491 typedef struct {
492
493 /* these two cannot be set from clients: the server sets them */
494
495 jack_nframes_t frame_rate;
496 jack_time_t usecs;
498 jack_transport_bits_t valid;
499 jack_transport_state_t transport_state;
500 jack_nframes_t frame;
501 jack_nframes_t loop_start;
502 jack_nframes_t loop_end;
503
504 long smpte_offset;
505 float smpte_frame_rate;
507 int bar;
508 int beat;
509 int tick;
510 double bar_start_tick;
511
512 float beats_per_bar;
513 float beat_type;
514 double ticks_per_beat;
515 double beats_per_minute;
516
517 } jack_transport_info_t;
518
531 void jack_get_transport_info (jack_client_t *client,
532 jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
533
541 void jack_set_transport_info (jack_client_t *client,
542 jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
543
544 #ifdef __cplusplus
545 }
546 #endif
547
548 #endif /* __jack_transport_h__ */
jack_client_t
struct _jack_client jack_client_t
Definition: types.h:72
JackTransportBBT
Definition: transport.h:480
JackTransportSMPTE
Definition: transport.h:479
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:70
jack_transport_info_t
Definition: transport.h:490
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:474
jack_release_timebase
int jack_release_timebase(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
jack_position_t
Definition: transport.h:84
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:68
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:53
jack_unique_t
uint64_t jack_unique_t
Definition: transport.h:63
jack_transport_reposition
int jack_transport_reposition(jack_client_t *client, const jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT
JackAudioVideoRatio
Definition: transport.h:73
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
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:72
JackTransportLooping
Definition: transport.h:58
JackTransportLoop
Definition: transport.h:478
JackVideoFrameOffset
Definition: transport.h:74
JackTransportPosition
Definition: transport.h:477
JackTransportStarting
Definition: transport.h:59
JackSyncCallback
int(* JackSyncCallback)(jack_transport_state_t state, jack_position_t *pos, void *arg)
Definition: transport.h:257
JackTransportRolling
Definition: transport.h:57
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:71
JackTransportState
Definition: transport.h:476
JackTimebaseCallback
void(* JackTimebaseCallback)(jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos, void *arg)
Definition: transport.h:334
JackTransportStopped
Definition: transport.h:56
client
jack_client_t * client
Definition: simple_client.c:17