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);
00189 jack_nframes_t jack_thread_wait (jack_client_t*, int status);
00190 
00198 jack_nframes_t jack_cycle_wait (jack_client_t* client);
00199         
00206 void jack_cycle_signal (jack_client_t* client, int status);
00207         
00221 int jack_set_process_thread(jack_client_t* client, JackThreadCallback fun, void *arg);
00222 
00234 int jack_set_thread_init_callback (jack_client_t *client,
00235                                    JackThreadInitCallback thread_init_callback,
00236                                    void *arg);
00237 
00247 int jack_set_freewheel_callback (jack_client_t *client,
00248                                  JackFreewheelCallback freewheel_callback,
00249                                  void *arg);
00250 
00275 int jack_set_freewheel(jack_client_t* client, int onoff);
00276 
00292 int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes);
00293 
00306 int jack_set_buffer_size_callback (jack_client_t *client,
00307                                    JackBufferSizeCallback bufsize_callback,
00308                                    void *arg);
00309 
00316 int jack_set_sample_rate_callback (jack_client_t *client,
00317                                    JackSampleRateCallback srate_callback,
00318                                    void *arg);
00319 
00326 int jack_set_client_registration_callback (jack_client_t *,
00327                                            JackClientRegistrationCallback
00328                                            registration_callback, void *arg);
00329         
00336 int jack_set_port_registration_callback (jack_client_t *,
00337                                          JackPortRegistrationCallback
00338                                          registration_callback, void *arg);
00339 
00346 int jack_set_port_connect_callback (jack_client_t *,
00347                                     JackPortConnectCallback
00348                                     connect_callback, void *arg);
00355 int jack_set_graph_order_callback (jack_client_t *,
00356                                    JackGraphOrderCallback graph_callback,
00357                                    void *);
00358 
00365 int jack_set_xrun_callback (jack_client_t *,
00366                             JackXRunCallback xrun_callback, void *arg);
00367 
00374 int jack_activate (jack_client_t *client);
00375 
00383 int jack_deactivate (jack_client_t *client);
00384 
00411 jack_port_t *jack_port_register (jack_client_t *client,
00412                                  const char *port_name,
00413                                  const char *port_type,
00414                                  unsigned long flags,
00415                                  unsigned long buffer_size);
00416 
00423 int jack_port_unregister (jack_client_t *, jack_port_t *);
00424 
00444 void *jack_port_get_buffer (jack_port_t *, jack_nframes_t);
00445 
00452 const char *jack_port_name (const jack_port_t *port);
00453 
00460 const char *jack_port_short_name (const jack_port_t *port);
00461 
00465 int jack_port_flags (const jack_port_t *port);
00466 
00471 const char *jack_port_type (const jack_port_t *port);
00472 
00476 int jack_port_is_mine (const jack_client_t *, const jack_port_t *port);
00477 
00483 int jack_port_connected (const jack_port_t *port);
00484 
00491 int jack_port_connected_to (const jack_port_t *port,
00492                             const char *port_name);
00493 
00505 const char **jack_port_get_connections (const jack_port_t *port);
00506 
00526 const char **jack_port_get_all_connections (const jack_client_t *client,
00527                                             const jack_port_t *port);
00528 
00545 int  jack_port_tie (jack_port_t *src, jack_port_t *dst);
00546 
00554 int  jack_port_untie (jack_port_t *port);
00555 
00566 jack_nframes_t jack_port_get_latency (jack_port_t *port);
00567 
00573 jack_nframes_t jack_port_get_total_latency (jack_client_t *,
00574                                             jack_port_t *port);
00575 
00586 void jack_port_set_latency (jack_port_t *, jack_nframes_t);
00587         
00599 int jack_recompute_total_latency (jack_client_t*, jack_port_t* port);
00600 
00614 int jack_recompute_total_latencies (jack_client_t*);
00615 
00623 int jack_port_set_name (jack_port_t *port, const char *port_name);
00624 
00638 int jack_port_set_alias (jack_port_t *port, const char *alias);
00639 
00648 int jack_port_unset_alias (jack_port_t *port, const char *alias);
00649 
00650 /*
00651  * Get any aliases known for @port.
00652  *
00653  * @return the number of aliases discovered for the port
00654  */
00655 int jack_port_get_aliases (const jack_port_t *port, char* const aliases[2]);
00656 
00661 int jack_port_request_monitor (jack_port_t *port, int onoff);
00662 
00671 int jack_port_request_monitor_by_name (jack_client_t *client,
00672                                        const char *port_name, int onoff);
00673 
00681 int jack_port_ensure_monitor (jack_port_t *port, int onoff);
00682 
00686 int jack_port_monitoring_input (jack_port_t *port);
00687 
00705 int jack_connect (jack_client_t *,
00706                   const char *source_port,
00707                   const char *destination_port);
00708 
00722 int jack_disconnect (jack_client_t *,
00723                      const char *source_port,
00724                      const char *destination_port);
00725 
00735 int jack_port_disconnect (jack_client_t *, jack_port_t *);
00736 
00745 int jack_port_name_size(void);
00746 
00751 int jack_port_type_size(void);
00752 
00757 jack_nframes_t jack_get_sample_rate (jack_client_t *);
00758 
00768 jack_nframes_t jack_get_buffer_size (jack_client_t *);
00769 
00786 const char **jack_get_ports (jack_client_t *, 
00787                              const char *port_name_pattern, 
00788                              const char *type_name_pattern, 
00789                              unsigned long flags);
00790 
00796 jack_port_t *jack_port_by_name (jack_client_t *, const char *port_name);
00797 
00801 jack_port_t *jack_port_by_id (jack_client_t *client,
00802                               jack_port_id_t port_id);
00803 
00814 int  jack_engine_takeover_timebase (jack_client_t *);
00815 
00820 jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *);
00821 
00827 jack_nframes_t jack_frame_time (const jack_client_t *);
00828 
00836 jack_nframes_t jack_last_frame_time (const jack_client_t *client);
00837 
00841 jack_time_t jack_frames_to_time(const jack_client_t *client, jack_nframes_t);
00842 
00846 jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t);
00847 
00856 jack_time_t jack_get_time();
00857 
00864 float jack_cpu_load (jack_client_t *client);
00865         
00870 pthread_t jack_client_thread_id (jack_client_t *);
00871 
00880 extern void (*jack_error_callback)(const char *msg);
00881 
00888 void jack_set_error_function (void (*func)(const char *));
00889 
00898 extern void (*jack_info_callback)(const char *msg);
00899 
00903 void jack_set_info_function (void (*func)(const char *));
00904 
00905 #ifdef __cplusplus
00906 }
00907 #endif
00908 
00909 #endif /* __jack_h__ */

Generated on Sun Jul 27 22:17:43 2008 for JACK-AUDIO-CONNECTION-KIT by  doxygen 1.5.6