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.

185 lines
4.9KB

  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. /* current driver, NULL if not driver is selected */
  35. jackctl_driver_t *driver;
  36. struct jack_dbus_object_descriptor dbus_descriptor;
  37. };
  38. #define JACK_CONF_HEADER_TEXT \
  39. "JACK settings, as persisted by D-Bus object.\n" \
  40. "You probably don't want to edit this because\n" \
  41. "it will be overwritten next time jackdbus saves.\n"
  42. jackctl_driver_t *
  43. jack_controller_find_driver(
  44. jackctl_server_t *server,
  45. const char *driver_name);
  46. jackctl_parameter_t *
  47. jack_controller_find_parameter(
  48. const JSList *parameters_list,
  49. const char *parameter_name);
  50. bool
  51. jack_controller_start_server(
  52. struct jack_controller *controller_ptr,
  53. void *dbus_call_context_ptr);
  54. bool
  55. jack_controller_stop_server(
  56. struct jack_controller *controller_ptr,
  57. void *dbus_call_context_ptr);
  58. bool
  59. jack_controller_select_driver(
  60. struct jack_controller *controller_ptr,
  61. const char * driver_name);
  62. void
  63. jack_controller_settings_set_driver_option(
  64. jackctl_driver_t *driver,
  65. const char *option_name,
  66. const char *option_value);
  67. void
  68. jack_controller_settings_set_engine_option(
  69. struct jack_controller *controller_ptr,
  70. const char *option_name,
  71. const char *option_value);
  72. bool
  73. jack_controller_settings_save_engine_options(
  74. void *context,
  75. struct jack_controller *controller_ptr,
  76. void *dbus_call_context_ptr);
  77. bool
  78. jack_controller_settings_write_option(
  79. void *context,
  80. const char *name,
  81. const char *content,
  82. void *dbus_call_context_ptr);
  83. bool
  84. jack_controller_settings_save_driver_options(
  85. void *context,
  86. jackctl_driver_t *driver,
  87. void *dbus_call_context_ptr);
  88. bool
  89. jack_controller_patchbay_init(
  90. struct jack_controller *controller_ptr);
  91. void
  92. jack_controller_patchbay_uninit(
  93. struct jack_controller *controller_ptr);
  94. void *
  95. jack_controller_patchbay_client_appeared_callback(
  96. void * server_context,
  97. uint64_t client_id,
  98. const char *client_name);
  99. void
  100. jack_controller_patchbay_client_disappeared_callback(
  101. void *server_context,
  102. uint64_t client_id,
  103. void *client_context);
  104. void *
  105. jack_controller_patchbay_port_appeared_callback(
  106. void *server_context,
  107. uint64_t client_id,
  108. void *client_context,
  109. uint64_t port_id,
  110. const char *port_name,
  111. uint32_t port_flags,
  112. uint32_t port_type);
  113. void
  114. jack_controller_patchbay_port_disappeared_callback(
  115. void *server_context,
  116. uint64_t client_id,
  117. void *client_context,
  118. uint64_t port_id,
  119. void *port_context);
  120. void *
  121. jack_controller_patchbay_ports_connected_callback(
  122. void *server_context,
  123. uint64_t client1_id,
  124. void *client1_context,
  125. uint64_t port1_id,
  126. void *port1_context,
  127. uint64_t client2_id,
  128. void *client2_context,
  129. uint64_t port2_id,
  130. void *port2_context,
  131. uint64_t connection_id);
  132. void
  133. jack_controller_patchbay_ports_disconnected_callback(
  134. void *server_context,
  135. uint64_t client1_id,
  136. void *client1_context,
  137. uint64_t port1_id,
  138. void *port1_context,
  139. uint64_t client2_id,
  140. void *client2_context,
  141. uint64_t port2_id,
  142. void *port2_context,
  143. uint64_t connection_id,
  144. void *connection_context);
  145. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_introspectable;
  146. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_control;
  147. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_configure;
  148. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay;
  149. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport;
  150. #endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */