00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "JackClient.h"
00022 #include "JackError.h"
00023 #include "JackGraphManager.h"
00024 #include "JackEngineControl.h"
00025 #include "JackClientControl.h"
00026 #include "JackGlobals.h"
00027 #include "JackTime.h"
00028 #include "JackCompilerDeps.h"
00029 #include "JackPortType.h"
00030 #include "JackPlatformPlug.h"
00031 #include <math.h>
00032
00033 #ifdef __CLIENTDEBUG__
00034 #include "JackLibGlobals.h"
00035 #endif
00036
00037 using namespace Jack;
00038
00039 #ifdef __cplusplus
00040 extern "C"
00041 {
00042 #endif
00043
00044 typedef void (*print_function)(const char *);
00045 typedef void *(*thread_routine)(void*);
00046
00047 EXPORT
00048 void
00049 jack_get_version(
00050 int *major_ptr,
00051 int *minor_ptr,
00052 int *micro_ptr,
00053 int *proto_ptr);
00054
00055 EXPORT
00056 const char *
00057 jack_get_version_string();
00058
00059 EXPORT jack_client_t * jack_client_open_aux (const char *client_name,
00060 jack_options_t options,
00061 jack_status_t *status, va_list ap);
00062 EXPORT jack_client_t * jack_client_open (const char *client_name,
00063 jack_options_t options,
00064 jack_status_t *status, ...);
00065 EXPORT jack_client_t * jack_client_new (const char *client_name);
00066 EXPORT int jack_client_name_size (void);
00067 EXPORT char* jack_get_client_name (jack_client_t *client);
00068 EXPORT int jack_internal_client_new (const char *client_name,
00069 const char *load_name,
00070 const char *load_init);
00071 EXPORT void jack_internal_client_close (const char *client_name);
00072 EXPORT int jack_is_realtime (jack_client_t *client);
00073 EXPORT void jack_on_shutdown (jack_client_t *client,
00074 JackShutdownCallback shutdown_callback, void *arg);
00075 EXPORT int jack_set_process_callback (jack_client_t *client,
00076 JackProcessCallback process_callback,
00077 void *arg);
00078 EXPORT jack_nframes_t jack_thread_wait(jack_client_t *client, int status);
00079
00080
00081 EXPORT jack_nframes_t jack_cycle_wait (jack_client_t*);
00082 EXPORT void jack_cycle_signal (jack_client_t*, int status);
00083 EXPORT int jack_set_process_thread(jack_client_t* client, JackThreadCallback fun, void *arg);
00084
00085 EXPORT int jack_set_thread_init_callback (jack_client_t *client,
00086 JackThreadInitCallback thread_init_callback,
00087 void *arg);
00088 EXPORT int jack_set_freewheel_callback (jack_client_t *client,
00089 JackFreewheelCallback freewheel_callback,
00090 void *arg);
00091 EXPORT int jack_set_freewheel(jack_client_t* client, int onoff);
00092 EXPORT int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes);
00093 EXPORT int jack_set_buffer_size_callback (jack_client_t *client,
00094 JackBufferSizeCallback bufsize_callback,
00095 void *arg);
00096 EXPORT int jack_set_sample_rate_callback (jack_client_t *client,
00097 JackSampleRateCallback srate_callback,
00098 void *arg);
00099 EXPORT int jack_set_client_registration_callback (jack_client_t *,
00100 JackClientRegistrationCallback
00101 registration_callback, void *arg);
00102 EXPORT int jack_set_port_registration_callback (jack_client_t *,
00103 JackPortRegistrationCallback
00104 registration_callback, void *arg);
00105 EXPORT int jack_set_port_connect_callback (jack_client_t *,
00106 JackPortConnectCallback
00107 connect_callback, void *arg);
00108 EXPORT int jack_set_port_rename_callback (jack_client_t *,
00109 JackPortRenameCallback
00110 rename_callback, void *arg);
00111 EXPORT int jack_set_graph_order_callback (jack_client_t *,
00112 JackGraphOrderCallback graph_callback,
00113 void *);
00114 EXPORT int jack_set_xrun_callback (jack_client_t *,
00115 JackXRunCallback xrun_callback, void *arg);
00116 EXPORT int jack_activate (jack_client_t *client);
00117 EXPORT int jack_deactivate (jack_client_t *client);
00118 EXPORT jack_port_t * jack_port_register (jack_client_t *client,
00119 const char *port_name,
00120 const char *port_type,
00121 unsigned long flags,
00122 unsigned long buffer_size);
00123 EXPORT int jack_port_unregister (jack_client_t *, jack_port_t *);
00124 EXPORT void * jack_port_get_buffer (jack_port_t *, jack_nframes_t);
00125 EXPORT const char * jack_port_name (const jack_port_t *port);
00126 EXPORT const char * jack_port_short_name (const jack_port_t *port);
00127 EXPORT int jack_port_flags (const jack_port_t *port);
00128 EXPORT const char * jack_port_type (const jack_port_t *port);
00129 EXPORT jack_port_type_id_t jack_port_type_id (const jack_port_t *port);
00130 EXPORT int jack_port_is_mine (const jack_client_t *, const jack_port_t *port);
00131 EXPORT int jack_port_connected (const jack_port_t *port);
00132 EXPORT int jack_port_connected_to (const jack_port_t *port,
00133 const char *port_name);
00134 EXPORT const char ** jack_port_get_connections (const jack_port_t *port);
00135 EXPORT const char ** jack_port_get_all_connections (const jack_client_t *client,
00136 const jack_port_t *port);
00137 EXPORT int jack_port_tie (jack_port_t *src, jack_port_t *dst);
00138 EXPORT int jack_port_untie (jack_port_t *port);
00139 EXPORT jack_nframes_t jack_port_get_latency (jack_port_t *port);
00140 EXPORT jack_nframes_t jack_port_get_total_latency (jack_client_t *,
00141 jack_port_t *port);
00142 EXPORT void jack_port_set_latency (jack_port_t *, jack_nframes_t);
00143 EXPORT int jack_recompute_total_latency (jack_client_t*, jack_port_t* port);
00144 EXPORT int jack_recompute_total_latencies (jack_client_t*);
00145 EXPORT int jack_port_set_name (jack_port_t *port, const char *port_name);
00146 EXPORT int jack_port_set_alias (jack_port_t *port, const char *alias);
00147 EXPORT int jack_port_unset_alias (jack_port_t *port, const char *alias);
00148 EXPORT int jack_port_get_aliases (const jack_port_t *port, char* const aliases[2]);
00149 EXPORT int jack_port_request_monitor (jack_port_t *port, int onoff);
00150 EXPORT int jack_port_request_monitor_by_name (jack_client_t *client,
00151 const char *port_name, int onoff);
00152 EXPORT int jack_port_ensure_monitor (jack_port_t *port, int onoff);
00153 EXPORT int jack_port_monitoring_input (jack_port_t *port);
00154 EXPORT int jack_connect (jack_client_t *,
00155 const char *source_port,
00156 const char *destination_port);
00157 EXPORT int jack_disconnect (jack_client_t *,
00158 const char *source_port,
00159 const char *destination_port);
00160 EXPORT int jack_port_disconnect (jack_client_t *, jack_port_t *);
00161 EXPORT int jack_port_name_size(void);
00162 EXPORT int jack_port_type_size(void);
00163 EXPORT jack_nframes_t jack_get_sample_rate (jack_client_t *);
00164 EXPORT jack_nframes_t jack_get_buffer_size (jack_client_t *);
00165 EXPORT const char ** jack_get_ports (jack_client_t *,
00166 const char *port_name_pattern,
00167 const char *type_name_pattern,
00168 unsigned long flags);
00169 EXPORT jack_port_t * jack_port_by_name (jack_client_t *, const char *port_name);
00170 EXPORT jack_port_t * jack_port_by_id (jack_client_t *client,
00171 jack_port_id_t port_id);
00172 EXPORT int jack_engine_takeover_timebase (jack_client_t *);
00173 EXPORT jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *);
00174 EXPORT jack_time_t jack_get_time();
00175 EXPORT jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t time);
00176 EXPORT jack_time_t jack_frames_to_time(const jack_client_t *client, jack_nframes_t frames);
00177 EXPORT jack_nframes_t jack_frame_time (const jack_client_t *);
00178 EXPORT jack_nframes_t jack_last_frame_time (const jack_client_t *client);
00179 EXPORT float jack_cpu_load (jack_client_t *client);
00180 EXPORT pthread_t jack_client_thread_id (jack_client_t *);
00181 EXPORT void jack_set_error_function (print_function);
00182 EXPORT void jack_set_info_function (print_function);
00183
00184 EXPORT float jack_get_max_delayed_usecs (jack_client_t *client);
00185 EXPORT float jack_get_xrun_delayed_usecs (jack_client_t *client);
00186 EXPORT void jack_reset_max_delayed_usecs (jack_client_t *client);
00187
00188 EXPORT int jack_release_timebase (jack_client_t *client);
00189 EXPORT int jack_set_sync_callback (jack_client_t *client,
00190 JackSyncCallback sync_callback,
00191 void *arg);
00192 EXPORT int jack_set_sync_timeout (jack_client_t *client,
00193 jack_time_t timeout);
00194 EXPORT int jack_set_timebase_callback (jack_client_t *client,
00195 int conditional,
00196 JackTimebaseCallback timebase_callback,
00197 void *arg);
00198 EXPORT int jack_transport_locate (jack_client_t *client,
00199 jack_nframes_t frame);
00200 EXPORT jack_transport_state_t jack_transport_query (const jack_client_t *client,
00201 jack_position_t *pos);
00202 EXPORT jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client);
00203 EXPORT int jack_transport_reposition (jack_client_t *client,
00204 jack_position_t *pos);
00205 EXPORT void jack_transport_start (jack_client_t *client);
00206 EXPORT void jack_transport_stop (jack_client_t *client);
00207 EXPORT void jack_get_transport_info (jack_client_t *client,
00208 jack_transport_info_t *tinfo);
00209 EXPORT void jack_set_transport_info (jack_client_t *client,
00210 jack_transport_info_t *tinfo);
00211
00212 EXPORT int jack_client_real_time_priority (jack_client_t*);
00213 EXPORT int jack_client_max_real_time_priority (jack_client_t*);
00214 EXPORT int jack_acquire_real_time_scheduling (pthread_t thread, int priority);
00215 EXPORT int jack_client_create_thread (jack_client_t* client,
00216 pthread_t *thread,
00217 int priority,
00218 int realtime,
00219 thread_routine routine,
00220 void *arg);
00221 EXPORT int jack_drop_real_time_scheduling (pthread_t thread);
00222
00223 EXPORT int jack_client_stop_thread (jack_client_t* client, pthread_t thread);
00224 EXPORT int jack_client_kill_thread (jack_client_t* client, pthread_t thread);
00225 #ifndef WIN32
00226 EXPORT void jack_set_thread_creator (jack_thread_creator_t jtc);
00227 #endif
00228 EXPORT char * jack_get_internal_client_name (jack_client_t *client,
00229 jack_intclient_t intclient);
00230 EXPORT jack_intclient_t jack_internal_client_handle (jack_client_t *client,
00231 const char *client_name,
00232 jack_status_t *status);
00233 EXPORT jack_intclient_t jack_internal_client_load (jack_client_t *client,
00234 const char *client_name,
00235 jack_options_t options,
00236 jack_status_t *status, ...);
00237 EXPORT jack_intclient_t jack_internal_client_load_aux (jack_client_t *client,
00238 const char *client_name,
00239 jack_options_t options,
00240 jack_status_t *status, va_list ap);
00241
00242 EXPORT jack_status_t jack_internal_client_unload (jack_client_t *client,
00243 jack_intclient_t intclient);
00244
00245 #ifdef __cplusplus
00246 }
00247 #endif
00248
00249 static inline bool CheckPort(jack_port_id_t port_index)
00250 {
00251 return (port_index > 0 && port_index < PORT_NUM);
00252 }
00253
00254 static inline bool CheckBufferSize(jack_nframes_t buffer_size)
00255 {
00256 return (buffer_size <= BUFFER_SIZE_MAX);
00257 }
00258
00259 static inline void WaitGraphChange()
00260 {
00261
00262
00263
00264
00265
00266 if (jack_tls_get(JackGlobals::fRealTime) == NULL) {
00267 JackGraphManager* manager = GetGraphManager();
00268 JackEngineControl* control = GetEngineControl();
00269 assert(manager);
00270 assert(control);
00271 if (manager->IsPendingChange()) {
00272 jack_log("WaitGraphChange...");
00273 JackSleep(int(control->fPeriodUsecs * 1.1f));
00274 }
00275 }
00276 }
00277
00278 EXPORT void jack_set_error_function (print_function func)
00279 {
00280 jack_error_callback = func;
00281 }
00282
00283 EXPORT void jack_set_info_function (print_function func)
00284 {
00285 jack_info_callback = func;
00286 }
00287
00288 EXPORT jack_client_t* jack_client_new(const char* client_name)
00289 {
00290 assert(JackGlobals::fOpenMutex);
00291 JackGlobals::fOpenMutex->Lock();
00292 jack_error("jack_client_new: deprecated");
00293 int options = JackUseExactName;
00294 if (getenv("JACK_START_SERVER") == NULL)
00295 options |= JackNoStartServer;
00296 jack_client_t* res = jack_client_open_aux(client_name, (jack_options_t)options, NULL, NULL);
00297 JackGlobals::fOpenMutex->Unlock();
00298 return res;
00299 }
00300
00301 EXPORT void* jack_port_get_buffer(jack_port_t* port, jack_nframes_t frames)
00302 {
00303 #ifdef __CLIENTDEBUG__
00304 JackLibGlobals::CheckContext();
00305 #endif
00306 #if defined(__x86_64__) || defined(__ppc64__)
00307 uint64_t port_aux = (uint64_t)port;
00308 #else
00309 uint32_t port_aux = (uint32_t)port;
00310 #endif
00311 jack_port_id_t myport = (jack_port_id_t)port_aux;
00312 if (!CheckPort(myport)) {
00313 jack_error("jack_port_get_buffer called with an incorrect port %ld", myport);
00314 return NULL;
00315 } else {
00316 JackGraphManager* manager = GetGraphManager();
00317 return (manager ? manager->GetBuffer(myport, frames) : NULL);
00318 }
00319 }
00320
00321 EXPORT const char* jack_port_name(const jack_port_t* port)
00322 {
00323 #ifdef __CLIENTDEBUG__
00324 JackLibGlobals::CheckContext();
00325 #endif
00326 #if defined(__x86_64__) || defined(__ppc64__)
00327 uint64_t port_aux = (uint64_t)port;
00328 #else
00329 uint32_t port_aux = (uint32_t)port;
00330 #endif
00331 jack_port_id_t myport = (jack_port_id_t)port_aux;
00332 if (!CheckPort(myport)) {
00333 jack_error("jack_port_name called with an incorrect port %ld", myport);
00334 return NULL;
00335 } else {
00336 JackGraphManager* manager = GetGraphManager();
00337 return (manager ? manager->GetPort(myport)->GetName() : NULL);
00338 }
00339 }
00340
00341 EXPORT const char* jack_port_short_name(const jack_port_t* port)
00342 {
00343 #ifdef __CLIENTDEBUG__
00344 JackLibGlobals::CheckContext();
00345 #endif
00346 #if defined(__x86_64__) || defined(__ppc64__)
00347 uint64_t port_aux = (uint64_t)port;
00348 #else
00349 uint32_t port_aux = (uint32_t)port;
00350 #endif
00351 jack_port_id_t myport = (jack_port_id_t)port_aux;
00352 if (!CheckPort(myport)) {
00353 jack_error("jack_port_short_name called with an incorrect port %ld", myport);
00354 return NULL;
00355 } else {
00356 JackGraphManager* manager = GetGraphManager();
00357 return (manager ? manager->GetPort(myport)->GetShortName() : NULL);
00358 }
00359 }
00360
00361 EXPORT int jack_port_flags(const jack_port_t* port)
00362 {
00363 #ifdef __CLIENTDEBUG__
00364 JackLibGlobals::CheckContext();
00365 #endif
00366 #if defined(__x86_64__) || defined(__ppc64__)
00367 uint64_t port_aux = (uint64_t)port;
00368 #else
00369 uint32_t port_aux = (uint32_t)port;
00370 #endif
00371 jack_port_id_t myport = (jack_port_id_t)port_aux;
00372 if (!CheckPort(myport)) {
00373 jack_error("jack_port_flags called with an incorrect port %ld", myport);
00374 return -1;
00375 } else {
00376 JackGraphManager* manager = GetGraphManager();
00377 return (manager ? manager->GetPort(myport)->GetFlags() : -1);
00378 }
00379 }
00380
00381 EXPORT const char* jack_port_type(const jack_port_t* port)
00382 {
00383 #ifdef __CLIENTDEBUG__
00384 JackLibGlobals::CheckContext();
00385 #endif
00386 #if defined(__x86_64__) || defined(__ppc64__)
00387 uint64_t port_aux = (uint64_t)port;
00388 #else
00389 uint32_t port_aux = (uint32_t)port;
00390 #endif
00391 jack_port_id_t myport = (jack_port_id_t)port_aux;
00392 if (!CheckPort(myport)) {
00393 jack_error("jack_port_flags called an incorrect port %ld", myport);
00394 return NULL;
00395 } else {
00396 JackGraphManager* manager = GetGraphManager();
00397 return (manager ? manager->GetPort(myport)->GetType() : NULL);
00398 }
00399 }
00400
00401 EXPORT jack_port_type_id_t jack_port_type_id(const jack_port_t *port)
00402 {
00403 #ifdef __CLIENTDEBUG__
00404 JackLibGlobals::CheckContext();
00405 #endif
00406 #if defined(__x86_64__) || defined(__ppc64__)
00407 uint64_t port_aux = (uint64_t)port;
00408 #else
00409 uint32_t port_aux = (uint32_t)port;
00410 #endif
00411 jack_port_id_t myport = (jack_port_id_t)port_aux;
00412 if (!CheckPort(myport)) {
00413 jack_error("jack_port_type_id called an incorrect port %ld", myport);
00414 return 0;
00415 } else {
00416 JackGraphManager* manager = GetGraphManager();
00417 return (manager ? GetPortTypeId(manager->GetPort(myport)->GetType()) : 0);
00418 }
00419 }
00420
00421 EXPORT int jack_port_connected(const jack_port_t* port)
00422 {
00423 #ifdef __CLIENTDEBUG__
00424 JackLibGlobals::CheckContext();
00425 #endif
00426 #if defined(__x86_64__) || defined(__ppc64__)
00427 uint64_t port_aux = (uint64_t)port;
00428 #else
00429 uint32_t port_aux = (uint32_t)port;
00430 #endif
00431 jack_port_id_t myport = (jack_port_id_t)port_aux;
00432 if (!CheckPort(myport)) {
00433 jack_error("jack_port_connected called with an incorrect port %ld", myport);
00434 return -1;
00435 } else {
00436 WaitGraphChange();
00437 JackGraphManager* manager = GetGraphManager();
00438 return (manager ? manager->GetConnectionsNum(myport) : -1);
00439 }
00440 }
00441
00442 EXPORT int jack_port_connected_to(const jack_port_t* port, const char* port_name)
00443 {
00444 #ifdef __CLIENTDEBUG__
00445 JackLibGlobals::CheckContext();
00446 #endif
00447 #if defined(__x86_64__) || defined(__ppc64__)
00448 uint64_t port_aux = (uint64_t)port;
00449 #else
00450 uint32_t port_aux = (uint32_t)port;
00451 #endif
00452 jack_port_id_t src = (jack_port_id_t)port_aux;
00453 if (!CheckPort(src)) {
00454 jack_error("jack_port_connected_to called with an incorrect port %ld", src);
00455 return -1;
00456 } else if (port_name == NULL) {
00457 jack_error("jack_port_connected_to called with a NULL port name");
00458 return -1;
00459 } else {
00460 WaitGraphChange();
00461 JackGraphManager* manager = GetGraphManager();
00462 jack_port_id_t dst = (manager ? manager->GetPort(port_name) : NO_PORT);
00463 if (dst == NO_PORT) {
00464 jack_error("Unknown destination port port_name = %s", port_name);
00465 return 0;
00466 } else {
00467 return manager->IsConnected(src, dst);
00468 }
00469 }
00470 }
00471
00472 EXPORT int jack_port_tie(jack_port_t* src, jack_port_t* dst)
00473 {
00474 #ifdef __CLIENTDEBUG__
00475 JackLibGlobals::CheckContext();
00476 #endif
00477 #if defined(__x86_64__) || defined(__ppc64__)
00478 uint64_t src_aux = (uint64_t)src;
00479 #else
00480 uint32_t src_aux = (uint32_t)src;
00481 #endif
00482 jack_port_id_t mysrc = (jack_port_id_t)src_aux;
00483 if (!CheckPort(mysrc)) {
00484 jack_error("jack_port_tie called with a NULL src port");
00485 return -1;
00486 }
00487 #if defined(__x86_64__) || defined(__ppc64__)
00488 uint64_t dst_aux = (uint64_t)dst;
00489 #else
00490 uint32_t dst_aux = (uint32_t)dst;
00491 #endif
00492 jack_port_id_t mydst = (jack_port_id_t)dst_aux;
00493 if (!CheckPort(mydst)) {
00494 jack_error("jack_port_tie called with a NULL dst port");
00495 return -1;
00496 }
00497 JackGraphManager* manager = GetGraphManager();
00498 if (manager && manager->GetPort(mysrc)->GetRefNum() != manager->GetPort(mydst)->GetRefNum()) {
00499 jack_error("jack_port_tie called with ports not belonging to the same client");
00500 return -1;
00501 } else {
00502 return manager->GetPort(mydst)->Tie(mysrc);
00503 }
00504 }
00505
00506 EXPORT int jack_port_untie(jack_port_t* port)
00507 {
00508 #ifdef __CLIENTDEBUG__
00509 JackLibGlobals::CheckContext();
00510 #endif
00511 #if defined(__x86_64__) || defined(__ppc64__)
00512 uint64_t port_aux = (uint64_t)port;
00513 #else
00514 uint32_t port_aux = (uint32_t)port;
00515 #endif
00516 jack_port_id_t myport = (jack_port_id_t)port_aux;
00517 if (!CheckPort(myport)) {
00518 jack_error("jack_port_untie called with an incorrect port %ld", myport);
00519 return -1;
00520 } else {
00521 JackGraphManager* manager = GetGraphManager();
00522 return (manager ? manager->GetPort(myport)->UnTie() : -1);
00523 }
00524 }
00525
00526 EXPORT jack_nframes_t jack_port_get_latency(jack_port_t* port)
00527 {
00528 #ifdef __CLIENTDEBUG__
00529 JackLibGlobals::CheckContext();
00530 #endif
00531 #if defined(__x86_64__) || defined(__ppc64__)
00532 uint64_t port_aux = (uint64_t)port;
00533 #else
00534 uint32_t port_aux = (uint32_t)port;
00535 #endif
00536 jack_port_id_t myport = (jack_port_id_t)port_aux;
00537 if (!CheckPort(myport)) {
00538 jack_error("jack_port_get_latency called with an incorrect port %ld", myport);
00539 return 0;
00540 } else {
00541 WaitGraphChange();
00542 JackGraphManager* manager = GetGraphManager();
00543 return (manager ? manager->GetPort(myport)->GetLatency() : 0);
00544 }
00545 }
00546
00547 EXPORT void jack_port_set_latency(jack_port_t* port, jack_nframes_t frames)
00548 {
00549 #ifdef __CLIENTDEBUG__
00550 JackLibGlobals::CheckContext();
00551 #endif
00552 #if defined(__x86_64__) || defined(__ppc64__)
00553 uint64_t port_aux = (uint64_t)port;
00554 #else
00555 uint32_t port_aux = (uint32_t)port;
00556 #endif
00557 jack_port_id_t myport = (jack_port_id_t)port_aux;
00558 if (!CheckPort(myport)) {
00559 jack_error("jack_port_set_latency called with an incorrect port %ld", myport);
00560 } else {
00561 JackGraphManager* manager = GetGraphManager();
00562 if (manager)
00563 manager->GetPort(myport)->SetLatency(frames);
00564 }
00565 }
00566
00567 EXPORT int jack_recompute_total_latency(jack_client_t* ext_client, jack_port_t* port)
00568 {
00569 #ifdef __CLIENTDEBUG__
00570 JackLibGlobals::CheckContext();
00571 #endif
00572
00573 JackClient* client = (JackClient*)ext_client;
00574 #if defined(__x86_64__) || defined(__ppc64__)
00575 uint64_t port_aux = (uint64_t)port;
00576 #else
00577 uint32_t port_aux = (uint32_t)port;
00578 #endif
00579 jack_port_id_t myport = (jack_port_id_t)port_aux;
00580 if (client == NULL) {
00581 jack_error("jack_recompute_total_latencies called with a NULL client");
00582 return -1;
00583 } else if (!CheckPort(myport)) {
00584 jack_error("jack_recompute_total_latencies called with a NULL port");
00585 return -1;
00586 } else {
00587 WaitGraphChange();
00588 JackGraphManager* manager = GetGraphManager();
00589 return (manager ? manager->ComputeTotalLatency(myport) : -1);
00590 }
00591 }
00592
00593 EXPORT int jack_recompute_total_latencies(jack_client_t* ext_client)
00594 {
00595 #ifdef __CLIENTDEBUG__
00596 JackLibGlobals::CheckContext();
00597 #endif
00598
00599 JackClient* client = (JackClient*)ext_client;
00600 if (client == NULL) {
00601 jack_error("jack_recompute_total_latencies called with a NULL client");
00602 return -1;
00603 } else {
00604 WaitGraphChange();
00605 JackGraphManager* manager = GetGraphManager();
00606 return (manager ? manager->ComputeTotalLatencies() : -1);
00607 }
00608 }
00609
00610
00611
00612
00613
00614 EXPORT int jack_port_set_name(jack_port_t* port, const char* name)
00615 {
00616 #ifdef __CLIENTDEBUG__
00617 JackLibGlobals::CheckContext();
00618 #endif
00619 #if defined(__x86_64__) || defined(__ppc64__)
00620 uint64_t port_aux = (uint64_t)port;
00621 #else
00622 uint32_t port_aux = (uint32_t)port;
00623 #endif
00624 jack_port_id_t myport = (jack_port_id_t)port_aux;
00625 if (!CheckPort(myport)) {
00626 jack_error("jack_port_set_name called with an incorrect port %ld", myport);
00627 return -1;
00628 } else if (name == NULL) {
00629 jack_error("jack_port_set_name called with a NULL port name");
00630 return -1;
00631 } else {
00632 JackGraphManager* manager = GetGraphManager();
00633 int refnum;
00634 if (manager && ((refnum = manager->GetPort(myport)->GetRefNum()) > 0)) {
00635 JackClient* client = JackGlobals::fClientTable[refnum];
00636 assert(client);
00637 return client->PortRename(myport, name);
00638 } else {
00639 return -1;
00640 }
00641 }
00642 }
00643
00644 EXPORT int jack_port_set_alias(jack_port_t* port, const char* name)
00645 {
00646 #ifdef __CLIENTDEBUG__
00647 JackLibGlobals::CheckContext();
00648 #endif
00649 #if defined(__x86_64__) || defined(__ppc64__)
00650 uint64_t port_aux = (uint64_t)port;
00651 #else
00652 uint32_t port_aux = (uint32_t)port;
00653 #endif
00654 jack_port_id_t myport = (jack_port_id_t)port_aux;
00655 if (!CheckPort(myport)) {
00656 jack_error("jack_port_set_alias called with an incorrect port %ld", myport);
00657 return -1;
00658 } else if (name == NULL) {
00659 jack_error("jack_port_set_alias called with a NULL port name");
00660 return -1;
00661 } else {
00662 JackGraphManager* manager = GetGraphManager();
00663 return (manager ? manager->GetPort(myport)->SetAlias(name) : -1);
00664 }
00665 }
00666
00667 EXPORT int jack_port_unset_alias(jack_port_t* port, const char* name)
00668 {
00669 #ifdef __CLIENTDEBUG__
00670 JackLibGlobals::CheckContext();
00671 #endif
00672 #if defined(__x86_64__) || defined(__ppc64__)
00673 uint64_t port_aux = (uint64_t)port;
00674 #else
00675 uint32_t port_aux = (uint32_t)port;
00676 #endif
00677 jack_port_id_t myport = (jack_port_id_t)port_aux;
00678 if (!CheckPort(myport)) {
00679 jack_error("jack_port_unset_alias called with an incorrect port %ld", myport);
00680 return -1;
00681 } else if (name == NULL) {
00682 jack_error("jack_port_unset_alias called with a NULL port name");
00683 return -1;
00684 } else {
00685 JackGraphManager* manager = GetGraphManager();
00686 return (manager ? manager->GetPort(myport)->UnsetAlias(name) : -1);
00687 }
00688 }
00689
00690 EXPORT int jack_port_get_aliases(const jack_port_t* port, char* const aliases[2])
00691 {
00692 #ifdef __CLIENTDEBUG__
00693 JackLibGlobals::CheckContext();
00694 #endif
00695 #if defined(__x86_64__) || defined(__ppc64__)
00696 uint64_t port_aux = (uint64_t)port;
00697 #else
00698 uint32_t port_aux = (uint32_t)port;
00699 #endif
00700 jack_port_id_t myport = (jack_port_id_t)port_aux;
00701 if (!CheckPort(myport)) {
00702 jack_error("jack_port_get_aliases called with an incorrect port %ld", myport);
00703 return -1;
00704 } else {
00705 JackGraphManager* manager = GetGraphManager();
00706 return (manager ? manager->GetPort(myport)->GetAliases(aliases) : -1);
00707 }
00708 }
00709
00710 EXPORT int jack_port_request_monitor(jack_port_t* port, int onoff)
00711 {
00712 #ifdef __CLIENTDEBUG__
00713 JackLibGlobals::CheckContext();
00714 #endif
00715 #if defined(__x86_64__) || defined(__ppc64__)
00716 uint64_t port_aux = (uint64_t)port;
00717 #else
00718 uint32_t port_aux = (uint32_t)port;
00719 #endif
00720 jack_port_id_t myport = (jack_port_id_t)port_aux;
00721 if (!CheckPort(myport)) {
00722 jack_error("jack_port_request_monitor called with an incorrect port %ld", myport);
00723 return -1;
00724 } else {
00725 JackGraphManager* manager = GetGraphManager();
00726 return (manager ? manager->RequestMonitor(myport, onoff) : -1);
00727 }
00728 }
00729
00730 EXPORT int jack_port_request_monitor_by_name(jack_client_t* ext_client, const char* port_name, int onoff)
00731 {
00732 #ifdef __CLIENTDEBUG__
00733 JackLibGlobals::CheckContext();
00734 #endif
00735 JackClient* client = (JackClient*)ext_client;
00736 if (client == NULL) {
00737 jack_error("jack_port_request_monitor_by_name called with a NULL client");
00738 return -1;
00739 } else {
00740 JackGraphManager* manager = GetGraphManager();
00741 if (!manager)
00742 return -1;
00743 jack_port_id_t myport = manager->GetPort(port_name);
00744 if (!CheckPort(myport)) {
00745 jack_error("jack_port_request_monitor_by_name called with an incorrect port %s", port_name);
00746 return -1;
00747 } else {
00748 return manager->RequestMonitor(myport, onoff);
00749 }
00750 }
00751 }
00752
00753 EXPORT int jack_port_ensure_monitor(jack_port_t* port, int onoff)
00754 {
00755 #ifdef __CLIENTDEBUG__
00756 JackLibGlobals::CheckContext();
00757 #endif
00758 #if defined(__x86_64__) || defined(__ppc64__)
00759 uint64_t port_aux = (uint64_t)port;
00760 #else
00761 uint32_t port_aux = (uint32_t)port;
00762 #endif
00763 jack_port_id_t myport = (jack_port_id_t)port_aux;
00764 if (!CheckPort(myport)) {
00765 jack_error("jack_port_ensure_monitor called with an incorrect port %ld", myport);
00766 return -1;
00767 } else {
00768 JackGraphManager* manager = GetGraphManager();
00769 return (manager ? manager->GetPort(myport)->EnsureMonitor(onoff) : -1);
00770 }
00771 }
00772
00773 EXPORT int jack_port_monitoring_input(jack_port_t* port)
00774 {
00775 #ifdef __CLIENTDEBUG__
00776 JackLibGlobals::CheckContext();
00777 #endif
00778 #if defined(__x86_64__) || defined(__ppc64__)
00779 uint64_t port_aux = (uint64_t)port;
00780 #else
00781 uint32_t port_aux = (uint32_t)port;
00782 #endif
00783 jack_port_id_t myport = (jack_port_id_t)port_aux;
00784 if (!CheckPort(myport)) {
00785 jack_error("jack_port_monitoring_input called with an incorrect port %ld", myport);
00786 return -1;
00787 } else {
00788 JackGraphManager* manager = GetGraphManager();
00789 return (manager ? manager->GetPort(myport)->MonitoringInput() : -1);
00790 }
00791 }
00792
00793 EXPORT int jack_is_realtime(jack_client_t* ext_client)
00794 {
00795 #ifdef __CLIENTDEBUG__
00796 JackLibGlobals::CheckContext();
00797 #endif
00798 JackClient* client = (JackClient*)ext_client;
00799 if (client == NULL) {
00800 jack_error("jack_is_realtime called with a NULL client");
00801 return -1;
00802 } else {
00803 JackEngineControl* control = GetEngineControl();
00804 return (control ? control->fRealTime : -1);
00805 }
00806 }
00807
00808 EXPORT void jack_on_shutdown(jack_client_t* ext_client, JackShutdownCallback callback, void* arg)
00809 {
00810 #ifdef __CLIENTDEBUG__
00811 JackLibGlobals::CheckContext();
00812 #endif
00813 JackClient* client = (JackClient*)ext_client;
00814 if (client == NULL) {
00815 jack_error("jack_on_shutdown called with a NULL client");
00816 } else {
00817 client->OnShutdown(callback, arg);
00818 }
00819 }
00820
00821 EXPORT int jack_set_process_callback(jack_client_t* ext_client, JackProcessCallback callback, void* arg)
00822 {
00823 #ifdef __CLIENTDEBUG__
00824 JackLibGlobals::CheckContext();
00825 #endif
00826 JackClient* client = (JackClient*)ext_client;
00827 if (client == NULL) {
00828 jack_error("jack_set_process_callback called with a NULL client");
00829 return -1;
00830 } else {
00831 return client->SetProcessCallback(callback, arg);
00832 }
00833 }
00834
00835 EXPORT jack_nframes_t jack_thread_wait(jack_client_t* ext_client, int status)
00836 {
00837 #ifdef __CLIENTDEBUG__
00838 JackLibGlobals::CheckContext();
00839 #endif
00840 JackClient* client = (JackClient*)ext_client;
00841 if (client == NULL) {
00842 jack_error("jack_thread_wait called with a NULL client");
00843 return 0;
00844 } else {
00845 return client->Wait(status);
00846 }
00847 }
00848
00849 EXPORT jack_nframes_t jack_cycle_wait(jack_client_t* ext_client)
00850 {
00851 #ifdef __CLIENTDEBUG__
00852 JackLibGlobals::CheckContext();
00853 #endif
00854 JackClient* client = (JackClient*)ext_client;
00855 if (client == NULL) {
00856 jack_error("jack_cycle_wait called with a NULL client");
00857 return 0;
00858 } else {
00859 return client->CycleWait();
00860 }
00861 }
00862
00863 EXPORT void jack_cycle_signal(jack_client_t* ext_client, int status)
00864 {
00865 #ifdef __CLIENTDEBUG__
00866 JackLibGlobals::CheckContext();
00867 #endif
00868 JackClient* client = (JackClient*)ext_client;
00869 if (client == NULL) {
00870 jack_error("jack_cycle_signal called with a NULL client");
00871 } else {
00872 client->CycleSignal(status);
00873 }
00874 }
00875
00876 EXPORT int jack_set_process_thread(jack_client_t* ext_client, JackThreadCallback fun, void *arg)
00877 {
00878 #ifdef __CLIENTDEBUG__
00879 JackLibGlobals::CheckContext();
00880 #endif
00881 JackClient* client = (JackClient*)ext_client;
00882 if (client == NULL) {
00883 jack_error("jack_set_process_thread called with a NULL client");
00884 return -1;
00885 } else {
00886 return client->SetProcessThread(fun, arg);
00887 }
00888 }
00889
00890 EXPORT int jack_set_freewheel_callback(jack_client_t* ext_client, JackFreewheelCallback freewheel_callback, void* arg)
00891 {
00892 #ifdef __CLIENTDEBUG__
00893 JackLibGlobals::CheckContext();
00894 #endif
00895 JackClient* client = (JackClient*)ext_client;
00896 if (client == NULL) {
00897 jack_error("jack_set_freewheel_callback called with a NULL client");
00898 return -1;
00899 } else {
00900 return client->SetFreewheelCallback(freewheel_callback, arg);
00901 }
00902 }
00903
00904 EXPORT int jack_set_freewheel(jack_client_t* ext_client, int onoff)
00905 {
00906 #ifdef __CLIENTDEBUG__
00907 JackLibGlobals::CheckContext();
00908 #endif
00909 JackClient* client = (JackClient*)ext_client;
00910 if (client == NULL) {
00911 jack_error("jack_set_freewheel called with a NULL client");
00912 return -1;
00913 } else {
00914 return client->SetFreeWheel(onoff);
00915 }
00916 }
00917
00918 EXPORT int jack_set_buffer_size(jack_client_t* ext_client, jack_nframes_t buffer_size)
00919 {
00920 #ifdef __CLIENTDEBUG__
00921 JackLibGlobals::CheckContext();
00922 #endif
00923 JackClient* client = (JackClient*)ext_client;
00924 if (client == NULL) {
00925 jack_error("jack_set_buffer_size called with a NULL client");
00926 return -1;
00927 } else if (!CheckBufferSize(buffer_size)) {
00928 return -1;
00929 } else {
00930 return client->SetBufferSize(buffer_size);
00931 }
00932 }
00933
00934 EXPORT int jack_set_buffer_size_callback(jack_client_t* ext_client, JackBufferSizeCallback bufsize_callback, void* arg)
00935 {
00936 #ifdef __CLIENTDEBUG__
00937 JackLibGlobals::CheckContext();
00938 #endif
00939 JackClient* client = (JackClient*)ext_client;
00940 if (client == NULL) {
00941 jack_error("jack_set_buffer_size_callback called with a NULL client");
00942 return -1;
00943 } else {
00944 return client->SetBufferSizeCallback(bufsize_callback, arg);
00945 }
00946 }
00947
00948 EXPORT int jack_set_sample_rate_callback(jack_client_t* ext_client, JackSampleRateCallback srate_callback, void* arg)
00949 {
00950 #ifdef __CLIENTDEBUG__
00951 JackLibGlobals::CheckContext();
00952 #endif
00953 JackClient* client = (JackClient*)ext_client;
00954 if (client == NULL) {
00955 jack_error("jack_set_sample_rate_callback called with a NULL client");
00956 return -1;
00957 } else {
00958 return client->SetSampleRateCallback(srate_callback, arg);
00959 }
00960 }
00961
00962 EXPORT int jack_set_client_registration_callback(jack_client_t* ext_client, JackClientRegistrationCallback registration_callback, void* arg)
00963 {
00964 #ifdef __CLIENTDEBUG__
00965 JackLibGlobals::CheckContext();
00966 #endif
00967 JackClient* client = (JackClient*)ext_client;
00968 if (client == NULL) {
00969 jack_error("jack_set_client_registration_callback called with a NULL client");
00970 return -1;
00971 } else {
00972 return client->SetClientRegistrationCallback(registration_callback, arg);
00973 }
00974 }
00975
00976 EXPORT int jack_set_port_registration_callback(jack_client_t* ext_client, JackPortRegistrationCallback registration_callback, void* arg)
00977 {
00978 #ifdef __CLIENTDEBUG__
00979 JackLibGlobals::CheckContext();
00980 #endif
00981 JackClient* client = (JackClient*)ext_client;
00982 if (client == NULL) {
00983 jack_error("jack_set_port_registration_callback called with a NULL client");
00984 return -1;
00985 } else {
00986 return client->SetPortRegistrationCallback(registration_callback, arg);
00987 }
00988 }
00989
00990 EXPORT int jack_set_port_connect_callback(jack_client_t* ext_client, JackPortConnectCallback portconnect_callback, void* arg)
00991 {
00992 #ifdef __CLIENTDEBUG__
00993 JackLibGlobals::CheckContext();
00994 #endif
00995 JackClient* client = (JackClient*)ext_client;
00996 if (client == NULL) {
00997 jack_error("jack_set_port_connect_callback called with a NULL client");
00998 return -1;
00999 } else {
01000 return client->SetPortConnectCallback(portconnect_callback, arg);
01001 }
01002 }
01003
01004 EXPORT int jack_set_port_rename_callback(jack_client_t* ext_client, JackPortRenameCallback rename_callback, void* arg)
01005 {
01006 #ifdef __CLIENTDEBUG__
01007 JackLibGlobals::CheckContext();
01008 #endif
01009 JackClient* client = (JackClient*)ext_client;
01010 if (client == NULL) {
01011 jack_error("jack_set_port_rename_callback called with a NULL client");
01012 return -1;
01013 } else {
01014 return client->SetPortRenameCallback(rename_callback, arg);
01015 }
01016 }
01017
01018 EXPORT int jack_set_graph_order_callback(jack_client_t* ext_client, JackGraphOrderCallback graph_callback, void* arg)
01019 {
01020 #ifdef __CLIENTDEBUG__
01021 JackLibGlobals::CheckContext();
01022 #endif
01023 JackClient* client = (JackClient*)ext_client;
01024 jack_log("jack_set_graph_order_callback ext_client %x client %x ", ext_client, client);
01025 if (client == NULL) {
01026 jack_error("jack_set_graph_order_callback called with a NULL client");
01027 return -1;
01028 } else {
01029 return client->SetGraphOrderCallback(graph_callback, arg);
01030 }
01031 }
01032
01033 EXPORT int jack_set_xrun_callback(jack_client_t* ext_client, JackXRunCallback xrun_callback, void* arg)
01034 {
01035 #ifdef __CLIENTDEBUG__
01036 JackLibGlobals::CheckContext();
01037 #endif
01038 JackClient* client = (JackClient*)ext_client;
01039 if (client == NULL) {
01040 jack_error("jack_set_xrun_callback called with a NULL client");
01041 return -1;
01042 } else {
01043 return client->SetXRunCallback(xrun_callback, arg);
01044 }
01045 }
01046
01047 EXPORT int jack_set_thread_init_callback(jack_client_t* ext_client, JackThreadInitCallback init_callback, void *arg)
01048 {
01049 #ifdef __CLIENTDEBUG__
01050 JackLibGlobals::CheckContext();
01051 #endif
01052 JackClient* client = (JackClient*)ext_client;
01053 jack_log("jack_set_thread_init_callback ext_client %x client %x ", ext_client, client);
01054 if (client == NULL) {
01055 jack_error("jack_set_thread_init_callback called with a NULL client");
01056 return -1;
01057 } else {
01058 return client->SetInitCallback(init_callback, arg);
01059 }
01060 }
01061
01062 EXPORT int jack_activate(jack_client_t* ext_client)
01063 {
01064 #ifdef __CLIENTDEBUG__
01065 JackLibGlobals::CheckContext();
01066 #endif
01067 JackClient* client = (JackClient*)ext_client;
01068 if (client == NULL) {
01069 jack_error("jack_activate called with a NULL client");
01070 return -1;
01071 } else {
01072 return client->Activate();
01073 }
01074 }
01075
01076 EXPORT int jack_deactivate(jack_client_t* ext_client)
01077 {
01078 #ifdef __CLIENTDEBUG__
01079 JackLibGlobals::CheckContext();
01080 #endif
01081 JackClient* client = (JackClient*)ext_client;
01082 if (client == NULL) {
01083 jack_error("jack_deactivate called with a NULL client");
01084 return -1;
01085 } else {
01086 return client->Deactivate();
01087 }
01088 }
01089
01090 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)
01091 {
01092 #ifdef __CLIENTDEBUG__
01093 JackLibGlobals::CheckContext();
01094 #endif
01095 JackClient* client = (JackClient*)ext_client;
01096 if (client == NULL) {
01097 jack_error("jack_port_register called with a NULL client");
01098 return NULL;
01099 } else if ((port_name == NULL) || (port_type == NULL)) {
01100 jack_error("jack_port_register called with a NULL port name or a NULL port_type");
01101 return NULL;
01102 } else {
01103 #if defined(__x86_64__) || defined(__ppc64__)
01104 return (jack_port_t *)((uint64_t)client->PortRegister(port_name, port_type, flags, buffer_size));
01105 #else
01106 return (jack_port_t *)client->PortRegister(port_name, port_type, flags, buffer_size);
01107 #endif
01108 }
01109 }
01110
01111 EXPORT int jack_port_unregister(jack_client_t* ext_client, jack_port_t* port)
01112 {
01113 #ifdef __CLIENTDEBUG__
01114 JackLibGlobals::CheckContext();
01115 #endif
01116 JackClient* client = (JackClient*)ext_client;
01117 if (client == NULL) {
01118 jack_error("jack_port_unregister called with a NULL client");
01119 return -1;
01120 }
01121 #if defined(__x86_64__) || defined(__ppc64__)
01122 uint64_t port_aux = (uint64_t)port;
01123 #else
01124 uint32_t port_aux = (uint32_t)port;
01125 #endif
01126 jack_port_id_t myport = (jack_port_id_t)port_aux;
01127 if (!CheckPort(myport)) {
01128 jack_error("jack_port_unregister called with an incorrect port %ld", myport);
01129 return -1;
01130 }
01131 return client->PortUnRegister(myport);
01132 }
01133
01134 EXPORT int jack_port_is_mine(const jack_client_t* ext_client, const jack_port_t* port)
01135 {
01136 #ifdef __CLIENTDEBUG__
01137 JackLibGlobals::CheckContext();
01138 #endif
01139 JackClient* client = (JackClient*)ext_client;
01140 if (client == NULL) {
01141 jack_error("jack_port_is_mine called with a NULL client");
01142 return -1;
01143 }
01144 #if defined(__x86_64__) || defined(__ppc64__)
01145 uint64_t port_aux = (uint64_t)port;
01146 #else
01147 uint32_t port_aux = (uint32_t)port;
01148 #endif
01149 jack_port_id_t myport = (jack_port_id_t)port_aux;
01150 if (!CheckPort(myport)) {
01151 jack_error("jack_port_is_mine called with an incorrect port %ld", myport);
01152 return -1;
01153 }
01154 return client->PortIsMine(myport);
01155 }
01156
01157 EXPORT const char** jack_port_get_connections(const jack_port_t* port)
01158 {
01159 #ifdef __CLIENTDEBUG__
01160 JackLibGlobals::CheckContext();
01161 #endif
01162 #if defined(__x86_64__) || defined(__ppc64__)
01163 uint64_t port_aux = (uint64_t)port;
01164 #else
01165 uint32_t port_aux = (uint32_t)port;
01166 #endif
01167 jack_port_id_t myport = (jack_port_id_t)port_aux;
01168 if (!CheckPort(myport)) {
01169 jack_error("jack_port_get_connections called with an incorrect port %ld", myport);
01170 return NULL;
01171 } else {
01172 WaitGraphChange();
01173 JackGraphManager* manager = GetGraphManager();
01174 return (manager ? manager->GetConnections(myport) : NULL);
01175 }
01176 }
01177
01178
01179 EXPORT const char** jack_port_get_all_connections(const jack_client_t* ext_client, const jack_port_t* port)
01180 {
01181 #ifdef __CLIENTDEBUG__
01182 JackLibGlobals::CheckContext();
01183 #endif
01184 JackClient* client = (JackClient*)ext_client;
01185 if (client == NULL) {
01186 jack_error("jack_port_get_all_connections called with a NULL client");
01187 return NULL;
01188 }
01189
01190 #if defined(__x86_64__) || defined(__ppc64__)
01191 uint64_t port_aux = (uint64_t)port;
01192 #else
01193 uint32_t port_aux = (uint32_t)port;
01194 #endif
01195 jack_port_id_t myport = (jack_port_id_t)port_aux;
01196 if (!CheckPort(myport)) {
01197 jack_error("jack_port_get_all_connections called with an incorrect port %ld", myport);
01198 return NULL;
01199 } else {
01200 WaitGraphChange();
01201 JackGraphManager* manager = GetGraphManager();
01202 return (manager ? manager->GetConnections(myport) : NULL);
01203 }
01204 }
01205
01206 EXPORT jack_nframes_t jack_port_get_total_latency(jack_client_t* ext_client, jack_port_t* port)
01207 {
01208 #ifdef __CLIENTDEBUG__
01209 JackLibGlobals::CheckContext();
01210 #endif
01211 JackClient* client = (JackClient*)ext_client;
01212 if (client == NULL) {
01213 jack_error("jack_port_get_total_latency called with a NULL client");
01214 return 0;
01215 }
01216
01217 #if defined(__x86_64__) || defined(__ppc64__)
01218 uint64_t port_aux = (uint64_t)port;
01219 #else
01220 uint32_t port_aux = (uint32_t)port;
01221 #endif
01222 jack_port_id_t myport = (jack_port_id_t)port_aux;
01223 if (!CheckPort(myport)) {
01224 jack_error("jack_port_get_total_latency called with an incorrect port %ld", myport);
01225 return 0;
01226 } else {
01227 WaitGraphChange();
01228 JackGraphManager* manager = GetGraphManager();
01229 if (manager) {
01230 manager->ComputeTotalLatency(myport);
01231 return manager->GetPort(myport)->GetTotalLatency();
01232 } else {
01233 return 0;
01234 }
01235 }
01236 }
01237
01238 EXPORT int jack_connect(jack_client_t* ext_client, const char* src, const char* dst)
01239 {
01240 #ifdef __CLIENTDEBUG__
01241 JackLibGlobals::CheckContext();
01242 #endif
01243 JackClient* client = (JackClient*)ext_client;
01244 if (client == NULL) {
01245 jack_error("jack_connect called with a NULL client");
01246 return -1;
01247 } else if ((src == NULL) || (dst == NULL)) {
01248 jack_error("jack_connect called with a NULL port name");
01249 return -1;
01250 } else {
01251 return client->PortConnect(src, dst);
01252 }
01253 }
01254
01255 EXPORT int jack_disconnect(jack_client_t* ext_client, const char* src, const char* dst)
01256 {
01257 #ifdef __CLIENTDEBUG__
01258 JackLibGlobals::CheckContext();
01259 #endif
01260 JackClient* client = (JackClient*)ext_client;
01261 if (client == NULL) {
01262 jack_error("jack_disconnect called with a NULL client");
01263 return -1;
01264 } else if ((src == NULL) || (dst == NULL)) {
01265 jack_error("jack_connect called with a NULL port name");
01266 return -1;
01267 } else {
01268 return client->PortDisconnect(src, dst);
01269 }
01270 }
01271
01272 EXPORT int jack_port_disconnect(jack_client_t* ext_client, jack_port_t* src)
01273 {
01274 #ifdef __CLIENTDEBUG__
01275 JackLibGlobals::CheckContext();
01276 #endif
01277 JackClient* client = (JackClient*)ext_client;
01278 if (client == NULL) {
01279 jack_error("jack_port_disconnect called with a NULL client");
01280 return -1;
01281 }
01282 #if defined(__x86_64__) || defined(__ppc64__)
01283 uint64_t port_aux = (uint64_t)src;
01284 #else
01285 uint32_t port_aux = (uint32_t)src;
01286 #endif
01287 jack_port_id_t myport = (jack_port_id_t)port_aux;
01288 if (!CheckPort(myport)) {
01289 jack_error("jack_port_disconnect called with an incorrect port %ld", myport);
01290 return -1;
01291 }
01292 return client->PortDisconnect(myport);
01293 }
01294
01295 EXPORT jack_nframes_t jack_get_sample_rate(jack_client_t* ext_client)
01296 {
01297 #ifdef __CLIENTDEBUG__
01298 JackLibGlobals::CheckContext();
01299 #endif
01300 JackClient* client = (JackClient*)ext_client;
01301 if (client == NULL) {
01302 jack_error("jack_get_sample_rate called with a NULL client");
01303 return 0;
01304 } else {
01305 JackEngineControl* control = GetEngineControl();
01306 return (control ? control->fSampleRate : 0);
01307 }
01308 }
01309
01310 EXPORT jack_nframes_t jack_get_buffer_size(jack_client_t* ext_client)
01311 {
01312 #ifdef __CLIENTDEBUG__
01313 JackLibGlobals::CheckContext();
01314 #endif
01315 JackClient* client = (JackClient*)ext_client;
01316 if (client == NULL) {
01317 jack_error("jack_get_buffer_size called with a NULL client");
01318 return 0;
01319 } else {
01320 JackEngineControl* control = GetEngineControl();
01321 return (control ? control->fBufferSize : 0);
01322 }
01323 }
01324
01325 EXPORT const char** jack_get_ports(jack_client_t* ext_client, const char* port_name_pattern, const char* type_name_pattern, unsigned long flags)
01326 {
01327 #ifdef __CLIENTDEBUG__
01328 JackLibGlobals::CheckContext();
01329 #endif
01330 JackClient* client = (JackClient*)ext_client;
01331 if (client == NULL) {
01332 jack_error("jack_get_ports called with a NULL client");
01333 return NULL;
01334 }
01335 JackGraphManager* manager = GetGraphManager();
01336 return (manager ? manager->GetPorts(port_name_pattern, type_name_pattern, flags) : NULL);
01337 }
01338
01339 EXPORT jack_port_t* jack_port_by_name(jack_client_t* ext_client, const char* portname)
01340 {
01341 #ifdef __CLIENTDEBUG__
01342 JackLibGlobals::CheckContext();
01343 #endif
01344 JackClient* client = (JackClient*)ext_client;
01345 if (client == NULL) {
01346 jack_error("jack_get_ports called with a NULL client");
01347 return 0;
01348 }
01349
01350 if (portname == NULL) {
01351 jack_error("jack_port_by_name called with a NULL port name");
01352 return NULL;
01353 } else {
01354 JackGraphManager* manager = GetGraphManager();
01355 if (!manager)
01356 return NULL;
01357 int res = manager->GetPort(portname);
01358 #if defined(__x86_64__) || defined(__ppc64__)
01359 return (res == NO_PORT) ? NULL : (jack_port_t*)((uint64_t)res);
01360 #else
01361 return (res == NO_PORT) ? NULL : (jack_port_t*)res;
01362 #endif
01363 }
01364 }
01365
01366 EXPORT jack_port_t* jack_port_by_id(jack_client_t* ext_client, jack_port_id_t id)
01367 {
01368 #ifdef __CLIENTDEBUG__
01369 JackLibGlobals::CheckContext();
01370 #endif
01371
01372 #if defined(__x86_64__) || defined(__ppc64__)
01373 return (jack_port_t*)((uint64_t)id);
01374 #else
01375 return (jack_port_t*)id;
01376 #endif
01377 }
01378
01379 EXPORT int jack_engine_takeover_timebase(jack_client_t* ext_client)
01380 {
01381 #ifdef __CLIENTDEBUG__
01382 JackLibGlobals::CheckContext();
01383 #endif
01384 JackClient* client = (JackClient*)ext_client;
01385 if (client == NULL) {
01386 jack_error("jack_engine_takeover_timebase called with a NULL client");
01387 return -1;
01388 } else {
01389 jack_error("jack_engine_takeover_timebase: deprecated\n");
01390 return 0;
01391 }
01392 }
01393
01394 EXPORT jack_nframes_t jack_frames_since_cycle_start(const jack_client_t* ext_client)
01395 {
01396 #ifdef __CLIENTDEBUG__
01397 JackLibGlobals::CheckContext();
01398 #endif
01399 JackTimer timer;
01400 JackEngineControl* control = GetEngineControl();
01401 if (control) {
01402 control->ReadFrameTime(&timer);
01403 return timer.FramesSinceCycleStart(GetMicroSeconds(), control->fSampleRate);
01404 } else {
01405 return 0;
01406 }
01407 }
01408
01409 EXPORT jack_time_t jack_get_time()
01410 {
01411 return GetMicroSeconds();
01412 }
01413
01414 EXPORT jack_time_t jack_frames_to_time(const jack_client_t* ext_client, jack_nframes_t frames)
01415 {
01416 #ifdef __CLIENTDEBUG__
01417 JackLibGlobals::CheckContext();
01418 #endif
01419 JackClient* client = (JackClient*)ext_client;
01420 if (client == NULL) {
01421 jack_error("jack_frames_to_time called with a NULL client");
01422 return 0;
01423 } else {
01424 JackTimer timer;
01425 JackEngineControl* control = GetEngineControl();
01426 if (control) {
01427 control->ReadFrameTime(&timer);
01428 return timer.Frames2Time(frames, control->fBufferSize);
01429 } else {
01430 return 0;
01431 }
01432 }
01433 }
01434
01435 EXPORT jack_nframes_t jack_time_to_frames(const jack_client_t* ext_client, jack_time_t time)
01436 {
01437 #ifdef __CLIENTDEBUG__
01438 JackLibGlobals::CheckContext();
01439 #endif
01440 JackClient* client = (JackClient*)ext_client;
01441 if (client == NULL) {
01442 jack_error("jack_time_to_frames called with a NULL client");
01443 return 0;
01444 } else {
01445 JackTimer timer;
01446 JackEngineControl* control = GetEngineControl();
01447 if (control) {
01448 control->ReadFrameTime(&timer);
01449 return timer.Time2Frames(time, control->fBufferSize);
01450 } else {
01451 return 0;
01452 }
01453 }
01454 }
01455
01456 EXPORT jack_nframes_t jack_frame_time(const jack_client_t* ext_client)
01457 {
01458 return jack_time_to_frames(ext_client, GetMicroSeconds());
01459 }
01460
01461 EXPORT jack_nframes_t jack_last_frame_time(const jack_client_t* ext_client)
01462 {
01463 #ifdef __CLIENTDEBUG__
01464 JackLibGlobals::CheckContext();
01465 #endif
01466 JackTimer timer;
01467 JackEngineControl* control = GetEngineControl();
01468 if (control) {
01469 control->ReadFrameTime(&timer);
01470 return timer.CurFrame();
01471 } else {
01472 return 0;
01473 }
01474 }
01475
01476 EXPORT float jack_cpu_load(jack_client_t* ext_client)
01477 {
01478 #ifdef __CLIENTDEBUG__
01479 JackLibGlobals::CheckContext();
01480 #endif
01481 JackClient* client = (JackClient*)ext_client;
01482 if (client == NULL) {
01483 jack_error("jack_cpu_load called with a NULL client");
01484 return 0.0f;
01485 } else {
01486 JackEngineControl* control = GetEngineControl();
01487 return (control ? control->fCPULoad : 0.0f);
01488 }
01489 }
01490
01491 EXPORT pthread_t jack_client_thread_id(jack_client_t* ext_client)
01492 {
01493 #ifdef __CLIENTDEBUG__
01494 JackLibGlobals::CheckContext();
01495 #endif
01496 JackClient* client = (JackClient*)ext_client;
01497 if (client == NULL) {
01498 jack_error("jack_client_thread_id called with a NULL client");
01499 return (pthread_t)NULL;
01500 } else {
01501 return client->GetThreadID();
01502 }
01503 }
01504
01505 EXPORT char* jack_get_client_name(jack_client_t* ext_client)
01506 {
01507 #ifdef __CLIENTDEBUG__
01508 JackLibGlobals::CheckContext();
01509 #endif
01510 JackClient* client = (JackClient*)ext_client;
01511 if (client == NULL) {
01512 jack_error("jack_get_client_name called with a NULL client");
01513 return NULL;
01514 } else {
01515 return client->GetClientControl()->fName;
01516 }
01517 }
01518
01519 EXPORT int jack_client_name_size(void)
01520 {
01521 return JACK_CLIENT_NAME_SIZE;
01522 }
01523
01524 EXPORT int jack_port_name_size(void)
01525 {
01526 return JACK_PORT_NAME_SIZE;
01527 }
01528
01529 EXPORT int jack_port_type_size(void)
01530 {
01531 return JACK_PORT_TYPE_SIZE;
01532 }
01533
01534
01535 EXPORT int jack_release_timebase(jack_client_t* ext_client)
01536 {
01537 #ifdef __CLIENTDEBUG__
01538 JackLibGlobals::CheckContext();
01539 #endif
01540 JackClient* client = (JackClient*)ext_client;
01541 if (client == NULL) {
01542 jack_error("jack_release_timebase called with a NULL client");
01543 return -1;
01544 } else {
01545 return client->ReleaseTimebase();
01546 }
01547 }
01548
01549 EXPORT int jack_set_sync_callback(jack_client_t* ext_client, JackSyncCallback sync_callback, void *arg)
01550 {
01551 #ifdef __CLIENTDEBUG__
01552 JackLibGlobals::CheckContext();
01553 #endif
01554 JackClient* client = (JackClient*)ext_client;
01555 if (client == NULL) {
01556 jack_error("jack_set_sync_callback called with a NULL client");
01557 return -1;
01558 } else {
01559 return client->SetSyncCallback(sync_callback, arg);
01560 }
01561 }
01562
01563 EXPORT int jack_set_sync_timeout(jack_client_t* ext_client, jack_time_t timeout)
01564 {
01565 #ifdef __CLIENTDEBUG__
01566 JackLibGlobals::CheckContext();
01567 #endif
01568 JackClient* client = (JackClient*)ext_client;
01569 if (client == NULL) {
01570 jack_error("jack_set_sync_timeout called with a NULL client");
01571 return -1;
01572 } else {
01573 return client->SetSyncTimeout(timeout);
01574 }
01575 }
01576
01577 EXPORT int jack_set_timebase_callback(jack_client_t* ext_client, int conditional, JackTimebaseCallback timebase_callback, void* arg)
01578 {
01579 #ifdef __CLIENTDEBUG__
01580 JackLibGlobals::CheckContext();
01581 #endif
01582 JackClient* client = (JackClient*)ext_client;
01583 if (client == NULL) {
01584 jack_error("jack_set_timebase_callback called with a NULL client");
01585 return -1;
01586 } else {
01587 return client->SetTimebaseCallback(conditional, timebase_callback, arg);
01588 }
01589 }
01590
01591 EXPORT int jack_transport_locate(jack_client_t* ext_client, jack_nframes_t frame)
01592 {
01593 #ifdef __CLIENTDEBUG__
01594 JackLibGlobals::CheckContext();
01595 #endif
01596 JackClient* client = (JackClient*)ext_client;
01597 if (client == NULL) {
01598 jack_error("jack_transport_locate called with a NULL client");
01599 return -1;
01600 } else {
01601 client->TransportLocate(frame);
01602 return 0;
01603 }
01604 }
01605
01606 EXPORT jack_transport_state_t jack_transport_query(const jack_client_t* ext_client, jack_position_t* pos)
01607 {
01608 #ifdef __CLIENTDEBUG__
01609 JackLibGlobals::CheckContext();
01610 #endif
01611 JackClient* client = (JackClient*)ext_client;
01612 if (client == NULL) {
01613 jack_error("jack_transport_query called with a NULL client");
01614 return JackTransportStopped;
01615 } else {
01616 return client->TransportQuery(pos);
01617 }
01618 }
01619
01620 EXPORT jack_nframes_t jack_get_current_transport_frame(const jack_client_t* ext_client)
01621 {
01622 #ifdef __CLIENTDEBUG__
01623 JackLibGlobals::CheckContext();
01624 #endif
01625 JackClient* client = (JackClient*)ext_client;
01626 if (client == NULL) {
01627 jack_error("jack_get_current_transport_frame called with a NULL client");
01628 return 0;
01629 } else {
01630 return client->GetCurrentTransportFrame();
01631 }
01632 }
01633
01634 EXPORT int jack_transport_reposition(jack_client_t* ext_client, jack_position_t* pos)
01635 {
01636 #ifdef __CLIENTDEBUG__
01637 JackLibGlobals::CheckContext();
01638 #endif
01639 JackClient* client = (JackClient*)ext_client;
01640 if (client == NULL) {
01641 jack_error("jack_transport_reposition called with a NULL client");
01642 return -1;
01643 } else {
01644 client->TransportReposition(pos);
01645 return 0;
01646 }
01647 }
01648
01649 EXPORT void jack_transport_start(jack_client_t* ext_client)
01650 {
01651 #ifdef __CLIENTDEBUG__
01652 JackLibGlobals::CheckContext();
01653 #endif
01654 JackClient* client = (JackClient*)ext_client;
01655 if (client == NULL) {
01656 jack_error("jack_transport_start called with a NULL client");
01657 } else {
01658 client->TransportStart();
01659 }
01660 }
01661
01662 EXPORT void jack_transport_stop(jack_client_t* ext_client)
01663 {
01664 #ifdef __CLIENTDEBUG__
01665 JackLibGlobals::CheckContext();
01666 #endif
01667 JackClient* client = (JackClient*)ext_client;
01668 if (client == NULL) {
01669 jack_error("jack_transport_stop called with a NULL client");
01670 } else {
01671 client->TransportStop();
01672 }
01673 }
01674
01675
01676 EXPORT void jack_get_transport_info(jack_client_t* ext_client, jack_transport_info_t* tinfo)
01677 {
01678 jack_error("jack_get_transport_info: deprecated");
01679 if (tinfo)
01680 memset(tinfo, 0, sizeof(jack_transport_info_t));
01681 }
01682
01683 EXPORT void jack_set_transport_info(jack_client_t* ext_client, jack_transport_info_t* tinfo)
01684 {
01685 jack_error("jack_set_transport_info: deprecated");
01686 if (tinfo)
01687 memset(tinfo, 0, sizeof(jack_transport_info_t));
01688 }
01689
01690
01691 EXPORT float jack_get_max_delayed_usecs(jack_client_t* ext_client)
01692 {
01693 #ifdef __CLIENTDEBUG__
01694 JackLibGlobals::CheckContext();
01695 #endif
01696 JackClient* client = (JackClient*)ext_client;
01697 if (client == NULL) {
01698 jack_error("jack_get_max_delayed_usecs called with a NULL client");
01699 return 0.f;
01700 } else {
01701 JackEngineControl* control = GetEngineControl();
01702 return (control ? control->fMaxDelayedUsecs : 0.f);
01703 }
01704 }
01705
01706 EXPORT float jack_get_xrun_delayed_usecs(jack_client_t* ext_client)
01707 {
01708 #ifdef __CLIENTDEBUG__
01709 JackLibGlobals::CheckContext();
01710 #endif
01711 JackClient* client = (JackClient*)ext_client;
01712 if (client == NULL) {
01713 jack_error("jack_get_xrun_delayed_usecs called with a NULL client");
01714 return 0.f;
01715 } else {
01716 JackEngineControl* control = GetEngineControl();
01717 return (control ? control->fXrunDelayedUsecs : 0.f);
01718 }
01719 }
01720
01721 EXPORT void jack_reset_max_delayed_usecs(jack_client_t* ext_client)
01722 {
01723 #ifdef __CLIENTDEBUG__
01724 JackLibGlobals::CheckContext();
01725 #endif
01726 JackClient* client = (JackClient*)ext_client;
01727 if (client == NULL) {
01728 jack_error("jack_reset_max_delayed_usecs called with a NULL client");
01729 } else {
01730 JackEngineControl* control = GetEngineControl();
01731 control->ResetXRun();
01732 }
01733 }
01734
01735
01736 EXPORT int jack_client_real_time_priority(jack_client_t* ext_client)
01737 {
01738 #ifdef __CLIENTDEBUG__
01739 JackLibGlobals::CheckContext();
01740 #endif
01741 JackClient* client = (JackClient*)ext_client;
01742 if (client == NULL) {
01743 jack_error("jack_client_real_time_priority called with a NULL client");
01744 return -1;
01745 } else {
01746 JackEngineControl* control = GetEngineControl();
01747 return (control->fRealTime) ? control->fClientPriority : -1;
01748 }
01749 }
01750
01751 EXPORT int jack_client_max_real_time_priority(jack_client_t* ext_client)
01752 {
01753 #ifdef __CLIENTDEBUG__
01754 JackLibGlobals::CheckContext();
01755 #endif
01756 JackClient* client = (JackClient*)ext_client;
01757 if (client == NULL) {
01758 jack_error("jack_client_max_real_time_priority called with a NULL client");
01759 return -1;
01760 } else {
01761 JackEngineControl* control = GetEngineControl();
01762 return (control->fRealTime) ? control->fMaxClientPriority : -1;
01763 }
01764 }
01765
01766 EXPORT int jack_acquire_real_time_scheduling(pthread_t thread, int priority)
01767 {
01768 JackEngineControl* control = GetEngineControl();
01769 return (control ? JackThread::AcquireRealTimeImp(thread, priority, GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint) : -1);
01770 }
01771
01772 EXPORT int jack_client_create_thread(jack_client_t* client,
01773 pthread_t *thread,
01774 int priority,
01775 int realtime,
01776 thread_routine routine,
01777 void *arg)
01778 {
01779 return JackThread::StartImp(thread, priority, realtime, routine, arg);
01780 }
01781
01782 EXPORT int jack_drop_real_time_scheduling(pthread_t thread)
01783 {
01784 return JackThread::DropRealTimeImp(thread);
01785 }
01786
01787 EXPORT int jack_client_stop_thread(jack_client_t* client, pthread_t thread)
01788 {
01789 return JackThread::StopImp(thread);
01790 }
01791
01792 EXPORT int jack_client_kill_thread(jack_client_t* client, pthread_t thread)
01793 {
01794 return JackThread::KillImp(thread);
01795 }
01796
01797 #ifndef WIN32
01798 EXPORT void jack_set_thread_creator (jack_thread_creator_t jtc)
01799 {
01800 JackGlobals::fJackThreadCreator = jtc;
01801 }
01802 #endif
01803
01804
01805 EXPORT int jack_internal_client_new (const char *client_name,
01806 const char *load_name,
01807 const char *load_init)
01808 {
01809 jack_error("jack_internal_client_new: deprecated");
01810 return -1;
01811 }
01812
01813 EXPORT void jack_internal_client_close (const char *client_name)
01814 {
01815 jack_error("jack_internal_client_close: deprecated");
01816 }
01817
01818 EXPORT char* jack_get_internal_client_name(jack_client_t* ext_client, jack_intclient_t intclient)
01819 {
01820 #ifdef __CLIENTDEBUG__
01821 JackLibGlobals::CheckContext();
01822 #endif
01823 JackClient* client = (JackClient*)ext_client;
01824 if (client == NULL) {
01825 jack_error("jack_get_internal_client_name called with a NULL client");
01826 return NULL;
01827 } else if (intclient >= CLIENT_NUM) {
01828 jack_error("jack_get_internal_client_name: incorrect client");
01829 return NULL;
01830 } else {
01831 return client->GetInternalClientName(intclient);
01832 }
01833 }
01834
01835 EXPORT jack_intclient_t jack_internal_client_handle(jack_client_t* ext_client, const char* client_name, jack_status_t* status)
01836 {
01837 #ifdef __CLIENTDEBUG__
01838 JackLibGlobals::CheckContext();
01839 #endif
01840 JackClient* client = (JackClient*)ext_client;
01841 if (client == NULL) {
01842 jack_error("jack_internal_client_handle called with a NULL client");
01843 return 0;
01844 } else {
01845 jack_status_t my_status;
01846 if (status == NULL)
01847 status = &my_status;
01848 *status = (jack_status_t)0;
01849 return client->InternalClientHandle(client_name, status);
01850 }
01851 }
01852
01853 EXPORT 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)
01854 {
01855 #ifdef __CLIENTDEBUG__
01856 JackLibGlobals::CheckContext();
01857 #endif
01858 JackClient* client = (JackClient*)ext_client;
01859 if (client == NULL) {
01860 jack_error("jack_internal_client_load called with a NULL client");
01861 return 0;
01862 } else {
01863 jack_varargs_t va;
01864 jack_status_t my_status;
01865
01866 if (status == NULL)
01867 status = &my_status;
01868 *status = (jack_status_t)0;
01869
01870
01871 if ((options & ~JackLoadOptions)) {
01872 int my_status1 = *status | (JackFailure | JackInvalidOption);
01873 *status = (jack_status_t)my_status1;
01874 return 0;
01875 }
01876
01877
01878 jack_varargs_parse(options, ap, &va);
01879 return client->InternalClientLoad(client_name, options, status, &va);
01880 }
01881 }
01882
01883 EXPORT jack_intclient_t jack_internal_client_load(jack_client_t *client, const char *client_name, jack_options_t options, jack_status_t *status, ...)
01884 {
01885 va_list ap;
01886 va_start(ap, status);
01887 jack_intclient_t res = jack_internal_client_load_aux(client, client_name, options, status, ap);
01888 va_end(ap);
01889 return res;
01890 }
01891
01892 EXPORT jack_status_t jack_internal_client_unload(jack_client_t* ext_client, jack_intclient_t intclient)
01893 {
01894 #ifdef __CLIENTDEBUG__
01895 JackLibGlobals::CheckContext();
01896 #endif
01897 JackClient* client = (JackClient*)ext_client;
01898 if (client == NULL) {
01899 jack_error("jack_internal_client_unload called with a NULL client");
01900 return (jack_status_t)(JackNoSuchClient | JackFailure);
01901 } else if (intclient >= CLIENT_NUM) {
01902 jack_error("jack_internal_client_unload: incorrect client");
01903 return (jack_status_t)(JackNoSuchClient | JackFailure);
01904 } else {
01905 jack_status_t my_status;
01906 client->InternalClientUnload(intclient, &my_status);
01907 return my_status;
01908 }
01909 }
01910
01911 EXPORT
01912 void
01913 jack_get_version(
01914 int *major_ptr,
01915 int *minor_ptr,
01916 int *micro_ptr,
01917 int *proto_ptr)
01918 {
01919
01920 *major_ptr = 0;
01921 *minor_ptr = 0;
01922 *micro_ptr = 0;
01923 *proto_ptr = 0;
01924 }
01925
01926 EXPORT
01927 const char *
01928 jack_get_version_string()
01929 {
01930 return VERSION;
01931 }