00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __jack_types_h__
00022 #define __jack_types_h__
00023
00024 #include <jack/systemdeps.h>
00025
00026 typedef int32_t jack_shmsize_t;
00027
00031 typedef uint32_t jack_nframes_t;
00032
00036 #define JACK_MAX_FRAMES (4294967295U)
00037
00042 typedef uint64_t jack_time_t;
00043
00048 #define JACK_LOAD_INIT_LIMIT 1024
00049
00055 typedef uint64_t jack_intclient_t;
00056
00061 typedef struct _jack_port jack_port_t;
00062
00067 typedef struct _jack_client jack_client_t;
00068
00073 typedef uint32_t jack_port_id_t;
00074
00075 typedef uint32_t jack_port_type_id_t;
00076
00080 enum JackOptions {
00081
00085 JackNullOption = 0x00,
00086
00093 JackNoStartServer = 0x01,
00094
00099 JackUseExactName = 0x02,
00100
00104 JackServerName = 0x04,
00105
00110 JackLoadName = 0x08,
00111
00116 JackLoadInit = 0x10,
00117
00121 JackSessionID = 0x20
00122 };
00123
00125 #define JackOpenOptions (JackSessionID|JackServerName|JackNoStartServer|JackUseExactName)
00126
00128 #define JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName)
00129
00134 typedef enum JackOptions jack_options_t;
00135
00139 enum JackStatus {
00140
00144 JackFailure = 0x01,
00145
00149 JackInvalidOption = 0x02,
00150
00160 JackNameNotUnique = 0x04,
00161
00168 JackServerStarted = 0x08,
00169
00173 JackServerFailed = 0x10,
00174
00178 JackServerError = 0x20,
00179
00183 JackNoSuchClient = 0x40,
00184
00188 JackLoadFailure = 0x80,
00189
00193 JackInitFailure = 0x100,
00194
00198 JackShmFailure = 0x200,
00199
00203 JackVersionError = 0x400,
00204
00208 JackBackendError = 0x800,
00209
00213 JackClientZombie = 0x1000
00214 };
00215
00220 typedef enum JackStatus jack_status_t;
00221
00225 enum JackLatencyCallbackMode {
00226
00232 JackCaptureLatency,
00233
00239 JackPlaybackLatency
00240
00241 };
00242
00246 typedef enum JackLatencyCallbackMode jack_latency_callback_mode_t;
00247
00257 typedef void (*JackLatencyCallback)(jack_latency_callback_mode_t mode, void *arg);
00258
00262 PRE_PACKED_STRUCTURE
00263 struct _jack_latency_range
00264 {
00268 jack_nframes_t min;
00272 jack_nframes_t max;
00273 } POST_PACKED_STRUCTURE;
00274
00275 typedef struct _jack_latency_range jack_latency_range_t;
00276
00289 typedef int (*JackProcessCallback)(jack_nframes_t nframes, void *arg);
00290
00298 typedef void *(*JackThreadCallback)(void* arg);
00299
00312 typedef void (*JackThreadInitCallback)(void *arg);
00313
00322 typedef int (*JackGraphOrderCallback)(void *arg);
00323
00334 typedef int (*JackXRunCallback)(void *arg);
00335
00350 typedef int (*JackBufferSizeCallback)(jack_nframes_t nframes, void *arg);
00351
00361 typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg);
00362
00372 typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int register, void *arg);
00373
00383 typedef void (*JackClientRegistrationCallback)(const char* name, int register, void *arg);
00384
00395 typedef void (*JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void* arg);
00396
00407 typedef int (*JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void *arg);
00408
00416 typedef void (*JackFreewheelCallback)(int starting, void *arg);
00417
00429 typedef void (*JackShutdownCallback)(void *arg);
00430
00444 typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* reason, void *arg);
00445
00450 #define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
00451 #define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi"
00452
00458 typedef float jack_default_audio_sample_t;
00459
00466 enum JackPortFlags {
00467
00472 JackPortIsInput = 0x1,
00473
00478 JackPortIsOutput = 0x2,
00479
00484 JackPortIsPhysical = 0x4,
00485
00499 JackPortCanMonitor = 0x8,
00500
00515 JackPortIsTerminal = 0x10,
00516
00517 };
00518
00522 typedef enum {
00523
00524
00525 JackTransportStopped = 0,
00526 JackTransportRolling = 1,
00527 JackTransportLooping = 2,
00528 JackTransportStarting = 3,
00529 JackTransportNetStarting = 4,
00531 } jack_transport_state_t;
00532
00533 typedef uint64_t jack_unique_t;
00538 typedef enum {
00539
00540 JackPositionBBT = 0x10,
00541 JackPositionTimecode = 0x20,
00542 JackBBTFrameOffset = 0x40,
00543 JackAudioVideoRatio = 0x80,
00544 JackVideoFrameOffset = 0x100
00546 } jack_position_bits_t;
00547
00549 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
00550 #define EXTENDED_TIME_INFO
00551
00552 PRE_PACKED_STRUCTURE
00553 struct _jack_position {
00554
00555
00556 jack_unique_t unique_1;
00557 jack_time_t usecs;
00558 jack_nframes_t frame_rate;
00559 jack_nframes_t frame;
00561 jack_position_bits_t valid;
00563
00564 int32_t bar;
00565 int32_t beat;
00566 int32_t tick;
00567 double bar_start_tick;
00568
00569 float beats_per_bar;
00570 float beat_type;
00571 double ticks_per_beat;
00572 double beats_per_minute;
00573
00574
00575 double frame_time;
00576 double next_time;
00579
00580 jack_nframes_t bbt_offset;
00595
00596
00597 float audio_frames_per_video_frame;
00604 jack_nframes_t video_offset;
00611
00612
00613
00614 int32_t padding[7];
00615
00616
00617 jack_unique_t unique_2;
00619 } POST_PACKED_STRUCTURE;
00620
00621 typedef struct _jack_position jack_position_t;
00622
00644 typedef int (*JackSyncCallback)(jack_transport_state_t state,
00645 jack_position_t *pos,
00646 void *arg);
00647
00648
00678 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
00679 jack_nframes_t nframes,
00680 jack_position_t *pos,
00681 int new_pos,
00682 void *arg);
00683
00684
00685
00686
00687
00688
00694 typedef enum {
00695
00696 JackTransportState = 0x1,
00697 JackTransportPosition = 0x2,
00698 JackTransportLoop = 0x4,
00699 JackTransportSMPTE = 0x8,
00700 JackTransportBBT = 0x10
00702 } jack_transport_bits_t;
00703
00710 typedef struct {
00711
00712
00713
00714 jack_nframes_t frame_rate;
00715 jack_time_t usecs;
00717 jack_transport_bits_t valid;
00718 jack_transport_state_t transport_state;
00719 jack_nframes_t frame;
00720 jack_nframes_t loop_start;
00721 jack_nframes_t loop_end;
00722
00723 long smpte_offset;
00724 float smpte_frame_rate;
00726 int bar;
00727 int beat;
00728 int tick;
00729 double bar_start_tick;
00730
00731 float beats_per_bar;
00732 float beat_type;
00733 double ticks_per_beat;
00734 double beats_per_minute;
00735
00736 } jack_transport_info_t;
00737
00738
00739 #endif