jack.h

00001 /*
00002   Copyright (C) 2001 Paul Davis
00003   Copyright (C) 2004 Jack O'Quin
00004   
00005   This program is free software; you can redistribute it and/or modify
00006   it under the terms of the GNU Lesser General Public License as published by
00007   the Free Software Foundation; either version 2.1 of the License, or
00008   (at your option) any later version.
00009   
00010   This program is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013   GNU Lesser General Public License for more details.
00014   
00015   You should have received a copy of the GNU Lesser General Public License
00016   along with this program; if not, write to the Free Software 
00017   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 
00019   $Id: jack.h,v 1.5.2.6 2006/06/20 14:44:00 letz Exp $
00020 */
00021 
00022 #ifndef __jack_h__
00023 #define __jack_h__
00024 
00025 #ifdef __cplusplus
00026 extern "C"
00027 {
00028 #endif
00029 
00030 #ifdef WIN32
00031         #include <windows.h>
00032     typedef HANDLE pthread_t;
00033 #else
00034         #include <pthread.h>
00035 #endif
00036 
00037 /*
00038 #include <jack/types.h>
00039 #include <jack/transport.h>
00040 */
00041 
00042 #include "types.h"
00043 #include "transport.h"
00044 
00082     jack_client_t * jack_client_open (const char *client_name,
00083                                       jack_options_t options,
00084                                       jack_status_t *status, ...);
00085 
00107     jack_client_t * jack_client_new (const char *client_name);
00108 
00114     int jack_client_close (jack_client_t *client);
00115 
00120     int jack_client_name_size (void);
00121 
00128     char * jack_get_client_name (jack_client_t *client);
00129 
00151     int jack_internal_client_new (const char *client_name,
00152                                   const char *load_name,
00153                                   const char *load_init);
00154 
00155     jack_client_t* my_jack_internal_client_new(const char* client_name);
00156 
00162     void jack_internal_client_close (const char *client_name);
00163 
00164     void my_jack_internal_client_close (jack_client_t* client);
00165 
00173     int jack_is_realtime (jack_client_t *client);
00174 
00193     void jack_on_shutdown (jack_client_t *client,
00194                            void (*function)(void *arg), void *arg);
00195 
00211     int jack_set_process_callback (jack_client_t *client,
00212                                    JackProcessCallback process_callback,
00213                                    void *arg);
00214 
00226     int jack_set_thread_init_callback (jack_client_t *client,
00227                                        JackThreadInitCallback thread_init_callback,
00228                                        void *arg);
00229 
00239     int jack_set_freewheel_callback (jack_client_t *client,
00240                                      JackFreewheelCallback freewheel_callback,
00241                                      void *arg);
00242 
00267     int jack_set_freewheel(jack_client_t* client, int onoff);
00268 
00284     int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes);
00285 
00298     int jack_set_buffer_size_callback (jack_client_t *client,
00299                                        JackBufferSizeCallback bufsize_callback,
00300                                        void *arg);
00301 
00308     int jack_set_sample_rate_callback (jack_client_t *client,
00309                                        JackSampleRateCallback srate_callback,
00310                                        void *arg);
00311 
00318     int jack_set_port_registration_callback (jack_client_t *,
00319             JackPortRegistrationCallback
00320             registration_callback, void *arg);
00321 
00328     int jack_set_graph_order_callback (jack_client_t *,
00329                                        JackGraphOrderCallback graph_callback,
00330                                        void *);
00331 
00338     int jack_set_xrun_callback (jack_client_t *,
00339                                 JackXRunCallback xrun_callback, void *arg);
00340 
00347     int jack_activate (jack_client_t *client);
00348 
00356     int jack_deactivate (jack_client_t *client);
00357 
00384     jack_port_t * jack_port_register (jack_client_t *client,
00385                                       const char *port_name,
00386                                       const char *port_type,
00387                                       unsigned long flags,
00388                                       unsigned long buffer_size);
00389 
00396     int jack_port_unregister (jack_client_t *, jack_port_t *);
00397 
00414     void * jack_port_get_buffer (jack_port_t *, jack_nframes_t);
00415 
00422     const char * jack_port_name (const jack_port_t *port);
00423 
00430     const char * jack_port_short_name (const jack_port_t *port);
00431 
00435     int jack_port_flags (const jack_port_t *port);
00436 
00441     const char * jack_port_type (const jack_port_t *port);
00442 
00446     int jack_port_is_mine (const jack_client_t *, const jack_port_t *port);
00447 
00453     int jack_port_connected (const jack_port_t *port);
00454 
00461     int jack_port_connected_to (const jack_port_t *port,
00462                                 const char *port_name);
00463 
00475     const char ** jack_port_get_connections (const jack_port_t *port);
00476 
00496     const char ** jack_port_get_all_connections (const jack_client_t *client,
00497             const jack_port_t *port);
00498 
00515     int jack_port_tie (jack_port_t *src, jack_port_t *dst);
00516 
00524     int jack_port_untie (jack_port_t *port);
00525 
00533     int jack_port_lock (jack_client_t *, jack_port_t *);
00534 
00540     int jack_port_unlock (jack_client_t *, jack_port_t *);
00541 
00552     jack_nframes_t jack_port_get_latency (jack_port_t *port);
00553 
00559     jack_nframes_t jack_port_get_total_latency (jack_client_t *,
00560             jack_port_t *port);
00561 
00572     void jack_port_set_latency (jack_port_t *, jack_nframes_t);
00573 
00577     int jack_recompute_total_latencies (jack_client_t*);
00578 
00586     int jack_port_set_name (jack_port_t *port, const char *port_name);
00587 
00592     int jack_port_request_monitor (jack_port_t *port, int onoff);
00593 
00602     int jack_port_request_monitor_by_name (jack_client_t *client,
00603                                            const char *port_name, int onoff);
00604 
00612     int jack_port_ensure_monitor (jack_port_t *port, int onoff);
00613 
00617     int jack_port_monitoring_input (jack_port_t *port);
00618 
00636     int jack_connect (jack_client_t *,
00637                       const char *source_port,
00638                       const char *destination_port);
00639 
00653     int jack_disconnect (jack_client_t *,
00654                          const char *source_port,
00655                          const char *destination_port);
00656 
00666     int jack_port_disconnect (jack_client_t *, jack_port_t *);
00667 
00676     int jack_port_name_size(void);
00677 
00682     int jack_port_type_size(void);
00683 
00688     jack_nframes_t jack_get_sample_rate (jack_client_t *);
00689 
00699     jack_nframes_t jack_get_buffer_size (jack_client_t *);
00700 
00717     const char ** jack_get_ports (jack_client_t *,
00718                                   const char *port_name_pattern,
00719                                   const char *type_name_pattern,
00720                                   unsigned long flags);
00721 
00727     jack_port_t * jack_port_by_name (jack_client_t *, const char *port_name);
00728 
00732     jack_port_t * jack_port_by_id (jack_client_t *client,
00733                                    jack_port_id_t port_id);
00734 
00745     int jack_engine_takeover_timebase (jack_client_t *);
00746 
00751     jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *);
00752 
00758     jack_nframes_t jack_frame_time (const jack_client_t *);
00759 
00767     jack_nframes_t jack_last_frame_time (const jack_client_t *client);
00768 
00775     float jack_cpu_load (jack_client_t *client);
00776 
00781     pthread_t jack_client_thread_id (jack_client_t *);
00782 
00791     extern void (*jack_error_callback)(const char *msg);
00792 
00799     void jack_set_error_function (void (*func)(const char *));
00800 
00801 #ifdef __cplusplus
00802 }
00803 #endif
00804 
00805 #endif /* __jack_h__ */

Generated on Wed Jan 10 11:42:42 2007 for Jackdmp by  doxygen 1.4.5