21 #include "JackClient.h"
22 #include "JackError.h"
23 #include "JackGraphManager.h"
24 #include "JackEngineControl.h"
25 #include "JackClientControl.h"
26 #include "JackGlobals.h"
28 #include "JackPortType.h"
30 #define __STDC_FORMAT_MACROS 1
40 typedef void (*print_function)(
const char*);
41 typedef void *(*thread_routine)(
void*);
53 jack_get_version_string();
55 jack_client_t * jack_client_new_aux(
const char* client_name,
56 jack_options_t options,
57 jack_status_t *status);
60 jack_options_t options,
61 jack_status_t *status, ...);
66 const char* load_name,
67 const char* load_init);
69 LIB_EXPORT
int jack_is_realtime(jack_client_t *client);
71 JackShutdownCallback shutdown_callback,
void *arg);
73 JackInfoShutdownCallback shutdown_callback,
void *arg);
75 JackProcessCallback process_callback,
77 LIB_EXPORT jack_nframes_t
jack_thread_wait(jack_client_t *client,
int status);
85 JackThreadInitCallback thread_init_callback,
88 JackFreewheelCallback freewheel_callback,
93 JackBufferSizeCallback bufsize_callback,
96 JackSampleRateCallback srate_callback,
99 JackClientRegistrationCallback
100 registration_callback,
void *arg);
102 JackPortRegistrationCallback
103 registration_callback,
void *arg);
105 JackPortConnectCallback
106 connect_callback,
void *arg);
108 JackPortRenameCallback
109 rename_callback,
void *arg);
111 JackGraphOrderCallback graph_callback,
114 JackXRunCallback xrun_callback,
void *arg);
115 LIB_EXPORT
int jack_set_latency_callback(jack_client_t *client,
116 JackLatencyCallback latency_callback,
void *arg);
121 const char* port_name,
122 const char* port_type,
124 unsigned long buffer_size);
133 LIB_EXPORT
int jack_port_is_mine(
const jack_client_t *,
const jack_port_t *port);
136 const char* port_name);
139 const jack_port_t *port);
140 LIB_EXPORT
int jack_port_tie(jack_port_t *src, jack_port_t *dst);
156 LIB_EXPORT
int jack_port_rename(jack_client_t *client, jack_port_t *port,
const char* port_name);
162 const char* port_name,
int onoff);
166 const char* source_port,
167 const char* destination_port);
169 const char* source_port,
170 const char* destination_port);
178 const char* port_name_pattern,
179 const char* type_name_pattern,
180 unsigned long flags);
181 LIB_EXPORT jack_port_t *
jack_port_by_name(jack_client_t *,
const char* port_name);
183 jack_port_id_t port_id);
187 LIB_EXPORT jack_nframes_t
jack_time_to_frames(
const jack_client_t *client, jack_time_t usecs);
188 LIB_EXPORT jack_time_t
jack_frames_to_time(
const jack_client_t *client, jack_nframes_t frames);
192 jack_nframes_t *current_frames,
193 jack_time_t *current_usecs,
194 jack_time_t *next_usecs,
195 float *period_usecs);
201 LIB_EXPORT
float jack_get_max_delayed_usecs(jack_client_t *client);
202 LIB_EXPORT
float jack_get_xrun_delayed_usecs(jack_client_t *client);
203 LIB_EXPORT
void jack_reset_max_delayed_usecs(jack_client_t *client);
207 JackSyncCallback sync_callback,
210 jack_time_t timeout);
213 JackTimebaseCallback timebase_callback,
216 jack_nframes_t frame);
233 jack_native_thread_t *thread,
236 thread_routine routine,
245 LIB_EXPORT
char * jack_get_internal_client_name(jack_client_t *client,
246 jack_intclient_t intclient);
247 LIB_EXPORT jack_intclient_t jack_internal_client_handle(jack_client_t *client,
248 const char* client_name,
249 jack_status_t *status);
250 LIB_EXPORT jack_intclient_t jack_internal_client_load(jack_client_t *client,
251 const char* client_name,
252 jack_options_t options,
253 jack_status_t *status, ...);
255 LIB_EXPORT jack_status_t jack_internal_client_unload(jack_client_t *client,
256 jack_intclient_t intclient);
257 LIB_EXPORT
void jack_free(
void* ptr);
270 LIB_EXPORT jack_uuid_t jack_client_uuid_generate();
271 LIB_EXPORT jack_uuid_t jack_port_uuid_generate(uint32_t port_id);
272 LIB_EXPORT uint32_t jack_uuid_to_index(jack_uuid_t);
273 LIB_EXPORT
int jack_uuid_compare(jack_uuid_t, jack_uuid_t);
274 LIB_EXPORT
void jack_uuid_copy(jack_uuid_t* dst, jack_uuid_t src);
275 LIB_EXPORT
void jack_uuid_clear(jack_uuid_t*);
276 LIB_EXPORT
int jack_uuid_parse(
const char* buf, jack_uuid_t*);
277 LIB_EXPORT
void jack_uuid_unparse(jack_uuid_t,
char buf[JACK_UUID_STRING_SIZE]);
278 LIB_EXPORT
int jack_uuid_empty(jack_uuid_t);
284 static inline bool CheckPort(jack_port_id_t port_index)
286 return (port_index > 0 && port_index < PORT_NUM_MAX);
289 static inline bool CheckBufferSize(jack_nframes_t buffer_size)
291 return (buffer_size >= 1 && buffer_size <= BUFFER_SIZE_MAX);
294 static inline void WaitGraphChange()
301 if (jack_tls_get(JackGlobals::fRealTimeThread) == NULL) {
306 if (manager->IsPendingChange()) {
308 JackSleep(
int(control->fPeriodUsecs * 1.1f));
325 JackGlobals::CheckContext(
"jack_client_new");
328 assert(JackGlobals::fOpenMutex);
329 JackGlobals::fOpenMutex->Lock();
331 int options = JackUseExactName;
332 if (getenv(
"JACK_START_SERVER") == NULL) {
333 options |= JackNoStartServer;
335 jack_client_t* res = jack_client_new_aux(client_name, (jack_options_t)options, NULL);
336 JackGlobals::fOpenMutex->Unlock();
338 }
catch (std::bad_alloc& e) {
349 JackGlobals::CheckContext(
"jack_port_get_buffer");
351 uintptr_t port_aux = (uintptr_t)port;
352 jack_port_id_t myport = (jack_port_id_t)port_aux;
353 if (!CheckPort(myport)) {
354 jack_error(
"jack_port_get_buffer called with an incorrect port %ld", myport);
358 return (manager ? manager->GetBuffer(myport, frames) : NULL);
364 JackGlobals::CheckContext(
"jack_port_uuid");
366 uintptr_t port_aux = (uintptr_t)port;
367 jack_port_id_t myport = (jack_port_id_t)port_aux;
368 if (!CheckPort(myport)) {
369 jack_error(
"jack_port_uuid called with an incorrect port %ld", myport);
372 return jack_port_uuid_generate(myport);
378 JackGlobals::CheckContext(
"jack_port_name");
380 uintptr_t port_aux = (uintptr_t)port;
381 jack_port_id_t myport = (jack_port_id_t)port_aux;
382 if (!CheckPort(myport)) {
383 jack_error(
"jack_port_name called with an incorrect port %ld", myport);
387 return (manager ? manager->GetPort(myport)->GetName() : NULL);
393 JackGlobals::CheckContext(
"jack_port_short_name");
395 uintptr_t port_aux = (uintptr_t)port;
396 jack_port_id_t myport = (jack_port_id_t)port_aux;
397 if (!CheckPort(myport)) {
398 jack_error(
"jack_port_short_name called with an incorrect port %ld", myport);
402 return (manager ? manager->GetPort(myport)->GetShortName() : NULL);
408 JackGlobals::CheckContext(
"jack_port_flags");
410 uintptr_t port_aux = (uintptr_t)port;
411 jack_port_id_t myport = (jack_port_id_t)port_aux;
412 if (!CheckPort(myport)) {
413 jack_error(
"jack_port_flags called with an incorrect port %ld", myport);
417 return (manager ? manager->GetPort(myport)->GetFlags() : -1);
423 JackGlobals::CheckContext(
"jack_port_type");
425 uintptr_t port_aux = (uintptr_t)port;
426 jack_port_id_t myport = (jack_port_id_t)port_aux;
427 if (!CheckPort(myport)) {
428 jack_error(
"jack_port_flags called an incorrect port %ld", myport);
432 return (manager ? manager->GetPort(myport)->GetType() : NULL);
438 JackGlobals::CheckContext(
"jack_port_type_id");
440 uintptr_t port_aux = (uintptr_t)port;
441 jack_port_id_t myport = (jack_port_id_t)port_aux;
442 if (!CheckPort(myport)) {
443 jack_error(
"jack_port_type_id called an incorrect port %ld", myport);
447 return (manager ? GetPortTypeId(manager->GetPort(myport)->GetType()) : 0);
453 JackGlobals::CheckContext(
"jack_port_connected");
455 uintptr_t port_aux = (uintptr_t)port;
456 jack_port_id_t myport = (jack_port_id_t)port_aux;
457 if (!CheckPort(myport)) {
458 jack_error(
"jack_port_connected called with an incorrect port %ld", myport);
463 return (manager ? manager->GetConnectionsNum(myport) : -1);
469 JackGlobals::CheckContext(
"jack_port_connected_to");
471 uintptr_t port_aux = (uintptr_t)port;
472 jack_port_id_t src = (jack_port_id_t)port_aux;
473 if (!CheckPort(src)) {
474 jack_error(
"jack_port_connected_to called with an incorrect port %ld", src);
476 }
else if (port_name == NULL) {
477 jack_error(
"jack_port_connected_to called with a NULL port name");
482 jack_port_id_t dst = (manager ? manager->GetPort(port_name) : NO_PORT);
483 if (dst == NO_PORT) {
484 jack_error(
"Unknown destination port port_name = %s", port_name);
487 return manager->IsConnected(src, dst);
494 JackGlobals::CheckContext(
"jack_port_tie");
496 uintptr_t src_aux = (uintptr_t)src;
497 jack_port_id_t mysrc = (jack_port_id_t)src_aux;
498 if (!CheckPort(mysrc)) {
499 jack_error(
"jack_port_tie called with a NULL src port");
502 uintptr_t dst_aux = (uintptr_t)dst;
503 jack_port_id_t mydst = (jack_port_id_t)dst_aux;
504 if (!CheckPort(mydst)) {
505 jack_error(
"jack_port_tie called with a NULL dst port");
509 if (manager && manager->GetPort(mysrc)->GetRefNum() != manager->GetPort(mydst)->GetRefNum()) {
510 jack_error(
"jack_port_tie called with ports not belonging to the same client");
513 return manager->GetPort(mydst)->Tie(mysrc);
519 JackGlobals::CheckContext(
"jack_port_untie");
521 uintptr_t port_aux = (uintptr_t)port;
522 jack_port_id_t myport = (jack_port_id_t)port_aux;
523 if (!CheckPort(myport)) {
524 jack_error(
"jack_port_untie called with an incorrect port %ld", myport);
528 return (manager ? manager->GetPort(myport)->UnTie() : -1);
534 JackGlobals::CheckContext(
"jack_port_get_latency");
536 uintptr_t port_aux = (uintptr_t)port;
537 jack_port_id_t myport = (jack_port_id_t)port_aux;
538 if (!CheckPort(myport)) {
539 jack_error(
"jack_port_get_latency called with an incorrect port %ld", myport);
544 return (manager ? manager->GetPort(myport)->GetLatency() : 0);
550 JackGlobals::CheckContext(
"jack_port_set_latency");
552 uintptr_t port_aux = (uintptr_t)port;
553 jack_port_id_t myport = (jack_port_id_t)port_aux;
554 if (!CheckPort(myport)) {
555 jack_error(
"jack_port_set_latency called with an incorrect port %ld", myport);
559 manager->GetPort(myport)->SetLatency(frames);
565 JackGlobals::CheckContext(
"jack_port_get_latency_range");
567 uintptr_t port_aux = (uintptr_t)port;
568 jack_port_id_t myport = (jack_port_id_t)port_aux;
569 if (!CheckPort(myport)) {
570 jack_error(
"jack_port_get_latency_range called with an incorrect port %ld", myport);
575 manager->GetPort(myport)->GetLatencyRange(mode, range);
581 JackGlobals::CheckContext(
"jack_port_set_latency_range");
583 uintptr_t port_aux = (uintptr_t)port;
584 jack_port_id_t myport = (jack_port_id_t)port_aux;
585 if (!CheckPort(myport)) {
586 jack_error(
"jack_port_set_latency_range called with an incorrect port %ld", myport);
591 manager->GetPort(myport)->SetLatencyRange(mode, range);
597 JackGlobals::CheckContext(
"jack_recompute_total_latency");
601 uintptr_t port_aux = (uintptr_t)port;
602 jack_port_id_t myport = (jack_port_id_t)port_aux;
603 if (client == NULL) {
604 jack_error(
"jack_recompute_total_latency called with a NULL client");
606 }
else if (!CheckPort(myport)) {
607 jack_error(
"jack_recompute_total_latency called with a NULL port");
612 return (manager ? manager->ComputeTotalLatency(myport) : -1);
618 JackGlobals::CheckContext(
"jack_recompute_total_latencies");
621 if (client == NULL) {
622 jack_error(
"jack_recompute_total_latencies called with a NULL client");
625 return client->ComputeTotalLatencies();
631 JackGlobals::CheckContext(
"jack_port_set_name");
635 jack_client_t* client = NULL;
636 for (
int i = 0; i < CLIENT_NUM; i++) {
637 if ((client = (jack_client_t*)JackGlobals::fClientTable[i])) {
645 LIB_EXPORT
int jack_port_rename(jack_client_t* ext_client, jack_port_t* port,
const char* name)
647 JackGlobals::CheckContext(
"jack_port_rename");
650 uintptr_t port_aux = (uintptr_t)port;
651 jack_port_id_t myport = (jack_port_id_t)port_aux;
652 if (client == NULL) {
653 jack_error(
"jack_port_rename called with a NULL client");
655 }
else if (!CheckPort(myport)) {
656 jack_error(
"jack_port_rename called with an incorrect port %ld", myport);
658 }
else if (name == NULL) {
659 jack_error(
"jack_port_rename called with a NULL port name");
662 return client->PortRename(myport, name);
668 JackGlobals::CheckContext(
"jack_port_set_alias");
670 uintptr_t port_aux = (uintptr_t)port;
671 jack_port_id_t myport = (jack_port_id_t)port_aux;
672 if (!CheckPort(myport)) {
673 jack_error(
"jack_port_set_alias called with an incorrect port %ld", myport);
675 }
else if (name == NULL) {
676 jack_error(
"jack_port_set_alias called with a NULL port name");
680 return (manager ? manager->GetPort(myport)->SetAlias(name) : -1);
686 JackGlobals::CheckContext(
"jack_port_unset_alias");
688 uintptr_t port_aux = (uintptr_t)port;
689 jack_port_id_t myport = (jack_port_id_t)port_aux;
690 if (!CheckPort(myport)) {
691 jack_error(
"jack_port_unset_alias called with an incorrect port %ld", myport);
693 }
else if (name == NULL) {
694 jack_error(
"jack_port_unset_alias called with a NULL port name");
698 return (manager ? manager->GetPort(myport)->UnsetAlias(name) : -1);
704 JackGlobals::CheckContext(
"jack_port_get_aliases");
706 uintptr_t port_aux = (uintptr_t)port;
707 jack_port_id_t myport = (jack_port_id_t)port_aux;
708 if (!CheckPort(myport)) {
709 jack_error(
"jack_port_get_aliases called with an incorrect port %ld", myport);
713 return (manager ? manager->GetPort(myport)->GetAliases(aliases) : -1);
719 JackGlobals::CheckContext(
"jack_port_request_monitor");
721 uintptr_t port_aux = (uintptr_t)port;
722 jack_port_id_t myport = (jack_port_id_t)port_aux;
723 if (!CheckPort(myport)) {
724 jack_error(
"jack_port_request_monitor called with an incorrect port %ld", myport);
734 JackGlobals::CheckContext(
"jack_port_request_monitor_by_name");
737 if (client == NULL) {
738 jack_error(
"jack_port_request_monitor_by_name called with a NULL client");
744 jack_port_id_t myport = manager->GetPort(port_name);
745 if (!CheckPort(myport)) {
746 jack_error(
"jack_port_request_monitor_by_name called with an incorrect port %s", port_name);
756 JackGlobals::CheckContext(
"jack_port_ensure_monitor");
758 uintptr_t port_aux = (uintptr_t)port;
759 jack_port_id_t myport = (jack_port_id_t)port_aux;
760 if (!CheckPort(myport)) {
761 jack_error(
"jack_port_ensure_monitor called with an incorrect port %ld", myport);
765 return (manager ? manager->GetPort(myport)->
EnsureMonitor(onoff) : -1);
771 JackGlobals::CheckContext(
"jack_port_monitoring_input");
773 uintptr_t port_aux = (uintptr_t)port;
774 jack_port_id_t myport = (jack_port_id_t)port_aux;
775 if (!CheckPort(myport)) {
776 jack_error(
"jack_port_monitoring_input called with an incorrect port %ld", myport);
780 return (manager ? manager->GetPort(myport)->MonitoringInput() : -1);
784 LIB_EXPORT
int jack_is_realtime(jack_client_t* ext_client)
786 JackGlobals::CheckContext(
"jack_is_realtime");
789 if (client == NULL) {
790 jack_error(
"jack_is_realtime called with a NULL client");
794 return (control ? control->fRealTime : -1);
798 LIB_EXPORT
void jack_on_shutdown(jack_client_t* ext_client, JackShutdownCallback callback,
void* arg)
800 JackGlobals::CheckContext(
"jack_on_shutdown");
803 if (client == NULL) {
804 jack_error(
"jack_on_shutdown called with a NULL client");
806 client->OnShutdown(callback, arg);
812 JackGlobals::CheckContext(
"jack_on_info_shutdown");
815 if (client == NULL) {
816 jack_error(
"jack_on_info_shutdown called with a NULL client");
818 client->OnInfoShutdown(callback, arg);
824 JackGlobals::CheckContext(
"jack_set_process_callback");
827 if (client == NULL) {
828 jack_error(
"jack_set_process_callback called with a NULL client");
831 return client->SetProcessCallback(callback, arg);
837 JackGlobals::CheckContext(
"jack_thread_wait");
840 if (client == NULL) {
841 jack_error(
"jack_thread_wait called with a NULL client");
844 jack_error(
"jack_thread_wait: deprecated, use jack_cycle_wait/jack_cycle_signal");
851 JackGlobals::CheckContext(
"jack_cycle_wait");
854 if (client == NULL) {
855 jack_error(
"jack_cycle_wait called with a NULL client");
858 return client->CycleWait();
864 JackGlobals::CheckContext(
"jack_cycle_signal");
867 if (client == NULL) {
868 jack_error(
"jack_cycle_signal called with a NULL client");
870 client->CycleSignal(status);
876 JackGlobals::CheckContext(
"jack_set_process_thread");
879 if (client == NULL) {
880 jack_error(
"jack_set_process_thread called with a NULL client");
883 return client->SetProcessThread(fun, arg);
889 JackGlobals::CheckContext(
"jack_set_freewheel_callback");
892 if (client == NULL) {
893 jack_error(
"jack_set_freewheel_callback called with a NULL client");
896 return client->SetFreewheelCallback(freewheel_callback, arg);
902 JackGlobals::CheckContext(
"jack_set_freewheel");
905 if (client == NULL) {
906 jack_error(
"jack_set_freewheel called with a NULL client");
909 return client->SetFreeWheel(onoff);
915 JackGlobals::CheckContext(
"jack_set_buffer_size");
918 if (client == NULL) {
919 jack_error(
"jack_set_buffer_size called with a NULL client");
921 }
else if (!CheckBufferSize(buffer_size)) {
924 return client->SetBufferSize(buffer_size);
930 JackGlobals::CheckContext(
"jack_set_buffer_size_callback");
933 if (client == NULL) {
934 jack_error(
"jack_set_buffer_size_callback called with a NULL client");
937 return client->SetBufferSizeCallback(bufsize_callback, arg);
943 JackGlobals::CheckContext(
"jack_set_sample_rate_callback");
946 if (client == NULL) {
947 jack_error(
"jack_set_sample_rate_callback called with a NULL client");
950 return client->SetSampleRateCallback(srate_callback, arg);
956 JackGlobals::CheckContext(
"jack_set_client_registration_callback");
959 if (client == NULL) {
960 jack_error(
"jack_set_client_registration_callback called with a NULL client");
963 return client->SetClientRegistrationCallback(registration_callback, arg);
969 JackGlobals::CheckContext(
"jack_set_port_registration_callback");
972 if (client == NULL) {
973 jack_error(
"jack_set_port_registration_callback called with a NULL client");
976 return client->SetPortRegistrationCallback(registration_callback, arg);
982 JackGlobals::CheckContext(
"jack_set_port_connect_callback");
985 if (client == NULL) {
986 jack_error(
"jack_set_port_connect_callback called with a NULL client");
989 return client->SetPortConnectCallback(portconnect_callback, arg);
995 JackGlobals::CheckContext(
"jack_set_port_rename_callback");
998 if (client == NULL) {
999 jack_error(
"jack_set_port_rename_callback called with a NULL client");
1002 return client->SetPortRenameCallback(rename_callback, arg);
1008 JackGlobals::CheckContext(
"jack_set_graph_order_callback");
1011 jack_log(
"jack_set_graph_order_callback ext_client %x client %x ", ext_client, client);
1012 if (client == NULL) {
1013 jack_error(
"jack_set_graph_order_callback called with a NULL client");
1016 return client->SetGraphOrderCallback(graph_callback, arg);
1022 JackGlobals::CheckContext(
"jack_set_xrun_callback");
1025 if (client == NULL) {
1026 jack_error(
"jack_set_xrun_callback called with a NULL client");
1029 return client->SetXRunCallback(xrun_callback, arg);
1033 LIB_EXPORT
int jack_set_latency_callback(jack_client_t* ext_client, JackLatencyCallback latency_callback,
void *arg)
1035 JackGlobals::CheckContext(
"jack_set_latency_callback");
1038 if (client == NULL) {
1039 jack_error(
"jack_set_latency_callback called with a NULL client");
1042 return client->SetLatencyCallback(latency_callback, arg);
1048 JackGlobals::CheckContext(
"jack_set_thread_init_callback");
1051 jack_log(
"jack_set_thread_init_callback ext_client %x client %x ", ext_client, client);
1052 if (client == NULL) {
1053 jack_error(
"jack_set_thread_init_callback called with a NULL client");
1056 return client->SetInitCallback(init_callback, arg);
1062 JackGlobals::CheckContext(
"jack_activate");
1065 if (client == NULL) {
1066 jack_error(
"jack_activate called with a NULL client");
1075 JackGlobals::CheckContext(
"jack_deactivate");
1078 if (client == NULL) {
1079 jack_error(
"jack_deactivate called with a NULL client");
1086 LIB_EXPORT jack_port_t*
jack_port_register(jack_client_t* ext_client,
const char* port_name,
const char* port_type,
unsigned long flags,
unsigned long buffer_size)
1088 JackGlobals::CheckContext(
"jack_port_register");
1091 if (client == NULL) {
1092 jack_error(
"jack_port_register called with a NULL client");
1094 }
else if ((port_name == NULL) || (port_type == NULL)) {
1095 jack_error(
"jack_port_register called with a NULL port name or a NULL port_type");
1098 return (jack_port_t *)((uintptr_t)client->PortRegister(port_name, port_type, flags, buffer_size));
1104 JackGlobals::CheckContext(
"jack_port_unregister");
1107 if (client == NULL) {
1108 jack_error(
"jack_port_unregister called with a NULL client");
1111 uintptr_t port_aux = (uintptr_t)port;
1112 jack_port_id_t myport = (jack_port_id_t)port_aux;
1113 if (!CheckPort(myport)) {
1114 jack_error(
"jack_port_unregister called with an incorrect port %ld", myport);
1117 return client->PortUnRegister(myport);
1122 JackGlobals::CheckContext(
"jack_port_is_mine");
1125 if (client == NULL) {
1126 jack_error(
"jack_port_is_mine called with a NULL client");
1129 uintptr_t port_aux = (uintptr_t)port;
1130 jack_port_id_t myport = (jack_port_id_t)port_aux;
1131 if (!CheckPort(myport)) {
1132 jack_error(
"jack_port_is_mine called with an incorrect port %ld", myport);
1135 return client->PortIsMine(myport);
1140 JackGlobals::CheckContext(
"jack_port_get_connections");
1142 uintptr_t port_aux = (uintptr_t)port;
1143 jack_port_id_t myport = (jack_port_id_t)port_aux;
1144 if (!CheckPort(myport)) {
1145 jack_error(
"jack_port_get_connections called with an incorrect port %ld", myport);
1150 return (manager ? manager->GetConnections(myport) : NULL);
1157 JackGlobals::CheckContext(
"jack_port_get_all_connections");
1160 if (client == NULL) {
1161 jack_error(
"jack_port_get_all_connections called with a NULL client");
1165 uintptr_t port_aux = (uintptr_t)port;
1166 jack_port_id_t myport = (jack_port_id_t)port_aux;
1167 if (!CheckPort(myport)) {
1168 jack_error(
"jack_port_get_all_connections called with an incorrect port %ld", myport);
1173 return (manager ? manager->GetConnections(myport) : NULL);
1179 JackGlobals::CheckContext(
"jack_port_get_total_latency");
1182 if (client == NULL) {
1183 jack_error(
"jack_port_get_total_latency called with a NULL client");
1187 uintptr_t port_aux = (uintptr_t)port;
1188 jack_port_id_t myport = (jack_port_id_t)port_aux;
1189 if (!CheckPort(myport)) {
1190 jack_error(
"jack_port_get_total_latency called with an incorrect port %ld", myport);
1196 manager->ComputeTotalLatency(myport);
1197 return manager->GetPort(myport)->GetTotalLatency();
1204 LIB_EXPORT
int jack_connect(jack_client_t* ext_client,
const char* src,
const char* dst)
1206 JackGlobals::CheckContext(
"jack_connect");
1209 if (client == NULL) {
1210 jack_error(
"jack_connect called with a NULL client");
1212 }
else if ((src == NULL) || (dst == NULL)) {
1213 jack_error(
"jack_connect called with a NULL port name");
1216 return client->PortConnect(src, dst);
1220 LIB_EXPORT
int jack_disconnect(jack_client_t* ext_client,
const char* src,
const char* dst)
1222 JackGlobals::CheckContext(
"jack_disconnect");
1225 if (client == NULL) {
1226 jack_error(
"jack_disconnect called with a NULL client");
1228 }
else if ((src == NULL) || (dst == NULL)) {
1229 jack_error(
"jack_disconnect called with a NULL port name");
1232 return client->PortDisconnect(src, dst);
1238 JackGlobals::CheckContext(
"jack_port_disconnect");
1241 if (client == NULL) {
1242 jack_error(
"jack_port_disconnect called with a NULL client");
1245 uintptr_t port_aux = (uintptr_t)src;
1246 jack_port_id_t myport = (jack_port_id_t)port_aux;
1247 if (!CheckPort(myport)) {
1248 jack_error(
"jack_port_disconnect called with an incorrect port %ld", myport);
1251 return client->PortDisconnect(myport);
1256 JackGlobals::CheckContext(
"jack_get_sample_rate");
1259 if (client == NULL) {
1260 jack_error(
"jack_get_sample_rate called with a NULL client");
1264 return (control ? control->fSampleRate : 0);
1270 JackGlobals::CheckContext(
"jack_get_buffer_size");
1273 if (client == NULL) {
1274 jack_error(
"jack_get_buffer_size called with a NULL client");
1278 return (control ? control->fBufferSize : 0);
1282 LIB_EXPORT
const char**
jack_get_ports(jack_client_t* ext_client,
const char* port_name_pattern,
const char* type_name_pattern,
unsigned long flags)
1284 JackGlobals::CheckContext(
"jack_get_ports");
1287 if (client == NULL) {
1288 jack_error(
"jack_get_ports called with a NULL client");
1292 return (manager ? manager->GetPorts(port_name_pattern, type_name_pattern, flags) : NULL);
1297 JackGlobals::CheckContext(
"jack_port_by_name");
1300 if (client == NULL) {
1301 jack_error(
"jack_port_by_name called with a NULL client");
1305 if (portname == NULL) {
1306 jack_error(
"jack_port_by_name called with a NULL port name");
1312 int res = manager->GetPort(portname);
1313 return (res == NO_PORT) ? NULL : (jack_port_t*)((uintptr_t)res);
1321 JackGlobals::CheckContext(
"jack_port_by_id");
1324 return (jack_port_t*)((uintptr_t)
id);
1329 JackGlobals::CheckContext(
"jack_engine_takeover_timebase");
1332 if (client == NULL) {
1333 jack_error(
"jack_engine_takeover_timebase called with a NULL client");
1336 jack_error(
"jack_engine_takeover_timebase: deprecated\n");
1343 JackGlobals::CheckContext(
"jack_frames_since_cycle_start");
1348 control->ReadFrameTime(&timer);
1349 return timer.FramesSinceCycleStart(GetMicroSeconds(), control->fSampleRate);
1357 JackGlobals::CheckContext(
"jack_get_time");
1359 return GetMicroSeconds();
1364 JackGlobals::CheckContext(
"jack_frames_to_time");
1367 if (client == NULL) {
1368 jack_error(
"jack_frames_to_time called with a NULL client");
1374 control->ReadFrameTime(&timer);
1375 return timer.Frames2Time(frames, control->fBufferSize);
1384 JackGlobals::CheckContext(
"jack_time_to_frames");
1387 if (client == NULL) {
1388 jack_error(
"jack_time_to_frames called with a NULL client");
1394 control->ReadFrameTime(&timer);
1395 return timer.Time2Frames(usecs, control->fBufferSize);
1404 JackGlobals::CheckContext(
"jack_frame_time");
1411 JackGlobals::CheckContext(
"jack_last_frame_time");
1414 return (control) ? control->fFrameTimer.
ReadCurrentState()->CurFrame() : 0;
1418 jack_nframes_t *current_frames,
1419 jack_time_t *current_usecs,
1420 jack_time_t *next_usecs,
1421 float *period_usecs)
1423 JackGlobals::CheckContext(
"jack_get_cycle_times");
1428 control->ReadFrameTime(&timer);
1429 return timer.GetCycleTimes(current_frames, current_usecs, next_usecs, period_usecs);
1437 JackGlobals::CheckContext(
"jack_cpu_load");
1440 if (client == NULL) {
1441 jack_error(
"jack_cpu_load called with a NULL client");
1445 return (control ? control->fCPULoad : 0.0f);
1451 JackGlobals::CheckContext(
"jack_client_thread_id");
1454 if (client == NULL) {
1455 jack_error(
"jack_client_thread_id called with a NULL client");
1456 return (jack_native_thread_t)NULL;
1458 return client->GetThreadID();
1464 JackGlobals::CheckContext(
"jack_get_client_name");
1467 if (client == NULL) {
1468 jack_error(
"jack_get_client_name called with a NULL client");
1471 return client->GetClientControl()->fName;
1477 return JACK_CLIENT_NAME_SIZE+1;
1482 return REAL_JACK_PORT_NAME_SIZE+1;
1487 return JACK_PORT_TYPE_SIZE;
1492 JackGlobals::CheckContext(
"jack_port_type_get_buffer_size");
1495 if (client == NULL) {
1496 jack_error(
"jack_port_type_get_buffer_size called with a NULL client");
1499 jack_port_type_id_t port_id = GetPortTypeId(port_type);
1500 if (port_id == PORT_TYPES_MAX) {
1501 jack_error(
"jack_port_type_get_buffer_size called with an unknown port type = %s", port_type);
1504 return GetPortType(port_id)->size();
1512 JackGlobals::CheckContext(
"jack_release_timebase");
1515 if (client == NULL) {
1516 jack_error(
"jack_release_timebase called with a NULL client");
1519 return client->ReleaseTimebase();
1525 JackGlobals::CheckContext(
"jack_set_sync_callback");
1528 if (client == NULL) {
1529 jack_error(
"jack_set_sync_callback called with a NULL client");
1532 return client->SetSyncCallback(sync_callback, arg);
1538 JackGlobals::CheckContext(
"jack_set_sync_timeout");
1541 if (client == NULL) {
1542 jack_error(
"jack_set_sync_timeout called with a NULL client");
1545 return client->SetSyncTimeout(timeout);
1551 JackGlobals::CheckContext(
"jack_set_timebase_callback");
1554 if (client == NULL) {
1555 jack_error(
"jack_set_timebase_callback called with a NULL client");
1558 return client->SetTimebaseCallback(conditional, timebase_callback, arg);
1564 JackGlobals::CheckContext(
"jack_transport_locate");
1567 if (client == NULL) {
1568 jack_error(
"jack_transport_locate called with a NULL client");
1571 client->TransportLocate(frame);
1578 JackGlobals::CheckContext(
"jack_transport_query");
1581 if (client == NULL) {
1582 jack_error(
"jack_transport_query called with a NULL client");
1583 return JackTransportStopped;
1585 return client->TransportQuery(pos);
1591 JackGlobals::CheckContext(
"jack_get_current_transport_frame");
1594 if (client == NULL) {
1595 jack_error(
"jack_get_current_transport_frame called with a NULL client");
1598 return client->GetCurrentTransportFrame();
1604 JackGlobals::CheckContext(
"jack_transport_reposition");
1607 if (client == NULL) {
1608 jack_error(
"jack_transport_reposition called with a NULL client");
1611 client->TransportReposition(pos);
1618 JackGlobals::CheckContext(
"jack_transport_start");
1621 if (client == NULL) {
1622 jack_error(
"jack_transport_start called with a NULL client");
1624 client->TransportStart();
1630 JackGlobals::CheckContext(
"jack_transport_stop");
1633 if (client == NULL) {
1634 jack_error(
"jack_transport_stop called with a NULL client");
1636 client->TransportStop();
1643 JackGlobals::CheckContext(
"jack_get_transport_info");
1645 jack_error(
"jack_get_transport_info: deprecated");
1652 JackGlobals::CheckContext(
"jack_set_transport_info");
1654 jack_error(
"jack_set_transport_info: deprecated");
1660 LIB_EXPORT
float jack_get_max_delayed_usecs(jack_client_t* ext_client)
1662 JackGlobals::CheckContext(
"jack_get_max_delayed_usecs");
1665 if (client == NULL) {
1666 jack_error(
"jack_get_max_delayed_usecs called with a NULL client");
1670 return (control ? control->fMaxDelayedUsecs : 0.f);
1674 LIB_EXPORT
float jack_get_xrun_delayed_usecs(jack_client_t* ext_client)
1676 JackGlobals::CheckContext(
"jack_get_xrun_delayed_usecs");
1679 if (client == NULL) {
1680 jack_error(
"jack_get_xrun_delayed_usecs called with a NULL client");
1684 return (control ? control->fXrunDelayedUsecs : 0.f);
1688 LIB_EXPORT
void jack_reset_max_delayed_usecs(jack_client_t* ext_client)
1690 JackGlobals::CheckContext(
"jack_reset_max_delayed_usecs");
1693 if (client == NULL) {
1694 jack_error(
"jack_reset_max_delayed_usecs called with a NULL client");
1697 control->ResetXRun();
1704 JackGlobals::CheckContext(
"jack_client_real_time_priority");
1707 if (client == NULL) {
1708 jack_error(
"jack_client_real_time_priority called with a NULL client");
1712 return (control->fRealTime) ? control->fClientPriority : -1;
1718 JackGlobals::CheckContext(
"jack_client_max_real_time_priority");
1721 if (client == NULL) {
1722 jack_error(
"jack_client_max_real_time_priority called with a NULL client");
1726 return (control->fRealTime) ? control->fMaxClientPriority : -1;
1734 ? JackThread::AcquireRealTimeImp(thread, priority, control->fPeriod, control->fComputation, control->fConstraint)
1739 jack_native_thread_t *thread,
1742 thread_routine routine,
1745 JackGlobals::CheckContext(
"jack_client_create_thread");
1748 int res = JackThread::StartImp(thread, priority, realtime, routine, arg);
1750 ? ((realtime ? JackThread::AcquireRealTimeImp(*thread, priority, control->fPeriod, control->fComputation, control->fConstraint) : res))
1756 return JackThread::DropRealTimeImp(thread);
1761 JackGlobals::CheckContext(
"jack_client_stop_thread");
1762 return JackThread::StopImp(thread);
1767 JackGlobals::CheckContext(
"jack_client_kill_thread");
1768 return JackThread::KillImp(thread);
1775 JackGlobals::fJackThreadCreator = pthread_create;
1777 JackGlobals::fJackThreadCreator = jtc;
1784 const char* load_name,
1785 const char* load_init)
1787 JackGlobals::CheckContext(
"jack_internal_client_new");
1788 jack_error(
"jack_internal_client_new: deprecated");
1794 JackGlobals::CheckContext(
"jack_internal_client_close");
1795 jack_error(
"jack_internal_client_close: deprecated");
1798 LIB_EXPORT
char* jack_get_internal_client_name(jack_client_t* ext_client, jack_intclient_t intclient)
1800 JackGlobals::CheckContext(
"jack_get_internal_client_name");
1803 if (client == NULL) {
1804 jack_error(
"jack_get_internal_client_name called with a NULL client");
1806 }
else if (intclient >= CLIENT_NUM) {
1807 jack_error(
"jack_get_internal_client_name: incorrect client");
1810 return client->GetInternalClientName(intclient);
1814 LIB_EXPORT jack_intclient_t jack_internal_client_handle(jack_client_t* ext_client,
const char* client_name, jack_status_t* status)
1816 JackGlobals::CheckContext(
"jack_internal_client_handle");
1819 if (client == NULL) {
1820 jack_error(
"jack_internal_client_handle called with a NULL client");
1823 jack_status_t my_status;
1825 status = &my_status;
1826 *status = (jack_status_t)0;
1827 return client->InternalClientHandle(client_name, status);
1831 static jack_intclient_t jack_internal_client_load_aux(jack_client_t* ext_client,
const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
1833 JackGlobals::CheckContext(
"jack_internal_client_load_aux");
1836 if (client == NULL) {
1837 jack_error(
"jack_internal_client_load called with a NULL client");
1841 jack_status_t my_status;
1844 status = &my_status;
1845 *status = (jack_status_t)0;
1848 if ((options & ~JackLoadOptions)) {
1849 int my_status1 = *status | (JackFailure | JackInvalidOption);
1850 *status = (jack_status_t)my_status1;
1855 jack_varargs_parse(options, ap, &va);
1856 return client->InternalClientLoad(client_name, options, status, &va);
1860 LIB_EXPORT jack_intclient_t jack_internal_client_load(jack_client_t *client,
const char* client_name, jack_options_t options, jack_status_t *status, ...)
1862 JackGlobals::CheckContext(
"jack_internal_client_load");
1865 va_start(ap, status);
1866 jack_intclient_t res = jack_internal_client_load_aux(client, client_name, options, status, ap);
1871 LIB_EXPORT jack_status_t jack_internal_client_unload(jack_client_t* ext_client, jack_intclient_t intclient)
1873 JackGlobals::CheckContext(
"jack_internal_client_load");
1876 if (client == NULL) {
1877 jack_error(
"jack_internal_client_unload called with a NULL client");
1878 return (jack_status_t)(JackNoSuchClient | JackFailure);
1879 }
else if (intclient >= CLIENT_NUM) {
1880 jack_error(
"jack_internal_client_unload: incorrect client");
1881 return (jack_status_t)(JackNoSuchClient | JackFailure);
1883 jack_status_t my_status;
1884 client->InternalClientUnload(intclient, &my_status);
1889 LIB_EXPORT
void jack_get_version(
int *major_ptr,
1894 JackGlobals::CheckContext(
"jack_get_version");
1903 LIB_EXPORT
const char* jack_get_version_string()
1905 JackGlobals::CheckContext(
"jack_get_version_string");
1909 LIB_EXPORT
void jack_free(
void* ptr)
1911 JackGlobals::CheckContext(
"jack_free");
1921 JackGlobals::CheckContext(
"jack_set_session_callback");
1924 jack_log(
"jack_set_session_callback ext_client %x client %x ", ext_client, client);
1925 if (client == NULL) {
1926 jack_error(
"jack_set_session_callback called with a NULL client");
1929 return client->SetSessionCallback(session_callback, arg);
1935 JackGlobals::CheckContext(
"jack_session_notify");
1938 jack_log(
"jack_session_notify ext_client %x client %x ", ext_client, client);
1939 if (client == NULL) {
1940 jack_error(
"jack_session_notify called with a NULL client");
1943 return client->SessionNotify(target, ev_type, path);
1949 JackGlobals::CheckContext(
"jack_session_reply");
1952 jack_log(
"jack_session_reply ext_client %x client %x ", ext_client, client);
1953 if (client == NULL) {
1954 jack_error(
"jack_session_reply called with a NULL client");
1957 return client->SessionReply(event);
1963 JackGlobals::CheckContext(
"jack_session_event_free");
1978 JackGlobals::CheckContext(
"jack_client_get_uuid");
1981 if (client == NULL) {
1982 jack_error(
"jack_client_get_uuid called with a NULL client");
1985 char retval[JACK_UUID_STRING_SIZE];
1986 jack_uuid_unparse(client->GetClientControl()->fSessionID, retval);
1987 return strdup(retval);
1993 JackGlobals::CheckContext(
"jack_get_uuid_for_client_name");
1996 jack_log(
"jack_get_uuid_for_client_name ext_client %x client %x ", ext_client, client);
1997 if (client == NULL) {
1998 jack_error(
"jack_get_uuid_for_client_name called with a NULL client");
2001 return client->GetUUIDForClientName(client_name);
2007 JackGlobals::CheckContext(
"jack_get_client_name_by_uuid");
2010 jack_log(
"jack_get_uuid_for_client_name ext_client %x client %x ", ext_client, client);
2011 if (client == NULL) {
2012 jack_error(
"jack_get_client_name_by_uuid called with a NULL client");
2015 return client->GetClientNameByUUID(client_uuid);
2021 JackGlobals::CheckContext(
"jack_reserve_client_name");
2024 jack_log(
"jack_reserve_client_name ext_client %x client %x ", ext_client, client);
2025 if (client == NULL) {
2026 jack_error(
"jack_reserve_client_name called with a NULL client");
2029 return client->ReserveClientName(client_name, uuid);
2035 JackGlobals::CheckContext(
"jack_session_commands_free");
2044 if (cmds[i].client_name) {
2045 free ((
char *)cmds[i].client_name);
2047 if (cmds[i].command) {
2048 free ((
char *)cmds[i].command);
2051 free ((
char *)cmds[i].uuid);
2064 JackGlobals::CheckContext(
"jack_client_has_session_callback");
2067 jack_log(
"jack_client_has_session_callback ext_client %x client %x ", ext_client, client);
2068 if (client == NULL) {
2069 jack_error(
"jack_client_has_session_callback called with a NULL client");
2072 return client->ClientHasSessionCallback(client_name);
2076 LIB_EXPORT jack_uuid_t jack_client_uuid_generate()
2078 static uint32_t uuid_cnt = 0;
2079 jack_uuid_t uuid = 0x2; ;
2080 uuid = (uuid << 32) | ++uuid_cnt;
2084 LIB_EXPORT jack_uuid_t jack_port_uuid_generate(uint32_t port_id)
2086 jack_uuid_t uuid = 0x1;
2087 uuid = (uuid << 32) | (port_id + 1);
2091 LIB_EXPORT uint32_t jack_uuid_to_index(jack_uuid_t u)
2093 return (u & 0xffff) - 1;
2096 LIB_EXPORT
int jack_uuid_compare(jack_uuid_t a, jack_uuid_t b)
2109 LIB_EXPORT
void jack_uuid_copy(jack_uuid_t* dst, jack_uuid_t src)
2114 LIB_EXPORT
void jack_uuid_clear(jack_uuid_t* u)
2116 *u = JACK_UUID_EMPTY_INITIALIZER;
2119 LIB_EXPORT
int jack_uuid_parse(
const char* b, jack_uuid_t* u)
2121 if (sscanf (b,
"%" PRIu64, u) == 1) {
2123 if (*u < (0x1LL << 32)) {
2134 LIB_EXPORT
void jack_uuid_unparse(jack_uuid_t u,
char b[JACK_UUID_STRING_SIZE])
2136 snprintf (b, JACK_UUID_STRING_SIZE,
"%" PRIu64, u);
2139 LIB_EXPORT
int jack_uuid_empty(jack_uuid_t u)
2141 return u == JACK_UUID_EMPTY_INITIALIZER;
LIB_EXPORT jack_nframes_t jack_port_get_total_latency(jack_client_t *, jack_port_t *port)
LIB_EXPORT int jack_set_client_registration_callback(jack_client_t *, JackClientRegistrationCallback registration_callback, void *arg)
LIB_EXPORT int jack_port_request_monitor(jack_port_t *port, int onoff)
LIB_EXPORT int jack_set_freewheel_callback(jack_client_t *client, JackFreewheelCallback freewheel_callback, void *arg)
T * ReadCurrentState()
Returns the current state : only valid in the RT reader thread.
LIB_EXPORT int jack_set_graph_order_callback(jack_client_t *, JackGraphOrderCallback graph_callback, void *)
LIB_EXPORT int jack_set_buffer_size(jack_client_t *client, jack_nframes_t nframes)
A structure used for time management.
LIB_EXPORT int jack_port_unregister(jack_client_t *, jack_port_t *)
SERVER_EXPORT void(* jack_info_callback)(const char *desc)
LIB_EXPORT int jack_port_tie(jack_port_t *src, jack_port_t *dst)
LIB_EXPORT int jack_set_thread_init_callback(jack_client_t *client, JackThreadInitCallback thread_init_callback, void *arg)
LIB_EXPORT int jack_set_session_callback(jack_client_t *ext_client, JackSessionCallback session_callback, void *arg)
LIB_EXPORT jack_port_type_id_t jack_port_type_id(const jack_port_t *port)
LIB_EXPORT jack_port_t * jack_port_by_id(jack_client_t *client, jack_port_id_t port_id)
LIB_EXPORT void jack_port_set_latency(jack_port_t *, jack_nframes_t)
LIB_EXPORT int jack_port_set_alias(jack_port_t *port, const char *alias)
LIB_EXPORT void jack_set_transport_info(jack_client_t *client, jack_transport_info_t *tinfo)
LIB_EXPORT int jack_port_ensure_monitor(jack_port_t *port, int onoff)
LIB_EXPORT int jack_client_real_time_priority(jack_client_t *)
LIB_EXPORT void jack_cycle_signal(jack_client_t *, int status)
LIB_EXPORT jack_transport_state_t jack_transport_query(const jack_client_t *client, jack_position_t *pos)
LIB_EXPORT void jack_internal_client_close(const char *client_name)
LIB_EXPORT jack_nframes_t jack_cycle_wait(jack_client_t *)
LIB_EXPORT int jack_port_name_size(void)
LIB_EXPORT int jack_set_process_callback(jack_client_t *client, JackProcessCallback process_callback, void *arg)
LIB_EXPORT int jack_recompute_total_latency(jack_client_t *, jack_port_t *port)
LIB_EXPORT int jack_activate(jack_client_t *client)
SERVER_EXPORT void(* jack_error_callback)(const char *desc)
LIB_EXPORT int jack_client_stop_thread(jack_client_t *client, jack_native_thread_t thread)
LIB_EXPORT const char * jack_port_type(const jack_port_t *port)
virtual int Deactivate()
Need to stop thread after deactivating in the server.
void jack_set_info_function(void(*func)(const char *)) JACK_OPTIONAL_WEAK_EXPORT
LIB_EXPORT jack_native_thread_t jack_client_thread_id(jack_client_t *)
LIB_EXPORT const char ** jack_port_get_connections(const jack_port_t *port)
SERVER_EXPORT void jack_error(const char *fmt,...)
LIB_EXPORT int jack_port_disconnect(jack_client_t *, jack_port_t *)
LIB_EXPORT void jack_port_set_latency_range(jack_port_t *port, jack_latency_callback_mode_t mode, jack_latency_range_t *range)
LIB_EXPORT char * jack_get_client_name_by_uuid(jack_client_t *ext_client, const char *client_uuid)
LIB_EXPORT char * jack_client_get_uuid(jack_client_t *client)
LIB_EXPORT int jack_connect(jack_client_t *, const char *source_port, const char *destination_port)
LIB_EXPORT jack_uuid_t jack_port_uuid(const jack_port_t *)
LIB_EXPORT int jack_disconnect(jack_client_t *, const char *source_port, const char *destination_port)
LIB_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)
LIB_EXPORT int jack_release_timebase(jack_client_t *client)
LIB_EXPORT const char ** jack_port_get_all_connections(const jack_client_t *client, const jack_port_t *port)
LIB_EXPORT int jack_acquire_real_time_scheduling(jack_native_thread_t thread, int priority)
LIB_EXPORT int jack_port_type_size(void)
LIB_EXPORT void jack_on_shutdown(jack_client_t *client, JackShutdownCallback shutdown_callback, void *arg)
LIB_EXPORT int jack_set_port_connect_callback(jack_client_t *, JackPortConnectCallback connect_callback, void *arg)
LIB_EXPORT jack_client_t * jack_client_open(const char *client_name, jack_options_t options, jack_status_t *status,...)
LIB_EXPORT jack_nframes_t jack_frame_time(const jack_client_t *)
LIB_EXPORT char * jack_get_client_name(jack_client_t *client)
LIB_EXPORT jack_nframes_t jack_last_frame_time(const jack_client_t *client)
LIB_EXPORT int jack_port_monitoring_input(jack_port_t *port)
LIB_EXPORT int jack_client_has_session_callback(jack_client_t *client, const char *client_name)
void jack_set_error_function(void(*func)(const char *)) JACK_OPTIONAL_WEAK_EXPORT
Graph manager: contains the connection manager and the port array.
LIB_EXPORT void jack_transport_start(jack_client_t *client)
LIB_EXPORT void jack_session_commands_free(jack_session_command_t *cmds)
LIB_EXPORT int jack_set_port_rename_callback(jack_client_t *, JackPortRenameCallback rename_callback, void *arg)
LIB_EXPORT int jack_set_xrun_callback(jack_client_t *, JackXRunCallback xrun_callback, void *arg)
LIB_EXPORT int jack_set_sync_timeout(jack_client_t *client, jack_time_t timeout)
LIB_EXPORT jack_session_command_t * jack_session_notify(jack_client_t *ext_client, const char *target, jack_session_event_type_t ev_type, const char *path)
virtual int Activate()
We need to start thread before activating in the server, otherwise the FW driver connected to the cli...
LIB_EXPORT int jack_reserve_client_name(jack_client_t *ext_client, const char *name, const char *uuid)
LIB_EXPORT jack_nframes_t jack_get_buffer_size(jack_client_t *)
LIB_EXPORT jack_nframes_t jack_port_get_latency(jack_port_t *port)
LIB_EXPORT int jack_port_untie(jack_port_t *port)
LIB_EXPORT int jack_client_max_real_time_priority(jack_client_t *)
LIB_EXPORT void jack_set_thread_creator(jack_thread_creator_t jtc)
LIB_EXPORT int jack_set_sample_rate_callback(jack_client_t *client, JackSampleRateCallback srate_callback, void *arg)
LIB_EXPORT int jack_transport_locate(jack_client_t *client, jack_nframes_t frame)
LIB_EXPORT void * jack_port_get_buffer(jack_port_t *, jack_nframes_t)
LIB_EXPORT jack_time_t jack_frames_to_time(const jack_client_t *client, jack_nframes_t frames)
LIB_EXPORT int jack_port_get_aliases(const jack_port_t *port, char *const aliases[2])
LIB_EXPORT void jack_transport_stop(jack_client_t *client)
LIB_EXPORT jack_nframes_t jack_frames_since_cycle_start(const jack_client_t *)
LIB_EXPORT int jack_recompute_total_latencies(jack_client_t *)
LIB_EXPORT int jack_port_connected_to(const jack_port_t *port, const char *port_name)
LIB_EXPORT int jack_port_is_mine(const jack_client_t *, const jack_port_t *port)
LIB_EXPORT int jack_port_unset_alias(jack_port_t *port, const char *alias)
LIB_EXPORT int jack_client_create_thread(jack_client_t *client, jack_native_thread_t *thread, int priority, int realtime, thread_routine routine, void *arg)
LIB_EXPORT int jack_drop_real_time_scheduling(jack_native_thread_t thread)
LIB_EXPORT int jack_transport_reposition(jack_client_t *client, const jack_position_t *pos)
LIB_EXPORT jack_port_t * jack_port_by_name(jack_client_t *, const char *port_name)
LIB_EXPORT jack_time_t jack_get_time()
LIB_EXPORT jack_nframes_t jack_get_sample_rate(jack_client_t *)
LIB_EXPORT int jack_set_timebase_callback(jack_client_t *client, int conditional, JackTimebaseCallback timebase_callback, void *arg)
LIB_EXPORT size_t jack_port_type_get_buffer_size(jack_client_t *client, const char *port_type)
LIB_EXPORT int jack_set_buffer_size_callback(jack_client_t *client, JackBufferSizeCallback bufsize_callback, void *arg)
LIB_EXPORT int jack_port_set_name(jack_port_t *port, const char *port_name)
LIB_EXPORT float jack_cpu_load(jack_client_t *client)
LIB_EXPORT int jack_set_sync_callback(jack_client_t *client, JackSyncCallback sync_callback, void *arg)
LIB_EXPORT int jack_port_connected(const jack_port_t *port)
LIB_EXPORT void jack_on_info_shutdown(jack_client_t *client, JackInfoShutdownCallback shutdown_callback, void *arg)
LIB_EXPORT int jack_port_request_monitor_by_name(jack_client_t *client, const char *port_name, int onoff)
int RequestMonitor(jack_port_id_t port_index, bool onoff)
LIB_EXPORT int jack_internal_client_new(const char *client_name, const char *load_name, const char *load_init)
LIB_EXPORT char * jack_get_uuid_for_client_name(jack_client_t *ext_client, const char *client_name)
LIB_EXPORT int jack_session_reply(jack_client_t *ext_client, jack_session_event_t *event)
LIB_EXPORT int jack_engine_takeover_timebase(jack_client_t *)
LIB_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)
Engine control in shared memory.
LIB_EXPORT jack_nframes_t jack_thread_wait(jack_client_t *client, int status)
LIB_EXPORT const char * jack_port_name(const jack_port_t *port)
LIB_EXPORT int jack_client_name_size(void)
LIB_EXPORT jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t usecs)
LIB_EXPORT const char ** jack_get_ports(jack_client_t *, const char *port_name_pattern, const char *type_name_pattern, unsigned long flags)
LIB_EXPORT int jack_port_flags(const jack_port_t *port)
LIB_EXPORT int jack_set_port_registration_callback(jack_client_t *, JackPortRegistrationCallback registration_callback, void *arg)
LIB_EXPORT int jack_deactivate(jack_client_t *client)
LIB_EXPORT jack_client_t * jack_client_new(const char *client_name)
LIB_EXPORT int jack_set_process_thread(jack_client_t *client, JackThreadCallback fun, void *arg)
LIB_EXPORT int jack_port_rename(jack_client_t *client, jack_port_t *port, const char *port_name)
LIB_EXPORT void jack_get_transport_info(jack_client_t *client, jack_transport_info_t *tinfo)
SERVER_EXPORT void jack_log(const char *fmt,...)
LIB_EXPORT jack_nframes_t jack_get_current_transport_frame(const jack_client_t *client)
void(* JackSessionCallback)(jack_session_event_t *event, void *arg)
LIB_EXPORT void jack_port_get_latency_range(jack_port_t *port, jack_latency_callback_mode_t mode, jack_latency_range_t *range)
LIB_EXPORT const char * jack_port_short_name(const jack_port_t *port)
int EnsureMonitor(bool onoff)
The base class for clients: share part of the implementation for JackInternalClient and JackLibClient...
LIB_EXPORT int jack_client_kill_thread(jack_client_t *client, jack_native_thread_t thread)
LIB_EXPORT void jack_session_event_free(jack_session_event_t *ev)
LIB_EXPORT int jack_set_freewheel(jack_client_t *client, int onoff)