00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __jack_transport_h__
00022 #define __jack_transport_h__
00023
00024 #ifdef __cplusplus
00025 extern "C"
00026 {
00027 #endif
00028
00029
00030 #include "types.h"
00031
00035 typedef enum {
00036
00037
00038 JackTransportStopped = 0,
00039 JackTransportRolling = 1,
00040 JackTransportLooping = 2,
00041 JackTransportStarting = 3,
00042 JackTransportSynching = 4
00044 } jack_transport_state_t;
00045
00046 typedef uint64_t jack_unique_t;
00051 typedef enum {
00052
00053 JackPositionBBT = 0x10,
00054 JackPositionTimecode = 0x20
00056 } jack_position_bits_t;
00057
00059 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
00060 #define EXTENDED_TIME_INFO
00061
00065 typedef struct {
00066
00067
00068 jack_unique_t unique_1;
00069 jack_time_t usecs;
00070 jack_nframes_t frame_rate;
00071 jack_nframes_t frame;
00073 jack_position_bits_t valid;
00075
00076 int32_t bar;
00077 int32_t beat;
00078 int32_t tick;
00079 double bar_start_tick;
00080
00081 float beats_per_bar;
00082 float beat_type;
00083 double ticks_per_beat;
00084 double beats_per_minute;
00085
00086
00087 double frame_time;
00088 double next_time;
00091
00092
00093
00094 int32_t padding[10];
00095
00096
00097 jack_unique_t unique_2;
00099 }
00100 jack_position_t;
00101
00119 int jack_release_timebase (jack_client_t *client);
00120
00142 typedef int (*JackSyncCallback)(jack_transport_state_t state,
00143 jack_position_t *pos,
00144 void *arg);
00145
00167 int jack_set_sync_callback (jack_client_t *client,
00168 JackSyncCallback sync_callback,
00169 void *arg);
00188 int jack_set_sync_timeout (jack_client_t *client,
00189 jack_time_t timeout);
00219 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
00220 jack_nframes_t nframes,
00221 jack_position_t *pos,
00222 int new_pos,
00223 void *arg);
00224
00251 int jack_set_timebase_callback (jack_client_t *client,
00252 int conditional,
00253 JackTimebaseCallback timebase_callback,
00254 void *arg);
00272 int jack_transport_locate (jack_client_t *client,
00273 jack_nframes_t frame);
00290 jack_transport_state_t jack_transport_query (const jack_client_t *client,
00291 jack_position_t *pos);
00300 jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client);
00318 int jack_transport_reposition (jack_client_t *client,
00319 jack_position_t *pos);
00332 void jack_transport_start (jack_client_t *client);
00342 void jack_transport_stop (jack_client_t *client);
00343
00344
00345
00346
00347
00348
00354 typedef enum {
00355
00356 JackTransportState = 0x1,
00357 JackTransportPosition = 0x2,
00358 JackTransportLoop = 0x4,
00359 JackTransportSMPTE = 0x8,
00360 JackTransportBBT = 0x10
00362 } jack_transport_bits_t;
00363
00370 typedef struct {
00371
00372
00373
00374 jack_nframes_t frame_rate;
00375 jack_time_t usecs;
00377 jack_transport_bits_t valid;
00378 jack_transport_state_t transport_state;
00379 jack_nframes_t frame;
00380 jack_nframes_t loop_start;
00381 jack_nframes_t loop_end;
00382
00383 long smpte_offset;
00384 float smpte_frame_rate;
00386 int bar;
00387 int beat;
00388 int tick;
00389 double bar_start_tick;
00390
00391 float beats_per_bar;
00392 float beat_type;
00393 double ticks_per_beat;
00394 double beats_per_minute;
00395
00396 }
00397 jack_transport_info_t;
00398
00412 void jack_get_transport_info (jack_client_t *client,
00413 jack_transport_info_t *tinfo);
00422 void jack_set_transport_info (jack_client_t *client,
00423 jack_transport_info_t *tinfo);
00424
00425 #ifdef __cplusplus
00426 }
00427 #endif
00428
00429 #endif