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.

210 lines
5.6KB

  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. long pending_save; /* uptime seconds */
  58. };
  59. #define DEFAULT_DRIVER "dummy"
  60. #define JACK_CONF_HEADER_TEXT \
  61. "JACK settings, as persisted by D-Bus object.\n" \
  62. "You probably don't want to edit this because\n" \
  63. "it will be overwritten next time jackdbus saves.\n"
  64. void
  65. jack_controller_pending_save(
  66. struct jack_controller *controller_ptr);
  67. bool
  68. jack_controller_start_server(
  69. struct jack_controller *controller_ptr,
  70. void *dbus_call_context_ptr);
  71. bool
  72. jack_controller_stop_server(
  73. struct jack_controller *controller_ptr,
  74. void *dbus_call_context_ptr);
  75. bool
  76. jack_controller_switch_master(
  77. struct jack_controller *controller_ptr,
  78. void *dbus_call_context_ptr);
  79. bool
  80. jack_controller_add_slave_driver(
  81. struct jack_controller *controller_ptr,
  82. const char * driver_name);
  83. bool
  84. jack_controller_remove_slave_driver(
  85. struct jack_controller *controller_ptr,
  86. const char * driver_name);
  87. bool
  88. jack_controller_select_driver(
  89. struct jack_controller *controller_ptr,
  90. const char * driver_name);
  91. bool
  92. jack_controller_load_internal(
  93. struct jack_controller *controller_ptr,
  94. const char * internal_name);
  95. bool
  96. jack_controller_unload_internal(
  97. struct jack_controller *controller_ptr,
  98. const char * internal_name);
  99. void
  100. jack_controller_deserialize_parameter_value(
  101. struct jack_controller *controller_ptr,
  102. const char * const * address,
  103. const char * value);
  104. void
  105. jack_controller_serialize_parameter_value(
  106. const struct jack_parameter * param_ptr,
  107. char * value_buffer);
  108. bool
  109. jack_controller_patchbay_init(
  110. struct jack_controller *controller_ptr);
  111. void
  112. jack_controller_patchbay_uninit(
  113. struct jack_controller *controller_ptr);
  114. void *
  115. jack_controller_patchbay_client_appeared_callback(
  116. void * server_context,
  117. uint64_t client_id,
  118. const char *client_name);
  119. void
  120. jack_controller_patchbay_client_disappeared_callback(
  121. void *server_context,
  122. uint64_t client_id,
  123. void *client_context);
  124. void *
  125. jack_controller_patchbay_port_appeared_callback(
  126. void *server_context,
  127. uint64_t client_id,
  128. void *client_context,
  129. uint64_t port_id,
  130. const char *port_name,
  131. uint32_t port_flags,
  132. uint32_t port_type);
  133. void
  134. jack_controller_patchbay_port_disappeared_callback(
  135. void *server_context,
  136. uint64_t client_id,
  137. void *client_context,
  138. uint64_t port_id,
  139. void *port_context);
  140. void *
  141. jack_controller_patchbay_ports_connected_callback(
  142. void *server_context,
  143. uint64_t client1_id,
  144. void *client1_context,
  145. uint64_t port1_id,
  146. void *port1_context,
  147. uint64_t client2_id,
  148. void *client2_context,
  149. uint64_t port2_id,
  150. void *port2_context,
  151. uint64_t connection_id);
  152. void
  153. jack_controller_patchbay_ports_disconnected_callback(
  154. void *server_context,
  155. uint64_t client1_id,
  156. void *client1_context,
  157. uint64_t port1_id,
  158. void *port1_context,
  159. uint64_t client2_id,
  160. void *client2_context,
  161. uint64_t port2_id,
  162. void *port2_context,
  163. uint64_t connection_id,
  164. void *connection_context);
  165. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_introspectable;
  166. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_control;
  167. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_configure;
  168. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay;
  169. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_session_manager;
  170. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport;
  171. #endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */