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.

204 lines
5.4KB

  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 "jack/session.h"
  23. #include "jackdbus.h"
  24. #include "list.h"
  25. #include "params.h"
  26. struct jack_controller_slave_driver
  27. {
  28. struct list_head siblings;
  29. char * name;
  30. jackctl_driver_t * handle;
  31. bool loaded;
  32. };
  33. struct jack_session_pending_command
  34. {
  35. struct list_head siblings;
  36. DBusConnection * connection;
  37. DBusMessage * message;
  38. jack_session_event_type_t type;
  39. const char * target;
  40. const char * path;
  41. };
  42. struct jack_controller
  43. {
  44. jackctl_server_t *server;
  45. jack_params_handle params;
  46. void *patchbay_context;
  47. bool started;
  48. jack_client_t *client;
  49. unsigned int xruns;
  50. struct list_head slave_drivers;
  51. bool slave_drivers_set;
  52. struct jack_parameter slave_drivers_vparam;
  53. union jackctl_parameter_value slave_drivers_vparam_value;
  54. struct jack_dbus_object_descriptor dbus_descriptor;
  55. pthread_mutex_t lock;
  56. struct list_head session_pending_commands;
  57. };
  58. #define DEFAULT_DRIVER "dummy"
  59. #define JACK_CONF_HEADER_TEXT \
  60. "JACK settings, as persisted by D-Bus object.\n" \
  61. "You probably don't want to edit this because\n" \
  62. "it will be overwritten next time jackdbus saves.\n"
  63. bool
  64. jack_controller_start_server(
  65. struct jack_controller *controller_ptr,
  66. void *dbus_call_context_ptr);
  67. bool
  68. jack_controller_stop_server(
  69. struct jack_controller *controller_ptr,
  70. void *dbus_call_context_ptr);
  71. bool
  72. jack_controller_switch_master(
  73. struct jack_controller *controller_ptr,
  74. void *dbus_call_context_ptr);
  75. bool
  76. jack_controller_add_slave_driver(
  77. struct jack_controller *controller_ptr,
  78. const char * driver_name);
  79. bool
  80. jack_controller_remove_slave_driver(
  81. struct jack_controller *controller_ptr,
  82. const char * driver_name);
  83. bool
  84. jack_controller_select_driver(
  85. struct jack_controller *controller_ptr,
  86. const char * driver_name);
  87. bool
  88. jack_controller_load_internal(
  89. struct jack_controller *controller_ptr,
  90. const char * internal_name);
  91. bool
  92. jack_controller_unload_internal(
  93. struct jack_controller *controller_ptr,
  94. const char * internal_name);
  95. void
  96. jack_controller_deserialize_parameter_value(
  97. struct jack_controller *controller_ptr,
  98. const char * const * address,
  99. const char * value);
  100. void
  101. jack_controller_serialize_parameter_value(
  102. const struct jack_parameter * param_ptr,
  103. char * value_buffer);
  104. bool
  105. jack_controller_patchbay_init(
  106. struct jack_controller *controller_ptr);
  107. void
  108. jack_controller_patchbay_uninit(
  109. struct jack_controller *controller_ptr);
  110. void *
  111. jack_controller_patchbay_client_appeared_callback(
  112. void * server_context,
  113. uint64_t client_id,
  114. const char *client_name);
  115. void
  116. jack_controller_patchbay_client_disappeared_callback(
  117. void *server_context,
  118. uint64_t client_id,
  119. void *client_context);
  120. void *
  121. jack_controller_patchbay_port_appeared_callback(
  122. void *server_context,
  123. uint64_t client_id,
  124. void *client_context,
  125. uint64_t port_id,
  126. const char *port_name,
  127. uint32_t port_flags,
  128. uint32_t port_type);
  129. void
  130. jack_controller_patchbay_port_disappeared_callback(
  131. void *server_context,
  132. uint64_t client_id,
  133. void *client_context,
  134. uint64_t port_id,
  135. void *port_context);
  136. void *
  137. jack_controller_patchbay_ports_connected_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
  149. jack_controller_patchbay_ports_disconnected_callback(
  150. void *server_context,
  151. uint64_t client1_id,
  152. void *client1_context,
  153. uint64_t port1_id,
  154. void *port1_context,
  155. uint64_t client2_id,
  156. void *client2_context,
  157. uint64_t port2_id,
  158. void *port2_context,
  159. uint64_t connection_id,
  160. void *connection_context);
  161. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_introspectable;
  162. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_control;
  163. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_configure;
  164. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay;
  165. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_session_manager;
  166. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport;
  167. #endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */