JACK API headers
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.

139 lines
5.1KB

  1. /*
  2. * Copyright (C) 2004 Jack O'Quin
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser General Public License as published by
  6. * the Free Software Foundation; either version 2.1 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. *
  18. */
  19. #ifndef __jack_intclient_h__
  20. #define __jack_intclient_h__
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #include <jack/types.h>
  25. /**
  26. * Get an internal client's name. This is useful when @ref
  27. * JackUseExactName was not specified on jack_internal_client_load()
  28. * and @ref JackNameNotUnique status was returned. In that case, the
  29. * actual name will differ from the @a client_name requested.
  30. *
  31. * @param client requesting JACK client's handle.
  32. *
  33. * @param intclient handle returned from jack_internal_client_load()
  34. * or jack_internal_client_handle().
  35. *
  36. * @return NULL if unsuccessful, otherwise pointer to the internal
  37. * client name obtained from the heap via malloc(). The caller should
  38. * free() this storage when no longer needed.
  39. */
  40. char *jack_get_internal_client_name (jack_client_t *client,
  41. jack_intclient_t intclient);
  42. /**
  43. * Find the @ref jack_intclient_t handle for an internal client
  44. * running in the JACK server.
  45. *
  46. * @param client requesting JACK client's handle.
  47. *
  48. * @param client_name for the internal client of no more than
  49. * jack_client_name_size() characters. The name scope is local to the
  50. * current server.
  51. *
  52. * @param status (if non-NULL) an address for JACK to return
  53. * information from this operation. This status word is formed by
  54. * OR-ing together the relevant @ref JackStatus bits.
  55. *
  56. * @param handle the client handle will be returned here (passed
  57. * by reference because of the type.
  58. *
  59. * @return 0 if successfullm non-zero otherwise.
  60. * If non-zero, the
  61. * internal client was not found, and @a *status includes the @ref
  62. * JackNoSuchClient and @ref JackFailure bits.
  63. */
  64. int jack_internal_client_handle (jack_client_t *client,
  65. const char *client_name,
  66. jack_status_t *status,
  67. jack_intclient_t *handle);
  68. /**
  69. * Load an internal client into the JACK server.
  70. *
  71. * Internal clients run inside the JACK server process. They can use
  72. * most of the same functions as external clients. Each internal
  73. * client is built as a shared object module, which must declare
  74. * jack_initialize() and jack_finish() entry points called at load and
  75. * unload times. See @ref inprocess.c for an example.
  76. *
  77. * @param client loading JACK client's handle.
  78. *
  79. * @param client_name of at most jack_client_name_size() characters
  80. * for the internal client to load. The name scope is local to the
  81. * current server.
  82. *
  83. * @param options formed by OR-ing together @ref JackOptions bits.
  84. * Only the @ref JackLoadOptions bits are valid.
  85. *
  86. * @param status (if non-NULL) an address for JACK to return
  87. * information from the load operation. This status word is formed by
  88. * OR-ing together the relevant @ref JackStatus bits.
  89. *
  90. * @param handle the client handle will be returned here (passed
  91. * by reference because of the type.
  92. *
  93. * <b>Optional parameters:</b> depending on corresponding [@a options
  94. * bits] additional parameters may follow @a status (in this order).
  95. *
  96. * @arg [@ref JackLoadName] <em>(char *) load_name</em> is the shared
  97. * object file from which to load the new internal client (otherwise
  98. * use the @a client_name).
  99. *
  100. * @arg [@ref JackLoadInit] <em>(char *) load_init</em> an arbitary
  101. * string passed to the internal client's jack_initialize() routine
  102. * (otherwise NULL), of no more than @ref JACK_LOAD_INIT_LIMIT bytes.
  103. *
  104. * @return zero if successful, non-zero otherwise. If this is non-zero,
  105. * the load operation failed, the internal client was not loaded, and
  106. * @a *status includes the @ref JackFailure bit.
  107. */
  108. int jack_internal_client_load (jack_client_t *client,
  109. const char *client_name,
  110. jack_options_t options,
  111. jack_status_t *status,
  112. jack_intclient_t, ...);
  113. /**
  114. * Unload an internal client from a JACK server. This calls the
  115. * intclient's jack_finish() entry point then removes it. See @ref
  116. * inprocess.c for an example.
  117. *
  118. * @param client unloading JACK client's handle.
  119. *
  120. * @param intclient handle returned from jack_internal_client_load() or
  121. * jack_internal_client_handle().
  122. *
  123. * @return 0 if successful, otherwise @ref JackStatus bits.
  124. */
  125. jack_status_t jack_internal_client_unload (jack_client_t *client,
  126. jack_intclient_t intclient);
  127. #ifdef __cplusplus
  128. }
  129. #endif
  130. #endif /* __jack_intclient_h__ */