JACK-AUDIO-CONNECTION-KIT
jack.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2001 Paul Davis
3  Copyright (C) 2004 Jack O'Quin
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation; either version 2.1 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 */
20 
21 #ifndef __jack_h__
22 #define __jack_h__
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #include <jack/systemdeps.h>
29 #include <jack/types.h>
30 #include <jack/transport.h>
31 
37 /*************************************************************
38  * NOTE: JACK_WEAK_EXPORT ***MUST*** be used on every function
39  * added to the JACK API after the 0.116.2 release.
40  *
41  * Functions that predate this release are marked with
42  * JACK_WEAK_OPTIONAL_EXPORT which can be defined at compile
43  * time in a variety of ways. The default definition is empty,
44  * so that these symbols get normal linkage. If you wish to
45  * use all JACK symbols with weak linkage, include
46  * <jack/weakjack.h> before jack.h.
47  *************************************************************/
48 
49 #include <jack/weakmacros.h>
50 
89 jack_client_t *jack_client_open (const char *client_name,
90  jack_options_t options,
92 
98 jack_client_t *jack_client_new (const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
99 
106 
112 
120 
132  const char *name) JACK_WEAK_EXPORT;
133 
144  const char *uuid ) JACK_WEAK_EXPORT;
145 
167 int jack_internal_client_new (const char *client_name,
168  const char *load_name,
169  const char *load_init) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
170 
176 void jack_internal_client_close (const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
177 
185 
194 
200 
211 
224 jack_nframes_t jack_thread_wait (jack_client_t*, int status) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
225 
234 
242 
255 
275  JackThreadInitCallback thread_init_callback,
276  void *arg) JACK_OPTIONAL_WEAK_EXPORT;
277 
302  JackShutdownCallback function, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
303 
328  JackInfoShutdownCallback function, void *arg) JACK_WEAK_EXPORT;
329 
344  JackProcessCallback process_callback,
345  void *arg) JACK_OPTIONAL_WEAK_EXPORT;
346 
357  JackFreewheelCallback freewheel_callback,
358  void *arg) JACK_OPTIONAL_WEAK_EXPORT;
359 
373  JackBufferSizeCallback bufsize_callback,
374  void *arg) JACK_OPTIONAL_WEAK_EXPORT;
375 
383  JackSampleRateCallback srate_callback,
384  void *arg) JACK_OPTIONAL_WEAK_EXPORT;
385 
394  registration_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
395 
404  registration_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
405 
406 
415  rename_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
416 
425  connect_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
433  JackGraphOrderCallback graph_callback,
435 
443  JackXRunCallback xrun_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
444 
503  JackLatencyCallback latency_callback,
504  void *) JACK_WEAK_EXPORT;
537 
554 
560 
571 
582 int jack_engine_takeover_timebase (jack_client_t *) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
583 
591 
592 
630  const char *port_name,
631  const char *port_type,
632  unsigned long flags,
633  unsigned long buffer_size) JACK_OPTIONAL_WEAK_EXPORT;
634 
642 
655 
663 
670 
678 
683 
689 
694 
701 
709  const char *port_name) JACK_OPTIONAL_WEAK_EXPORT;
710 
723 
743 const char **jack_port_get_all_connections (const jack_client_t *client,
745 
753 int jack_port_tie (jack_port_t *src, jack_port_t *dst) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
754 
762 int jack_port_untie (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
763 
771 int jack_port_set_name (jack_port_t *port, const char *port_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
772 
783 int jack_port_rename (jack_client_t* client, jack_port_t *port, const char *port_name) JACK_OPTIONAL_WEAK_EXPORT;
784 
799 
809 
810 /*
811  * Get any aliases known for @port.
812  *
813  * @return the number of aliases discovered for the port
814  */
815 int jack_port_get_aliases (const jack_port_t *port, char* const aliases[2]) JACK_OPTIONAL_WEAK_EXPORT;
816 
822 
832  const char *port_name, int onoff) JACK_OPTIONAL_WEAK_EXPORT;
833 
842 
847 
866  const char *source_port,
867  const char *destination_port) JACK_OPTIONAL_WEAK_EXPORT;
868 
883  const char *source_port,
884  const char *destination_port) JACK_OPTIONAL_WEAK_EXPORT;
885 
896 
906 
912 
918 size_t jack_port_type_get_buffer_size (jack_client_t *client, const char *port_type) JACK_WEAK_EXPORT;
919 
986 void jack_port_set_latency (jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
987 
1001 
1070 
1085 
1101 jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
1102 
1114  jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
1115 
1132 int jack_recompute_total_latency (jack_client_t*, jack_port_t* port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
1133 
1158  const char *port_name_pattern,
1159  const char *type_name_pattern,
1160  unsigned long flags) JACK_OPTIONAL_WEAK_EXPORT;
1161 
1168 
1174 
1192 
1200 
1216 
1261  jack_nframes_t *current_frames,
1262  jack_time_t *current_usecs,
1263  jack_time_t *next_usecs,
1264  float *period_usecs) JACK_OPTIONAL_WEAK_EXPORT;
1265 
1270 
1275 
1283 
1290 
1299 extern void (*jack_error_callback)(const char *msg) JACK_OPTIONAL_WEAK_EXPORT;
1300 
1307 void jack_set_error_function (void (*func)(const char *)) JACK_OPTIONAL_WEAK_EXPORT;
1308 
1317 extern void (*jack_info_callback)(const char *msg) JACK_OPTIONAL_WEAK_EXPORT;
1318 
1322 void jack_set_info_function (void (*func)(const char *)) JACK_OPTIONAL_WEAK_EXPORT;
1333 
1334 #ifdef __cplusplus
1335 }
1336 #endif
1337 
1338 #endif /* __jack_h__ */
int jack_set_buffer_size_callback(jack_client_t *client, JackBufferSizeCallback bufsize_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT
int jack_set_xrun_callback(jack_client_t *, JackXRunCallback xrun_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT
int jack_set_port_rename_callback(jack_client_t *, JackPortRenameCallback rename_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
void jack_on_shutdown(jack_client_t *client, JackShutdownCallback function, 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_connect_callback(jack_client_t *, JackPortConnectCallback connect_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_sample_rate_callback(jack_client_t *client, JackSampleRateCallback srate_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_thread_init_callback(jack_client_t *client, JackThreadInitCallback thread_init_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
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
void jack_internal_client_close(const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
int jack_is_realtime(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
int jack_deactivate(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
int jack_client_close(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
char * jack_get_client_name(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
char * jack_get_uuid_for_client_name(jack_client_t *client, const char *name) JACK_WEAK_EXPORT
jack_native_thread_t jack_client_thread_id(jack_client_t *) 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
jack_client_t * jack_client_new(const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
int jack_activate(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
char * jack_get_client_name_by_uuid(jack_client_t *client, const char *uuid) JACK_WEAK_EXPORT
int jack_client_name_size(void) JACK_OPTIONAL_WEAK_EXPORT
jack_client_t * jack_client_open(const char *client_name, jack_options_t options, jack_status_t *status,...) JACK_OPTIONAL_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
int jack_recompute_total_latency(jack_client_t *, jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_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
jack_nframes_t jack_port_get_total_latency(jack_client_t *, jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_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
jack_nframes_t jack_thread_wait(jack_client_t *, int status) JACK_OPTIONAL_WEAK_DEPRECATED_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
jack_nframes_t jack_cycle_wait(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
int jack_port_tie(jack_port_t *src, jack_port_t *dst) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
int jack_port_set_name(jack_port_t *port, const char *port_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
void * jack_port_get_buffer(jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT
int jack_port_is_mine(const jack_client_t *, const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT
const char * jack_port_name(const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT
int jack_port_flags(const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT
int jack_port_rename(jack_client_t *client, jack_port_t *port, const char *port_name) 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_get_aliases(const jack_port_t *port, char *const aliases[2]) 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_unset_alias(jack_port_t *port, const char *alias) JACK_OPTIONAL_WEAK_EXPORT
size_t jack_port_type_get_buffer_size(jack_client_t *client, const char *port_type) JACK_WEAK_EXPORT
int jack_port_monitoring_input(jack_port_t *port) 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_type_size(void) JACK_OPTIONAL_WEAK_EXPORT
int jack_port_disconnect(jack_client_t *, jack_port_t *) JACK_OPTIONAL_WEAK_EXPORT
int jack_port_connected_to(const jack_port_t *port, const char *port_name) JACK_OPTIONAL_WEAK_EXPORT
int jack_port_unregister(jack_client_t *, jack_port_t *) JACK_OPTIONAL_WEAK_EXPORT
int jack_port_untie(jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
int jack_port_request_monitor(jack_port_t *port, int onoff) JACK_OPTIONAL_WEAK_EXPORT
int jack_port_name_size(void) JACK_OPTIONAL_WEAK_EXPORT
const char ** jack_port_get_connections(const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT
const char * jack_port_type(const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT
jack_uuid_t jack_port_uuid(const 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_port_set_alias(jack_port_t *port, const char *alias) JACK_OPTIONAL_WEAK_EXPORT
const char * jack_port_short_name(const jack_port_t *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_connected(const jack_port_t *port) 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
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
int jack_engine_takeover_timebase(jack_client_t *) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
jack_nframes_t jack_get_sample_rate(jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT
float jack_cpu_load(jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
jack_nframes_t jack_get_buffer_size(jack_client_t *) JACK_OPTIONAL_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
int jack_get_cycle_times(const jack_client_t *client, jack_nframes_t *current_frames, jack_time_t *current_usecs, jack_time_t *next_usecs, float *period_usecs) JACK_OPTIONAL_WEAK_EXPORT
void jack_set_info_function(void(*func)(const char *)) JACK_OPTIONAL_WEAK_EXPORT
jack_time_t jack_get_time(void) JACK_OPTIONAL_WEAK_EXPORT
void jack_free(void *ptr) JACK_OPTIONAL_WEAK_EXPORT
jack_nframes_t jack_frame_time(const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT
void(* jack_info_callback)(const char *msg) JACK_OPTIONAL_WEAK_EXPORT
void jack_set_error_function(void(*func)(const char *)) JACK_OPTIONAL_WEAK_EXPORT
void(* jack_error_callback)(const char *msg) 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_nframes_t jack_frames_since_cycle_start(const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT
jack_nframes_t jack_last_frame_time(const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
Definition: types.h:281
int(* JackSampleRateCallback)(jack_nframes_t nframes, void *arg)
Definition: types.h:369
enum JackOptions jack_options_t
Definition: types.h:154
void(* JackShutdownCallback)(void *arg)
Definition: types.h:438
void(* JackFreewheelCallback)(int starting, void *arg)
Definition: types.h:423
uint64_t jack_uuid_t
Definition: types.h:27
void(* JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void *arg)
Definition: types.h:414
void(* JackThreadInitCallback)(void *arg)
Definition: types.h:320
enum JackStatus jack_status_t
Definition: types.h:240
uint32_t jack_port_id_t
Definition: types.h:95
struct _jack_port jack_port_t
Definition: types.h:83
void(* JackClientRegistrationCallback)(const char *name, int, void *arg)
Definition: types.h:402
struct _jack_client jack_client_t
Definition: types.h:89
uint32_t jack_nframes_t
Definition: types.h:53
int(* JackBufferSizeCallback)(jack_nframes_t nframes, void *arg)
Definition: types.h:358
void(* JackPortRenameCallback)(jack_port_id_t port, const char *old_name, const char *new_name, void *arg)
Definition: types.h:391
void(* JackPortRegistrationCallback)(jack_port_id_t port, int, void *arg)
Definition: types.h:380
int(* JackProcessCallback)(jack_nframes_t nframes, void *arg)
Definition: types.h:306
void(* JackLatencyCallback)(jack_latency_callback_mode_t mode, void *arg)
Definition: types.h:275
int(* JackXRunCallback)(void *arg)
Definition: types.h:342
int(* JackGraphOrderCallback)(void *arg)
Definition: types.h:330
void(* JackInfoShutdownCallback)(jack_status_t code, const char *reason, void *arg)
Definition: types.h:453
enum JackLatencyCallbackMode jack_latency_callback_mode_t
Definition: types.h:266
void *(* JackThreadCallback)(void *arg)
Definition: types.h:425
uint64_t jack_time_t
Definition: types.h:64
#define JACK_OPTIONAL_WEAK_EXPORT
Definition: weakmacros.h:56