JACK-AUDIO-CONNECTION-KIT 0.121.3

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

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/types.h>
29 #include <jack/transport.h>
30
36 /*************************************************************
37 * NOTE: JACK_WEAK_EXPORT ***MUST*** be used on every function
38 * added to the JACK API after the 0.116.2 release.
39 *
40 * Functions that predate this release are marked with
41 * JACK_WEAK_OPTIONAL_EXPORT which can be defined at compile
42 * time in a variety of ways. The default definition is empty,
43 * so that these symbols get normal linkage. If you wish to
44 * use all JACK symbols with weak linkage, include
45 * <jack/weakjack.h> before jack.h.
46 *************************************************************/
47
48 #include <jack/weakmacros.h>
49
88 jack_client_t *jack_client_open (const char *client_name,
89 jack_options_t options,
90 jack_status_t *status, ...) JACK_OPTIONAL_WEAK_EXPORT;
91
97 jack_client_t *jack_client_new (const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
98
104 int jack_client_close (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
105
110 int jack_client_name_size (void) JACK_OPTIONAL_WEAK_EXPORT;
111
118 char *jack_get_client_name (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
119
141 int jack_internal_client_new (const char *client_name,
142 const char *load_name,
143 const char *load_init) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
144
150 void jack_internal_client_close (const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
151
158 int jack_activate (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
159
167 int jack_deactivate (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
168
173 jack_native_thread_t jack_client_thread_id (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;
174
184 int jack_is_realtime (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
185
198 jack_nframes_t jack_thread_wait (jack_client_t*, int status) JACK_OPTIONAL_WEAK_EXPORT;
199
207 jack_nframes_t jack_cycle_wait (jack_client_t* client) JACK_OPTIONAL_WEAK_EXPORT;
208
215 void jack_cycle_signal (jack_client_t* client, int status) JACK_OPTIONAL_WEAK_EXPORT;
216
228 int jack_set_process_thread(jack_client_t* client, JackThreadCallback fun, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
229
248 int jack_set_thread_init_callback (jack_client_t *client,
249 JackThreadInitCallback thread_init_callback,
250 void *arg) JACK_OPTIONAL_WEAK_EXPORT;
251
275 void jack_on_shutdown (jack_client_t *client,
276 JackShutdownCallback function, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
277
301 void jack_on_info_shutdown (jack_client_t *client,
302 JackInfoShutdownCallback function, void *arg) JACK_WEAK_EXPORT;
303
317 int jack_set_process_callback (jack_client_t *client,
318 JackProcessCallback process_callback,
319 void *arg) JACK_OPTIONAL_WEAK_EXPORT;
320
330 int jack_set_freewheel_callback (jack_client_t *client,
331 JackFreewheelCallback freewheel_callback,
332 void *arg) JACK_OPTIONAL_WEAK_EXPORT;
333
346 int jack_set_buffer_size_callback (jack_client_t *client,
347 JackBufferSizeCallback bufsize_callback,
348 void *arg) JACK_OPTIONAL_WEAK_EXPORT;
349
356 int jack_set_sample_rate_callback (jack_client_t *client,
357 JackSampleRateCallback srate_callback,
358 void *arg) JACK_OPTIONAL_WEAK_EXPORT;
359
366 int jack_set_client_registration_callback (jack_client_t *,
367 JackClientRegistrationCallback
368 registration_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
369
376 int jack_set_port_registration_callback (jack_client_t *,
377 JackPortRegistrationCallback
378 registration_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
379
386 int jack_set_port_connect_callback (jack_client_t *,
387 JackPortConnectCallback
388 connect_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
395 int jack_set_graph_order_callback (jack_client_t *,
396 JackGraphOrderCallback graph_callback,
397 void *) JACK_OPTIONAL_WEAK_EXPORT;
398
405 int jack_set_xrun_callback (jack_client_t *,
406 JackXRunCallback xrun_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
407
461 int jack_set_latency_callback (jack_client_t *,
462 JackLatencyCallback latency_callback,
463 void *) JACK_WEAK_EXPORT;
495 int jack_set_freewheel(jack_client_t* client, int onoff) JACK_OPTIONAL_WEAK_EXPORT;
496
512 int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes) JACK_OPTIONAL_WEAK_EXPORT;
513
518 jack_nframes_t jack_get_sample_rate (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;
519
529 jack_nframes_t jack_get_buffer_size (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;
530
541 int jack_engine_takeover_timebase (jack_client_t *) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
542
549 float jack_cpu_load (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
550
551
588 jack_port_t *jack_port_register (jack_client_t *client,
589 const char *port_name,
590 const char *port_type,
591 unsigned long flags,
592 unsigned long buffer_size) JACK_OPTIONAL_WEAK_EXPORT;
593
600 int jack_port_unregister (jack_client_t *, jack_port_t *) JACK_OPTIONAL_WEAK_EXPORT;
601
613 void *jack_port_get_buffer (jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT;
614
621 const char *jack_port_name (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
622
629 const char *jack_port_short_name (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
630
634 int jack_port_flags (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
635
640 const char *jack_port_type (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
641
645 int jack_port_is_mine (const jack_client_t *, const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
646
652 int jack_port_connected (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
653
660 int jack_port_connected_to (const jack_port_t *port,
661 const char *port_name) JACK_OPTIONAL_WEAK_EXPORT;
662
674 const char **jack_port_get_connections (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
675
695 const char **jack_port_get_all_connections (const jack_client_t *client,
696 const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
697
705 int jack_port_tie (jack_port_t *src, jack_port_t *dst) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
706
714 int jack_port_untie (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
715
723 int jack_port_set_name (jack_port_t *port, const char *port_name) JACK_OPTIONAL_WEAK_EXPORT;
724
738 int jack_port_set_alias (jack_port_t *port, const char *alias) JACK_OPTIONAL_WEAK_EXPORT;
739
748 int jack_port_unset_alias (jack_port_t *port, const char *alias) JACK_OPTIONAL_WEAK_EXPORT;
749
750 /*
751 * Get any aliases known for @port.
752 *
753 * @return the number of aliases discovered for the port
754 */
755 int jack_port_get_aliases (const jack_port_t *port, char* const aliases[2]) JACK_OPTIONAL_WEAK_EXPORT;
756
761 int jack_port_request_monitor (jack_port_t *port, int onoff) JACK_OPTIONAL_WEAK_EXPORT;
762
771 int jack_port_request_monitor_by_name (jack_client_t *client,
772 const char *port_name, int onoff) JACK_OPTIONAL_WEAK_EXPORT;
773
781 int jack_port_ensure_monitor (jack_port_t *port, int onoff) JACK_OPTIONAL_WEAK_EXPORT;
782
786 int jack_port_monitoring_input (jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT;
787
805 int jack_connect (jack_client_t *,
806 const char *source_port,
807 const char *destination_port) JACK_OPTIONAL_WEAK_EXPORT;
808
822 int jack_disconnect (jack_client_t *,
823 const char *source_port,
824 const char *destination_port) JACK_OPTIONAL_WEAK_EXPORT;
825
835 int jack_port_disconnect (jack_client_t *, jack_port_t *) JACK_OPTIONAL_WEAK_EXPORT;
836
845 int jack_port_name_size(void) JACK_OPTIONAL_WEAK_EXPORT;
846
851 int jack_port_type_size(void) JACK_OPTIONAL_WEAK_EXPORT;
852
858 size_t jack_port_type_get_buffer_size (jack_client_t *client, const char *port_type) JACK_WEAK_EXPORT;
859
926 void jack_port_set_latency (jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
927
937 void jack_port_get_latency_range (jack_port_t *port, jack_latency_callback_mode_t mode, jack_latency_range_t *range) JACK_WEAK_EXPORT;
938
1006 void jack_port_set_latency_range (jack_port_t *port, jack_latency_callback_mode_t mode, jack_latency_range_t *range) JACK_WEAK_EXPORT;
1007
1021 int jack_recompute_total_latencies (jack_client_t*) JACK_OPTIONAL_WEAK_EXPORT;
1022
1038 jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
1039
1050 jack_nframes_t jack_port_get_total_latency (jack_client_t *,
1051 jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
1052
1069 int jack_recompute_total_latency (jack_client_t*, jack_port_t* port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT;
1070
1094 const char **jack_get_ports (jack_client_t *,
1095 const char *port_name_pattern,
1096 const char *type_name_pattern,
1097 unsigned long flags) JACK_OPTIONAL_WEAK_EXPORT;
1098
1104 jack_port_t *jack_port_by_name (jack_client_t *, const char *port_name) JACK_OPTIONAL_WEAK_EXPORT;
1105
1109 jack_port_t *jack_port_by_id (jack_client_t *client,
1110 jack_port_id_t port_id) JACK_OPTIONAL_WEAK_EXPORT;
1111
1128 jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;
1129
1136 jack_nframes_t jack_frame_time (const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;
1137
1152 jack_nframes_t jack_last_frame_time (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
1153
1157 jack_time_t jack_frames_to_time(const jack_client_t *client, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT;
1158
1162 jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t) JACK_OPTIONAL_WEAK_EXPORT;
1163
1170 jack_time_t jack_get_time() JACK_OPTIONAL_WEAK_EXPORT;
1171
1178
1187 extern void (*jack_error_callback)(const char *msg) JACK_OPTIONAL_WEAK_EXPORT;
1188
1195 void jack_set_error_function (void (*func)(const char *)) JACK_OPTIONAL_WEAK_EXPORT;
1196
1205 extern void (*jack_info_callback)(const char *msg) JACK_OPTIONAL_WEAK_EXPORT;
1206
1210 void jack_set_info_function (void (*func)(const char *)) JACK_OPTIONAL_WEAK_EXPORT;
1220 void jack_free(void* ptr) JACK_OPTIONAL_WEAK_EXPORT;
1221
1222 #ifdef __cplusplus
1223 }
1224 #endif
1225
1226 #endif /* __jack_h__ */
1227