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.

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