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
00027 typedef int32_t jack_shmsize_t;
00028
00032 typedef uint32_t jack_nframes_t;
00033
00037 #define JACK_MAX_FRAMES (4294967295U)
00038
00043 typedef uint64_t jack_time_t;
00044
00049 #define JACK_LOAD_INIT_LIMIT 1024
00050
00056 typedef uint64_t jack_intclient_t;
00057
00062 typedef struct _jack_port jack_port_t;
00063
00068 typedef struct _jack_client jack_client_t;
00069
00074 typedef uint32_t jack_port_id_t;
00075
00076 typedef uint32_t jack_port_type_id_t;
00077
00090 typedef int (*JackProcessCallback)(jack_nframes_t nframes, void *arg);
00091
00099 typedef void *(*JackThreadCallback)(void* arg);
00100
00113 typedef void (*JackThreadInitCallback)(void *arg);
00114
00123 typedef int (*JackGraphOrderCallback)(void *arg);
00124
00135 typedef int (*JackXRunCallback)(void *arg);
00136
00151 typedef int (*JackBufferSizeCallback)(jack_nframes_t nframes, void *arg);
00152
00162 typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg);
00163
00170 typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int, void *arg);
00171
00181 typedef void (*JackClientRegistrationCallback)(const char* name, int val, void *arg);
00182
00193 typedef void (*JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void* arg);
00194
00205 typedef int (*JackPortRenameCallback)(jack_port_id_t port, const char* new_name, void *arg);
00206
00214 typedef void (*JackFreewheelCallback)(int starting, void *arg);
00215
00227 typedef void (*JackShutdownCallback)(void *arg);
00228
00233 #define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
00234 #define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi"
00235
00241 typedef float jack_default_audio_sample_t;
00242
00249 enum JackPortFlags {
00250
00255 JackPortIsInput = 0x1,
00256
00261 JackPortIsOutput = 0x2,
00262
00267 JackPortIsPhysical = 0x4,
00268
00282 JackPortCanMonitor = 0x8,
00283
00298 JackPortIsTerminal = 0x10
00299 };
00300
00304 enum JackOptions {
00305
00309 JackNullOption = 0x00,
00310
00317 JackNoStartServer = 0x01,
00318
00323 JackUseExactName = 0x02,
00324
00328 JackServerName = 0x04,
00329
00334 JackLoadName = 0x08,
00335
00340 JackLoadInit = 0x10
00341 };
00342
00344 #define JackOpenOptions (JackServerName|JackNoStartServer|JackUseExactName)
00345
00347 #define JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName)
00348
00353 typedef enum JackOptions jack_options_t;
00354
00358 enum JackStatus {
00359
00363 JackFailure = 0x01,
00364
00368 JackInvalidOption = 0x02,
00369
00379 JackNameNotUnique = 0x04,
00380
00387 JackServerStarted = 0x08,
00388
00392 JackServerFailed = 0x10,
00393
00397 JackServerError = 0x20,
00398
00402 JackNoSuchClient = 0x40,
00403
00407 JackLoadFailure = 0x80,
00408
00412 JackInitFailure = 0x100,
00413
00417 JackShmFailure = 0x200,
00418
00422 JackVersionError = 0x400,
00423
00427 JackBackendError = 0x800,
00428
00432 JackClientZombie = 0x1000
00433 };
00434
00439 typedef enum JackStatus jack_status_t;
00440
00444 typedef enum {
00445
00446
00447 JackTransportStopped = 0,
00448 JackTransportRolling = 1,
00449 JackTransportLooping = 2,
00450 JackTransportStarting = 3,
00451 JackTransportNetStarting = 4,
00453 } jack_transport_state_t;
00454
00455 typedef uint64_t jack_unique_t;
00460 typedef enum {
00461
00462 JackPositionBBT = 0x10,
00463 JackPositionTimecode = 0x20,
00464 JackBBTFrameOffset = 0x40,
00465 JackAudioVideoRatio = 0x80,
00466 JackVideoFrameOffset = 0x100
00468 } jack_position_bits_t;
00469
00471 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
00472 #define EXTENDED_TIME_INFO
00473
00474 typedef struct {
00475
00476
00477 jack_unique_t unique_1;
00478 jack_time_t usecs;
00479 jack_nframes_t frame_rate;
00480 jack_nframes_t frame;
00482 jack_position_bits_t valid;
00484
00485 int32_t bar;
00486 int32_t beat;
00487 int32_t tick;
00488 double bar_start_tick;
00489
00490 float beats_per_bar;
00491 float beat_type;
00492 double ticks_per_beat;
00493 double beats_per_minute;
00494
00495
00496 double frame_time;
00497 double next_time;
00500
00501 jack_nframes_t bbt_offset;
00516
00517
00518 float audio_frames_per_video_frame;
00525 jack_nframes_t video_offset;
00532
00533
00534
00535 int32_t padding[7];
00536
00537
00538 jack_unique_t unique_2;
00540 } jack_position_t;
00541
00563 typedef int (*JackSyncCallback)(jack_transport_state_t state,
00564 jack_position_t *pos,
00565 void *arg);
00566
00567
00597 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
00598 jack_nframes_t nframes,
00599 jack_position_t *pos,
00600 int new_pos,
00601 void *arg);
00602
00603
00604
00605
00606
00607
00613 typedef enum {
00614
00615 JackTransportState = 0x1,
00616 JackTransportPosition = 0x2,
00617 JackTransportLoop = 0x4,
00618 JackTransportSMPTE = 0x8,
00619 JackTransportBBT = 0x10
00621 } jack_transport_bits_t;
00622
00629 typedef struct {
00630
00631
00632
00633 jack_nframes_t frame_rate;
00634 jack_time_t usecs;
00636 jack_transport_bits_t valid;
00637 jack_transport_state_t transport_state;
00638 jack_nframes_t frame;
00639 jack_nframes_t loop_start;
00640 jack_nframes_t loop_end;
00641
00642 long smpte_offset;
00643 float smpte_frame_rate;
00645 int bar;
00646 int beat;
00647 int tick;
00648 double bar_start_tick;
00649
00650 float beats_per_bar;
00651 float beat_type;
00652 double ticks_per_beat;
00653 double beats_per_minute;
00654
00655 } jack_transport_info_t;
00656
00670 typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* reason, void *arg);
00671
00672 #endif