Go to the documentation of this file.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
00030 #ifndef
00031 #ifdef __GNUC__
00032
00033
00034
00035
00036
00037
00038
00039 #define __attribute__((__packed__))
00040 #else
00041
00042 #endif
00043 #endif
00044
00045
00049 typedef enum {
00050
00051
00052 JackTransportStopped = 0,
00053 JackTransportRolling = 1,
00054 JackTransportLooping = 2,
00055 JackTransportStarting = 3
00057 } jack_transport_state_t;
00058
00059 typedef uint64_t jack_unique_t;
00064 typedef enum {
00065
00066 JackPositionBBT = 0x10,
00067 JackPositionTimecode = 0x20,
00068 JackBBTFrameOffset = 0x40,
00069 JackAudioVideoRatio = 0x80,
00070 JackVideoFrameOffset = 0x100
00071 } jack_position_bits_t;
00072
00074 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode|JackBBTFrameOffset|JackAudioVideoRatio|JackVideoFrameOffset)
00075 #define EXTENDED_TIME_INFO
00076
00080 typedef struct {
00081
00082
00083 jack_unique_t unique_1;
00084 jack_time_t usecs;
00085 jack_nframes_t frame_rate;
00086 jack_nframes_t frame;
00088 jack_position_bits_t valid;
00090
00091 int32_t bar;
00092 int32_t beat;
00093 int32_t tick;
00094 double bar_start_tick;
00095
00096 float beats_per_bar;
00097 float beat_type;
00098 double ticks_per_beat;
00099 double beats_per_minute;
00100
00101
00102 double frame_time;
00103 double next_time;
00106
00107 jack_nframes_t bbt_offset;
00122
00123
00124 float audio_frames_per_video_frame;
00131 jack_nframes_t video_offset;
00138
00139
00140
00141 int32_t padding[7];
00142
00143
00144 jack_unique_t unique_2;
00146 } jack_position_t;
00147
00169 int jack_release_timebase (jack_client_t *client);
00170
00192 typedef int (*JackSyncCallback)(jack_transport_state_t state,
00193 jack_position_t *pos,
00194 void *arg);
00195
00216 int jack_set_sync_callback (jack_client_t *client,
00217 JackSyncCallback sync_callback,
00218 void *arg);
00219
00237 int jack_set_sync_timeout (jack_client_t *client,
00238 jack_time_t timeout);
00239
00269 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
00270 jack_nframes_t nframes,
00271 jack_position_t *pos,
00272 int new_pos,
00273 void *arg);
00274
00300 int jack_set_timebase_callback (jack_client_t *client,
00301 int conditional,
00302 JackTimebaseCallback timebase_callback,
00303 void *arg);
00304
00321 int jack_transport_locate (jack_client_t *client,
00322 jack_nframes_t frame);
00323
00339 jack_transport_state_t jack_transport_query (const jack_client_t *client,
00340 jack_position_t *pos);
00341
00349 jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client);
00350
00367 int jack_transport_reposition (jack_client_t *client,
00368 jack_position_t *pos);
00369
00381 void jack_transport_start (jack_client_t *client);
00382
00391 void jack_transport_stop (jack_client_t *client);
00392
00395
00396
00397
00398
00399
00405 typedef enum {
00406
00407 JackTransportState = 0x1,
00408 JackTransportPosition = 0x2,
00409 JackTransportLoop = 0x4,
00410 JackTransportSMPTE = 0x8,
00411 JackTransportBBT = 0x10
00413 } jack_transport_bits_t;
00414
00421 typedef struct {
00422
00423
00424
00425 jack_nframes_t frame_rate;
00426 jack_time_t usecs;
00428 jack_transport_bits_t valid;
00429 jack_transport_state_t transport_state;
00430 jack_nframes_t frame;
00431 jack_nframes_t loop_start;
00432 jack_nframes_t loop_end;
00433
00434 long smpte_offset;
00435 float smpte_frame_rate;
00437 int bar;
00438 int beat;
00439 int tick;
00440 double bar_start_tick;
00441
00442 float beats_per_bar;
00443 float beat_type;
00444 double ticks_per_beat;
00445 double beats_per_minute;
00446
00447 } jack_transport_info_t;
00448
00461 void jack_get_transport_info (jack_client_t *client,
00462 jack_transport_info_t *tinfo);
00463
00471 void jack_set_transport_info (jack_client_t *client,
00472 jack_transport_info_t *tinfo);
00473
00474 #ifdef __cplusplus
00475 }
00476 #endif
00477
00478 #endif
00479