types.h
/*
Copyright (C) 2001 Paul Davis
Copyright (C) 2004 Jack O'Quin
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __jack_types_h__
#define __jack_types_h__
#include <jack/systemdeps.h>
typedef uint64_t jack_uuid_t;
typedef int32_t jack_shmsize_t;
typedef uint32_t jack_nframes_t;
#define JACK_MAX_FRAMES (4294967295U) /* This should be UINT32_MAX, but C++ has a problem with that. */
typedef uint64_t jack_time_t;
#define JACK_LOAD_INIT_LIMIT 1024
typedef uint64_t jack_intclient_t;
typedef struct _jack_port jack_port_t;
typedef struct _jack_client jack_client_t;
typedef uint32_t jack_port_id_t;
typedef uint32_t jack_port_type_id_t;
enum JackOptions {
JackNullOption = 0x00,
JackNoStartServer = 0x01,
JackUseExactName = 0x02,
JackServerName = 0x04,
JackLoadName = 0x08,
JackLoadInit = 0x10,
JackSessionID = 0x20
};
#define JackOpenOptions (JackSessionID|JackServerName|JackNoStartServer|JackUseExactName)
#define JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName)
typedef enum JackOptions jack_options_t;
enum JackStatus {
JackFailure = 0x01,
JackInvalidOption = 0x02,
JackNameNotUnique = 0x04,
JackServerStarted = 0x08,
JackServerFailed = 0x10,
JackServerError = 0x20,
JackNoSuchClient = 0x40,
JackLoadFailure = 0x80,
JackInitFailure = 0x100,
JackShmFailure = 0x200,
JackVersionError = 0x400,
JackBackendError = 0x800,
JackClientZombie = 0x1000
};
typedef enum JackStatus jack_status_t;
enum JackLatencyCallbackMode {
JackCaptureLatency,
JackPlaybackLatency
};
typedef enum JackLatencyCallbackMode jack_latency_callback_mode_t;
typedef void (*JackLatencyCallback)(jack_latency_callback_mode_t mode, void *arg);
PRE_PACKED_STRUCTURE
struct _jack_latency_range
{
jack_nframes_t min;
jack_nframes_t max;
} POST_PACKED_STRUCTURE;
typedef struct _jack_latency_range jack_latency_range_t;
typedef int (*JackProcessCallback)(jack_nframes_t nframes, void *arg);
typedef void *(*JackThreadCallback)(void* arg);
typedef void (*JackThreadInitCallback)(void *arg);
typedef int (*JackGraphOrderCallback)(void *arg);
typedef int (*JackXRunCallback)(void *arg);
typedef int (*JackBufferSizeCallback)(jack_nframes_t nframes, void *arg);
typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg);
typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int /* register */, void *arg);
typedef void (*JackClientRegistrationCallback)(const char* name, int /* register */, void *arg);
typedef void (*JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void* arg);
typedef void (*JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void *arg);
typedef void (*JackFreewheelCallback)(int starting, void *arg);
typedef void (*JackShutdownCallback)(void *arg);
typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* reason, void *arg);
#define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
#define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi"
typedef float jack_default_audio_sample_t;
enum JackPortFlags {
JackPortIsInput = 0x1,
JackPortIsOutput = 0x2,
JackPortIsPhysical = 0x4,
JackPortCanMonitor = 0x8,
JackPortIsTerminal = 0x10,
};
typedef enum {
/* the order matters for binary compatibility */
JackTransportStopped = 0,
JackTransportRolling = 1,
JackTransportLooping = 2,
JackTransportStarting = 3,
JackTransportNetStarting = 4,
} jack_transport_state_t;
typedef uint64_t jack_unique_t;
typedef enum {
JackPositionBBT = 0x10,
JackPositionTimecode = 0x20,
JackBBTFrameOffset = 0x40,
JackAudioVideoRatio = 0x80,
JackVideoFrameOffset = 0x100
} jack_position_bits_t;
#define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
#define EXTENDED_TIME_INFO
PRE_PACKED_STRUCTURE
struct _jack_position {
/* these four cannot be set from clients: the server sets them */
jack_unique_t unique_1;
jack_time_t usecs;
jack_nframes_t frame_rate;
jack_nframes_t frame;
jack_position_bits_t valid;
/* JackPositionBBT fields: */
int32_t bar;
int32_t beat;
int32_t tick;
double bar_start_tick;
float beats_per_bar;
float beat_type;
double ticks_per_beat;
double beats_per_minute;
/* JackPositionTimecode fields: (EXPERIMENTAL: could change) */
double frame_time;
double next_time;
/* JackBBTFrameOffset fields: */
jack_nframes_t bbt_offset;
/* JACK video positional data (experimental) */
float audio_frames_per_video_frame;
jack_nframes_t video_offset;
/* For binary compatibility, new fields should be allocated from
* this padding area with new valid bits controlling access, so
* the existing structure size and offsets are preserved. */
int32_t padding[7];
/* When (unique_1 == unique_2) the contents are consistent. */
jack_unique_t unique_2;
} POST_PACKED_STRUCTURE;
typedef struct _jack_position jack_position_t;
typedef int (*JackSyncCallback)(jack_transport_state_t state,
jack_position_t *pos,
void *arg);
typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
jack_nframes_t nframes,
jack_position_t *pos,
int new_pos,
void *arg);
/*********************************************************************
* The following interfaces are DEPRECATED. They are only provided
* for compatibility with the earlier JACK transport implementation.
*********************************************************************/
typedef enum {
JackTransportState = 0x1,
JackTransportPosition = 0x2,
JackTransportLoop = 0x4,
JackTransportSMPTE = 0x8,
JackTransportBBT = 0x10
} jack_transport_bits_t;
typedef struct {
/* these two cannot be set from clients: the server sets them */
jack_nframes_t frame_rate;
jack_time_t usecs;
jack_transport_bits_t valid;
jack_transport_state_t transport_state;
jack_nframes_t frame;
jack_nframes_t loop_start;
jack_nframes_t loop_end;
long smpte_offset;
float smpte_frame_rate;
int bar;
int beat;
int tick;
double bar_start_tick;
float beats_per_bar;
float beat_type;
double ticks_per_beat;
double beats_per_minute;
} jack_transport_info_t;
#endif /* __jack_types_h__ */
_jack_position
Definition: types.h:554
_jack_position::frame_time
double frame_time
Definition: types.h:576
jack_transport_info_t
Definition: types.h:711
_jack_position::video_offset
jack_nframes_t video_offset
Definition: types.h:605
_jack_position::bbt_offset
jack_nframes_t bbt_offset
Definition: types.h:581
_jack_position::valid
jack_position_bits_t valid
Definition: types.h:562
_jack_position::beat_type
float beat_type
Definition: types.h:571
_jack_latency_range::min
jack_nframes_t min
Definition: types.h:270
_jack_position::tick
int32_t tick
Definition: types.h:567
_jack_latency_range
Definition: types.h:265
_jack_position::unique_1
jack_unique_t unique_1
Definition: types.h:557
_jack_latency_range::max
jack_nframes_t max
Definition: types.h:274
_jack_position::next_time
double next_time
Definition: types.h:577
_jack_position::beats_per_bar
float beats_per_bar
Definition: types.h:570
_jack_position::audio_frames_per_video_frame
float audio_frames_per_video_frame
Definition: types.h:598
_jack_position::frame_rate
jack_nframes_t frame_rate
Definition: types.h:559
jack_transport_info_t::valid
jack_transport_bits_t valid
Definition: types.h:718
_jack_position::unique_2
jack_unique_t unique_2
Definition: types.h:618
_jack_position::usecs
jack_time_t usecs
Definition: types.h:558
jack_transport_info_t::frame_rate
jack_nframes_t frame_rate
Definition: types.h:715
_jack_position::frame
jack_nframes_t frame
Definition: types.h:560
_jack_position::beat
int32_t beat
Definition: types.h:566
_jack_position::bar
int32_t bar
Definition: types.h:565
jack_transport_info_t::smpte_offset
long smpte_offset
Definition: types.h:724
jack_transport_info_t::smpte_frame_rate
float smpte_frame_rate
Definition: types.h:725
jack_transport_info_t::usecs
jack_time_t usecs
Definition: types.h:716