jack1 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.6KB

  1. /*
  2. Copyright (C) 2001 Paul Davis
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  14. $Id$
  15. */
  16. #ifndef __jack_engine_h__
  17. #define __jack_engine_h__
  18. #include <jack/jack.h>
  19. #include <jack/internal.h>
  20. struct _jack_driver;
  21. struct _jack_client_internal;
  22. struct _jack_port_internal;
  23. struct _jack_engine {
  24. jack_control_t *control;
  25. struct _jack_driver *driver;
  26. int (*process)(struct _jack_engine *, nframes_t frames);
  27. int (*set_buffer_size)(struct _jack_engine *, nframes_t frames);
  28. int (*set_sample_rate)(struct _jack_engine *, nframes_t frames);
  29. pthread_mutex_t graph_lock;
  30. pthread_mutex_t buffer_lock;
  31. pthread_mutex_t port_lock;
  32. int period_msecs;
  33. int port_max;
  34. int control_shm_id;
  35. key_t control_key;
  36. key_t port_segment_key; /* XXX fix me */
  37. void *port_segment_address; /* XXX fix me */
  38. pthread_t main_thread;
  39. pthread_t server_thread;
  40. /* these lists are protected by `buffer_lock' */
  41. GSList *port_segments;
  42. GSList *port_buffer_freelist;
  43. /* these lists are all protected by `graph_lock' */
  44. GSList *clients;
  45. GSList *clients_waiting;
  46. GSList *connections;
  47. struct _jack_port_internal *internal_ports;
  48. GSList *port_types; /* holds ptrs to jack_port_type_info_t */
  49. int fds[2];
  50. jack_client_id_t next_client_id;
  51. size_t pfd_size;
  52. size_t pfd_max;
  53. struct pollfd *pfd;
  54. struct _jack_client_internal *timebase_client;
  55. jack_port_buffer_info_t *silent_buffer;
  56. char fifo_prefix[PATH_MAX+1];
  57. int *fifo;
  58. unsigned long fifo_size;
  59. unsigned long external_client_cnt;
  60. int rtpriority;
  61. };
  62. /* public functions */
  63. jack_engine_t *jack_engine_new (int real_time, int real_time_priority);
  64. int jack_engine_delete (jack_engine_t *);
  65. int jack_run (jack_engine_t *engine);
  66. int jack_wait (jack_engine_t *engine);
  67. int jack_use_driver (jack_engine_t *, struct _jack_driver *);
  68. void jack_set_temp_dir (const char *);
  69. #endif /* __jack_engine_h__ */