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.

725 lines
19KB

  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 */
  149. /* -*- Mode: C ; c-basic-offset: 4 -*- */
  150. /*
  151. Copyright (C) 2007,2008 Nedko Arnaudov
  152. Copyright (C) 2007-2008 Juuso Alasuutari
  153. This program is free software; you can redistribute it and/or modify
  154. it under the terms of the GNU General Public License as published by
  155. the Free Software Foundation; either version 2 of the License.
  156. This program is distributed in the hope that it will be useful,
  157. but WITHOUT ANY WARRANTY; without even the implied warranty of
  158. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  159. GNU General Public License for more details.
  160. You should have received a copy of the GNU General Public License
  161. along with this program; if not, write to the Free Software
  162. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  163. */
  164. #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED
  165. #define CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED
  166. #include <stdbool.h>
  167. #include "jslist.h"
  168. #include "jack/control.h"
  169. #include "jack/jack.h"
  170. #include "jackdbus.h"
  171. struct jack_controller
  172. {
  173. jackctl_server_t *server;
  174. void *patchbay_context;
  175. bool started;
  176. jack_client_t *client;
  177. unsigned int xruns;
  178. const char **driver_names;
  179. unsigned int drivers_count;
  180. /* current driver, NULL if not driver is selected */
  181. jackctl_driver_t *driver;
  182. struct jack_dbus_object_descriptor dbus_descriptor;
  183. };
  184. #define JACK_CONF_HEADER_TEXT \
  185. "JACK settings, as persisted by D-Bus object.\n" \
  186. "You probably don't want to edit this because\n" \
  187. "it will be overwritten next time jackdbus saves.\n"
  188. jackctl_driver_t *
  189. jack_controller_find_driver(
  190. jackctl_server_t *server,
  191. const char *driver_name);
  192. jackctl_parameter_t *
  193. jack_controller_find_parameter(
  194. const JSList *parameters_list,
  195. const char *parameter_name);
  196. bool
  197. jack_controller_start_server(
  198. struct jack_controller *controller_ptr,
  199. void *dbus_call_context_ptr);
  200. bool
  201. jack_controller_stop_server(
  202. struct jack_controller *controller_ptr,
  203. void *dbus_call_context_ptr);
  204. bool
  205. jack_controller_select_driver(
  206. struct jack_controller *controller_ptr,
  207. const char * driver_name);
  208. void
  209. jack_controller_settings_set_driver_option(
  210. jackctl_driver_t *driver,
  211. const char *option_name,
  212. const char *option_value);
  213. void
  214. jack_controller_settings_set_engine_option(
  215. struct jack_controller *controller_ptr,
  216. const char *option_name,
  217. const char *option_value);
  218. bool
  219. jack_controller_settings_save_engine_options(
  220. void *context,
  221. struct jack_controller *controller_ptr,
  222. void *dbus_call_context_ptr);
  223. bool
  224. jack_controller_settings_write_option(
  225. void *context,
  226. const char *name,
  227. const char *content,
  228. void *dbus_call_context_ptr);
  229. bool
  230. jack_controller_settings_save_driver_options(
  231. void *context,
  232. jackctl_driver_t *driver,
  233. void *dbus_call_context_ptr);
  234. bool
  235. jack_controller_patchbay_init(
  236. struct jack_controller *controller_ptr);
  237. void
  238. jack_controller_patchbay_uninit(
  239. struct jack_controller *controller_ptr);
  240. void *
  241. jack_controller_patchbay_client_appeared_callback(
  242. void * server_context,
  243. uint64_t client_id,
  244. const char *client_name);
  245. void
  246. jack_controller_patchbay_client_disappeared_callback(
  247. void *server_context,
  248. uint64_t client_id,
  249. void *client_context);
  250. void *
  251. jack_controller_patchbay_port_appeared_callback(
  252. void *server_context,
  253. uint64_t client_id,
  254. void *client_context,
  255. uint64_t port_id,
  256. const char *port_name,
  257. uint32_t port_flags,
  258. uint32_t port_type);
  259. void
  260. jack_controller_patchbay_port_disappeared_callback(
  261. void *server_context,
  262. uint64_t client_id,
  263. void *client_context,
  264. uint64_t port_id,
  265. void *port_context);
  266. void *
  267. jack_controller_patchbay_ports_connected_callback(
  268. void *server_context,
  269. uint64_t client1_id,
  270. void *client1_context,
  271. uint64_t port1_id,
  272. void *port1_context,
  273. uint64_t client2_id,
  274. void *client2_context,
  275. uint64_t port2_id,
  276. void *port2_context,
  277. uint64_t connection_id);
  278. void
  279. jack_controller_patchbay_ports_disconnected_callback(
  280. void *server_context,
  281. uint64_t client1_id,
  282. void *client1_context,
  283. uint64_t port1_id,
  284. void *port1_context,
  285. uint64_t client2_id,
  286. void *client2_context,
  287. uint64_t port2_id,
  288. void *port2_context,
  289. uint64_t connection_id,
  290. void *connection_context);
  291. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_introspectable;
  292. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_control;
  293. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_configure;
  294. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay;
  295. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport;
  296. #endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */
  297. /* -*- Mode: C ; c-basic-offset: 4 -*- */
  298. /*
  299. Copyright (C) 2007,2008 Nedko Arnaudov
  300. Copyright (C) 2007-2008 Juuso Alasuutari
  301. This program is free software; you can redistribute it and/or modify
  302. it under the terms of the GNU General Public License as published by
  303. the Free Software Foundation; either version 2 of the License.
  304. This program is distributed in the hope that it will be useful,
  305. but WITHOUT ANY WARRANTY; without even the implied warranty of
  306. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  307. GNU General Public License for more details.
  308. You should have received a copy of the GNU General Public License
  309. along with this program; if not, write to the Free Software
  310. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  311. */
  312. #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED
  313. #define CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED
  314. #include <stdbool.h>
  315. #include "jslist.h"
  316. #include "jack/control.h"
  317. #include "jack/jack.h"
  318. #include "jackdbus.h"
  319. struct jack_controller
  320. {
  321. jackctl_server_t *server;
  322. void *patchbay_context;
  323. bool started;
  324. jack_client_t *client;
  325. unsigned int xruns;
  326. const char **driver_names;
  327. unsigned int drivers_count;
  328. /* current driver, NULL if not driver is selected */
  329. jackctl_driver_t *driver;
  330. struct jack_dbus_object_descriptor dbus_descriptor;
  331. };
  332. #define JACK_CONF_HEADER_TEXT \
  333. "JACK settings, as persisted by D-Bus object.\n" \
  334. "You probably don't want to edit this because\n" \
  335. "it will be overwritten next time jackdbus saves.\n"
  336. jackctl_driver_t *
  337. jack_controller_find_driver(
  338. jackctl_server_t *server,
  339. const char *driver_name);
  340. jackctl_parameter_t *
  341. jack_controller_find_parameter(
  342. const JSList *parameters_list,
  343. const char *parameter_name);
  344. bool
  345. jack_controller_start_server(
  346. struct jack_controller *controller_ptr,
  347. void *dbus_call_context_ptr);
  348. bool
  349. jack_controller_stop_server(
  350. struct jack_controller *controller_ptr,
  351. void *dbus_call_context_ptr);
  352. bool
  353. jack_controller_select_driver(
  354. struct jack_controller *controller_ptr,
  355. const char * driver_name);
  356. void
  357. jack_controller_settings_set_driver_option(
  358. jackctl_driver_t *driver,
  359. const char *option_name,
  360. const char *option_value);
  361. void
  362. jack_controller_settings_set_engine_option(
  363. struct jack_controller *controller_ptr,
  364. const char *option_name,
  365. const char *option_value);
  366. bool
  367. jack_controller_settings_save_engine_options(
  368. void *context,
  369. struct jack_controller *controller_ptr,
  370. void *dbus_call_context_ptr);
  371. bool
  372. jack_controller_settings_write_option(
  373. void *context,
  374. const char *name,
  375. const char *content,
  376. void *dbus_call_context_ptr);
  377. bool
  378. jack_controller_settings_save_driver_options(
  379. void *context,
  380. jackctl_driver_t *driver,
  381. void *dbus_call_context_ptr);
  382. bool
  383. jack_controller_patchbay_init(
  384. struct jack_controller *controller_ptr);
  385. void
  386. jack_controller_patchbay_uninit(
  387. struct jack_controller *controller_ptr);
  388. void *
  389. jack_controller_patchbay_client_appeared_callback(
  390. void * server_context,
  391. uint64_t client_id,
  392. const char *client_name);
  393. void
  394. jack_controller_patchbay_client_disappeared_callback(
  395. void *server_context,
  396. uint64_t client_id,
  397. void *client_context);
  398. void *
  399. jack_controller_patchbay_port_appeared_callback(
  400. void *server_context,
  401. uint64_t client_id,
  402. void *client_context,
  403. uint64_t port_id,
  404. const char *port_name,
  405. uint32_t port_flags,
  406. uint32_t port_type);
  407. void
  408. jack_controller_patchbay_port_disappeared_callback(
  409. void *server_context,
  410. uint64_t client_id,
  411. void *client_context,
  412. uint64_t port_id,
  413. void *port_context);
  414. void *
  415. jack_controller_patchbay_ports_connected_callback(
  416. void *server_context,
  417. uint64_t client1_id,
  418. void *client1_context,
  419. uint64_t port1_id,
  420. void *port1_context,
  421. uint64_t client2_id,
  422. void *client2_context,
  423. uint64_t port2_id,
  424. void *port2_context,
  425. uint64_t connection_id);
  426. void
  427. jack_controller_patchbay_ports_disconnected_callback(
  428. void *server_context,
  429. uint64_t client1_id,
  430. void *client1_context,
  431. uint64_t port1_id,
  432. void *port1_context,
  433. uint64_t client2_id,
  434. void *client2_context,
  435. uint64_t port2_id,
  436. void *port2_context,
  437. uint64_t connection_id,
  438. void *connection_context);
  439. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_introspectable;
  440. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_control;
  441. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_configure;
  442. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay;
  443. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport;
  444. #endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */
  445. /* -*- Mode: C ; c-basic-offset: 4 -*- */
  446. /*
  447. Copyright (C) 2007,2008 Nedko Arnaudov
  448. Copyright (C) 2007-2008 Juuso Alasuutari
  449. This program is free software; you can redistribute it and/or modify
  450. it under the terms of the GNU General Public License as published by
  451. the Free Software Foundation; either version 2 of the License.
  452. This program is distributed in the hope that it will be useful,
  453. but WITHOUT ANY WARRANTY; without even the implied warranty of
  454. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  455. GNU General Public License for more details.
  456. You should have received a copy of the GNU General Public License
  457. along with this program; if not, write to the Free Software
  458. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  459. */
  460. #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED
  461. #define CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED
  462. #include <stdbool.h>
  463. #include "jslist.h"
  464. #include "jack/control.h"
  465. #include "jack/jack.h"
  466. #include "jackdbus.h"
  467. struct jack_controller
  468. {
  469. jackctl_server_t *server;
  470. void *patchbay_context;
  471. bool started;
  472. jack_client_t *client;
  473. unsigned int xruns;
  474. const char **driver_names;
  475. unsigned int drivers_count;
  476. /* current driver, NULL if not driver is selected */
  477. jackctl_driver_t *driver;
  478. struct jack_dbus_object_descriptor dbus_descriptor;
  479. };
  480. #define JACK_CONF_HEADER_TEXT \
  481. "JACK settings, as persisted by D-Bus object.\n" \
  482. "You probably don't want to edit this because\n" \
  483. "it will be overwritten next time jackdbus saves.\n"
  484. jackctl_driver_t *
  485. jack_controller_find_driver(
  486. jackctl_server_t *server,
  487. const char *driver_name);
  488. jackctl_parameter_t *
  489. jack_controller_find_parameter(
  490. const JSList *parameters_list,
  491. const char *parameter_name);
  492. bool
  493. jack_controller_start_server(
  494. struct jack_controller *controller_ptr,
  495. void *dbus_call_context_ptr);
  496. bool
  497. jack_controller_stop_server(
  498. struct jack_controller *controller_ptr,
  499. void *dbus_call_context_ptr);
  500. bool
  501. jack_controller_select_driver(
  502. struct jack_controller *controller_ptr,
  503. const char * driver_name);
  504. void
  505. jack_controller_settings_set_driver_option(
  506. jackctl_driver_t *driver,
  507. const char *option_name,
  508. const char *option_value);
  509. void
  510. jack_controller_settings_set_engine_option(
  511. struct jack_controller *controller_ptr,
  512. const char *option_name,
  513. const char *option_value);
  514. bool
  515. jack_controller_settings_save_engine_options(
  516. void *context,
  517. struct jack_controller *controller_ptr,
  518. void *dbus_call_context_ptr);
  519. bool
  520. jack_controller_settings_write_option(
  521. void *context,
  522. const char *name,
  523. const char *content,
  524. void *dbus_call_context_ptr);
  525. bool
  526. jack_controller_settings_save_driver_options(
  527. void *context,
  528. jackctl_driver_t *driver,
  529. void *dbus_call_context_ptr);
  530. bool
  531. jack_controller_patchbay_init(
  532. struct jack_controller *controller_ptr);
  533. void
  534. jack_controller_patchbay_uninit(
  535. struct jack_controller *controller_ptr);
  536. void *
  537. jack_controller_patchbay_client_appeared_callback(
  538. void * server_context,
  539. uint64_t client_id,
  540. const char *client_name);
  541. void
  542. jack_controller_patchbay_client_disappeared_callback(
  543. void *server_context,
  544. uint64_t client_id,
  545. void *client_context);
  546. void *
  547. jack_controller_patchbay_port_appeared_callback(
  548. void *server_context,
  549. uint64_t client_id,
  550. void *client_context,
  551. uint64_t port_id,
  552. const char *port_name,
  553. uint32_t port_flags,
  554. uint32_t port_type);
  555. void
  556. jack_controller_patchbay_port_disappeared_callback(
  557. void *server_context,
  558. uint64_t client_id,
  559. void *client_context,
  560. uint64_t port_id,
  561. void *port_context);
  562. void *
  563. jack_controller_patchbay_ports_connected_callback(
  564. void *server_context,
  565. uint64_t client1_id,
  566. void *client1_context,
  567. uint64_t port1_id,
  568. void *port1_context,
  569. uint64_t client2_id,
  570. void *client2_context,
  571. uint64_t port2_id,
  572. void *port2_context,
  573. uint64_t connection_id);
  574. void
  575. jack_controller_patchbay_ports_disconnected_callback(
  576. void *server_context,
  577. uint64_t client1_id,
  578. void *client1_context,
  579. uint64_t port1_id,
  580. void *port1_context,
  581. uint64_t client2_id,
  582. void *client2_context,
  583. uint64_t port2_id,
  584. void *port2_context,
  585. uint64_t connection_id,
  586. void *connection_context);
  587. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_introspectable;
  588. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_control;
  589. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_configure;
  590. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay;
  591. extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport;
  592. #endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */