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.

128 lines
3.9KB

  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 Lesser General Public License as published by
  5. the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. $Id$
  15. */
  16. #ifndef __jack_types_h__
  17. #define __jack_types_h__
  18. #include <limits.h>
  19. typedef unsigned long jack_nframes_t;
  20. #define JACK_MAX_FRAMES ULONG_MAX;
  21. /**
  22. * jack_port_t is an opaque type. You may only access it using the API provided.
  23. */
  24. typedef struct _jack_port jack_port_t;
  25. /**
  26. * jack_client_t is an opaque type. You may only access it using the API provided.
  27. */
  28. typedef struct _jack_client jack_client_t;
  29. /**
  30. * Ports have unique ids. You will very rarely need to know them, however,
  31. * except in the case of the port registration callback.
  32. */
  33. typedef long jack_port_id_t;
  34. typedef int (*JackProcessCallback)(jack_nframes_t, void *);
  35. typedef int (*JackGraphOrderCallback)(void *);
  36. typedef int (*JackXRunCallback)(void *);
  37. typedef int (*JackBufferSizeCallback)(jack_nframes_t, void *);
  38. typedef int (*JackSampleRateCallback)(jack_nframes_t, void *);
  39. typedef void (*JackPortRegistrationCallback)(jack_port_id_t,int,void*);
  40. /**
  41. * Used for the type argument of jack_port_register().
  42. */
  43. #define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
  44. /**
  45. * For convenience, use this typedef if you want to be able to change
  46. * between float and double. You may want to typedef sample_t to
  47. * jack_default_audio_sample_t in your application.
  48. */
  49. typedef float jack_default_audio_sample_t;
  50. /**
  51. * A port has a set of flags that are formed by AND-ing together the
  52. * desired values from the list below. The flags "JackPortIsInput" and
  53. * "JackPortIsOutput" are mutually exclusive and it is an error to use
  54. * them both.
  55. */
  56. enum JackPortFlags {
  57. /**
  58. * if JackPortIsInput is set, then the port can receive
  59. * data.
  60. */
  61. JackPortIsInput = 0x1,
  62. /**
  63. * if JackPortIsOutput is set, then data can be read from
  64. * the port.
  65. */
  66. JackPortIsOutput = 0x2,
  67. /**
  68. * if JackPortIsPhysical is set, then the port corresponds
  69. * to some kind of physical I/O connector.
  70. */
  71. JackPortIsPhysical = 0x4,
  72. /**
  73. * if JackPortCanMonitor is set, then a call to
  74. * jack_port_request_monitor() makes sense.
  75. *
  76. * Precisely what this means is dependent on the client. A typical
  77. * result of it being called with TRUE as the second argument is
  78. * that data that would be available from an output port (with
  79. * JackPortIsPhysical set) is sent to a physical output connector
  80. * as well, so that it can be heard/seen/whatever.
  81. *
  82. * Clients that do not control physical interfaces
  83. * should never create ports with this bit set.
  84. */
  85. JackPortCanMonitor = 0x8,
  86. /**
  87. * JackPortIsTerminal means:
  88. *
  89. * for an input port: the data received by the port
  90. * will not be passed on or made
  91. * available at any other port
  92. *
  93. * for an output port: the data available at the port
  94. * does not originate from any other port
  95. *
  96. * Audio synthesizers, i/o h/w interface clients, HDR
  97. * systems are examples of things that would set this
  98. * flag for their ports.
  99. */
  100. JackPortIsTerminal = 0x10
  101. };
  102. #endif /* __jack_types_h__ */