jack.h
Go to the documentation of this file.
/*
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_h__
#define __jack_h__
#ifdef __cplusplus
extern "C" {
#endif
#include <jack/types.h>
#include <jack/transport.h>
/*************************************************************
* NOTE: JACK_WEAK_EXPORT ***MUST*** be used on every function
* added to the JACK API after the 0.116.2 release.
*
* Functions that predate this release are marked with
* JACK_WEAK_OPTIONAL_EXPORT which can be defined at compile
* time in a variety of ways. The default definition is empty,
* so that these symbols get normal linkage. If you wish to
* use all JACK symbols with weak linkage, include
* <jack/weakjack.h> before jack.h.
*************************************************************/
#include <jack/weakmacros.h>
jack_client_t *jack_client_open (const char *client_name,
jack_options_t options,
jack_status_t *status, ...) JACK_OPTIONAL_WEAK_EXPORT;
jack_client_t *jack_client_new (const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
int jack_client_close (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
int jack_client_name_size (void) JACK_OPTIONAL_WEAK_EXPORT;
char *jack_get_client_name (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
int jack_internal_client_new (const char *client_name,
const char *load_name,
const char *load_init) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
void jack_internal_client_close (const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
int jack_activate (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
int jack_deactivate (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
jack_native_thread_t jack_client_thread_id (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;
int jack_is_realtime (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
jack_nframes_t jack_thread_wait (jack_client_t*, int status) JACK_OPTIONAL_WEAK_EXPORT;
jack_nframes_t jack_cycle_wait (jack_client_t* client) JACK_OPTIONAL_WEAK_EXPORT;
void jack_cycle_signal (jack_client_t* client, int status) JACK_OPTIONAL_WEAK_EXPORT;
int jack_set_process_thread(jack_client_t* client, JackThreadCallback fun, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
int jack_set_thread_init_callback (jack_client_t *client,
JackThreadInitCallback thread_init_callback,
void *arg) JACK_OPTIONAL_WEAK_EXPORT;
void jack_on_shutdown (jack_client_t *client,
JackShutdownCallback function, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
void jack_on_info_shutdown (jack_client_t *client,
JackInfoShutdownCallback function, void *arg) JACK_WEAK_EXPORT;
int jack_set_process_callback (jack_client_t *client,
JackProcessCallback process_callback,
void *arg) JACK_OPTIONAL_WEAK_EXPORT;
int jack_set_freewheel_callback (jack_client_t *client,
JackFreewheelCallback freewheel_callback,
void *arg) JACK_OPTIONAL_WEAK_EXPORT;
int jack_set_buffer_size_callback (jack_client_t *client,
JackBufferSizeCallback bufsize_callback,
void *arg) JACK_OPTIONAL_WEAK_EXPORT;
int jack_set_sample_rate_callback (jack_client_t *client,
JackSampleRateCallback srate_callback,
void *arg) JACK_OPTIONAL_WEAK_EXPORT;
int jack_set_client_registration_callback (jack_client_t *,
JackClientRegistrationCallback
registration_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
int jack_set_port_registration_callback (jack_client_t *,
JackPortRegistrationCallback
registration_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
int jack_set_port_connect_callback (jack_client_t *,
JackPortConnectCallback
connect_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
int jack_set_graph_order_callback (jack_client_t *,
JackGraphOrderCallback graph_callback,
void *) JACK_OPTIONAL_WEAK_EXPORT;
int jack_set_xrun_callback (jack_client_t *,
JackXRunCallback xrun_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
int jack_set_latency_callback (jack_client_t *,
JackLatencyCallback latency_callback,
void *) JACK_WEAK_EXPORT;
int jack_set_freewheel(jack_client_t* client, int onoff) JACK_OPTIONAL_WEAK_EXPORT;
int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes) JACK_OPTIONAL_WEAK_EXPORT;
jack_nframes_t jack_get_sample_rate (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;
jack_nframes_t jack_get_buffer_size (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;
int jack_engine_takeover_timebase (jack_client_t *) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
float jack_cpu_load (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
jack_port_t *jack_port_register (jack_client_t *client,
const char *port_name,
const char *port_type,
unsigned long flags,
unsigned long buffer_size) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_unregister (jack_client_t *, jack_port_t *) JACK_OPTIONAL_WEAK_EXPORT;
void *jack_port_get_buffer (jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT;
const char *jack_port_name (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
const char *jack_port_short_name (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_flags (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
const char *jack_port_type (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_is_mine (const jack_client_t *, const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_connected (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_connected_to (const jack_port_t *port,
const char *port_name) JACK_OPTIONAL_WEAK_EXPORT;
const char **jack_port_get_connections (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
const char **jack_port_get_all_connections (const jack_client_t *client,
const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_tie (jack_port_t *src, jack_port_t *dst) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
int jack_port_untie (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
int jack_port_set_name (jack_port_t *port, const char *port_name) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_set_alias (jack_port_t *port, const char *alias) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_unset_alias (jack_port_t *port, const char *alias) JACK_OPTIONAL_WEAK_EXPORT;
/*
* Get any aliases known for @port.
*
* @return the number of aliases discovered for the port
*/
int jack_port_get_aliases (const jack_port_t *port, char* const aliases[2]) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_request_monitor (jack_port_t *port, int onoff) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_request_monitor_by_name (jack_client_t *client,
const char *port_name, int onoff) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_ensure_monitor (jack_port_t *port, int onoff) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_monitoring_input (jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
int jack_connect (jack_client_t *,
const char *source_port,
const char *destination_port) JACK_OPTIONAL_WEAK_EXPORT;
int jack_disconnect (jack_client_t *,
const char *source_port,
const char *destination_port) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_disconnect (jack_client_t *, jack_port_t *) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_name_size(void) JACK_OPTIONAL_WEAK_EXPORT;
int jack_port_type_size(void) JACK_OPTIONAL_WEAK_EXPORT;
size_t jack_port_type_get_buffer_size (jack_client_t *client, const char *port_type) JACK_WEAK_EXPORT;
void jack_port_set_latency (jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
void jack_port_get_latency_range (jack_port_t *port, jack_latency_callback_mode_t mode, jack_latency_range_t *range) JACK_WEAK_EXPORT;
void jack_port_set_latency_range (jack_port_t *port, jack_latency_callback_mode_t mode, jack_latency_range_t *range) JACK_WEAK_EXPORT;
int jack_recompute_total_latencies (jack_client_t*) JACK_OPTIONAL_WEAK_EXPORT;
jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
jack_nframes_t jack_port_get_total_latency (jack_client_t *,
jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
int jack_recompute_total_latency (jack_client_t*, jack_port_t* port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
const char **jack_get_ports (jack_client_t *,
const char *port_name_pattern,
const char *type_name_pattern,
unsigned long flags) JACK_OPTIONAL_WEAK_EXPORT;
jack_port_t *jack_port_by_name (jack_client_t *, const char *port_name) JACK_OPTIONAL_WEAK_EXPORT;
jack_port_t *jack_port_by_id (jack_client_t *client,
jack_port_id_t port_id) JACK_OPTIONAL_WEAK_EXPORT;
jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;
jack_nframes_t jack_frame_time (const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;
jack_nframes_t jack_last_frame_time (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
jack_time_t jack_frames_to_time(const jack_client_t *client, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT;
jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t) JACK_OPTIONAL_WEAK_EXPORT;
jack_time_t jack_get_time() JACK_OPTIONAL_WEAK_EXPORT;
extern void (*jack_error_callback)(const char *msg) JACK_OPTIONAL_WEAK_EXPORT;
void jack_set_error_function (void (*func)(const char *)) JACK_OPTIONAL_WEAK_EXPORT;
extern void (*jack_info_callback)(const char *msg) JACK_OPTIONAL_WEAK_EXPORT;
void jack_set_info_function (void (*func)(const char *)) JACK_OPTIONAL_WEAK_EXPORT;
void jack_free(void* ptr) JACK_OPTIONAL_WEAK_EXPORT;
#ifdef __cplusplus
}
#endif
#endif /* __jack_h__ */