jack2 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.

189 lines
5.0KB

  1. /* -*- Mode: C ; c-basic-offset: 4 -*- */
  2. /*
  3. Copyright (C) 2007,2008,2011 Nedko Arnaudov
  4. Copyright (C) 2007-2008 Juuso Alasuutari
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED
  17. #define CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED
  18. #include <stdbool.h>
  19. #include "jslist.h"
  20. #include "jack/control.h"
  21. #include "jack/jack.h"
  22. #include "jackdbus.h"
  23. #include "list.h"
  24. #include "params.h"
  25. struct jack_controller_slave_driver
  26. {
  27. struct list_head siblings;
  28. char * name;
  29. jackctl_driver_t * handle;
  30. bool loaded;
  31. };
  32. struct jack_controller
  33. {
  34. jackctl_server_t *server;
  35. jack_params_handle params;
  36. void *patchbay_context;
  37. bool started;
  38. jack_client_t *client;
  39. unsigned int xruns;
  40. struct list_head slave_drivers;
  41. bool slave_drivers_set;
  42. struct jack_parameter slave_drivers_vparam;
  43. union jackctl_parameter_value slave_drivers_vparam_value;
  44. struct jack_dbus_object_descriptor dbus_descriptor;
  45. };
  46. #define DEFAULT_DRIVER "dummy"
  47. #define JACK_CONF_HEADER_TEXT \
  48. "JACK settings, as persisted by D-Bus object.\n" \
  49. "You probably don't want to edit this because\n" \
  50. "it will be overwritten next time jackdbus saves.\n"
  51. bool
  52. jack_controller_start_server(
  53. struct jack_controller *controller_ptr,
  54. void *dbus_call_context_ptr);
  55. bool
  56. jack_controller_stop_server(
  57. struct jack_controller *controller_ptr,
  58. void *dbus_call_context_ptr);
  59. bool
  60. jack_controller_switch_master(
  61. struct jack_controller *controller_ptr,
  62. void *dbus_call_context_ptr);
  63. bool
  64. jack_controller_add_slave_driver(
  65. struct jack_controller *controller_ptr,
  66. const char * driver_name);
  67. bool
  68. jack_controller_remove_slave_driver(
  69. struct jack_controller *controller_ptr,
  70. const char * driver_name);
  71. bool
  72. jack_controller_select_driver(
  73. struct jack_controller *controller_ptr,
  74. const char * driver_name);
  75. bool
  76. jack_controller_load_internal(
  77. struct jack_controller *controller_ptr,
  78. const char * internal_name);
  79. bool
  80. jack_controller_unload_internal(
  81. struct jack_controller *controller_ptr,
  82. const char * internal_name);
  83. void
  84. jack_controller_deserialize_parameter_value(
  85. struct jack_controller *controller_ptr,
  86. const char * const * address,
  87. const char * value);
  88. void
  89. jack_controller_serialize_parameter_value(
  90. const struct jack_parameter * param_ptr,
  91. char * value_buffer);
  92. bool
  93. jack_controller_patchbay_init(
  94. struct jack_controller *controller_ptr);
  95. void
  96. jack_controller_patchbay_uninit(
  97. struct jack_controller *controller_ptr);
  98. void *
  99. jack_controller_patchbay_client_appeared_callback(
  100. void * server_context,
  101. uint64_t client_id,
  102. const char *client_name);
  103. void
  104. jack_controller_patchbay_client_disappeared_callback(
  105. void *server_context,
  106. uint64_t client_id,
  107. void *client_context);
  108. void *
  109. jack_controller_patchbay_port_appeared_callback(
  110. void *server_context,
  111. uint64_t client_id,
  112. void *client_context,
  113. uint64_t port_id,
  114. const char *port_name,
  115. uint32_t port_flags,
  116. uint32_t port_type);
  117. void
  118. jack_controller_patchbay_port_disappeared_callback(
  119. void *server_context,
  120. uint64_t client_id,
  121. void *client_context,
  122. uint64_t port_id,
  123. void *port_context);
  124. void *
  125. jack_controller_patchbay_ports_connected_callback(
  126. void *server_context,
  127. uint64_t client1_id,
  128. void *client1_context,
  129. uint64_t port1_id,
  130. void *port1_context,
  131. uint64_t client2_id,
  132. void *client2_context,
  133. uint64_t port2_id,
  134. void *port2_context,
  135. uint64_t connection_id);
  136. void
  137. jack_controller_patchbay_ports_disconnected_callback(
  138. void *server_context,
  139. uint64_t client1_id,
  140. void *client1_context,
  141. uint64_t port1_id,
  142. void *port1_context,
  143. uint64_t client2_id,
  144. void *client2_context,
  145. uint64_t port2_id,
  146. void *port2_context,
  147. uint64_t connection_id,
  148. void *connection_context);
  149. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_introspectable;
  150. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_control;
  151. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_configure;
  152. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay;
  153. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport;
  154. #endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */