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 {
00028 #endif
00029
00030
00031 #include "types.h"
00032
00036 typedef enum {
00037
00038
00039 JackTransportStopped = 0,
00040 JackTransportRolling = 1,
00041 JackTransportLooping = 2,
00042 JackTransportStarting = 3,
00043 JackTransportSynching = 4
00045 } jack_transport_state_t;
00046
00047 typedef uint64_t jack_unique_t;
00052 typedef enum {
00053
00054 JackPositionBBT = 0x10,
00055 JackPositionTimecode = 0x20
00057 } jack_position_bits_t;
00058
00060 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
00061 #define EXTENDED_TIME_INFO
00062
00066 typedef struct {
00067
00068
00069 jack_unique_t unique_1;
00070 jack_time_t usecs;
00071 jack_nframes_t frame_rate;
00072 jack_nframes_t frame;
00074 jack_position_bits_t valid;
00076
00077 int32_t bar;
00078 int32_t beat;
00079 int32_t tick;
00080 double bar_start_tick;
00081
00082 float beats_per_bar;
00083 float beat_type;
00084 double ticks_per_beat;
00085 double beats_per_minute;
00086
00087
00088 double frame_time;
00089 double next_time;
00092
00093
00094
00095 int32_t padding[10];
00096
00097
00098 jack_unique_t unique_2;
00100 }
00101 jack_position_t;
00102
00120 int jack_release_timebase (jack_client_t *client);
00121
00143 typedef int (*JackSyncCallback)(jack_transport_state_t state,
00144 jack_position_t *pos,
00145 void *arg);
00146
00168 int jack_set_sync_callback (jack_client_t *client,
00169 JackSyncCallback sync_callback,
00170 void *arg);
00189 int jack_set_sync_timeout (jack_client_t *client,
00190 jack_time_t timeout);
00220 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
00221 jack_nframes_t nframes,
00222 jack_position_t *pos,
00223 int new_pos,
00224 void *arg);
00225
00252 int jack_set_timebase_callback (jack_client_t *client,
00253 int conditional,
00254 JackTimebaseCallback timebase_callback,
00255 void *arg);
00273 int jack_transport_locate (jack_client_t *client,
00274 jack_nframes_t frame);
00291 jack_transport_state_t jack_transport_query (const jack_client_t *client,
00292 jack_position_t *pos);
00301 jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client);
00319 int jack_transport_reposition (jack_client_t *client,
00320 jack_position_t *pos);
00333 void jack_transport_start (jack_client_t *client);
00343 void jack_transport_stop (jack_client_t *client);
00344
00345
00346
00347
00348
00349
00355 typedef enum {
00356
00357 JackTransportState = 0x1,
00358 JackTransportPosition = 0x2,
00359 JackTransportLoop = 0x4,
00360 JackTransportSMPTE = 0x8,
00361 JackTransportBBT = 0x10
00363 } jack_transport_bits_t;
00364
00371 typedef struct {
00372
00373
00374
00375 jack_nframes_t frame_rate;
00376 jack_time_t usecs;
00378 jack_transport_bits_t valid;
00379 jack_transport_state_t transport_state;
00380 jack_nframes_t frame;
00381 jack_nframes_t loop_start;
00382 jack_nframes_t loop_end;
00383
00384 long smpte_offset;
00385 float smpte_frame_rate;
00387 int bar;
00388 int beat;
00389 int tick;
00390 double bar_start_tick;
00391
00392 float beats_per_bar;
00393 float beat_type;
00394 double ticks_per_beat;
00395 double beats_per_minute;
00396
00397 }
00398 jack_transport_info_t;
00399
00413 void jack_get_transport_info (jack_client_t *client,
00414 jack_transport_info_t *tinfo);
00423 void jack_set_transport_info (jack_client_t *client,
00424 jack_transport_info_t *tinfo);
00425
00426 #ifdef __cplusplus
00427 }
00428 #endif
00429
00430 #endif