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.

188 lines
5.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 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> /* ULONG_MAX */
  19. /**
  20. * Type used to represent sample frame counts.
  21. */
  22. typedef unsigned long jack_nframes_t;
  23. /**
  24. * Maximum value that can be stored in jack_nframes_t
  25. */
  26. #define JACK_MAX_FRAMES ULONG_MAX;
  27. /**
  28. * jack_port_t is an opaque type. You may only access it using the API provided.
  29. */
  30. typedef struct _jack_port jack_port_t;
  31. /**
  32. * jack_client_t is an opaque type. You may only access it using the API provided.
  33. */
  34. typedef struct _jack_client jack_client_t;
  35. /**
  36. * Ports have unique ids. You will very rarely need to know them, however,
  37. * except in the case of the port registration callback.
  38. */
  39. typedef long jack_port_id_t;
  40. /**
  41. * Prototype for the client supplied function that is called
  42. * by the engine anytime there is work to be done.
  43. *
  44. * @pre nframes == jack_get_buffer_size()
  45. *
  46. * @param nframes number of frames to process
  47. * @param arg pointer to a client supplied structure
  48. *
  49. * @return zero on success, non-zero on error
  50. */
  51. typedef int (*JackProcessCallback)(jack_nframes_t nframes, void *arg);
  52. /**
  53. * Prototype for the client supplied function that is called
  54. * whenever the processing graph is reordered.
  55. *
  56. * @param arg pointer to a client supplied structure
  57. *
  58. * @return zero on success, non-zero on error
  59. */
  60. typedef int (*JackGraphOrderCallback)(void *arg);
  61. /**
  62. * Prototype for the client supplied function that is called
  63. * whenever an xrun has occured.
  64. *
  65. * @param arg pointer to a client supplied structure
  66. *
  67. * @return zero on success, non-zero on error
  68. */
  69. typedef int (*JackXRunCallback)(void *arg);
  70. /**
  71. * Prototype for the client supplied function that is called
  72. * when the engine buffersize changes.
  73. *
  74. * Note! Use of this callback function is deprecated!
  75. *
  76. * @param nframes new engine buffer size
  77. * @param arg pointer to a client supplied structure
  78. *
  79. * @return zero on success, non-zero on error
  80. */
  81. typedef int (*JackBufferSizeCallback)(jack_nframes_t nframes, void *arg);
  82. /**
  83. * Prototype for the client supplied function that is called
  84. * when the engine sample rate changes.
  85. *
  86. * @param nframes new engine sample rate
  87. * @param arg pointer to a client supplied structure
  88. *
  89. * @return zero on success, non-zero on error
  90. */
  91. typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg);
  92. /**
  93. * Prototype for the client supplied function that is called
  94. * whenever a port is registered or unregistered.
  95. *
  96. * @param arg pointer to a client supplied structure
  97. */
  98. typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int, void *arg);
  99. /**
  100. * Used for the type argument of jack_port_register().
  101. */
  102. #define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
  103. /**
  104. * For convenience, use this typedef if you want to be able to change
  105. * between float and double. You may want to typedef sample_t to
  106. * jack_default_audio_sample_t in your application.
  107. */
  108. typedef float jack_default_audio_sample_t;
  109. /**
  110. * A port has a set of flags that are formed by AND-ing together the
  111. * desired values from the list below. The flags "JackPortIsInput" and
  112. * "JackPortIsOutput" are mutually exclusive and it is an error to use
  113. * them both.
  114. */
  115. enum JackPortFlags {
  116. /**
  117. * if JackPortIsInput is set, then the port can receive
  118. * data.
  119. */
  120. JackPortIsInput = 0x1,
  121. /**
  122. * if JackPortIsOutput is set, then data can be read from
  123. * the port.
  124. */
  125. JackPortIsOutput = 0x2,
  126. /**
  127. * if JackPortIsPhysical is set, then the port corresponds
  128. * to some kind of physical I/O connector.
  129. */
  130. JackPortIsPhysical = 0x4,
  131. /**
  132. * if JackPortCanMonitor is set, then a call to
  133. * jack_port_request_monitor() makes sense.
  134. *
  135. * Precisely what this means is dependent on the client. A typical
  136. * result of it being called with TRUE as the second argument is
  137. * that data that would be available from an output port (with
  138. * JackPortIsPhysical set) is sent to a physical output connector
  139. * as well, so that it can be heard/seen/whatever.
  140. *
  141. * Clients that do not control physical interfaces
  142. * should never create ports with this bit set.
  143. */
  144. JackPortCanMonitor = 0x8,
  145. /**
  146. * JackPortIsTerminal means:
  147. *
  148. * for an input port: the data received by the port
  149. * will not be passed on or made
  150. * available at any other port
  151. *
  152. * for an output port: the data available at the port
  153. * does not originate from any other port
  154. *
  155. * Audio synthesizers, i/o h/w interface clients, HDR
  156. * systems are examples of things that would set this
  157. * flag for their ports.
  158. */
  159. JackPortIsTerminal = 0x10
  160. };
  161. #endif /* __jack_types_h__ */