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

JACK-AUDIO-CONNECTION-KIT 0.125.0

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
34 typedef enum {
35
36 /* the order matters for binary compatibility */
37 JackTransportStopped = 0,
38 JackTransportRolling = 1,
39 JackTransportLooping = 2,
40 JackTransportStarting = 3
42 } jack_transport_state_t;
43
44 typedef uint64_t jack_unique_t;
49 typedef enum {
50
51 JackPositionBBT = 0x10,
52 JackPositionTimecode = 0x20,
53 JackBBTFrameOffset = 0x40,
54 JackAudioVideoRatio = 0x80,
55 JackVideoFrameOffset = 0x100
56 } jack_position_bits_t;
57
59 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode|JackBBTFrameOffset|JackAudioVideoRatio|JackVideoFrameOffset)
60 #define EXTENDED_TIME_INFO
61
65 typedef struct {
66
70 jack_unique_t unique_1;
71 jack_time_t usecs;
79 jack_nframes_t frame_rate;
80 /*}@*/
81
85 jack_nframes_t frame;
91 jack_position_bits_t valid;
94 /*}@*/
95
103 int32_t bar;
107 int32_t beat;
112 int32_t tick;
116 double bar_start_tick;
120 float beats_per_bar;
121 float beat_type;
122 double ticks_per_beat;
127 double beats_per_minute;
135 /*}@*/
136
140 double frame_time;
141 double next_time;
143 /*}@*/
144
146 /* JackBBTFrameOffset fields */
147 jack_nframes_t bbt_offset;
161 /*}@*/
162
164 /* JACK video positional data
165 * EXPERIMENTAL: could change */
166 float audio_frames_per_video_frame;
173 jack_nframes_t video_offset;
179 /*}@*/
180
183 /* For binary compatibility, new fields should be allocated from
184 * this padding area with new valid bits controlling access, so
185 * the existing structure size and offsets are preserved. */
186 int32_t padding[7];
187 /*}@*/
188
189 /* When (unique_1 == unique_2) the contents are consistent. */
190 jack_unique_t unique_2;
192 } jack_position_t;
193
215 int jack_release_timebase (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
216
238 typedef int (*JackSyncCallback)(jack_transport_state_t state,
239 jack_position_t *pos,
240 void *arg);
241
262 int jack_set_sync_callback (jack_client_t *client,
263 JackSyncCallback sync_callback,
264 void *arg) JACK_OPTIONAL_WEAK_EXPORT;
265
283 int jack_set_sync_timeout (jack_client_t *client,
284 jack_time_t timeout) JACK_OPTIONAL_WEAK_EXPORT;
285
315 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
316 jack_nframes_t nframes,
317 jack_position_t *pos,
318 int new_pos,
319 void *arg);
320
348 int jack_set_timebase_callback (jack_client_t *client,
349 int conditional,
350 JackTimebaseCallback timebase_callback,
351 void *arg) JACK_OPTIONAL_WEAK_EXPORT;
352
369 int jack_transport_locate (jack_client_t *client,
370 jack_nframes_t frame) JACK_OPTIONAL_WEAK_EXPORT;
371
387 jack_transport_state_t jack_transport_query (const jack_client_t *client,
388 jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT;
389
397 jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
398
417 int jack_transport_reposition (jack_client_t *client,
418 const jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT;
419
431 void jack_transport_start (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
432
441 void jack_transport_stop (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
442
445 /*********************************************************************
446 * The following interfaces are DEPRECATED. They are only provided
447 * for compatibility with the earlier JACK transport implementation.
448 *********************************************************************/
449
455 typedef enum {
456
457 JackTransportState = 0x1,
458 JackTransportPosition = 0x2,
459 JackTransportLoop = 0x4,
460 JackTransportSMPTE = 0x8,
461 JackTransportBBT = 0x10
463 } jack_transport_bits_t;
464
471 typedef struct {
472
473 /* these two cannot be set from clients: the server sets them */
474
475 jack_nframes_t frame_rate;
476 jack_time_t usecs;
478 jack_transport_bits_t valid;
479 jack_transport_state_t transport_state;
480 jack_nframes_t frame;
481 jack_nframes_t loop_start;
482 jack_nframes_t loop_end;
483
484 long smpte_offset;
485 float smpte_frame_rate;
487 int bar;
488 int beat;
489 int tick;
490 double bar_start_tick;
491
492 float beats_per_bar;
493 float beat_type;
494 double ticks_per_beat;
495 double beats_per_minute;
496
497 } jack_transport_info_t;
498
511 void jack_get_transport_info (jack_client_t *client,
512 jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
513
521 void jack_set_transport_info (jack_client_t *client,
522 jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
523
524 #ifdef __cplusplus
525 }
526 #endif
527
528 #endif /* __jack_transport_h__ */
jack_client_t
struct _jack_client jack_client_t
Definition: types.h:90
jack_position_t::audio_frames_per_video_frame
float audio_frames_per_video_frame
Definition: transport.h:166
JackTransportBBT
Definition: transport.h:461
jack_position_t::beat
int32_t beat
Definition: transport.h:107
JackTransportSMPTE
Definition: transport.h:460
types.h
jack_position_t::valid
jack_position_bits_t valid
Definition: transport.h:91
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:51
jack_transport_info_t
Definition: transport.h:471
jack_transport_query
jack_transport_state_t jack_transport_query(const jack_client_t *client, jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT
jack_transport_info_t::frame
jack_nframes_t frame
Definition: transport.h:480
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_info_t::beats_per_minute
double beats_per_minute
Definition: transport.h:495
jack_position_t::beats_per_minute
double beats_per_minute
Definition: transport.h:127
jack_transport_info_t::bar_start_tick
double bar_start_tick
Definition: transport.h:490
jack_transport_info_t::transport_state
jack_transport_state_t transport_state
Definition: transport.h:479
jack_transport_bits_t
jack_transport_bits_t
Definition: transport.h:455
jack_release_timebase
int jack_release_timebase(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
jack_position_t::tick
int32_t tick
Definition: transport.h:112
jack_position_t
Definition: transport.h:65
jack_position_t::video_offset
jack_nframes_t video_offset
Definition: transport.h:173
jack_transport_info_t::beats_per_bar
float beats_per_bar
Definition: transport.h:492
jack_transport_info_t::bar
int bar
Definition: transport.h:487
jack_position_t::frame_time
double frame_time
Definition: transport.h:140
jack_position_t::frame
jack_nframes_t frame
Definition: transport.h:85
jack_transport_start
void jack_transport_start(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
jack_position_t::next_time
double next_time
Definition: transport.h:141
jack_position_t::bar_start_tick
double bar_start_tick
Definition: transport.h:116
jack_transport_info_t::beat_type
float beat_type
Definition: transport.h:493
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:49
jack_transport_locate
int jack_transport_locate(jack_client_t *client, jack_nframes_t frame) JACK_OPTIONAL_WEAK_EXPORT
jack_position_t::bbt_offset
jack_nframes_t bbt_offset
Definition: transport.h:147
jack_transport_stop
void jack_transport_stop(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
jack_position_t::unique_2
jack_unique_t unique_2
Definition: transport.h:190
jack_transport_info_t::valid
jack_transport_bits_t valid
Definition: transport.h:478
jack_transport_info_t::tick
int tick
Definition: transport.h:489
jack_time_t
uint64_t jack_time_t
Definition: types.h:65
jack_transport_state_t
jack_transport_state_t
Definition: transport.h:34
jack_position_t::beat_type
float beat_type
Definition: transport.h:121
jack_unique_t
uint64_t jack_unique_t
Definition: transport.h:44
jack_transport_info_t::frame_rate
jack_nframes_t frame_rate
Definition: transport.h:475
jack_transport_info_t::loop_start
jack_nframes_t loop_start
Definition: transport.h:481
jack_transport_reposition
int jack_transport_reposition(jack_client_t *client, const jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT
JackAudioVideoRatio
Definition: transport.h:54
jack_nframes_t
uint32_t jack_nframes_t
Definition: types.h:53
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_position_t::usecs
jack_time_t usecs
Definition: transport.h:71
jack_position_t::frame_rate
jack_nframes_t frame_rate
Definition: transport.h:79
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:53
JackTransportLooping
Definition: transport.h:39
jack_transport_info_t::beat
int beat
Definition: transport.h:488
JackTransportLoop
Definition: transport.h:459
JackVideoFrameOffset
Definition: transport.h:55
jack_position_t::bar
int32_t bar
Definition: transport.h:103
jack_transport_info_t::smpte_offset
long smpte_offset
Definition: transport.h:484
JackTransportPosition
Definition: transport.h:458
jack_transport_info_t::ticks_per_beat
double ticks_per_beat
Definition: transport.h:494
jack_position_t::ticks_per_beat
double ticks_per_beat
Definition: transport.h:122
jack_transport_info_t::loop_end
jack_nframes_t loop_end
Definition: transport.h:482
jack_transport_info_t::smpte_frame_rate
float smpte_frame_rate
Definition: transport.h:485
JackTransportStarting
Definition: transport.h:40
JackSyncCallback
int(* JackSyncCallback)(jack_transport_state_t state, jack_position_t *pos, void *arg)
Definition: transport.h:238
JackTransportRolling
Definition: transport.h:38
jack_get_current_transport_frame
jack_nframes_t jack_get_current_transport_frame(const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
jack_position_t::unique_1
jack_unique_t unique_1
Definition: transport.h:70
jack_transport_info_t::usecs
jack_time_t usecs
Definition: transport.h:476
JackPositionTimecode
Definition: transport.h:52
JackTransportState
Definition: transport.h:457
JackTimebaseCallback
void(* JackTimebaseCallback)(jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos, void *arg)
Definition: transport.h:315
jack_position_t::beats_per_bar
float beats_per_bar
Definition: transport.h:120
JackTransportStopped
Definition: transport.h:37
client
jack_client_t * client
Definition: simple_client.c:17