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 #endif
00027
00028 #include <jack/types.h>
00029
00033 typedef enum {
00034
00035
00036 JackTransportStopped = 0,
00037 JackTransportRolling = 1,
00038 JackTransportLooping = 2,
00039 JackTransportStarting = 3
00041 } jack_transport_state_t;
00042
00043 typedef uint64_t jack_unique_t;
00048 typedef enum {
00049
00050 JackPositionBBT = 0x10,
00051 JackPositionTimecode = 0x20,
00052 JackBBTFrameOffset = 0x40,
00053 JackAudioVideoRatio = 0x80,
00054 JackVideoFrameOffset = 0x100
00055 } jack_position_bits_t;
00056
00058 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode|JackBBTFrameOffset|JackAudioVideoRatio|JackVideoFrameOffset)
00059 #define EXTENDED_TIME_INFO
00060
00064 typedef struct {
00065
00066
00067 jack_unique_t unique_1;
00068 jack_time_t usecs;
00069 jack_nframes_t frame_rate;
00070 jack_nframes_t frame;
00072 jack_position_bits_t valid;
00074
00075 int32_t bar;
00076 int32_t beat;
00077 int32_t tick;
00078 double bar_start_tick;
00079
00080 float beats_per_bar;
00081 float beat_type;
00082 double ticks_per_beat;
00083 double beats_per_minute;
00084
00085
00086 double frame_time;
00087 double next_time;
00090
00091 jack_nframes_t bbt_offset;
00106
00107
00108 float audio_frames_per_video_frame;
00115 jack_nframes_t video_offset;
00122
00123
00124
00125 int32_t padding[7];
00126
00127
00128 jack_unique_t unique_2;
00130 } jack_position_t;
00131
00148 int jack_release_timebase (jack_client_t *client);
00149
00171 typedef int (*JackSyncCallback)(jack_transport_state_t state,
00172 jack_position_t *pos,
00173 void *arg);
00174
00195 int jack_set_sync_callback (jack_client_t *client,
00196 JackSyncCallback sync_callback,
00197 void *arg);
00198
00216 int jack_set_sync_timeout (jack_client_t *client,
00217 jack_time_t timeout);
00218
00248 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
00249 jack_nframes_t nframes,
00250 jack_position_t *pos,
00251 int new_pos,
00252 void *arg);
00253
00279 int jack_set_timebase_callback (jack_client_t *client,
00280 int conditional,
00281 JackTimebaseCallback timebase_callback,
00282 void *arg);
00283
00300 int jack_transport_locate (jack_client_t *client,
00301 jack_nframes_t frame);
00302
00318 jack_transport_state_t jack_transport_query (const jack_client_t *client,
00319 jack_position_t *pos);
00320
00328 jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client);
00329
00346 int jack_transport_reposition (jack_client_t *client,
00347 jack_position_t *pos);
00348
00360 void jack_transport_start (jack_client_t *client);
00361
00370 void jack_transport_stop (jack_client_t *client);
00371
00372
00373
00374
00375
00376
00377
00383 typedef enum {
00384
00385 JackTransportState = 0x1,
00386 JackTransportPosition = 0x2,
00387 JackTransportLoop = 0x4,
00388 JackTransportSMPTE = 0x8,
00389 JackTransportBBT = 0x10
00391 } jack_transport_bits_t;
00392
00399 typedef struct {
00400
00401
00402
00403 jack_nframes_t frame_rate;
00404 jack_time_t usecs;
00406 jack_transport_bits_t valid;
00407 jack_transport_state_t transport_state;
00408 jack_nframes_t frame;
00409 jack_nframes_t loop_start;
00410 jack_nframes_t loop_end;
00411
00412 long smpte_offset;
00413 float smpte_frame_rate;
00415 int bar;
00416 int beat;
00417 int tick;
00418 double bar_start_tick;
00419
00420 float beats_per_bar;
00421 float beat_type;
00422 double ticks_per_beat;
00423 double beats_per_minute;
00424
00425 } jack_transport_info_t;
00426
00439 void jack_get_transport_info (jack_client_t *client,
00440 jack_transport_info_t *tinfo);
00441
00449 void jack_set_transport_info (jack_client_t *client,
00450 jack_transport_info_t *tinfo);
00451
00452 #ifdef __cplusplus
00453 }
00454 #endif
00455
00456 #endif