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, const char* dll_name, const char* object_data);
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_client_registration_callback (jack_client_t *,
00319                                                    JackClientRegistrationCallback
00320                                                    registration_callback, void *arg);
00321 
00328     int jack_set_port_registration_callback (jack_client_t *,
00329             JackPortRegistrationCallback
00330             registration_callback, void *arg);
00331 
00338     int jack_set_graph_order_callback (jack_client_t *,
00339                                        JackGraphOrderCallback graph_callback,
00340                                        void *);
00341 
00348     int jack_set_xrun_callback (jack_client_t *,
00349                                 JackXRunCallback xrun_callback, void *arg);
00350 
00357     int jack_activate (jack_client_t *client);
00358 
00366     int jack_deactivate (jack_client_t *client);
00367 
00394     jack_port_t * jack_port_register (jack_client_t *client,
00395                                       const char *port_name,
00396                                       const char *port_type,
00397                                       unsigned long flags,
00398                                       unsigned long buffer_size);
00399 
00406     int jack_port_unregister (jack_client_t *, jack_port_t *);
00407 
00424     void * jack_port_get_buffer (jack_port_t *, jack_nframes_t);
00425 
00432     const char * jack_port_name (const jack_port_t *port);
00433 
00440     const char * jack_port_short_name (const jack_port_t *port);
00441 
00445     int jack_port_flags (const jack_port_t *port);
00446 
00451     const char * jack_port_type (const jack_port_t *port);
00452 
00456     int jack_port_is_mine (const jack_client_t *, const jack_port_t *port);
00457 
00463     int jack_port_connected (const jack_port_t *port);
00464 
00471     int jack_port_connected_to (const jack_port_t *port,
00472                                 const char *port_name);
00473 
00485     const char ** jack_port_get_connections (const jack_port_t *port);
00486 
00506     const char ** jack_port_get_all_connections (const jack_client_t *client,
00507             const jack_port_t *port);
00508 
00525     int jack_port_tie (jack_port_t *src, jack_port_t *dst);
00526 
00534     int jack_port_untie (jack_port_t *port);
00535 
00543     int jack_port_lock (jack_client_t *, jack_port_t *);
00544 
00550     int jack_port_unlock (jack_client_t *, jack_port_t *);
00551 
00562     jack_nframes_t jack_port_get_latency (jack_port_t *port);
00563 
00569     jack_nframes_t jack_port_get_total_latency (jack_client_t *,
00570             jack_port_t *port);
00571 
00582     void jack_port_set_latency (jack_port_t *, jack_nframes_t);
00583 
00587     int jack_recompute_total_latencies (jack_client_t*);
00588 
00596     int jack_port_set_name (jack_port_t *port, const char *port_name);
00597 
00611         int jack_port_set_alias (jack_port_t *port, const char *alias);
00612 
00621         int jack_port_unset_alias (jack_port_t *port, const char *alias);
00622 
00623         /*
00624          * Get any aliases known for @port.
00625          *
00626          * @return the number of aliases discovered for the port
00627          */
00628         int jack_port_get_aliases (const jack_port_t *port, char* const aliases[2]);
00629 
00634     int jack_port_request_monitor (jack_port_t *port, int onoff);
00635 
00644     int jack_port_request_monitor_by_name (jack_client_t *client,
00645                                            const char *port_name, int onoff);
00646 
00654     int jack_port_ensure_monitor (jack_port_t *port, int onoff);
00655 
00659     int jack_port_monitoring_input (jack_port_t *port);
00660 
00678     int jack_connect (jack_client_t *,
00679                       const char *source_port,
00680                       const char *destination_port);
00681 
00695     int jack_disconnect (jack_client_t *,
00696                          const char *source_port,
00697                          const char *destination_port);
00698 
00708     int jack_port_disconnect (jack_client_t *, jack_port_t *);
00709 
00718     int jack_port_name_size(void);
00719 
00724     int jack_port_type_size(void);
00725 
00730     jack_nframes_t jack_get_sample_rate (jack_client_t *);
00731 
00741     jack_nframes_t jack_get_buffer_size (jack_client_t *);
00742 
00759     const char ** jack_get_ports (jack_client_t *,
00760                                   const char *port_name_pattern,
00761                                   const char *type_name_pattern,
00762                                   unsigned long flags);
00763 
00769     jack_port_t * jack_port_by_name (jack_client_t *, const char *port_name);
00770 
00774     jack_port_t * jack_port_by_id (jack_client_t *client,
00775                                    jack_port_id_t port_id);
00776 
00787     int jack_engine_takeover_timebase (jack_client_t *);
00788 
00793     jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *);
00794 
00800     jack_nframes_t jack_frame_time (const jack_client_t *);
00801 
00809     jack_nframes_t jack_last_frame_time (const jack_client_t *client);
00810 
00814         jack_time_t jack_frames_to_time(const jack_client_t *client, jack_nframes_t);
00815 
00819         jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t);
00820 
00829         jack_time_t jack_get_time();
00830 
00837     float jack_cpu_load (jack_client_t *client);
00838 
00843     pthread_t jack_client_thread_id (jack_client_t *);
00844 
00853     extern void (*jack_error_callback)(const char *msg);
00854 
00861     void jack_set_error_function (void (*func)(const char *));
00862 
00863 #ifdef __cplusplus
00864 }
00865 #endif
00866 
00867 #endif /* __jack_h__ */

Generated on Mon Oct 15 17:11:13 2007 for Jackdmp by  doxygen 1.5.1