JackAPIWrapper.cpp

00001 /*
00002 Copyright (C) 2008 Grame
00003 
00004 This program is free software; you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation; either version 2 of the License, or
00007 (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 
00018 */
00019 
00020 #include "types.h"
00021 #include "jack.h"
00022 #include "JackExports.h"
00023 #include <dlfcn.h>
00024 #include <stdarg.h>
00025 #include <stdio.h>
00026 #include <dirent.h>
00027 #include <string.h>
00028 
00029 #ifdef __cplusplus
00030 extern "C"
00031 {
00032 #endif
00033 
00034     EXPORT int jack_client_name_size (void);
00035     EXPORT char* jack_get_client_name (jack_client_t *client);
00036     EXPORT int jack_internal_client_new (const char *client_name,
00037                                          const char *load_name,
00038                                          const char *load_init);
00039     EXPORT void jack_internal_client_close (const char *client_name);
00040     EXPORT int jack_is_realtime (jack_client_t *client);
00041     EXPORT void jack_on_shutdown (jack_client_t *client,
00042                                   void (*function)(void *arg), void *arg);
00043     EXPORT int jack_set_process_callback (jack_client_t *client,
00044                                           JackProcessCallback process_callback,
00045                                           void *arg);
00046     EXPORT int jack_set_thread_init_callback (jack_client_t *client,
00047             JackThreadInitCallback thread_init_callback,
00048             void *arg);
00049     EXPORT int jack_set_freewheel_callback (jack_client_t *client,
00050                                             JackFreewheelCallback freewheel_callback,
00051                                             void *arg);
00052     EXPORT int jack_set_freewheel(jack_client_t* client, int onoff);
00053     EXPORT int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes);
00054     EXPORT int jack_set_buffer_size_callback (jack_client_t *client,
00055             JackBufferSizeCallback bufsize_callback,
00056             void *arg);
00057     EXPORT int jack_set_sample_rate_callback (jack_client_t *client,
00058             JackSampleRateCallback srate_callback,
00059             void *arg);
00060     EXPORT int jack_set_port_registration_callback (jack_client_t *,
00061             JackPortRegistrationCallback
00062             registration_callback, void *arg);
00063     EXPORT int jack_set_graph_order_callback (jack_client_t *,
00064             JackGraphOrderCallback graph_callback,
00065             void *);
00066     EXPORT int jack_set_xrun_callback (jack_client_t *,
00067                                        JackXRunCallback xrun_callback, void *arg);
00068     EXPORT int jack_activate (jack_client_t *client);
00069     EXPORT int jack_deactivate (jack_client_t *client);
00070     EXPORT jack_port_t * jack_port_register (jack_client_t *client,
00071             const char *port_name,
00072             const char *port_type,
00073             unsigned long flags,
00074             unsigned long buffer_size);
00075     EXPORT int jack_port_unregister (jack_client_t *, jack_port_t *);
00076     EXPORT void * jack_port_get_buffer (jack_port_t *, jack_nframes_t);
00077     EXPORT const char * jack_port_name (const jack_port_t *port);
00078     EXPORT const char * jack_port_short_name (const jack_port_t *port);
00079     EXPORT int jack_port_flags (const jack_port_t *port);
00080     EXPORT const char * jack_port_type (const jack_port_t *port);
00081     EXPORT int jack_port_is_mine (const jack_client_t *, const jack_port_t *port);
00082     EXPORT int jack_port_connected (const jack_port_t *port);
00083     EXPORT int jack_port_connected_to (const jack_port_t *port,
00084                                        const char *port_name);
00085     EXPORT const char ** jack_port_get_connections (const jack_port_t *port);
00086     EXPORT const char ** jack_port_get_all_connections (const jack_client_t *client,
00087             const jack_port_t *port);
00088     EXPORT int jack_port_tie (jack_port_t *src, jack_port_t *dst);
00089     EXPORT int jack_port_untie (jack_port_t *port);
00090     EXPORT jack_nframes_t jack_port_get_latency (jack_port_t *port);
00091     EXPORT jack_nframes_t jack_port_get_total_latency (jack_client_t *,
00092             jack_port_t *port);
00093     EXPORT void jack_port_set_latency (jack_port_t *, jack_nframes_t);
00094     EXPORT int jack_recompute_total_latencies (jack_client_t*);
00095     EXPORT int jack_port_set_name (jack_port_t *port, const char *port_name);
00096     EXPORT int jack_port_request_monitor (jack_port_t *port, int onoff);
00097     EXPORT int jack_port_request_monitor_by_name (jack_client_t *client,
00098             const char *port_name, int onoff);
00099     EXPORT int jack_port_ensure_monitor (jack_port_t *port, int onoff);
00100     EXPORT int jack_port_monitoring_input (jack_port_t *port);
00101     EXPORT int jack_connect (jack_client_t *,
00102                              const char *source_port,
00103                              const char *destination_port);
00104     EXPORT int jack_disconnect (jack_client_t *,
00105                                 const char *source_port,
00106                                 const char *destination_port);
00107     EXPORT int jack_port_disconnect (jack_client_t *, jack_port_t *);
00108     EXPORT int jack_port_name_size(void);
00109     EXPORT int jack_port_type_size(void);
00110     EXPORT jack_nframes_t jack_get_sample_rate (jack_client_t *);
00111     EXPORT jack_nframes_t jack_get_buffer_size (jack_client_t *);
00112     EXPORT const char ** jack_get_ports (jack_client_t *,
00113                                          const char *port_name_pattern,
00114                                          const char *type_name_pattern,
00115                                          unsigned long flags);
00116     EXPORT jack_port_t * jack_port_by_name (jack_client_t *, const char *port_name);
00117     EXPORT jack_port_t * jack_port_by_id (jack_client_t *client,
00118                                           jack_port_id_t port_id);
00119     EXPORT int jack_engine_takeover_timebase (jack_client_t *);
00120     EXPORT jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *);
00121     EXPORT jack_nframes_t jack_frame_time (const jack_client_t *);
00122     EXPORT jack_nframes_t jack_last_frame_time (const jack_client_t *client);
00123     EXPORT float jack_cpu_load (jack_client_t *client);
00124     EXPORT pthread_t jack_client_thread_id (jack_client_t *);
00125     EXPORT void jack_set_error_function (void (*func)(const char *));
00126 
00127     EXPORT float jack_get_max_delayed_usecs (jack_client_t *client);
00128     EXPORT float jack_get_xrun_delayed_usecs (jack_client_t *client);
00129     EXPORT void jack_reset_max_delayed_usecs (jack_client_t *client);
00130 
00131     EXPORT int jack_release_timebase (jack_client_t *client);
00132     EXPORT int jack_set_sync_callback (jack_client_t *client,
00133                                        JackSyncCallback sync_callback,
00134                                        void *arg);
00135     EXPORT int jack_set_sync_timeout (jack_client_t *client,
00136                                       jack_time_t timeout);
00137     EXPORT int jack_set_timebase_callback (jack_client_t *client,
00138                                            int conditional,
00139                                            JackTimebaseCallback timebase_callback,
00140                                            void *arg);
00141     EXPORT int jack_transport_locate (jack_client_t *client,
00142                                       jack_nframes_t frame);
00143     EXPORT jack_transport_state_t jack_transport_query (const jack_client_t *client,
00144             jack_position_t *pos);
00145     EXPORT jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client);
00146     EXPORT int jack_transport_reposition (jack_client_t *client,
00147                                           jack_position_t *pos);
00148     EXPORT void jack_transport_start (jack_client_t *client);
00149     EXPORT void jack_transport_stop (jack_client_t *client);
00150     EXPORT void jack_get_transport_info (jack_client_t *client,
00151                                          jack_transport_info_t *tinfo);
00152     EXPORT void jack_set_transport_info (jack_client_t *client,
00153                                          jack_transport_info_t *tinfo);
00154 
00155     EXPORT int jack_acquire_real_time_scheduling (pthread_t thread, int priority);
00156     EXPORT int jack_client_create_thread (jack_client_t* client,
00157                                           pthread_t *thread,
00158                                           int priority,
00159                                           int realtime,         // boolean
00160                                           void *(*start_routine)(void*),
00161                                           void *arg);
00162     EXPORT int jack_drop_real_time_scheduling (pthread_t thread);
00163 
00164     EXPORT char * jack_get_internal_client_name (jack_client_t *client,
00165             jack_intclient_t intclient);
00166     EXPORT jack_intclient_t jack_internal_client_handle (jack_client_t *client,
00167             const char *client_name,
00168             jack_status_t *status);
00169     EXPORT jack_intclient_t jack_internal_client_load (jack_client_t *client,
00170             const char *client_name,
00171             jack_options_t options,
00172             jack_status_t *status, ...);
00173     EXPORT jack_status_t jack_internal_client_unload (jack_client_t *client,
00174             jack_intclient_t intclient);
00175                         
00176         EXPORT jack_client_t * jack_client_open (const char *client_name,
00177             jack_options_t options,
00178             jack_status_t *status, ...);
00179     EXPORT jack_client_t * jack_client_new (const char *client_name);
00180     EXPORT int jack_client_close (jack_client_t *client);
00181 
00182 #ifdef __cplusplus
00183 }
00184 #endif
00185 
00186 // Function definition
00187 
00188 typedef void* (*jack_port_get_buffer_fun_def)(jack_port_t* port, jack_nframes_t frames);
00189 static jack_port_get_buffer_fun_def jack_port_get_buffer_fun = 0;
00190 EXPORT void* jack_port_get_buffer(jack_port_t* port, jack_nframes_t frames)
00191 {
00192         return (*jack_port_get_buffer_fun)(port, frames);
00193 }
00194 
00195 typedef const char* (*jack_port_name_fun_def)(const jack_port_t* port);
00196 static jack_port_name_fun_def jack_port_name_fun = 0;
00197 EXPORT const char* jack_port_name(const jack_port_t* port)
00198 {
00199     return (*jack_port_name_fun)(port);
00200 }
00201 
00202 typedef const char* (*jack_port_short_name_fun_def) (const jack_port_t* port);
00203 static jack_port_short_name_fun_def jack_port_short_name_fun = 0;
00204 EXPORT const char* jack_port_short_name(const jack_port_t* port)
00205 {
00206     return (*jack_port_short_name_fun)(port);
00207 }
00208 
00209 typedef int (*jack_port_flags_fun_def)(const jack_port_t* port);
00210 static jack_port_flags_fun_def jack_port_flags_fun = 0;
00211 EXPORT int jack_port_flags(const jack_port_t* port)
00212 {
00213     return (*jack_port_flags_fun)(port);
00214 }
00215 
00216 typedef const char* (*jack_port_type_fun_def)(const jack_port_t* port);
00217 static jack_port_type_fun_def jack_port_type_fun = 0;
00218 EXPORT const char* jack_port_type(const jack_port_t* port)
00219 {
00220     return (*jack_port_type_fun)(port);
00221 }
00222 
00223 typedef int (*jack_port_connected_fun_def)(const jack_port_t* port);
00224 static jack_port_connected_fun_def jack_port_connected_fun = 0;
00225 EXPORT int jack_port_connected(const jack_port_t* port)
00226 {
00227     return (*jack_port_connected_fun)(port);
00228 }
00229 
00230 typedef int (*jack_port_connected_to_fun_def)(const jack_port_t* port, const char* portname);
00231 static jack_port_connected_to_fun_def jack_port_connected_to_fun = 0;
00232 EXPORT int jack_port_connected_to(const jack_port_t* port, const char* portname)
00233 {
00234     return (*jack_port_connected_to_fun)(port, portname);
00235 }
00236 
00237 typedef int (*jack_port_tie_fun_def)(jack_port_t* src, jack_port_t* dst);
00238 static jack_port_tie_fun_def jack_port_tie_fun = 0;
00239 EXPORT int jack_port_tie(jack_port_t* src, jack_port_t* dst)
00240 {
00241     return (*jack_port_tie_fun)(src, dst);
00242 }
00243 
00244 typedef int (*jack_port_untie_fun_def)(jack_port_t* port);
00245 static jack_port_untie_fun_def jack_port_untie_fun = 0;
00246 EXPORT int jack_port_untie(jack_port_t* port)
00247 {
00248     return (*jack_port_untie_fun)(port);
00249 }
00250 
00251 typedef jack_nframes_t (*jack_port_get_latency_fun_def)(jack_port_t* port);
00252 static jack_port_get_latency_fun_def jack_port_get_latency_fun = 0;
00253 EXPORT jack_nframes_t jack_port_get_latency(jack_port_t* port)
00254 {
00255      return (*jack_port_get_latency)(port);
00256 }
00257 
00258 typedef void (*jack_port_set_latency_fun_def)(jack_port_t* port, jack_nframes_t frames);
00259 static jack_port_set_latency_fun_def jack_port_set_latency_fun = 0;
00260 EXPORT void jack_port_set_latency(jack_port_t* port, jack_nframes_t frames)
00261 {
00262     (*jack_port_set_latency_fun)(port, frames);
00263 }
00264 
00265 typedef int (*jack_recompute_total_latencies_fun_def)(jack_client_t* ext_client);
00266 static jack_recompute_total_latencies_fun_def jack_recompute_total_latencies_fun = 0;
00267 EXPORT int jack_recompute_total_latencies(jack_client_t* ext_client)
00268 {
00269         return (*jack_recompute_total_latencies_fun)(ext_client);
00270 }
00271 
00272 typedef int (*jack_port_set_name_fun_def)(jack_port_t* port, const char* name);
00273 static jack_port_set_name_fun_def jack_port_set_name_fun = 0;
00274 EXPORT int jack_port_set_name(jack_port_t* port, const char* name)
00275 {
00276     return (*jack_port_set_name_fun)(port, name);
00277 }
00278 
00279 typedef int (*jack_port_request_monitor_fun_def)(jack_port_t* port, int onoff);
00280 static jack_port_request_monitor_fun_def jack_port_request_monitor_fun = 0;
00281 EXPORT int jack_port_request_monitor(jack_port_t* port, int onoff)
00282 {
00283     return (*jack_port_request_monitor_fun)(port, onoff);
00284 }
00285 
00286 typedef int (*jack_port_request_monitor_by_name_fun_def)(jack_client_t* ext_client, const char* port_name, int onoff);
00287 static jack_port_request_monitor_by_name_fun_def jack_port_request_monitor_by_name_fun = 0;
00288 EXPORT int jack_port_request_monitor_by_name(jack_client_t* ext_client, const char* port_name, int onoff)
00289 {
00290     return (*jack_port_request_monitor_by_name_fun)(ext_client, port_name, onoff);
00291 }
00292 
00293 typedef int (*jack_port_ensure_monitor_fun_def)(jack_port_t* port, int onoff);
00294 static jack_port_ensure_monitor_fun_def jack_port_ensure_monitor_fun = 0;
00295 EXPORT int jack_port_ensure_monitor(jack_port_t* port, int onoff)
00296 {
00297     return (*jack_port_ensure_monitor_fun)(port, onoff);
00298 }
00299 
00300 typedef int (*jack_port_monitoring_input_fun_def)(jack_port_t* port);
00301 static jack_port_monitoring_input_fun_def jack_port_monitoring_input_fun = 0;
00302 EXPORT int jack_port_monitoring_input(jack_port_t* port)
00303 {
00304     return (*jack_port_monitoring_input_fun)(port);
00305 }
00306 
00307 typedef int (*jack_is_realtime_fun_def)(jack_client_t* ext_client);
00308 static jack_is_realtime_fun_def jack_is_realtime_fun = 0;
00309 EXPORT int jack_is_realtime(jack_client_t* ext_client)
00310 {
00311     return (*jack_is_realtime_fun)(ext_client);
00312 }
00313 
00314 typedef void (*shutdown_fun)(void* arg);
00315 typedef void (*jack_on_shutdown_fun_def)(jack_client_t* ext_client, shutdown_fun callback, void* arg);
00316 static jack_on_shutdown_fun_def jack_on_shutdown_fun = 0;
00317 EXPORT void jack_on_shutdown(jack_client_t* ext_client, shutdown_fun callback, void* arg)
00318 {
00319     return (*jack_on_shutdown_fun)(ext_client, callback, arg);
00320 }
00321 
00322 typedef int (*jack_set_process_callback_fun_def)(jack_client_t* ext_client, JackProcessCallback callback, void* arg);
00323 static jack_set_process_callback_fun_def jack_set_process_callback_fun = 0;
00324 EXPORT int jack_set_process_callback(jack_client_t* ext_client, JackProcessCallback callback, void* arg)
00325 {
00326     return (*jack_set_process_callback_fun)(ext_client, callback, arg);
00327 }
00328 
00329 typedef int (*jack_set_freewheel_callback_fun_def)(jack_client_t* ext_client, JackFreewheelCallback freewheel_callback, void* arg);
00330 static jack_set_freewheel_callback_fun_def jack_set_freewheel_callback_fun = 0;
00331 EXPORT int jack_set_freewheel_callback(jack_client_t* ext_client, JackFreewheelCallback freewheel_callback, void* arg)
00332 {
00333     return (*jack_set_freewheel_callback_fun)(ext_client, freewheel_callback, arg);
00334 }
00335 
00336 typedef int (*jack_set_freewheel_fun_def)(jack_client_t* ext_client, int onoff);
00337 static jack_set_freewheel_fun_def jack_set_freewheel_fun = 0;
00338 EXPORT int jack_set_freewheel(jack_client_t* ext_client, int onoff)
00339 {
00340     return (*jack_set_freewheel_fun)(ext_client, onoff);
00341 }
00342 
00343 typedef int (*jack_set_buffer_size_fun_def)(jack_client_t* ext_client, jack_nframes_t buffer_size);
00344 static jack_set_buffer_size_fun_def jack_set_buffer_size_fun = 0;
00345 EXPORT int jack_set_buffer_size(jack_client_t* ext_client, jack_nframes_t buffer_size)
00346 {
00347     return (*jack_set_buffer_size_fun)(ext_client, buffer_size);
00348 }
00349 
00350 typedef int (*jack_set_buffer_size_callback_fun_def)(jack_client_t* ext_client, JackBufferSizeCallback bufsize_callback, void* arg);
00351 static jack_set_buffer_size_callback_fun_def jack_set_buffer_size_callback_fun = 0;
00352 EXPORT int jack_set_buffer_size_callback(jack_client_t* ext_client, JackBufferSizeCallback bufsize_callback, void* arg)
00353 {
00354     return (*jack_set_buffer_size_callback_fun)(ext_client, bufsize_callback, arg);
00355 }
00356 
00357 typedef int (*jack_set_sample_rate_callback_fun_def)(jack_client_t* ext_client, JackSampleRateCallback srate_callback, void* arg);
00358 static jack_set_sample_rate_callback_fun_def jack_set_sample_rate_callback_fun = 0;
00359 EXPORT int jack_set_sample_rate_callback(jack_client_t* ext_client, JackSampleRateCallback srate_callback, void* arg)
00360 {
00361     return (*jack_set_sample_rate_callback_fun)(ext_client, srate_callback, arg);
00362 }
00363 
00364 typedef int (*jack_set_port_registration_callback_fun_def)(jack_client_t* ext_client, JackPortRegistrationCallback registration_callback, void* arg);
00365 static jack_set_port_registration_callback_fun_def jack_set_port_registration_callback_fun = 0;
00366 EXPORT int jack_set_port_registration_callback(jack_client_t* ext_client, JackPortRegistrationCallback registration_callback, void* arg)
00367 {
00368     return (*jack_set_port_registration_callback_fun)(ext_client, registration_callback, arg);
00369 }
00370 
00371 typedef int (*jack_set_graph_order_callback_fun_def)(jack_client_t* ext_client, JackGraphOrderCallback graph_callback, void* arg);
00372 static jack_set_graph_order_callback_fun_def jack_set_graph_order_callback_fun = 0;
00373 EXPORT int jack_set_graph_order_callback(jack_client_t* ext_client, JackGraphOrderCallback graph_callback, void* arg)
00374 {
00375     return (*jack_set_graph_order_callback_fun)(ext_client, graph_callback, arg);
00376 }
00377 
00378 typedef int (*jack_set_xrun_callback_fun_def)(jack_client_t* ext_client, JackXRunCallback xrun_callback, void* arg);
00379 static jack_set_xrun_callback_fun_def jack_set_xrun_callback_fun = 0;
00380 EXPORT int jack_set_xrun_callback(jack_client_t* ext_client, JackXRunCallback xrun_callback, void* arg)
00381 {
00382     return (*jack_set_xrun_callback_fun)(ext_client, xrun_callback, arg);
00383 }
00384 
00385 typedef int (*jack_set_thread_init_callback_fun_def)(jack_client_t* ext_client, JackThreadInitCallback init_callback, void *arg);
00386 static jack_set_thread_init_callback_fun_def jack_set_thread_init_callback_fun = 0;
00387 EXPORT int jack_set_thread_init_callback(jack_client_t* ext_client, JackThreadInitCallback init_callback, void *arg)
00388 {
00389     return (*jack_set_thread_init_callback_fun)(ext_client, init_callback, arg);
00390 }
00391 
00392 typedef int (*jack_activate_fun_def)(jack_client_t* ext_client);
00393 static jack_activate_fun_def jack_activate_fun = 0;
00394 EXPORT int jack_activate(jack_client_t* ext_client)
00395 {
00396     return (*jack_activate_fun)(ext_client);
00397 }
00398 
00399 typedef int (*jack_deactivate_fun_def)(jack_client_t* ext_client);
00400 static jack_deactivate_fun_def jack_deactivate_fun = 0;
00401 EXPORT int jack_deactivate(jack_client_t* ext_client)
00402 {
00403     return (*jack_deactivate_fun)(ext_client);
00404 }
00405 
00406 typedef jack_port_t* (*jack_port_register_fun_def)(jack_client_t* ext_client, const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size);
00407 static jack_port_register_fun_def jack_port_register_fun = 0;
00408 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)
00409 {
00410     return (*jack_port_register_fun)(ext_client, port_name, port_type, flags, buffer_size);
00411 }
00412 
00413 typedef int (*jack_port_unregister_fun_def)(jack_client_t* ext_client, jack_port_t* port);
00414 static jack_port_unregister_fun_def jack_port_unregister_fun = 0;
00415 EXPORT int jack_port_unregister(jack_client_t* ext_client, jack_port_t* port)
00416 {
00417     return (*jack_port_unregister_fun)(ext_client, port);
00418 }
00419 
00420 typedef int (*jack_port_is_mine_fun_def)(const jack_client_t* ext_client, const jack_port_t* port);
00421 static jack_port_is_mine_fun_def jack_port_is_mine_fun = 0;
00422 EXPORT int jack_port_is_mine(const jack_client_t* ext_client, const jack_port_t* port)
00423 {
00424     return (*jack_port_is_mine_fun)(ext_client, port);
00425 }
00426 
00427 typedef const char** (*jack_port_get_connections_fun_def)(const jack_port_t* port);
00428 static jack_port_get_connections_fun_def jack_port_get_connections_fun = 0;
00429 EXPORT const char** jack_port_get_connections(const jack_port_t* port)
00430 {
00431     return (*jack_port_get_connections_fun)(port);
00432 }
00433 
00434 // Calling client does not need to "own" the port
00435 typedef const char** (*jack_port_get_all_connections_fun_def)(const jack_client_t* ext_client, const jack_port_t* port);
00436 static jack_port_get_all_connections_fun_def jack_port_get_all_connections_fun = 0;
00437 EXPORT const char** jack_port_get_all_connections(const jack_client_t* ext_client, const jack_port_t* port)
00438 {
00439     return (*jack_port_get_all_connections_fun)(ext_client, port);
00440 }
00441 
00442 typedef jack_nframes_t (*jack_port_get_total_latency_fun_def)(jack_client_t* ext_client, jack_port_t* port);
00443 static jack_port_get_total_latency_fun_def jack_port_get_total_latency_fun = 0;
00444 EXPORT jack_nframes_t jack_port_get_total_latency(jack_client_t* ext_client, jack_port_t* port)
00445 {
00446     return (*jack_port_get_total_latency_fun)(ext_client, port);
00447 }
00448 
00449 typedef int (*jack_connect_fun_def)(jack_client_t* ext_client, const char* src, const char* dst);
00450 static jack_connect_fun_def jack_connect_fun = 0;
00451 EXPORT int jack_connect(jack_client_t* ext_client, const char* src, const char* dst)
00452 {
00453     return (*jack_connect_fun)(ext_client, src, dst);
00454 }
00455 
00456 typedef int (*jack_disconnect_fun_def)(jack_client_t* ext_client, const char* src, const char* dst);
00457 static jack_disconnect_fun_def jack_disconnect_fun = 0;
00458 EXPORT int jack_disconnect(jack_client_t* ext_client, const char* src, const char* dst)
00459 {
00460     return (*jack_disconnect_fun)(ext_client, src, dst);
00461 }
00462 
00463 typedef int (*jack_port_connect_fun_def)(jack_client_t* ext_client, jack_port_t* src, jack_port_t* dst);
00464 static jack_port_connect_fun_def jack_port_connect_fun = 0;
00465 EXPORT int jack_port_connect(jack_client_t* ext_client, jack_port_t* src, jack_port_t* dst)
00466 {
00467     return (*jack_port_connect_fun)(ext_client, src, dst);
00468 }
00469 
00470 typedef int (*jack_port_disconnect_fun_def)(jack_client_t* ext_client, jack_port_t* src);
00471 static jack_port_disconnect_fun_def jack_port_disconnect_fun = 0;
00472 EXPORT int jack_port_disconnect(jack_client_t* ext_client, jack_port_t* src)
00473 {
00474     return (*jack_port_disconnect_fun)(ext_client, src);
00475 }
00476 
00477 typedef jack_nframes_t (*jack_get_sample_rate_fun_def)(jack_client_t* ext_client);
00478 static jack_get_sample_rate_fun_def jack_get_sample_rate_fun = 0;
00479 EXPORT jack_nframes_t jack_get_sample_rate(jack_client_t* ext_client)
00480 {
00481     return (*jack_get_sample_rate_fun)(ext_client);
00482 }
00483 
00484 typedef jack_nframes_t (*jack_get_buffer_size_fun_def)(jack_client_t* ext_client);
00485 static jack_get_buffer_size_fun_def jack_get_buffer_size_fun = 0;
00486 EXPORT jack_nframes_t jack_get_buffer_size(jack_client_t* ext_client)
00487 {
00488         return (*jack_get_buffer_size_fun)(ext_client);
00489 }
00490 
00491 typedef const char** (*jack_get_ports_fun_def)(jack_client_t* ext_client, const char* port_name_pattern, const char* type_name_pattern, unsigned long flags);
00492 static jack_get_ports_fun_def jack_get_ports_fun = 0;
00493 EXPORT const char** jack_get_ports(jack_client_t* ext_client, const char* port_name_pattern, const char* type_name_pattern, unsigned long flags)
00494 {
00495     return (*jack_get_ports_fun)(ext_client, port_name_pattern, type_name_pattern, flags);
00496 }
00497 
00498 typedef jack_port_t* (*jack_port_by_name_fun_def)(jack_client_t* ext_client, const char* portname);
00499 static jack_port_by_name_fun_def jack_port_by_name_fun = 0;
00500 EXPORT jack_port_t* jack_port_by_name(jack_client_t* ext_client, const char* portname)
00501 {
00502     return (*jack_port_by_name_fun)(ext_client, portname);
00503 }
00504 
00505 typedef jack_port_t* (*jack_port_by_id_fun_def)(const jack_client_t* ext_client, jack_port_id_t id);
00506 static jack_port_by_id_fun_def jack_port_by_id_fun = 0;
00507 EXPORT jack_port_t* jack_port_by_id(const jack_client_t* ext_client, jack_port_id_t id)
00508 {
00509     return (*jack_port_by_id_fun)(ext_client, id);
00510 }
00511 
00512 typedef int (*jack_engine_takeover_timebase_fun_def)(jack_client_t* ext_client);
00513 static jack_engine_takeover_timebase_fun_def jack_engine_takeover_timebase_fun = 0;
00514 EXPORT int jack_engine_takeover_timebase(jack_client_t* ext_client)
00515 {
00516     return (*jack_engine_takeover_timebase_fun)(ext_client);
00517 }
00518 
00519 typedef jack_nframes_t (*jack_frames_since_cycle_start_fun_def)(const jack_client_t* ext_client);
00520 static jack_frames_since_cycle_start_fun_def jack_frames_since_cycle_start_fun = 0;
00521 EXPORT jack_nframes_t jack_frames_since_cycle_start(const jack_client_t* ext_client)
00522 {
00523     return (*jack_frames_since_cycle_start_fun)(ext_client);
00524 }
00525 
00526 typedef jack_nframes_t (*jack_frame_time_fun_def)(const jack_client_t* ext_client);
00527 static jack_frame_time_fun_def jack_frame_time_fun = 0;
00528 EXPORT jack_nframes_t jack_frame_time(const jack_client_t* ext_client)
00529 {
00530     return (*jack_frame_time_fun)(ext_client);
00531 }
00532 
00533 typedef jack_nframes_t (*jack_last_frame_time_fun_def)(const jack_client_t* ext_client);
00534 static jack_last_frame_time_fun_def jack_last_frame_time_fun = 0;
00535 EXPORT jack_nframes_t jack_last_frame_time(const jack_client_t* ext_client)
00536 {
00537     return (*jack_last_frame_time_fun)(ext_client);
00538 }
00539 
00540 typedef float (*jack_cpu_load_fun_def)(jack_client_t* ext_client);
00541 static jack_cpu_load_fun_def jack_cpu_load_fun = 0;
00542 EXPORT float jack_cpu_load(jack_client_t* ext_client)
00543 {
00544     return (*jack_cpu_load_fun)(ext_client);
00545 }
00546 
00547 typedef pthread_t (*jack_client_thread_id_fun_def)(jack_client_t* ext_client);
00548 static jack_client_thread_id_fun_def jack_client_thread_id_fun = 0;
00549 EXPORT pthread_t  jack_client_thread_id(jack_client_t* ext_client)
00550 {
00551     return (*jack_client_thread_id_fun)(ext_client);
00552 }
00553 
00554 typedef char* (*jack_get_client_name_fun_def)(jack_client_t* ext_client);
00555 static jack_get_client_name_fun_def jack_get_client_name_fun = 0;
00556 EXPORT char* jack_get_client_name (jack_client_t* ext_client)
00557 {
00558     return (*jack_get_client_name_fun)(ext_client);
00559 }
00560 
00561 typedef int (*jack_client_name_size_fun_def)(void);
00562 static jack_client_name_size_fun_def jack_client_name_size_fun = 0;
00563 EXPORT int jack_client_name_size(void)
00564 {
00565     return (*jack_client_name_size_fun)();
00566 }
00567 
00568 typedef int (*jack_port_name_size_fun_def)(void);
00569 static jack_port_name_size_fun_def jack_port_name_size_fun = 0;
00570 EXPORT int jack_port_name_size(void)
00571 {
00572     return (*jack_port_name_size_fun)();
00573 }
00574 
00575 // transport.h
00576 
00577 typedef int (*jack_release_timebase_fun_def)(jack_client_t* ext_client);
00578 static jack_release_timebase_fun_def jack_release_timebase_fun = 0;
00579 EXPORT int jack_release_timebase(jack_client_t* ext_client)
00580 {
00581     return (*jack_release_timebase_fun)(ext_client);
00582 }
00583 
00584 typedef int (*jack_set_sync_callback_fun_def)(jack_client_t* ext_client, JackSyncCallback sync_callback, void *arg);
00585 static jack_set_sync_callback_fun_def jack_set_sync_callback_fun = 0;
00586 EXPORT int jack_set_sync_callback(jack_client_t* ext_client, JackSyncCallback sync_callback, void *arg)
00587 {
00588     return (*jack_set_sync_callback_fun)(ext_client, sync_callback, arg);
00589 }
00590 
00591 typedef int (*jack_set_sync_timeout_fun_def)(jack_client_t* ext_client, jack_time_t timeout);
00592 static jack_set_sync_timeout_fun_def jack_set_sync_timeout_fun = 0;
00593 EXPORT int jack_set_sync_timeout(jack_client_t* ext_client, jack_time_t timeout)
00594 {
00595     return (*jack_set_sync_timeout_fun)(ext_client, timeout);
00596 }
00597 
00598 typedef int (*jack_set_timebase_callback_fun_def)(jack_client_t* ext_client, int conditional, JackTimebaseCallback timebase_callback, void* arg);
00599 static jack_set_timebase_callback_fun_def jack_set_timebase_callback_fun = 0;
00600 EXPORT int jack_set_timebase_callback(jack_client_t* ext_client, int conditional, JackTimebaseCallback timebase_callback, void* arg)
00601 {
00602     return (*jack_set_timebase_callback_fun)(ext_client, conditional, timebase_callback, arg);
00603 }
00604 
00605 typedef int (*jack_transport_locate_fun_def)(jack_client_t* ext_client, jack_nframes_t frame);
00606 static jack_transport_locate_fun_def jack_transport_locate_fun = 0;
00607 EXPORT int jack_transport_locate(jack_client_t* ext_client, jack_nframes_t frame)
00608 {
00609     return (*jack_transport_locate_fun)(ext_client, frame);
00610 }
00611 
00612 typedef jack_transport_state_t (*jack_transport_query_fun_def)(const jack_client_t* ext_client, jack_position_t* pos);
00613 static jack_transport_query_fun_def jack_transport_query_fun = 0;
00614 EXPORT jack_transport_state_t jack_transport_query(const jack_client_t* ext_client, jack_position_t* pos)
00615 {
00616     return (*jack_transport_query_fun)(ext_client, pos);
00617 }
00618 
00619 typedef jack_nframes_t (*jack_get_current_transport_frame_fun_def)(const jack_client_t* ext_client);
00620 static jack_get_current_transport_frame_fun_def jack_get_current_transport_frame_fun = 0;
00621 EXPORT jack_nframes_t jack_get_current_transport_frame(const jack_client_t* ext_client)
00622 {
00623     return (*jack_get_current_transport_frame_fun)(ext_client);
00624 }
00625 
00626 typedef int (*jack_transport_reposition_fun_def)(jack_client_t* ext_client, jack_position_t* pos);
00627 static jack_transport_reposition_fun_def jack_transport_reposition_fun = 0;
00628 EXPORT int jack_transport_reposition(jack_client_t* ext_client, jack_position_t* pos)
00629 {
00630     return (*jack_transport_reposition_fun)(ext_client, pos);
00631 }
00632 
00633 typedef void (*jack_transport_start_fun_def)(jack_client_t* ext_client);
00634 static jack_transport_start_fun_def jack_transport_start_fun = 0;
00635 EXPORT void jack_transport_start(jack_client_t* ext_client)
00636 {
00637     return (*jack_transport_start_fun)(ext_client);
00638 }
00639 
00640 typedef void (*jack_transport_stop_fun_def)(jack_client_t* ext_client);
00641 static jack_transport_stop_fun_def jack_transport_stop_fun = 0;
00642 EXPORT void jack_transport_stop(jack_client_t* ext_client)
00643 {
00644         return (*jack_transport_stop_fun)(ext_client);
00645 }
00646 
00647 // deprecated
00648 
00649 typedef void (*jack_get_transport_info_fun_def)(jack_client_t* ext_client, jack_transport_info_t* tinfo);
00650 static jack_get_transport_info_fun_def jack_get_transport_info_fun = 0;
00651 EXPORT void jack_get_transport_info(jack_client_t* ext_client, jack_transport_info_t* tinfo)
00652 {
00653     (*jack_get_transport_info_fun)(ext_client, tinfo);
00654 }
00655 
00656 typedef void (*jack_set_transport_info_fun_def)(jack_client_t* ext_client, jack_transport_info_t* tinfo);
00657 static jack_set_transport_info_fun_def jack_set_transport_info_fun = 0;
00658 EXPORT void jack_set_transport_info(jack_client_t* ext_client, jack_transport_info_t* tinfo)
00659 {
00660     (*jack_set_transport_info_fun)(ext_client, tinfo);
00661 }
00662 
00663 // statistics.h
00664 
00665 typedef float (*jack_get_max_delayed_usecs_fun_def)(jack_client_t* ext_client);
00666 static jack_get_max_delayed_usecs_fun_def jack_get_max_delayed_usecs_fun = 0;
00667 EXPORT float jack_get_max_delayed_usecs(jack_client_t* ext_client)
00668 {
00669     return (*jack_get_max_delayed_usecs_fun)(ext_client);
00670 }
00671 
00672 typedef float (*jack_get_xrun_delayed_usecs_fun_def)(jack_client_t* ext_client);
00673 static jack_get_xrun_delayed_usecs_fun_def jack_get_xrun_delayed_usecs_fun = 0;
00674 EXPORT float jack_get_xrun_delayed_usecs(jack_client_t* ext_client)
00675 {
00676     return (*jack_get_xrun_delayed_usecs_fun)(ext_client);
00677 }
00678 
00679 typedef void (*jack_reset_max_delayed_usecs_fun_def)(jack_client_t* ext_client);
00680 static jack_reset_max_delayed_usecs_fun_def jack_reset_max_delayed_usecs_fun = 0;
00681 EXPORT void jack_reset_max_delayed_usecs(jack_client_t* ext_client)
00682 {
00683     (*jack_reset_max_delayed_usecs)(ext_client);
00684 }
00685 
00686 // thread.h
00687 
00688 typedef int (*jack_acquire_real_time_scheduling_fun_def)(pthread_t thread, int priority);
00689 static jack_acquire_real_time_scheduling_fun_def jack_acquire_real_time_scheduling_fun = 0;
00690 EXPORT int jack_acquire_real_time_scheduling(pthread_t thread, int priority)
00691 {
00692     return (*jack_acquire_real_time_scheduling_fun)(thread, priority);
00693 }
00694 
00695 typedef void *(*start_routine)(void*);
00696 typedef int (*jack_client_create_thread_fun_def)(jack_client_t* client,
00697                                                                                                 pthread_t *thread,
00698                                                                                                 int priority,
00699                                                                                                 int realtime,   // boolean 
00700                                                                                                 start_routine callback,
00701                                                                                                 void *arg);
00702 static jack_client_create_thread_fun_def jack_client_create_thread_fun = 0;
00703 EXPORT int jack_client_create_thread(jack_client_t* client,
00704                                      pthread_t *thread,
00705                                      int priority,
00706                                      int realtime,      // boolean 
00707                                      start_routine callback,
00708                                      void *arg)
00709 {
00710     return (*jack_client_create_thread_fun)(client, thread, priority, realtime, callback, arg);
00711 }
00712 
00713 typedef int (*jack_drop_real_time_scheduling_fun_def)(pthread_t thread);
00714 static jack_drop_real_time_scheduling_fun_def jack_drop_real_time_scheduling_fun = 0;
00715 EXPORT int jack_drop_real_time_scheduling(pthread_t thread)
00716 {
00717     return (*jack_drop_real_time_scheduling_fun)(thread);
00718 }
00719 
00720 // intclient.h
00721 
00722 typedef char* (*jack_get_internal_client_name_fun_def)(jack_client_t* ext_client, jack_intclient_t intclient);
00723 static jack_get_internal_client_name_fun_def jack_get_internal_client_name_fun = 0;
00724 EXPORT char* jack_get_internal_client_name(jack_client_t* ext_client, jack_intclient_t intclient)
00725 {
00726     return (*jack_get_internal_client_name_fun)(ext_client, intclient);
00727 }
00728 
00729 typedef jack_intclient_t (*jack_internal_client_handle_fun_def)(jack_client_t* ext_client, const char* client_name, jack_status_t* status);
00730 static jack_internal_client_handle_fun_def jack_internal_client_handle_fun = 0;
00731 EXPORT jack_intclient_t jack_internal_client_handle(jack_client_t* ext_client, const char* client_name, jack_status_t* status)
00732 {
00733     return (*jack_internal_client_handle_fun)(ext_client, client_name, status);
00734 }
00735 
00736 typedef jack_intclient_t (*jack_internal_client_load_fun_def)(jack_client_t* ext_client, const char* client_name, jack_options_t options, jack_status_t* status, ...);
00737 static jack_internal_client_load_fun_def jack_internal_client_load_fun = 0;
00738 EXPORT jack_intclient_t jack_internal_client_load(jack_client_t* ext_client, const char* client_name, jack_options_t options, jack_status_t* status, ...)
00739 {
00740         va_list ap;
00741         va_start(ap, status);
00742         jack_intclient_t res =  (*jack_internal_client_load_fun)(ext_client, client_name, options, status, ap);
00743         va_end(ap);
00744         return res;
00745 }
00746 
00747 typedef jack_status_t (*jack_internal_client_unload_fun_def)(jack_client_t* ext_client, jack_intclient_t intclient);
00748 static jack_internal_client_unload_fun_def jack_internal_client_unload_fun = 0;
00749 EXPORT jack_status_t jack_internal_client_unload(jack_client_t* ext_client, jack_intclient_t intclient)
00750 {
00751     return (*jack_internal_client_unload_fun)(ext_client, intclient);
00752 }
00753 
00754 // client
00755 static long gClientCount = 0;
00756 static void* gLibrary = 0;
00757 static bool init_library();
00758 static bool open_library();
00759 static void close_library();
00760 
00761 typedef jack_client_t * (*jack_client_open_fun_def)(const char *client_name, jack_options_t options, jack_status_t *status, ...);
00762 static jack_client_open_fun_def jack_client_open_fun = 0;
00763 EXPORT jack_client_t * jack_client_open(const char *client_name, jack_options_t options, jack_status_t *status, ...)
00764 {
00765         // Library check...
00766         if (!open_library()) 
00767                 return 0;
00768                 
00769         va_list ap;
00770         va_start(ap, status);
00771         jack_client_t* res = (*jack_client_open_fun)(client_name, options, status, ap);
00772         va_end(ap);
00773         return res;
00774 }
00775 
00776 typedef jack_client_t * (*jack_client_new_fun_def)(const char *client_name);
00777 static jack_client_new_fun_def jack_client_new_fun = 0;
00778 EXPORT jack_client_t * jack_client_new(const char *client_name)
00779 {
00780         // Library check...
00781         if (!open_library()) 
00782                 return 0;
00783                 
00784         return (*jack_client_new_fun)(client_name);
00785 }
00786 
00787 typedef int (*jack_client_close_fun_def)(jack_client_t *client);
00788 static jack_client_close_fun_def jack_client_close_fun = 0;
00789 EXPORT int jack_client_close(jack_client_t *client)
00790 {       
00791         int res = (*jack_client_close_fun)(client);
00792         close_library();
00793         return res;
00794 }
00795 
00796 // Library loader
00797 static bool get_jack_library_in_directory(const char* dir_name, char* library_name)
00798 {
00799         struct dirent * dir_entry;
00800         DIR * dir_stream = opendir(dir_name);
00801         if (!dir_stream)        
00802                 return false;
00803          
00804         while ((dir_entry = readdir(dir_stream))) {
00805                 if (strncmp("libjack.so", dir_entry->d_name, 10) == 0) {
00806             strcpy(library_name, dir_entry->d_name);
00807                         closedir(dir_stream);
00808                         return true;
00809         }
00810         }
00811         closedir(dir_stream);
00812         return false;
00813 }
00814 
00815 static bool get_jack_library(char* library_name)
00816 {
00817         if (get_jack_library_in_directory("/usr/lib", library_name))
00818                 return true;
00819         if (get_jack_library_in_directory("/usr/local/lib", library_name))
00820                 return true;
00821         return false;
00822 }
00823 
00824 static bool open_library()
00825 {
00826         if (gClientCount++ == 0) {
00827                 return init_library();
00828         } else {
00829                 return true;
00830         }
00831 }
00832 
00833 static void close_library()
00834 {
00835         if (--gClientCount == 0) {
00836                 dlclose(gLibrary);
00837         } 
00838 }
00839 
00840 static bool check_client(void* library)
00841 {
00842         jack_client_t* client = 0; 
00843 
00844         // Get "new", "open" and "close" entry points...
00845         jack_client_new_fun = (jack_client_new_fun_def)dlsym(library, "jack_client_new");
00846         jack_client_close_fun = (jack_client_close_fun_def)dlsym(library, "jack_client_close");
00847         jack_client_open_fun = (jack_client_open_fun_def)dlsym(gLibrary, "jack_client_open");
00848 
00849         // Try opening a client...
00850         if ((client = (*jack_client_new_fun)("dummy"))) { // jackd server is running....
00851                 (*jack_client_close_fun)(client);
00852                 return true;
00853         } else {
00854                 return false;
00855         }
00856 }
00857 
00858 static bool init_library()
00859 {
00860         char library_name[64];
00861         void* jackLibrary = (get_jack_library(library_name)) ? dlopen(library_name, RTLD_LAZY) : 0;
00862         void* jackmpLibrary = dlopen("libjackmp.so", RTLD_LAZY);
00863         
00864         if (jackLibrary) {
00865                 
00866                 if (check_client(jackLibrary)) { // jackd is running...
00867                         gLibrary = jackLibrary;
00868                         if (jackmpLibrary) dlclose(jackmpLibrary);
00869                 } else if (check_client(jackmpLibrary)) { // jackdmp is running...
00870                         gLibrary = jackmpLibrary;
00871                         if (jackLibrary) dlclose(jackLibrary);
00872                 } else {
00873                         goto error;
00874                 }
00875                 
00876         } else if (jackmpLibrary) { 
00877         
00878                 if (check_client(jackmpLibrary)) { // jackd is running...
00879                         gLibrary = jackmpLibrary;
00880                 } else {
00881                         goto error;
00882                 }
00883                 
00884         } else {
00885                 printf("Jack libraries not found, failure...\n");
00886                 goto error;
00887         }
00888         
00889         // Load entry points...
00890         jack_port_get_buffer_fun = (jack_port_get_buffer_fun_def)dlsym(gLibrary, "jack_port_get_buffer");
00891         jack_port_name_fun = (jack_port_name_fun_def)dlsym(gLibrary, "jack_port_name");
00892         jack_port_short_name_fun = (jack_port_short_name_fun_def)dlsym(gLibrary, "jack_port_short_name");
00893         jack_port_flags_fun = (jack_port_flags_fun_def)dlsym(gLibrary, "jack_port_flags");
00894         jack_port_type_fun = (jack_port_type_fun_def)dlsym(gLibrary, "jack_port_type");
00895         jack_port_connected_fun = (jack_port_connected_fun_def)dlsym(gLibrary, "jack_port_connected");
00896         jack_port_connected_to_fun = (jack_port_connected_to_fun_def)dlsym(gLibrary, "jack_port_connected_to");
00897         jack_port_tie_fun = (jack_port_tie_fun_def)dlsym(gLibrary, "jack_port_tie");
00898         jack_port_untie_fun = (jack_port_untie_fun_def)dlsym(gLibrary, "jack_port_untie");
00899         jack_port_get_latency_fun = (jack_port_get_latency_fun_def)dlsym(gLibrary, "jack_port_get_latency");
00900         jack_port_set_latency_fun = (jack_port_set_latency_fun_def)dlsym(gLibrary, "jack_port_set_latency");
00901         jack_recompute_total_latencies_fun = (jack_recompute_total_latencies_fun_def)dlsym(gLibrary, "jack_recompute_total_latencies");
00902         jack_port_set_name_fun = (jack_port_set_name_fun_def)dlsym(gLibrary, "jack_port_set_name");
00903         jack_port_request_monitor_fun = (jack_port_request_monitor_fun_def)dlsym(gLibrary, "jack_port_request_monitor");
00904         jack_port_request_monitor_by_name_fun = (jack_port_request_monitor_by_name_fun_def)dlsym(gLibrary, "jack_port_request_monitor_by_name");
00905         jack_port_ensure_monitor_fun = (jack_port_ensure_monitor_fun_def)dlsym(gLibrary, "jack_port_ensure_monitor");
00906         jack_port_monitoring_input_fun = (jack_port_monitoring_input_fun_def)dlsym(gLibrary, "jack_port_monitoring_input_fun");
00907         jack_is_realtime_fun = (jack_is_realtime_fun_def)dlsym(gLibrary, "jack_is_realtime");
00908         jack_on_shutdown_fun = (jack_on_shutdown_fun_def)dlsym(gLibrary, "jack_on_shutdown");
00909         jack_set_process_callback_fun = (jack_set_process_callback_fun_def)dlsym(gLibrary, "jack_set_process_callback");
00910         jack_set_freewheel_callback_fun = (jack_set_freewheel_callback_fun_def)dlsym(gLibrary, "jack_set_freewheel_callback");
00911         jack_set_freewheel_fun = (jack_set_freewheel_fun_def)dlsym(gLibrary, "jack_set_freewheel");
00912         jack_set_buffer_size_fun = (jack_set_buffer_size_fun_def)dlsym(gLibrary, "jack_set_buffer_size");
00913         jack_set_buffer_size_callback_fun = (jack_set_buffer_size_callback_fun_def)dlsym(gLibrary, "jack_set_buffer_size_callback");
00914         jack_set_sample_rate_callback_fun = (jack_set_sample_rate_callback_fun_def)dlsym(gLibrary, "jack_set_sample_rate_callback");
00915         jack_set_port_registration_callback_fun = (jack_set_port_registration_callback_fun_def)dlsym(gLibrary, "jack_set_port_registration_callback");
00916         jack_set_graph_order_callback_fun = (jack_set_graph_order_callback_fun_def)dlsym(gLibrary, "jack_set_graph_order_callback");
00917         jack_set_xrun_callback_fun = (jack_set_xrun_callback_fun_def)dlsym(gLibrary, "jack_set_xrun_callback");
00918         jack_set_thread_init_callback_fun = (jack_set_thread_init_callback_fun_def)dlsym(gLibrary, "jack_set_thread_init_callback");
00919         jack_activate_fun = (jack_activate_fun_def)dlsym(gLibrary, "jack_activate");
00920         jack_deactivate_fun = (jack_deactivate_fun_def)dlsym(gLibrary, "jack_deactivate");
00921         jack_port_register_fun = (jack_port_register_fun_def)dlsym(gLibrary, "jack_port_register");
00922         jack_port_unregister_fun = (jack_port_unregister_fun_def)dlsym(gLibrary, "jack_port_unregister");
00923         jack_port_is_mine_fun = (jack_port_is_mine_fun_def)dlsym(gLibrary, "jack_port_is_mine");
00924         jack_port_get_connections_fun = (jack_port_get_connections_fun_def)dlsym(gLibrary, "jack_port_get_connections");
00925         jack_port_get_all_connections_fun = (jack_port_get_all_connections_fun_def)dlsym(gLibrary, "jack_port_get_all_connections_fun");
00926         jack_port_get_total_latency_fun = (jack_port_get_total_latency_fun_def)dlsym(gLibrary, "jack_port_get_total_latency");
00927         jack_connect_fun = (jack_connect_fun_def)dlsym(gLibrary, "jack_connect");
00928         jack_disconnect_fun = (jack_disconnect_fun_def)dlsym(gLibrary, "jack_disconnect");
00929         jack_port_connect_fun = (jack_port_connect_fun_def)dlsym(gLibrary, "jack_port_connect");
00930         jack_port_disconnect_fun = (jack_port_disconnect_fun_def)dlsym(gLibrary, "jack_port_disconnect");
00931         jack_get_sample_rate_fun = (jack_get_sample_rate_fun_def)dlsym(gLibrary, "jack_get_sample_rate");
00932         jack_get_buffer_size_fun = (jack_get_buffer_size_fun_def)dlsym(gLibrary, "jack_get_buffer_size");
00933         jack_get_ports_fun = (jack_get_ports_fun_def)dlsym(gLibrary, "jack_get_ports");
00934         jack_port_by_name_fun = (jack_port_by_name_fun_def)dlsym(gLibrary, "jack_port_by_name");
00935         jack_port_by_id_fun = (jack_port_by_id_fun_def)dlsym(gLibrary, "jack_port_by_id");
00936         jack_engine_takeover_timebase_fun = (jack_engine_takeover_timebase_fun_def)dlsym(gLibrary, "jack_engine_takeover_timebase");
00937         jack_frames_since_cycle_start_fun = (jack_frames_since_cycle_start_fun_def)dlsym(gLibrary, "jack_frames_since_cycle_start");
00938         jack_frame_time_fun = (jack_frame_time_fun_def)dlsym(gLibrary, "jack_frame_time_fun");
00939         jack_last_frame_time_fun = (jack_last_frame_time_fun_def)dlsym(gLibrary, "jack_last_frame_time");
00940         jack_cpu_load_fun = (jack_cpu_load_fun_def)dlsym(gLibrary, "jack_cpu_load");
00941         jack_client_thread_id_fun = (jack_client_thread_id_fun_def)dlsym(gLibrary, "jack_client_thread_id");
00942         jack_get_client_name_fun = (jack_get_client_name_fun_def)dlsym(gLibrary, "jack_get_client_name");
00943         jack_port_name_size_fun = (jack_port_name_size_fun_def)dlsym(gLibrary, "jack_port_name_size");
00944         jack_client_name_size_fun = (jack_client_name_size_fun_def)dlsym(gLibrary, "jack_client_name_size");
00945         jack_release_timebase_fun = (jack_release_timebase_fun_def)dlsym(gLibrary, "jack_release_timebase");
00946         jack_set_sync_callback_fun = (jack_set_sync_callback_fun_def)dlsym(gLibrary, "jack_set_sync_callback");
00947         jack_set_sync_timeout_fun = (jack_set_sync_timeout_fun_def)dlsym(gLibrary, "jack_set_sync_timeout");
00948         jack_set_timebase_callback_fun = (jack_set_timebase_callback_fun_def)dlsym(gLibrary, "jack_set_timebase_callback");
00949         jack_transport_locate_fun = (jack_transport_locate_fun_def)dlsym(gLibrary, "jack_transport_locate_fun");
00950         jack_transport_query_fun = (jack_transport_query_fun_def)dlsym(gLibrary, "jack_transport_query");
00951         jack_get_current_transport_frame_fun = (jack_get_current_transport_frame_fun_def)dlsym(gLibrary, "jack_get_current_transport_frame");
00952         jack_transport_reposition_fun = (jack_transport_reposition_fun_def)dlsym(gLibrary, "jack_transport_reposition");
00953         jack_transport_start_fun = (jack_transport_start_fun_def)dlsym(gLibrary, "jack_transport_start");
00954         jack_transport_stop_fun = (jack_transport_stop_fun_def)dlsym(gLibrary, "jack_transport_stop");
00955         jack_get_transport_info_fun = (jack_get_transport_info_fun_def)dlsym(gLibrary, "jack_get_transport_info");
00956         jack_set_transport_info_fun = (jack_set_transport_info_fun_def)dlsym(gLibrary, "jack_set_transport_info");
00957         jack_get_max_delayed_usecs_fun = (jack_get_max_delayed_usecs_fun_def)dlsym(gLibrary, "jack_get_max_delayed_usecs");
00958         jack_get_xrun_delayed_usecs_fun = (jack_get_xrun_delayed_usecs_fun_def)dlsym(gLibrary, "jack_get_xrun_delayed_usecs");
00959         jack_reset_max_delayed_usecs_fun = (jack_reset_max_delayed_usecs_fun_def)dlsym(gLibrary, "jack_reset_max_delayed_usecs");
00960         jack_acquire_real_time_scheduling_fun = (jack_acquire_real_time_scheduling_fun_def)dlsym(gLibrary, "jack_acquire_real_time_scheduling");
00961         jack_client_create_thread_fun = (jack_client_create_thread_fun_def)dlsym(gLibrary, "jack_client_create_thread");
00962         jack_drop_real_time_scheduling_fun = (jack_drop_real_time_scheduling_fun_def)dlsym(gLibrary, "jack_drop_real_time_scheduling");
00963         jack_get_internal_client_name_fun = (jack_get_internal_client_name_fun_def)dlsym(gLibrary, "jack_get_internal_client_name");
00964         jack_internal_client_handle_fun = (jack_internal_client_handle_fun_def)dlsym(gLibrary, "jack_internal_client_handle");
00965         jack_internal_client_load_fun = (jack_internal_client_load_fun_def)dlsym(gLibrary, "jack_internal_client_load");
00966         jack_internal_client_unload_fun = (jack_internal_client_unload_fun_def)dlsym(gLibrary, "jack_internal_client_unload");
00967         jack_client_open_fun = (jack_client_open_fun_def)dlsym(gLibrary, "jack_client_open");
00968         jack_client_new_fun = (jack_client_new_fun_def)dlsym(gLibrary, "jack_client_new");
00969         jack_client_close_fun = (jack_client_close_fun_def)dlsym(gLibrary, "jack_client_close");
00970         
00971         return true;
00972 
00973 error:
00974         if (jackLibrary) dlclose(jackLibrary);
00975         if (jackmpLibrary) dlclose(jackmpLibrary);
00976         return false;
00977 }

Generated on Thu Feb 14 11:16:01 2008 for Jackdmp by  doxygen 1.5.1