00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __jack_transport_h__
00023 #define __jack_transport_h__
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029 #include <jack/types.h>
00030
00034 typedef enum {
00035
00036
00037 JackTransportStopped = 0,
00038 JackTransportRolling = 1,
00039 JackTransportLooping = 2,
00040 JackTransportStarting = 3
00042 } jack_transport_state_t;
00043
00044 typedef uint64_t jack_unique_t;
00049 typedef enum {
00050
00051 JackPositionBBT = 0x10,
00052 JackPositionTimecode = 0x20
00054 } jack_position_bits_t;
00055
00057 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
00058 #define EXTENDED_TIME_INFO
00059
00063 typedef struct {
00064
00065
00066 jack_unique_t unique_1;
00067 jack_time_t usecs;
00068 jack_nframes_t frame_rate;
00069 jack_nframes_t frame;
00071 jack_position_bits_t valid;
00073
00074 int32_t bar;
00075 int32_t beat;
00076 int32_t tick;
00077 double bar_start_tick;
00078
00079 float beats_per_bar;
00080 float beat_type;
00081 double ticks_per_beat;
00082 double beats_per_minute;
00083
00084
00085 double frame_time;
00086 double next_time;
00089
00090
00091
00092 int32_t padding[10];
00093
00094
00095 jack_unique_t unique_2;
00097 } jack_position_t;
00098
00115 int jack_release_timebase (jack_client_t *client);
00116
00137 typedef int (*JackSyncCallback)(jack_transport_state_t state,
00138 jack_position_t *pos,
00139 void *arg);
00140
00160 int jack_set_sync_callback (jack_client_t *client,
00161 JackSyncCallback sync_callback,
00162 void *arg);
00163
00181 int jack_set_sync_timeout (jack_client_t *client,
00182 jack_time_t timeout);
00183
00213 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
00214 jack_nframes_t nframes,
00215 jack_position_t *pos,
00216 int new_pos,
00217 void *arg);
00218
00244 int jack_set_timebase_callback (jack_client_t *client,
00245 int conditional,
00246 JackTimebaseCallback timebase_callback,
00247 void *arg);
00248
00265 int jack_transport_locate (jack_client_t *client,
00266 jack_nframes_t frame);
00267
00283 jack_transport_state_t jack_transport_query (const jack_client_t *client,
00284 jack_position_t *pos);
00285
00293 jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client);
00294
00311 int jack_transport_reposition (jack_client_t *client,
00312 jack_position_t *pos);
00313
00325 void jack_transport_start (jack_client_t *client);
00326
00335 void jack_transport_stop (jack_client_t *client);
00336
00337
00338
00339
00340
00341
00342
00348 typedef enum {
00349
00350 JackTransportState = 0x1,
00351 JackTransportPosition = 0x2,
00352 JackTransportLoop = 0x4,
00353 JackTransportSMPTE = 0x8,
00354 JackTransportBBT = 0x10
00356 } jack_transport_bits_t;
00357
00364 typedef struct {
00365
00366
00367
00368 jack_nframes_t frame_rate;
00369 jack_time_t usecs;
00371 jack_transport_bits_t valid;
00372 jack_transport_state_t transport_state;
00373 jack_nframes_t frame;
00374 jack_nframes_t loop_start;
00375 jack_nframes_t loop_end;
00376
00377 long smpte_offset;
00378 float smpte_frame_rate;
00380 int bar;
00381 int beat;
00382 int tick;
00383 double bar_start_tick;
00384
00385 float beats_per_bar;
00386 float beat_type;
00387 double ticks_per_beat;
00388 double beats_per_minute;
00389
00390 } jack_transport_info_t;
00391
00404 void jack_get_transport_info (jack_client_t *client,
00405 jack_transport_info_t *tinfo);
00406
00414 void jack_set_transport_info (jack_client_t *client,
00415 jack_transport_info_t *tinfo);
00416
00417 #ifdef __cplusplus
00418 }
00419 #endif
00420
00421 #endif