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,
00053 JackBBTFrameOffset = 0x40,
00054 JackAudioVideoRatio = 0x80,
00055 JackVideoFrameOffset = 0x100
00056 } jack_position_bits_t;
00057
00059 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode|JackBBTFrameOffset|JackAudioVideoRatio|JackVideoFrameOffset)
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 jack_nframes_t bbt_offset;
00107
00108
00109 float audio_frames_per_video_frame;
00116 jack_nframes_t video_offset;
00123
00124
00125
00126 int32_t padding[7];
00127
00128
00129 jack_unique_t unique_2;
00131 } jack_position_t;
00132
00149 int jack_release_timebase (jack_client_t *client);
00150
00172 typedef int (*JackSyncCallback)(jack_transport_state_t state,
00173 jack_position_t *pos,
00174 void *arg);
00175
00196 int jack_set_sync_callback (jack_client_t *client,
00197 JackSyncCallback sync_callback,
00198 void *arg);
00199
00217 int jack_set_sync_timeout (jack_client_t *client,
00218 jack_time_t timeout);
00219
00249 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
00250 jack_nframes_t nframes,
00251 jack_position_t *pos,
00252 int new_pos,
00253 void *arg);
00254
00280 int jack_set_timebase_callback (jack_client_t *client,
00281 int conditional,
00282 JackTimebaseCallback timebase_callback,
00283 void *arg);
00284
00301 int jack_transport_locate (jack_client_t *client,
00302 jack_nframes_t frame);
00303
00319 jack_transport_state_t jack_transport_query (const jack_client_t *client,
00320 jack_position_t *pos);
00321
00329 jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client);
00330
00347 int jack_transport_reposition (jack_client_t *client,
00348 jack_position_t *pos);
00349
00361 void jack_transport_start (jack_client_t *client);
00362
00371 void jack_transport_stop (jack_client_t *client);
00372
00373
00374
00375
00376
00377
00378
00384 typedef enum {
00385
00386 JackTransportState = 0x1,
00387 JackTransportPosition = 0x2,
00388 JackTransportLoop = 0x4,
00389 JackTransportSMPTE = 0x8,
00390 JackTransportBBT = 0x10
00392 } jack_transport_bits_t;
00393
00400 typedef struct {
00401
00402
00403
00404 jack_nframes_t frame_rate;
00405 jack_time_t usecs;
00407 jack_transport_bits_t valid;
00408 jack_transport_state_t transport_state;
00409 jack_nframes_t frame;
00410 jack_nframes_t loop_start;
00411 jack_nframes_t loop_end;
00412
00413 long smpte_offset;
00414 float smpte_frame_rate;
00416 int bar;
00417 int beat;
00418 int tick;
00419 double bar_start_tick;
00420
00421 float beats_per_bar;
00422 float beat_type;
00423 double ticks_per_beat;
00424 double beats_per_minute;
00425
00426 } jack_transport_info_t;
00427
00440 void jack_get_transport_info (jack_client_t *client,
00441 jack_transport_info_t *tinfo);
00442
00450 void jack_set_transport_info (jack_client_t *client,
00451 jack_transport_info_t *tinfo);
00452
00453 #ifdef __cplusplus
00454 }
00455 #endif
00456
00457 #endif