jack.h

Go to the documentation of this file.
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 */
00020 
00021 #ifndef __jack_h__
00022 #define __jack_h__
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 #include <pthread.h>
00029 
00030 #include <jack/types.h>
00031 #include <jack/transport.h>
00032 
00070 jack_client_t *jack_client_open (const char *client_name,
00071                                  jack_options_t options,
00072                                  jack_status_t *status, ...);
00073 
00079 jack_client_t *jack_client_new (const char *client_name);
00080 
00086 int jack_client_close (jack_client_t *client);
00087 
00092 int jack_client_name_size (void);
00093 
00100 char *jack_get_client_name (jack_client_t *client);
00101 
00123 int jack_internal_client_new (const char *client_name,
00124                               const char *load_name,
00125                               const char *load_init);
00126 
00132 void jack_internal_client_close (const char *client_name);
00133 
00141 int jack_is_realtime (jack_client_t *client);
00142 
00161 void jack_on_shutdown (jack_client_t *client,
00162                        void (*function)(void *arg), void *arg);
00163 
00179 int jack_set_process_callback (jack_client_t *client,
00180                                JackProcessCallback process_callback,
00181                                void *arg);
00193 jack_nframes_t jack_thread_wait (jack_client_t*, int status);
00194 
00206 int jack_set_thread_init_callback (jack_client_t *client,
00207                                    JackThreadInitCallback thread_init_callback,
00208                                    void *arg);
00209 
00219 int jack_set_freewheel_callback (jack_client_t *client,
00220                                  JackFreewheelCallback freewheel_callback,
00221                                  void *arg);
00222 
00247 int jack_set_freewheel(jack_client_t* client, int onoff);
00248 
00264 int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes);
00265 
00278 int jack_set_buffer_size_callback (jack_client_t *client,
00279                                    JackBufferSizeCallback bufsize_callback,
00280                                    void *arg);
00281 
00288 int jack_set_sample_rate_callback (jack_client_t *client,
00289                                    JackSampleRateCallback srate_callback,
00290                                    void *arg);
00291 
00298 int jack_set_client_registration_callback (jack_client_t *,
00299                                            JackClientRegistrationCallback
00300                                            registration_callback, void *arg);
00301         
00308 int jack_set_port_registration_callback (jack_client_t *,
00309                                          JackPortRegistrationCallback
00310                                          registration_callback, void *arg);
00311 
00318 int jack_set_port_connect_callback (jack_client_t *,
00319                                     JackPortConnectCallback
00320                                     connect_callback, void *arg);
00327 int jack_set_graph_order_callback (jack_client_t *,
00328                                    JackGraphOrderCallback graph_callback,
00329                                    void *);
00330 
00337 int jack_set_xrun_callback (jack_client_t *,
00338                             JackXRunCallback xrun_callback, void *arg);
00339 
00346 int jack_activate (jack_client_t *client);
00347 
00355 int jack_deactivate (jack_client_t *client);
00356 
00383 jack_port_t *jack_port_register (jack_client_t *client,
00384                                  const char *port_name,
00385                                  const char *port_type,
00386                                  unsigned long flags,
00387                                  unsigned long buffer_size);
00388 
00395 int jack_port_unregister (jack_client_t *, jack_port_t *);
00396 
00413 void *jack_port_get_buffer (jack_port_t *, jack_nframes_t);
00414 
00421 const char *jack_port_name (const jack_port_t *port);
00422 
00429 const char *jack_port_short_name (const jack_port_t *port);
00430 
00434 int jack_port_flags (const jack_port_t *port);
00435 
00440 const char *jack_port_type (const jack_port_t *port);
00441 
00445 int jack_port_is_mine (const jack_client_t *, const jack_port_t *port);
00446 
00452 int jack_port_connected (const jack_port_t *port);
00453 
00460 int jack_port_connected_to (const jack_port_t *port,
00461                             const char *port_name);
00462 
00474 const char **jack_port_get_connections (const jack_port_t *port);
00475 
00495 const char **jack_port_get_all_connections (const jack_client_t *client,
00496                                             const jack_port_t *port);
00497 
00514 int  jack_port_tie (jack_port_t *src, jack_port_t *dst);
00515 
00523 int  jack_port_untie (jack_port_t *port);
00524 
00535 jack_nframes_t jack_port_get_latency (jack_port_t *port);
00536 
00542 jack_nframes_t jack_port_get_total_latency (jack_client_t *,
00543                                             jack_port_t *port);
00544 
00555 void jack_port_set_latency (jack_port_t *, jack_nframes_t);
00556         
00568 int jack_recompute_total_latency (jack_client_t*, jack_port_t* port);
00569 
00583 int jack_recompute_total_latencies (jack_client_t*);
00584 
00592 int jack_port_set_name (jack_port_t *port, const char *port_name);
00593 
00607 int jack_port_set_alias (jack_port_t *port, const char *alias);
00608 
00617 int jack_port_unset_alias (jack_port_t *port, const char *alias);
00618 
00619 /*
00620  * Get any aliases known for @port.
00621  *
00622  * @return the number of aliases discovered for the port
00623  */
00624 int jack_port_get_aliases (const jack_port_t *port, char* const aliases[2]);
00625 
00630 int jack_port_request_monitor (jack_port_t *port, int onoff);
00631 
00640 int jack_port_request_monitor_by_name (jack_client_t *client,
00641                                        const char *port_name, int onoff);
00642 
00650 int jack_port_ensure_monitor (jack_port_t *port, int onoff);
00651 
00655 int jack_port_monitoring_input (jack_port_t *port);
00656 
00674 int jack_connect (jack_client_t *,
00675                   const char *source_port,
00676                   const char *destination_port);
00677 
00691 int jack_disconnect (jack_client_t *,
00692                      const char *source_port,
00693                      const char *destination_port);
00694 
00704 int jack_port_disconnect (jack_client_t *, jack_port_t *);
00705 
00714 int jack_port_name_size(void);
00715 
00720 int jack_port_type_size(void);
00721 
00726 jack_nframes_t jack_get_sample_rate (jack_client_t *);
00727 
00737 jack_nframes_t jack_get_buffer_size (jack_client_t *);
00738 
00755 const char **jack_get_ports (jack_client_t *, 
00756                              const char *port_name_pattern, 
00757                              const char *type_name_pattern, 
00758                              unsigned long flags);
00759 
00765 jack_port_t *jack_port_by_name (jack_client_t *, const char *port_name);
00766 
00770 jack_port_t *jack_port_by_id (jack_client_t *client,
00771                               jack_port_id_t port_id);
00772 
00783 int  jack_engine_takeover_timebase (jack_client_t *);
00784 
00789 jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *);
00790 
00796 jack_nframes_t jack_frame_time (const jack_client_t *);
00797 
00805 jack_nframes_t jack_last_frame_time (const jack_client_t *client);
00806 
00810 jack_time_t jack_frames_to_time(const jack_client_t *client, jack_nframes_t);
00811 
00815 jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t);
00816 
00825 jack_time_t jack_get_time();
00826 
00833 float jack_cpu_load (jack_client_t *client);
00834         
00839 pthread_t jack_client_thread_id (jack_client_t *);
00840 
00849 extern void (*jack_error_callback)(const char *msg);
00850 
00857 void jack_set_error_function (void (*func)(const char *));
00858 
00859 #ifdef __cplusplus
00860 }
00861 #endif
00862 
00863 #endif /* __jack_h__ */

Generated on Thu Feb 14 05:40:23 2008 for JACK-AUDIO-CONNECTION-KIT by  doxygen 1.5.4