JACK-AUDIO-CONNECTION-KIT
|
#include <inttypes.h>
#include <pthread.h>
Go to the source code of this file.
Data Structures | |
struct | _jack_latency_range |
Macros | |
#define | JACK_MAX_FRAMES |
#define | JACK_LOAD_INIT_LIMIT 1024 |
#define | JackOpenOptions (JackSessionID|JackServerName|JackNoStartServer|JackUseExactName) |
#define | JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName) |
#define | JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio" |
#define | JACK_DEFAULT_MIDI_TYPE "8 bit raw midi" |
Typedefs | |
typedef uint64_t | jack_uuid_t |
typedef int32_t | jack_shmsize_t |
typedef uint32_t | jack_nframes_t |
typedef uint64_t | jack_time_t |
typedef jack_uuid_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 enum JackOptions | jack_options_t |
typedef enum JackStatus | jack_status_t |
typedef enum JackLatencyCallbackMode | jack_latency_callback_mode_t |
typedef void(* | JackLatencyCallback) (jack_latency_callback_mode_t mode, void *arg) |
typedef struct _jack_latency_range | jack_latency_range_t |
typedef int(* | JackProcessCallback) (jack_nframes_t nframes, 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, void *arg) |
typedef void(* | JackPortRenameCallback) (jack_port_id_t port, const char *old_name, const char *new_name, void *arg) |
typedef void(* | JackClientRegistrationCallback) (const char *name, int, void *arg) |
typedef void(* | JackPortConnectCallback) (jack_port_id_t a, jack_port_id_t b, int connect, void *arg) |
typedef void(* | JackFreewheelCallback) (int starting, void *arg) |
typedef void *(* | JackThreadCallback) (void *arg) |
typedef void(* | JackShutdownCallback) (void *arg) |
typedef void(* | JackInfoShutdownCallback) (jack_status_t code, const char *reason, void *arg) |
typedef float | jack_default_audio_sample_t |
Enumerations | |
enum | JackOptions { JackNullOption = 0x00 , JackNoStartServer = 0x01 , JackUseExactName = 0x02 , JackServerName = 0x04 , JackLoadName = 0x08 , JackLoadInit = 0x10 , JackSessionID = 0x20 } |
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 } |
enum | JackLatencyCallbackMode { JackCaptureLatency , JackPlaybackLatency } |
enum | JackPortFlags { JackPortIsInput = 0x1 , JackPortIsOutput = 0x2 , JackPortIsPhysical = 0x4 , JackPortCanMonitor = 0x8 , JackPortIsTerminal = 0x10 } |
#define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio" |
Used for the type argument of jack_port_register() for default audio and midi ports.
#define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi" |
#define JACK_LOAD_INIT_LIMIT 1024 |
Maximum size of load_init string passed to an internal client jack_initialize() function via jack_internal_client_load().
#define JACK_MAX_FRAMES |
Maximum value that can be stored in jack_nframes_t
#define JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName) |
Valid options for loading an internal client.
#define JackOpenOptions (JackSessionID|JackServerName|JackNoStartServer|JackUseExactName) |
Valid options for opening an external client.
typedef struct _jack_client jack_client_t |
jack_client_t is an opaque type. You may only access it using the API provided.
typedef float jack_default_audio_sample_t |
For convenience, use this typedef if you want to be able to change between float and double. You may want to typedef sample_t to jack_default_audio_sample_t in your application.
typedef jack_uuid_t jack_intclient_t |
jack_intclient_t is an opaque type representing a loaded internal client. You may only access it using the API provided in <jack/intclient.h>.
typedef enum JackLatencyCallbackMode jack_latency_callback_mode_t |
Type of Latency Callback (Capture or Playback)
typedef struct _jack_latency_range jack_latency_range_t |
typedef uint32_t jack_nframes_t |
Type used to represent sample frame counts.
typedef enum JackOptions jack_options_t |
Options for several JACK operations, formed by OR-ing together the relevant JackOptions bits.
typedef uint32_t jack_port_id_t |
Ports have unique ids. A port registration callback is the only place you ever need to know their value.
typedef struct _jack_port jack_port_t |
jack_port_t is an opaque type. You may only access it using the API provided.
typedef int32_t jack_shmsize_t |
typedef enum JackStatus jack_status_t |
Status word returned from several JACK operations, formed by OR-ing together the relevant JackStatus bits.
typedef uint64_t jack_time_t |
Type used to represent the value of free running monotonic clock with units of microseconds.
typedef uint64_t jack_uuid_t |
typedef int(* JackBufferSizeCallback) (jack_nframes_t nframes, void *arg) |
Prototype for the bufsize_callback that is invoked whenever the JACK engine buffer size changes. Although this function is called in the JACK process thread, the normal process cycle is suspended during its operation, causing a gap in the audio flow. So, the bufsize_callback can allocate storage, touch memory not previously referenced, and perform other operations that are not realtime safe.
nframes | buffer size |
arg | pointer supplied by jack_set_buffer_size_callback(). |
typedef void(* JackClientRegistrationCallback) (const char *name, int, void *arg) |
Prototype for the client supplied function that is called whenever a client is registered or unregistered.
name | a null-terminated string containing the client name |
register | non-zero if the client is being registered, zero if the client is being unregistered |
arg | pointer to a client supplied data |
typedef void(* JackFreewheelCallback) (int starting, void *arg) |
Prototype for the client supplied function that is called whenever jackd starts or stops freewheeling.
starting | non-zero if we start starting to freewheel, zero otherwise |
arg | pointer to a client supplied structure |
typedef int(* JackGraphOrderCallback) (void *arg) |
Prototype for the client supplied function that is called whenever the processing graph is reordered.
arg | pointer to a client supplied data |
typedef void(* JackInfoShutdownCallback) (jack_status_t code, const char *reason, void *arg) |
Prototype for the client supplied function that is called whenever jackd is shutdown. Note that after server shutdown, the client pointer is not deallocated by libjack, the application is responsible to properly use jack_client_close() to release client ressources. Warning: jack_client_close() cannot be safely used inside the shutdown callback and has to be called outside of the callback context.
code | a shutdown code |
reason | a string describing the shutdown reason (backend failure, server crash... etc...) |
arg | pointer to a client supplied structure |
typedef void(* JackLatencyCallback) (jack_latency_callback_mode_t mode, void *arg) |
Prototype for the client supplied function that is called by the engine when port latencies need to be recalculated
mode | playback or capture latency |
arg | pointer to a client supplied data |
typedef void(* JackPortConnectCallback) (jack_port_id_t a, jack_port_id_t b, int connect, void *arg) |
Prototype for the client supplied function that is called whenever ports are connected or disconnected.
a | one of two ports connected or disconnected |
b | one of two ports connected or disconnected |
connect | non-zero if ports were connected zero if ports were disconnected |
arg | pointer to a client supplied data |
typedef void(* JackPortRegistrationCallback) (jack_port_id_t port, int, void *arg) |
Prototype for the client supplied function that is called whenever a port is registered or unregistered.
port | the ID of the port |
arg | pointer to a client supplied data |
register | non-zero if the port is being registered, zero if the port is being unregistered |
typedef void(* JackPortRenameCallback) (jack_port_id_t port, const char *old_name, const char *new_name, void *arg) |
Prototype for the client supplied function that is called whenever a port is renamed
port | the ID of the port |
arg | pointer to a client supplied data |
old_name | the name of the port before the rename was carried out |
new_name | the name of the port after the rename was carried out |
typedef int(* JackProcessCallback) (jack_nframes_t nframes, void *arg) |
Prototype for the client supplied function that is called by the engine anytime there is work to be done.
nframes | number of frames to process |
arg | pointer to a client supplied data |
typedef int(* JackSampleRateCallback) (jack_nframes_t nframes, void *arg) |
Prototype for the client supplied function that is called when the engine sample rate changes.
nframes | new engine sample rate |
arg | pointer to a client supplied data |
typedef void(* JackShutdownCallback) (void *arg) |
Prototype for the client supplied function that is called whenever jackd is shutdown. Note that after server shutdown, the client pointer is not deallocated by libjack, the application is responsible to properly use jack_client_close() to release client ressources. Warning: jack_client_close() cannot be safely used inside the shutdown callback and has to be called outside of the callback context.
arg | pointer to a client supplied structure |
typedef void*(* JackThreadCallback) (void *arg) |
typedef void(* JackThreadInitCallback) (void *arg) |
Prototype for the client supplied function that is called once after the creation of the thread in which other callbacks will be made. Special thread characteristics can be set from this callback, for example. This is a highly specialized callback and most clients will not and should not use it.
arg | pointer to a client supplied structure |
typedef int(* JackXRunCallback) (void *arg) |
Prototype for the client-supplied function that is called whenever an xrun has occured.
arg | pointer to a client supplied data |
enum JackOptions |
jack_options_t bits
enum JackPortFlags |
A port has a set of flags that are formed by OR-ing together the desired values from the list below. The flags "JackPortIsInput" and "JackPortIsOutput" are mutually exclusive and it is an error to use them both.
Enumerator | |
---|---|
JackPortIsInput | if JackPortIsInput is set, then the port can receive data. |
JackPortIsOutput | if JackPortIsOutput is set, then data can be read from the port. |
JackPortIsPhysical | if JackPortIsPhysical is set, then the port corresponds to some kind of physical I/O connector. |
JackPortCanMonitor | if JackPortCanMonitor is set, then a call to jack_port_request_monitor() makes sense. Precisely what this means is dependent on the client. A typical result of it being called with TRUE as the second argument is that data that would be available from an output port (with JackPortIsPhysical set) is sent to a physical output connector as well, so that it can be heard/seen/whatever. Clients that do not control physical interfaces should never create ports with this bit set. |
JackPortIsTerminal | JackPortIsTerminal means: for an input port: the data received by the port will not be passed on or made available at any other port for an output port: the data available at the port does not originate from any other port Audio synthesizers, I/O hardware interface clients, HDR systems are examples of clients that would set this flag for their ports. |
enum JackStatus |
jack_status_t bits
Enumerator | |
---|---|
JackFailure | Overall operation failed. |
JackInvalidOption | The operation contained an invalid or unsupported option. |
JackNameNotUnique | The desired client name was not unique. With the JackUseExactName option this situation is fatal. Otherwise, the name was modified by appending a dash and a two-digit number in the range "-01" to "-99". The jack_get_client_name() function will return the exact string that was used. If the specified client_name plus these extra characters would be too long, the open fails instead. |
JackServerStarted | The JACK server was started as a result of this operation. Otherwise, it was running already. In either case the caller is now connected to jackd, so there is no race condition. When the server shuts down, the client will find out. |
JackServerFailed | Unable to connect to the JACK server. |
JackServerError | Communication error with the JACK server. |
JackNoSuchClient | Requested client does not exist. |
JackLoadFailure | Unable to load internal client |
JackInitFailure | Unable to initialize client |
JackShmFailure | Unable to access shared memory |
JackVersionError | Client's protocol version does not match |
JackBackendError | |
JackClientZombie |