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.

98 lines
2.1KB

  1. /*
  2. Sun Audio API driver for Jack
  3. Copyright (C) 2008 Jacob Meuser <jakemsr@sdf.lonestar.org>
  4. Based heavily on oss_driver.h which came with the following
  5. copyright notice.
  6. Copyright (C) 2003-2007 Jussi Laako <jussi@sonarnerd.net>
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  18. MA 02111-1307 USA
  19. */
  20. #ifndef __JACK_SUN_DRIVER_H__
  21. #define __JACK_SUN_DRIVER_H__
  22. #include <sys/types.h>
  23. #include <pthread.h>
  24. #include <semaphore.h>
  25. #include <jack/types.h>
  26. #include <jack/jslist.h>
  27. #include <jack/driver.h>
  28. #include <jack/jack.h>
  29. #define SUN_DRIVER_DEF_DEV "/dev/audio"
  30. #define SUN_DRIVER_DEF_FS 48000
  31. #define SUN_DRIVER_DEF_BLKSIZE 1024
  32. #define SUN_DRIVER_DEF_NPERIODS 2
  33. #define SUN_DRIVER_DEF_BITS 16
  34. #define SUN_DRIVER_DEF_INS 2
  35. #define SUN_DRIVER_DEF_OUTS 2
  36. typedef jack_default_audio_sample_t jack_sample_t;
  37. typedef struct _sun_driver
  38. {
  39. JACK_DRIVER_NT_DECL
  40. jack_nframes_t sample_rate;
  41. jack_nframes_t period_size;
  42. unsigned int nperiods;
  43. int bits;
  44. int sample_bytes;
  45. unsigned int capture_channels;
  46. unsigned int playback_channels;
  47. char *indev;
  48. char *outdev;
  49. int infd;
  50. int outfd;
  51. int format;
  52. int ignorehwbuf;
  53. size_t indevbufsize;
  54. size_t outdevbufsize;
  55. size_t portbufsize;
  56. void *indevbuf;
  57. void *outdevbuf;
  58. int poll_timeout;
  59. jack_time_t poll_last;
  60. jack_time_t poll_next;
  61. float iodelay;
  62. jack_nframes_t sys_in_latency;
  63. jack_nframes_t sys_out_latency;
  64. JSList *capture_ports;
  65. JSList *playback_ports;
  66. jack_client_t *client;
  67. int playback_drops;
  68. int capture_drops;
  69. } sun_driver_t;
  70. #endif