# 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     $Id: jack.h 895 2005-05-11 02:06:47Z pbd $
    00020 */
    00021
    00022 #ifndef __jack_h__
    00023 #define __jack_h__
    00024
    00025 #ifdef __cplusplus
    00026 extern "C" {
    00027 #endif
    00028
    00029 #include <pthread.h>
    00030
    00031 #include <jack/types.h>
    00032 #include <jack/transport.h>
    00033
    00071 jack_client_t *jack_client_open (const char *client_name,
    00072                                  jack_options_t options,
    00073                                  jack_status_t *status, ...);
    00074
    00096 jack_client_t *jack_client_new (const char *client_name);
    00097
    00103 int jack_client_close (jack_client_t *client);
    00104
    00109 int jack_client_name_size (void);
    00110
    00117 char *jack_get_client_name (jack_client_t *client);
    00118
    00140 int jack_internal_client_new (const char *client_name,
    00141                               const char *load_name,
    00142                               const char *load_init);
    00143
    00149 void jack_internal_client_close (const char *client_name);
    00150
    00158 int jack_is_realtime (jack_client_t *client);
    00159
    00178 void jack_on_shutdown (jack_client_t *client,
    00179                        void (*function)(void *arg), void *arg);
    00180
    00196 int jack_set_process_callback (jack_client_t *client,
    00197                                JackProcessCallback process_callback,
    00198                                void *arg);
    00199
    00211 int jack_set_thread_init_callback (jack_client_t *client,
    00212                                    JackThreadInitCallback thread_init_callback,
    00213                                    void *arg);
    00214
    00224 int jack_set_freewheel_callback (jack_client_t *client,
    00225                                  JackFreewheelCallback freewheel_callback,
    00226                                  void *arg);
    00227
    00252 int jack_set_freewheel(jack_client_t* client, int onoff);
    00253
    00269 int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes);
    00270
    00283 int jack_set_buffer_size_callback (jack_client_t *client,
    00284                                    JackBufferSizeCallback bufsize_callback,
    00285                                    void *arg);
    00286
    00293 int jack_set_sample_rate_callback (jack_client_t *client,
    00294                                    JackSampleRateCallback srate_callback,
    00295                                    void *arg);
    00296
    00303 int jack_set_port_registration_callback (jack_client_t *,
    00304                                          JackPortRegistrationCallback
    00305                                          registration_callback, void *arg);
    00306
    00313 int jack_set_graph_order_callback (jack_client_t *,
    00314                                    JackGraphOrderCallback graph_callback,
    00315                                    void *);
    00316
    00323 int jack_set_xrun_callback (jack_client_t *,
    00324                             JackXRunCallback xrun_callback, void *arg);
    00325
    00332 int jack_activate (jack_client_t *client);
    00333
    00341 int jack_deactivate (jack_client_t *client);
    00342
    00369 jack_port_t *jack_port_register (jack_client_t *client,
    00370                                  const char *port_name,
    00371                                  const char *port_type,
    00372                                  unsigned long flags,
    00373                                  unsigned long buffer_size);
    00374
    00381 int jack_port_unregister (jack_client_t *, jack_port_t *);
    00382
    00399 void *jack_port_get_buffer (jack_port_t *, jack_nframes_t);
    00400
    00407 const char *jack_port_name (const jack_port_t *port);
    00408
    00415 const char *jack_port_short_name (const jack_port_t *port);
    00416
    00420 int jack_port_flags (const jack_port_t *port);
    00421
    00426 const char *jack_port_type (const jack_port_t *port);
    00427
    00431 int jack_port_is_mine (const jack_client_t *, const jack_port_t *port);
    00432
    00438 int jack_port_connected (const jack_port_t *port);
    00439
    00446 int jack_port_connected_to (const jack_port_t *port,
    00447                             const char *port_name);
    00448
    00460 const char **jack_port_get_connections (const jack_port_t *port);
    00461
    00481 const char **jack_port_get_all_connections (const jack_client_t *client,
    00482                                             const jack_port_t *port);
    00483
    00500 int  jack_port_tie (jack_port_t *src, jack_port_t *dst);
    00501
    00509 int  jack_port_untie (jack_port_t *port);
    00510
    00518 int jack_port_lock (jack_client_t *, jack_port_t *);
    00519
    00525 int jack_port_unlock (jack_client_t *, jack_port_t *);
    00526
    00537 jack_nframes_t jack_port_get_latency (jack_port_t *port);
    00538
    00544 jack_nframes_t jack_port_get_total_latency (jack_client_t *,
    00545                                             jack_port_t *port);
    00546
    00557 void jack_port_set_latency (jack_port_t *, jack_nframes_t);
    00558
    00562 int jack_recompute_total_latencies (jack_client_t*);
    00563
    00571 int jack_port_set_name (jack_port_t *port, const char *port_name);
    00572
    00577 int jack_port_request_monitor (jack_port_t *port, int onoff);
    00578
    00587 int jack_port_request_monitor_by_name (jack_client_t *client,
    00588                                        const char *port_name, int onoff);
    00589
    00597 int jack_port_ensure_monitor (jack_port_t *port, int onoff);
    00598
    00602 int jack_port_monitoring_input (jack_port_t *port);
    00603
    00621 int jack_connect (jack_client_t *,
    00622                   const char *source_port,
    00623                   const char *destination_port);
    00624
    00638 int jack_disconnect (jack_client_t *,
    00639                      const char *source_port,
    00640                      const char *destination_port);
    00641
    00651 int jack_port_disconnect (jack_client_t *, jack_port_t *);
    00652
    00661 int jack_port_name_size(void);
    00662
    00667 int jack_port_type_size(void);
    00668
    00673 jack_nframes_t jack_get_sample_rate (jack_client_t *);
    00674
    00684 jack_nframes_t jack_get_buffer_size (jack_client_t *);
    00685
    00702 const char **jack_get_ports (jack_client_t *,
    00703                              const char *port_name_pattern,
    00704                              const char *type_name_pattern,
    00705                              unsigned long flags);
    00706
    00712 jack_port_t *jack_port_by_name (jack_client_t *, const char *port_name);
    00713
    00717 jack_port_t *jack_port_by_id (jack_client_t *client,
    00718                               jack_port_id_t port_id);
    00719
    00730 int  jack_engine_takeover_timebase (jack_client_t *);
    00731
    00736 jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *);
    00737
    00743 jack_nframes_t jack_frame_time (const jack_client_t *);
    00744
    00752 jack_nframes_t jack_last_frame_time (const jack_client_t *client);
    00753
    00760 float jack_cpu_load (jack_client_t *client);
    00761
    00766 pthread_t jack_client_thread_id (jack_client_t *);
    00767
    00776 extern void (*jack_error_callback)(const char *msg);
    00777
    00784 void jack_set_error_function (void (*func)(const char *));
    00785
    00786 #ifdef __cplusplus
    00787 }
    00788 #endif
    00789
    00790 #endif /* __jack_h__ */