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.

214 lines
5.6KB

  1. /* -*- Mode: C ; c-basic-offset: 4 -*- */
  2. /*
  3. Copyright (C) 2007,2008 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. struct jack_controller
  24. {
  25. jackctl_server_t *server;
  26. void *patchbay_context;
  27. bool started;
  28. jack_client_t *client;
  29. unsigned int xruns;
  30. const char **driver_names;
  31. unsigned int drivers_count;
  32. const char **internal_names;
  33. unsigned int internals_count;
  34. jackctl_driver_t *driver;
  35. bool driver_set; /* whether driver is manually set, if false - DEFAULT_DRIVER is auto set */
  36. struct jack_dbus_object_descriptor dbus_descriptor;
  37. };
  38. #define DEFAULT_DRIVER "dummy"
  39. #define JACK_CONF_HEADER_TEXT \
  40. "JACK settings, as persisted by D-Bus object.\n" \
  41. "You probably don't want to edit this because\n" \
  42. "it will be overwritten next time jackdbus saves.\n"
  43. jackctl_driver_t *
  44. jack_controller_find_driver(
  45. jackctl_server_t *server,
  46. const char *driver_name);
  47. jackctl_internal_t *
  48. jack_controller_find_internal(
  49. jackctl_server_t *server,
  50. const char *internal_name);
  51. jackctl_parameter_t *
  52. jack_controller_find_parameter(
  53. const JSList *parameters_list,
  54. const char *parameter_name);
  55. bool
  56. jack_controller_start_server(
  57. struct jack_controller *controller_ptr,
  58. void *dbus_call_context_ptr);
  59. bool
  60. jack_controller_stop_server(
  61. struct jack_controller *controller_ptr,
  62. void *dbus_call_context_ptr);
  63. bool
  64. jack_controller_select_driver(
  65. struct jack_controller *controller_ptr,
  66. const char * driver_name);
  67. bool
  68. jack_controller_load_internal(
  69. struct jack_controller *controller_ptr,
  70. const char * internal_name);
  71. bool
  72. jack_controller_unload_internal(
  73. struct jack_controller *controller_ptr,
  74. const char * internal_name);
  75. void
  76. jack_controller_settings_set_driver_option(
  77. jackctl_driver_t *driver,
  78. const char *option_name,
  79. const char *option_value);
  80. void
  81. jack_controller_settings_set_internal_option(
  82. jackctl_internal_t *internal,
  83. const char *option_name,
  84. const char *option_value);
  85. void
  86. jack_controller_settings_set_engine_option(
  87. struct jack_controller *controller_ptr,
  88. const char *option_name,
  89. const char *option_value);
  90. bool
  91. jack_controller_settings_save_engine_options(
  92. void *context,
  93. struct jack_controller *controller_ptr,
  94. void *dbus_call_context_ptr);
  95. bool
  96. jack_controller_settings_write_option(
  97. void *context,
  98. const char *name,
  99. const char *content,
  100. void *dbus_call_context_ptr);
  101. bool
  102. jack_controller_settings_save_driver_options(
  103. void *context,
  104. jackctl_driver_t *driver,
  105. void *dbus_call_context_ptr);
  106. bool
  107. jack_controller_settings_save_internal_options(
  108. void *context,
  109. jackctl_internal_t *internal,
  110. void *dbus_call_context_ptr);
  111. bool
  112. jack_controller_patchbay_init(
  113. struct jack_controller *controller_ptr);
  114. void
  115. jack_controller_patchbay_uninit(
  116. struct jack_controller *controller_ptr);
  117. void *
  118. jack_controller_patchbay_client_appeared_callback(
  119. void * server_context,
  120. uint64_t client_id,
  121. const char *client_name);
  122. void
  123. jack_controller_patchbay_client_disappeared_callback(
  124. void *server_context,
  125. uint64_t client_id,
  126. void *client_context);
  127. void *
  128. jack_controller_patchbay_port_appeared_callback(
  129. void *server_context,
  130. uint64_t client_id,
  131. void *client_context,
  132. uint64_t port_id,
  133. const char *port_name,
  134. uint32_t port_flags,
  135. uint32_t port_type);
  136. void
  137. jack_controller_patchbay_port_disappeared_callback(
  138. void *server_context,
  139. uint64_t client_id,
  140. void *client_context,
  141. uint64_t port_id,
  142. void *port_context);
  143. void *
  144. jack_controller_patchbay_ports_connected_callback(
  145. void *server_context,
  146. uint64_t client1_id,
  147. void *client1_context,
  148. uint64_t port1_id,
  149. void *port1_context,
  150. uint64_t client2_id,
  151. void *client2_context,
  152. uint64_t port2_id,
  153. void *port2_context,
  154. uint64_t connection_id);
  155. void
  156. jack_controller_patchbay_ports_disconnected_callback(
  157. void *server_context,
  158. uint64_t client1_id,
  159. void *client1_context,
  160. uint64_t port1_id,
  161. void *port1_context,
  162. uint64_t client2_id,
  163. void *client2_context,
  164. uint64_t port2_id,
  165. void *port2_context,
  166. uint64_t connection_id,
  167. void *connection_context);
  168. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_introspectable;
  169. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_control;
  170. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_configure;
  171. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay;
  172. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport;
  173. #endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */