git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2365 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.90
@@ -29,96 +29,3 @@ jack_controller_destroy( | |||||
void *controller_ptr); | void *controller_ptr); | ||||
#endif /* #ifndef CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED */ | #endif /* #ifndef CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED */ | ||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007 Nedko Arnaudov | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED | |||||
#define CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED | |||||
void * | |||||
jack_controller_create( | |||||
DBusConnection *connection); | |||||
void | |||||
jack_controller_destroy( | |||||
void *controller_ptr); | |||||
#endif /* #ifndef CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED */ | |||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007 Nedko Arnaudov | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED | |||||
#define CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED | |||||
void * | |||||
jack_controller_create( | |||||
DBusConnection *connection); | |||||
void | |||||
jack_controller_destroy( | |||||
void *controller_ptr); | |||||
#endif /* #ifndef CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED */ | |||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007 Nedko Arnaudov | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED | |||||
#define CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED | |||||
void * | |||||
jack_controller_create( | |||||
DBusConnection *connection); | |||||
void | |||||
jack_controller_destroy( | |||||
void *controller_ptr); | |||||
#endif /* #ifndef CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED */ |
@@ -179,546 +179,3 @@ extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport; | extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport; | ||||
#endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */ | #endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */ | ||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007,2008 Nedko Arnaudov | |||||
Copyright (C) 2007-2008 Juuso Alasuutari | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED | |||||
#define CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED | |||||
#include <stdbool.h> | |||||
#include "jslist.h" | |||||
#include "jack/control.h" | |||||
#include "jack/jack.h" | |||||
#include "jackdbus.h" | |||||
struct jack_controller | |||||
{ | |||||
jackctl_server_t *server; | |||||
void *patchbay_context; | |||||
bool started; | |||||
jack_client_t *client; | |||||
unsigned int xruns; | |||||
const char **driver_names; | |||||
unsigned int drivers_count; | |||||
/* current driver, NULL if not driver is selected */ | |||||
jackctl_driver_t *driver; | |||||
struct jack_dbus_object_descriptor dbus_descriptor; | |||||
}; | |||||
#define JACK_CONF_HEADER_TEXT \ | |||||
"JACK settings, as persisted by D-Bus object.\n" \ | |||||
"You probably don't want to edit this because\n" \ | |||||
"it will be overwritten next time jackdbus saves.\n" | |||||
jackctl_driver_t * | |||||
jack_controller_find_driver( | |||||
jackctl_server_t *server, | |||||
const char *driver_name); | |||||
jackctl_parameter_t * | |||||
jack_controller_find_parameter( | |||||
const JSList *parameters_list, | |||||
const char *parameter_name); | |||||
bool | |||||
jack_controller_start_server( | |||||
struct jack_controller *controller_ptr, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_stop_server( | |||||
struct jack_controller *controller_ptr, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_select_driver( | |||||
struct jack_controller *controller_ptr, | |||||
const char * driver_name); | |||||
void | |||||
jack_controller_settings_set_driver_option( | |||||
jackctl_driver_t *driver, | |||||
const char *option_name, | |||||
const char *option_value); | |||||
void | |||||
jack_controller_settings_set_engine_option( | |||||
struct jack_controller *controller_ptr, | |||||
const char *option_name, | |||||
const char *option_value); | |||||
bool | |||||
jack_controller_settings_save_engine_options( | |||||
void *context, | |||||
struct jack_controller *controller_ptr, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_settings_write_option( | |||||
void *context, | |||||
const char *name, | |||||
const char *content, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_settings_save_driver_options( | |||||
void *context, | |||||
jackctl_driver_t *driver, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_patchbay_init( | |||||
struct jack_controller *controller_ptr); | |||||
void | |||||
jack_controller_patchbay_uninit( | |||||
struct jack_controller *controller_ptr); | |||||
void * | |||||
jack_controller_patchbay_client_appeared_callback( | |||||
void * server_context, | |||||
uint64_t client_id, | |||||
const char *client_name); | |||||
void | |||||
jack_controller_patchbay_client_disappeared_callback( | |||||
void *server_context, | |||||
uint64_t client_id, | |||||
void *client_context); | |||||
void * | |||||
jack_controller_patchbay_port_appeared_callback( | |||||
void *server_context, | |||||
uint64_t client_id, | |||||
void *client_context, | |||||
uint64_t port_id, | |||||
const char *port_name, | |||||
uint32_t port_flags, | |||||
uint32_t port_type); | |||||
void | |||||
jack_controller_patchbay_port_disappeared_callback( | |||||
void *server_context, | |||||
uint64_t client_id, | |||||
void *client_context, | |||||
uint64_t port_id, | |||||
void *port_context); | |||||
void * | |||||
jack_controller_patchbay_ports_connected_callback( | |||||
void *server_context, | |||||
uint64_t client1_id, | |||||
void *client1_context, | |||||
uint64_t port1_id, | |||||
void *port1_context, | |||||
uint64_t client2_id, | |||||
void *client2_context, | |||||
uint64_t port2_id, | |||||
void *port2_context, | |||||
uint64_t connection_id); | |||||
void | |||||
jack_controller_patchbay_ports_disconnected_callback( | |||||
void *server_context, | |||||
uint64_t client1_id, | |||||
void *client1_context, | |||||
uint64_t port1_id, | |||||
void *port1_context, | |||||
uint64_t client2_id, | |||||
void *client2_context, | |||||
uint64_t port2_id, | |||||
void *port2_context, | |||||
uint64_t connection_id, | |||||
void *connection_context); | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_introspectable; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_control; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_configure; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport; | |||||
#endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */ | |||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007,2008 Nedko Arnaudov | |||||
Copyright (C) 2007-2008 Juuso Alasuutari | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED | |||||
#define CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED | |||||
#include <stdbool.h> | |||||
#include "jslist.h" | |||||
#include "jack/control.h" | |||||
#include "jack/jack.h" | |||||
#include "jackdbus.h" | |||||
struct jack_controller | |||||
{ | |||||
jackctl_server_t *server; | |||||
void *patchbay_context; | |||||
bool started; | |||||
jack_client_t *client; | |||||
unsigned int xruns; | |||||
const char **driver_names; | |||||
unsigned int drivers_count; | |||||
/* current driver, NULL if not driver is selected */ | |||||
jackctl_driver_t *driver; | |||||
struct jack_dbus_object_descriptor dbus_descriptor; | |||||
}; | |||||
#define JACK_CONF_HEADER_TEXT \ | |||||
"JACK settings, as persisted by D-Bus object.\n" \ | |||||
"You probably don't want to edit this because\n" \ | |||||
"it will be overwritten next time jackdbus saves.\n" | |||||
jackctl_driver_t * | |||||
jack_controller_find_driver( | |||||
jackctl_server_t *server, | |||||
const char *driver_name); | |||||
jackctl_parameter_t * | |||||
jack_controller_find_parameter( | |||||
const JSList *parameters_list, | |||||
const char *parameter_name); | |||||
bool | |||||
jack_controller_start_server( | |||||
struct jack_controller *controller_ptr, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_stop_server( | |||||
struct jack_controller *controller_ptr, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_select_driver( | |||||
struct jack_controller *controller_ptr, | |||||
const char * driver_name); | |||||
void | |||||
jack_controller_settings_set_driver_option( | |||||
jackctl_driver_t *driver, | |||||
const char *option_name, | |||||
const char *option_value); | |||||
void | |||||
jack_controller_settings_set_engine_option( | |||||
struct jack_controller *controller_ptr, | |||||
const char *option_name, | |||||
const char *option_value); | |||||
bool | |||||
jack_controller_settings_save_engine_options( | |||||
void *context, | |||||
struct jack_controller *controller_ptr, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_settings_write_option( | |||||
void *context, | |||||
const char *name, | |||||
const char *content, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_settings_save_driver_options( | |||||
void *context, | |||||
jackctl_driver_t *driver, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_patchbay_init( | |||||
struct jack_controller *controller_ptr); | |||||
void | |||||
jack_controller_patchbay_uninit( | |||||
struct jack_controller *controller_ptr); | |||||
void * | |||||
jack_controller_patchbay_client_appeared_callback( | |||||
void * server_context, | |||||
uint64_t client_id, | |||||
const char *client_name); | |||||
void | |||||
jack_controller_patchbay_client_disappeared_callback( | |||||
void *server_context, | |||||
uint64_t client_id, | |||||
void *client_context); | |||||
void * | |||||
jack_controller_patchbay_port_appeared_callback( | |||||
void *server_context, | |||||
uint64_t client_id, | |||||
void *client_context, | |||||
uint64_t port_id, | |||||
const char *port_name, | |||||
uint32_t port_flags, | |||||
uint32_t port_type); | |||||
void | |||||
jack_controller_patchbay_port_disappeared_callback( | |||||
void *server_context, | |||||
uint64_t client_id, | |||||
void *client_context, | |||||
uint64_t port_id, | |||||
void *port_context); | |||||
void * | |||||
jack_controller_patchbay_ports_connected_callback( | |||||
void *server_context, | |||||
uint64_t client1_id, | |||||
void *client1_context, | |||||
uint64_t port1_id, | |||||
void *port1_context, | |||||
uint64_t client2_id, | |||||
void *client2_context, | |||||
uint64_t port2_id, | |||||
void *port2_context, | |||||
uint64_t connection_id); | |||||
void | |||||
jack_controller_patchbay_ports_disconnected_callback( | |||||
void *server_context, | |||||
uint64_t client1_id, | |||||
void *client1_context, | |||||
uint64_t port1_id, | |||||
void *port1_context, | |||||
uint64_t client2_id, | |||||
void *client2_context, | |||||
uint64_t port2_id, | |||||
void *port2_context, | |||||
uint64_t connection_id, | |||||
void *connection_context); | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_introspectable; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_control; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_configure; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport; | |||||
#endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */ | |||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007,2008 Nedko Arnaudov | |||||
Copyright (C) 2007-2008 Juuso Alasuutari | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED | |||||
#define CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED | |||||
#include <stdbool.h> | |||||
#include "jslist.h" | |||||
#include "jack/control.h" | |||||
#include "jack/jack.h" | |||||
#include "jackdbus.h" | |||||
struct jack_controller | |||||
{ | |||||
jackctl_server_t *server; | |||||
void *patchbay_context; | |||||
bool started; | |||||
jack_client_t *client; | |||||
unsigned int xruns; | |||||
const char **driver_names; | |||||
unsigned int drivers_count; | |||||
/* current driver, NULL if not driver is selected */ | |||||
jackctl_driver_t *driver; | |||||
struct jack_dbus_object_descriptor dbus_descriptor; | |||||
}; | |||||
#define JACK_CONF_HEADER_TEXT \ | |||||
"JACK settings, as persisted by D-Bus object.\n" \ | |||||
"You probably don't want to edit this because\n" \ | |||||
"it will be overwritten next time jackdbus saves.\n" | |||||
jackctl_driver_t * | |||||
jack_controller_find_driver( | |||||
jackctl_server_t *server, | |||||
const char *driver_name); | |||||
jackctl_parameter_t * | |||||
jack_controller_find_parameter( | |||||
const JSList *parameters_list, | |||||
const char *parameter_name); | |||||
bool | |||||
jack_controller_start_server( | |||||
struct jack_controller *controller_ptr, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_stop_server( | |||||
struct jack_controller *controller_ptr, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_select_driver( | |||||
struct jack_controller *controller_ptr, | |||||
const char * driver_name); | |||||
void | |||||
jack_controller_settings_set_driver_option( | |||||
jackctl_driver_t *driver, | |||||
const char *option_name, | |||||
const char *option_value); | |||||
void | |||||
jack_controller_settings_set_engine_option( | |||||
struct jack_controller *controller_ptr, | |||||
const char *option_name, | |||||
const char *option_value); | |||||
bool | |||||
jack_controller_settings_save_engine_options( | |||||
void *context, | |||||
struct jack_controller *controller_ptr, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_settings_write_option( | |||||
void *context, | |||||
const char *name, | |||||
const char *content, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_settings_save_driver_options( | |||||
void *context, | |||||
jackctl_driver_t *driver, | |||||
void *dbus_call_context_ptr); | |||||
bool | |||||
jack_controller_patchbay_init( | |||||
struct jack_controller *controller_ptr); | |||||
void | |||||
jack_controller_patchbay_uninit( | |||||
struct jack_controller *controller_ptr); | |||||
void * | |||||
jack_controller_patchbay_client_appeared_callback( | |||||
void * server_context, | |||||
uint64_t client_id, | |||||
const char *client_name); | |||||
void | |||||
jack_controller_patchbay_client_disappeared_callback( | |||||
void *server_context, | |||||
uint64_t client_id, | |||||
void *client_context); | |||||
void * | |||||
jack_controller_patchbay_port_appeared_callback( | |||||
void *server_context, | |||||
uint64_t client_id, | |||||
void *client_context, | |||||
uint64_t port_id, | |||||
const char *port_name, | |||||
uint32_t port_flags, | |||||
uint32_t port_type); | |||||
void | |||||
jack_controller_patchbay_port_disappeared_callback( | |||||
void *server_context, | |||||
uint64_t client_id, | |||||
void *client_context, | |||||
uint64_t port_id, | |||||
void *port_context); | |||||
void * | |||||
jack_controller_patchbay_ports_connected_callback( | |||||
void *server_context, | |||||
uint64_t client1_id, | |||||
void *client1_context, | |||||
uint64_t port1_id, | |||||
void *port1_context, | |||||
uint64_t client2_id, | |||||
void *client2_context, | |||||
uint64_t port2_id, | |||||
void *port2_context, | |||||
uint64_t connection_id); | |||||
void | |||||
jack_controller_patchbay_ports_disconnected_callback( | |||||
void *server_context, | |||||
uint64_t client1_id, | |||||
void *client1_context, | |||||
uint64_t port1_id, | |||||
void *port1_context, | |||||
uint64_t client2_id, | |||||
void *client2_context, | |||||
uint64_t port2_id, | |||||
void *port2_context, | |||||
uint64_t connection_id, | |||||
void *connection_context); | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_introspectable; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_control; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_configure; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay; | |||||
extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport; | |||||
#endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */ |
@@ -281,852 +281,3 @@ jack_dbus_send_signal( | |||||
extern struct jack_dbus_interface_descriptor * g_jackcontroller_interfaces[]; | extern struct jack_dbus_interface_descriptor * g_jackcontroller_interfaces[]; | ||||
#endif /* #ifndef DBUS_H__3DB2458F_44B2_43EA_882A_9F888DF71A88__INCLUDED */ | #endif /* #ifndef DBUS_H__3DB2458F_44B2_43EA_882A_9F888DF71A88__INCLUDED */ | ||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007,2008 Nedko Arnaudov | |||||
Copyright (C) 2007-2008 Juuso Alasuutari | |||||
Copyright (C) 2008 Marc-Olivier Barre | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef DBUS_H__3DB2458F_44B2_43EA_882A_9F888DF71A88__INCLUDED | |||||
#define DBUS_H__3DB2458F_44B2_43EA_882A_9F888DF71A88__INCLUDED | |||||
#include <stdbool.h> | |||||
#define JACK_DBUS_DEBUG | |||||
//#define DISABLE_SIGNAL_MAGIC | |||||
#define DEFAULT_XDG_CONFIG "/.config" | |||||
#define DEFAULT_XDG_LOG "/.log" | |||||
#define JACKDBUS_DIR "/jack" | |||||
#define JACKDBUS_LOG "/jackdbus.log" | |||||
#define JACKDBUS_CONF "/conf.xml" | |||||
extern char *g_jackdbus_config_dir; | |||||
extern size_t g_jackdbus_config_dir_len; /* without terminating '\0' char */ | |||||
extern int g_exit_command; | |||||
bool | |||||
jack_controller_settings_init(); | |||||
void | |||||
jack_controller_settings_uninit(); | |||||
#define JACK_DBUS_ERROR_UNKNOWN_METHOD "org.jackaudio.Error.UnknownMethod" | |||||
#define JACK_DBUS_ERROR_SERVER_NOT_RUNNING "org.jackaudio.Error.ServerNotRunning" | |||||
#define JACK_DBUS_ERROR_UNKNOWN_DRIVER "org.jackaudio.Error.UnknownDriver" | |||||
#define JACK_DBUS_ERROR_NEED_DRIVER "org.jackaudio.Error.NeedDriver" | |||||
#define JACK_DBUS_ERROR_UNKNOWN_DRIVER_PARAMETER "org.jackaudio.Error.UnknownDriverParameter" | |||||
#define JACK_DBUS_ERROR_UNKNOWN_ENGINE_PARAMETER "org.jackaudio.Error.UnknownEngineParameter" | |||||
#define JACK_DBUS_ERROR_INVALID_ARGS "org.jackaudio.Error.InvalidArgs" | |||||
#define JACK_DBUS_ERROR_GENERIC "org.jackaudio.Error.Generic" | |||||
#define JACK_DBUS_ERROR_FATAL "org.jackaudio.Error.Fatal" | |||||
struct jack_dbus_method_call | |||||
{ | |||||
void *context; | |||||
DBusConnection *connection; | |||||
const char *method_name; | |||||
DBusMessage *message; | |||||
DBusMessage *reply; | |||||
}; | |||||
struct jack_dbus_interface_method_argument_descriptor | |||||
{ | |||||
const char * name; | |||||
const char * type; | |||||
bool direction_out; /* true - out, false - in */ | |||||
}; | |||||
struct jack_dbus_interface_method_descriptor | |||||
{ | |||||
const char * name; | |||||
const struct jack_dbus_interface_method_argument_descriptor * arguments; | |||||
void (* handler)(struct jack_dbus_method_call * call); | |||||
}; | |||||
struct jack_dbus_interface_signal_argument_descriptor | |||||
{ | |||||
const char * name; | |||||
const char * type; | |||||
}; | |||||
struct jack_dbus_interface_signal_descriptor | |||||
{ | |||||
const char * name; | |||||
const struct jack_dbus_interface_signal_argument_descriptor * arguments; | |||||
}; | |||||
struct jack_dbus_interface_descriptor | |||||
{ | |||||
const char * name; | |||||
bool | |||||
(* handler)( | |||||
struct jack_dbus_method_call * call, | |||||
const struct jack_dbus_interface_method_descriptor * methods); | |||||
const struct jack_dbus_interface_method_descriptor * methods; | |||||
const struct jack_dbus_interface_signal_descriptor * signals; | |||||
}; | |||||
struct jack_dbus_object_descriptor | |||||
{ | |||||
struct jack_dbus_interface_descriptor ** interfaces; | |||||
void * context; | |||||
}; | |||||
typedef union | |||||
{ | |||||
unsigned char byte; | |||||
dbus_bool_t boolean; | |||||
dbus_int16_t int16; | |||||
dbus_uint16_t uint16; | |||||
dbus_int32_t int32; | |||||
dbus_uint32_t uint32; | |||||
dbus_int64_t int64; | |||||
dbus_uint64_t uint64; | |||||
double doubl; | |||||
const char *string; | |||||
} message_arg_t; | |||||
#define JACK_DBUS_METHOD_ARGUMENTS_BEGIN(method_name) \ | |||||
static const \ | |||||
struct jack_dbus_interface_method_argument_descriptor method_name ## _arguments[] = \ | |||||
{ | |||||
#define JACK_DBUS_METHOD_ARGUMENT(argument_name, argument_type, argument_direction_out) \ | |||||
{ \ | |||||
.name = argument_name, \ | |||||
.type = argument_type, \ | |||||
.direction_out = argument_direction_out \ | |||||
}, | |||||
#define JACK_DBUS_METHOD_ARGUMENTS_END \ | |||||
JACK_DBUS_METHOD_ARGUMENT(NULL, NULL, false) \ | |||||
}; | |||||
#define JACK_DBUS_METHODS_BEGIN \ | |||||
static const \ | |||||
struct jack_dbus_interface_method_descriptor methods_dtor[] = \ | |||||
{ | |||||
#define JACK_DBUS_METHOD_DESCRIBE(method_name, handler_name) \ | |||||
{ \ | |||||
.name = # method_name, \ | |||||
.arguments = method_name ## _arguments, \ | |||||
.handler = handler_name \ | |||||
}, | |||||
#define JACK_DBUS_METHODS_END \ | |||||
{ \ | |||||
.name = NULL, \ | |||||
.arguments = NULL, \ | |||||
.handler = NULL \ | |||||
} \ | |||||
}; | |||||
#define JACK_DBUS_SIGNAL_ARGUMENTS_BEGIN(signal_name) \ | |||||
static const \ | |||||
struct jack_dbus_interface_signal_argument_descriptor signal_name ## _arguments[] = \ | |||||
{ | |||||
#define JACK_DBUS_SIGNAL_ARGUMENT(argument_name, argument_type) \ | |||||
{ \ | |||||
.name = argument_name, \ | |||||
.type = argument_type \ | |||||
}, | |||||
#define JACK_DBUS_SIGNAL_ARGUMENTS_END \ | |||||
JACK_DBUS_SIGNAL_ARGUMENT(NULL, NULL) \ | |||||
}; | |||||
#define JACK_DBUS_SIGNALS_BEGIN \ | |||||
static const \ | |||||
struct jack_dbus_interface_signal_descriptor signals_dtor[] = \ | |||||
{ | |||||
#define JACK_DBUS_SIGNAL_DESCRIBE(signal_name) \ | |||||
{ \ | |||||
.name = # signal_name, \ | |||||
.arguments = signal_name ## _arguments \ | |||||
}, | |||||
#define JACK_DBUS_SIGNALS_END \ | |||||
{ \ | |||||
.name = NULL, \ | |||||
.arguments = NULL, \ | |||||
} \ | |||||
}; | |||||
#define JACK_DBUS_IFACE_BEGIN(iface_var, iface_name) \ | |||||
struct jack_dbus_interface_descriptor iface_var = \ | |||||
{ \ | |||||
.name = iface_name, \ | |||||
.handler = jack_dbus_run_method, | |||||
#define JACK_DBUS_IFACE_HANDLER(handler_func) \ | |||||
.handler = handler_func, | |||||
#define JACK_DBUS_IFACE_EXPOSE_METHODS \ | |||||
.methods = methods_dtor, | |||||
#define JACK_DBUS_IFACE_EXPOSE_SIGNALS \ | |||||
.signals = signals_dtor, | |||||
#define JACK_DBUS_IFACE_END \ | |||||
}; | |||||
DBusHandlerResult | |||||
jack_dbus_message_handler( | |||||
DBusConnection *connection, | |||||
DBusMessage *message, | |||||
void *data); | |||||
void | |||||
jack_dbus_message_handler_unregister( | |||||
DBusConnection *connection, | |||||
void *data); | |||||
bool | |||||
jack_dbus_run_method( | |||||
struct jack_dbus_method_call * call, | |||||
const struct jack_dbus_interface_method_descriptor * methods); | |||||
void | |||||
jack_dbus_error( | |||||
void *dbus_call_context_ptr, | |||||
const char *error_name, | |||||
const char *format, | |||||
...); | |||||
bool | |||||
jack_dbus_get_method_args( | |||||
struct jack_dbus_method_call *call, | |||||
int type, | |||||
...); | |||||
bool | |||||
jack_dbus_get_method_args_string_and_variant( | |||||
struct jack_dbus_method_call *call, | |||||
const char **arg1, | |||||
message_arg_t *arg2, | |||||
int *type_ptr); | |||||
bool | |||||
jack_dbus_message_append_variant( | |||||
DBusMessageIter *iter, | |||||
int type, | |||||
const char *signature, | |||||
message_arg_t *arg); | |||||
void | |||||
jack_dbus_construct_method_return_empty( | |||||
struct jack_dbus_method_call * call); | |||||
void | |||||
jack_dbus_construct_method_return_single( | |||||
struct jack_dbus_method_call *call, | |||||
int type, | |||||
message_arg_t arg); | |||||
void | |||||
jack_dbus_construct_method_return_array_of_strings( | |||||
struct jack_dbus_method_call *call, | |||||
unsigned int num_members, | |||||
const char **array); | |||||
void | |||||
jack_dbus_send_signal( | |||||
const char *sender_object_path, | |||||
const char *iface, | |||||
const char *signal_name, | |||||
int first_arg_type, | |||||
...); | |||||
#define JACK_CONTROLLER_OBJECT_PATH "/org/jackaudio/Controller" | |||||
extern struct jack_dbus_interface_descriptor * g_jackcontroller_interfaces[]; | |||||
#endif /* #ifndef DBUS_H__3DB2458F_44B2_43EA_882A_9F888DF71A88__INCLUDED */ | |||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007,2008 Nedko Arnaudov | |||||
Copyright (C) 2007-2008 Juuso Alasuutari | |||||
Copyright (C) 2008 Marc-Olivier Barre | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef DBUS_H__3DB2458F_44B2_43EA_882A_9F888DF71A88__INCLUDED | |||||
#define DBUS_H__3DB2458F_44B2_43EA_882A_9F888DF71A88__INCLUDED | |||||
#include <stdbool.h> | |||||
#define JACK_DBUS_DEBUG | |||||
//#define DISABLE_SIGNAL_MAGIC | |||||
#define DEFAULT_XDG_CONFIG "/.config" | |||||
#define DEFAULT_XDG_LOG "/.log" | |||||
#define JACKDBUS_DIR "/jack" | |||||
#define JACKDBUS_LOG "/jackdbus.log" | |||||
#define JACKDBUS_CONF "/conf.xml" | |||||
extern char *g_jackdbus_config_dir; | |||||
extern size_t g_jackdbus_config_dir_len; /* without terminating '\0' char */ | |||||
extern int g_exit_command; | |||||
bool | |||||
jack_controller_settings_init(); | |||||
void | |||||
jack_controller_settings_uninit(); | |||||
#define JACK_DBUS_ERROR_UNKNOWN_METHOD "org.jackaudio.Error.UnknownMethod" | |||||
#define JACK_DBUS_ERROR_SERVER_NOT_RUNNING "org.jackaudio.Error.ServerNotRunning" | |||||
#define JACK_DBUS_ERROR_UNKNOWN_DRIVER "org.jackaudio.Error.UnknownDriver" | |||||
#define JACK_DBUS_ERROR_NEED_DRIVER "org.jackaudio.Error.NeedDriver" | |||||
#define JACK_DBUS_ERROR_UNKNOWN_DRIVER_PARAMETER "org.jackaudio.Error.UnknownDriverParameter" | |||||
#define JACK_DBUS_ERROR_UNKNOWN_ENGINE_PARAMETER "org.jackaudio.Error.UnknownEngineParameter" | |||||
#define JACK_DBUS_ERROR_INVALID_ARGS "org.jackaudio.Error.InvalidArgs" | |||||
#define JACK_DBUS_ERROR_GENERIC "org.jackaudio.Error.Generic" | |||||
#define JACK_DBUS_ERROR_FATAL "org.jackaudio.Error.Fatal" | |||||
struct jack_dbus_method_call | |||||
{ | |||||
void *context; | |||||
DBusConnection *connection; | |||||
const char *method_name; | |||||
DBusMessage *message; | |||||
DBusMessage *reply; | |||||
}; | |||||
struct jack_dbus_interface_method_argument_descriptor | |||||
{ | |||||
const char * name; | |||||
const char * type; | |||||
bool direction_out; /* true - out, false - in */ | |||||
}; | |||||
struct jack_dbus_interface_method_descriptor | |||||
{ | |||||
const char * name; | |||||
const struct jack_dbus_interface_method_argument_descriptor * arguments; | |||||
void (* handler)(struct jack_dbus_method_call * call); | |||||
}; | |||||
struct jack_dbus_interface_signal_argument_descriptor | |||||
{ | |||||
const char * name; | |||||
const char * type; | |||||
}; | |||||
struct jack_dbus_interface_signal_descriptor | |||||
{ | |||||
const char * name; | |||||
const struct jack_dbus_interface_signal_argument_descriptor * arguments; | |||||
}; | |||||
struct jack_dbus_interface_descriptor | |||||
{ | |||||
const char * name; | |||||
bool | |||||
(* handler)( | |||||
struct jack_dbus_method_call * call, | |||||
const struct jack_dbus_interface_method_descriptor * methods); | |||||
const struct jack_dbus_interface_method_descriptor * methods; | |||||
const struct jack_dbus_interface_signal_descriptor * signals; | |||||
}; | |||||
struct jack_dbus_object_descriptor | |||||
{ | |||||
struct jack_dbus_interface_descriptor ** interfaces; | |||||
void * context; | |||||
}; | |||||
typedef union | |||||
{ | |||||
unsigned char byte; | |||||
dbus_bool_t boolean; | |||||
dbus_int16_t int16; | |||||
dbus_uint16_t uint16; | |||||
dbus_int32_t int32; | |||||
dbus_uint32_t uint32; | |||||
dbus_int64_t int64; | |||||
dbus_uint64_t uint64; | |||||
double doubl; | |||||
const char *string; | |||||
} message_arg_t; | |||||
#define JACK_DBUS_METHOD_ARGUMENTS_BEGIN(method_name) \ | |||||
static const \ | |||||
struct jack_dbus_interface_method_argument_descriptor method_name ## _arguments[] = \ | |||||
{ | |||||
#define JACK_DBUS_METHOD_ARGUMENT(argument_name, argument_type, argument_direction_out) \ | |||||
{ \ | |||||
.name = argument_name, \ | |||||
.type = argument_type, \ | |||||
.direction_out = argument_direction_out \ | |||||
}, | |||||
#define JACK_DBUS_METHOD_ARGUMENTS_END \ | |||||
JACK_DBUS_METHOD_ARGUMENT(NULL, NULL, false) \ | |||||
}; | |||||
#define JACK_DBUS_METHODS_BEGIN \ | |||||
static const \ | |||||
struct jack_dbus_interface_method_descriptor methods_dtor[] = \ | |||||
{ | |||||
#define JACK_DBUS_METHOD_DESCRIBE(method_name, handler_name) \ | |||||
{ \ | |||||
.name = # method_name, \ | |||||
.arguments = method_name ## _arguments, \ | |||||
.handler = handler_name \ | |||||
}, | |||||
#define JACK_DBUS_METHODS_END \ | |||||
{ \ | |||||
.name = NULL, \ | |||||
.arguments = NULL, \ | |||||
.handler = NULL \ | |||||
} \ | |||||
}; | |||||
#define JACK_DBUS_SIGNAL_ARGUMENTS_BEGIN(signal_name) \ | |||||
static const \ | |||||
struct jack_dbus_interface_signal_argument_descriptor signal_name ## _arguments[] = \ | |||||
{ | |||||
#define JACK_DBUS_SIGNAL_ARGUMENT(argument_name, argument_type) \ | |||||
{ \ | |||||
.name = argument_name, \ | |||||
.type = argument_type \ | |||||
}, | |||||
#define JACK_DBUS_SIGNAL_ARGUMENTS_END \ | |||||
JACK_DBUS_SIGNAL_ARGUMENT(NULL, NULL) \ | |||||
}; | |||||
#define JACK_DBUS_SIGNALS_BEGIN \ | |||||
static const \ | |||||
struct jack_dbus_interface_signal_descriptor signals_dtor[] = \ | |||||
{ | |||||
#define JACK_DBUS_SIGNAL_DESCRIBE(signal_name) \ | |||||
{ \ | |||||
.name = # signal_name, \ | |||||
.arguments = signal_name ## _arguments \ | |||||
}, | |||||
#define JACK_DBUS_SIGNALS_END \ | |||||
{ \ | |||||
.name = NULL, \ | |||||
.arguments = NULL, \ | |||||
} \ | |||||
}; | |||||
#define JACK_DBUS_IFACE_BEGIN(iface_var, iface_name) \ | |||||
struct jack_dbus_interface_descriptor iface_var = \ | |||||
{ \ | |||||
.name = iface_name, \ | |||||
.handler = jack_dbus_run_method, | |||||
#define JACK_DBUS_IFACE_HANDLER(handler_func) \ | |||||
.handler = handler_func, | |||||
#define JACK_DBUS_IFACE_EXPOSE_METHODS \ | |||||
.methods = methods_dtor, | |||||
#define JACK_DBUS_IFACE_EXPOSE_SIGNALS \ | |||||
.signals = signals_dtor, | |||||
#define JACK_DBUS_IFACE_END \ | |||||
}; | |||||
DBusHandlerResult | |||||
jack_dbus_message_handler( | |||||
DBusConnection *connection, | |||||
DBusMessage *message, | |||||
void *data); | |||||
void | |||||
jack_dbus_message_handler_unregister( | |||||
DBusConnection *connection, | |||||
void *data); | |||||
bool | |||||
jack_dbus_run_method( | |||||
struct jack_dbus_method_call * call, | |||||
const struct jack_dbus_interface_method_descriptor * methods); | |||||
void | |||||
jack_dbus_error( | |||||
void *dbus_call_context_ptr, | |||||
const char *error_name, | |||||
const char *format, | |||||
...); | |||||
bool | |||||
jack_dbus_get_method_args( | |||||
struct jack_dbus_method_call *call, | |||||
int type, | |||||
...); | |||||
bool | |||||
jack_dbus_get_method_args_string_and_variant( | |||||
struct jack_dbus_method_call *call, | |||||
const char **arg1, | |||||
message_arg_t *arg2, | |||||
int *type_ptr); | |||||
bool | |||||
jack_dbus_message_append_variant( | |||||
DBusMessageIter *iter, | |||||
int type, | |||||
const char *signature, | |||||
message_arg_t *arg); | |||||
void | |||||
jack_dbus_construct_method_return_empty( | |||||
struct jack_dbus_method_call * call); | |||||
void | |||||
jack_dbus_construct_method_return_single( | |||||
struct jack_dbus_method_call *call, | |||||
int type, | |||||
message_arg_t arg); | |||||
void | |||||
jack_dbus_construct_method_return_array_of_strings( | |||||
struct jack_dbus_method_call *call, | |||||
unsigned int num_members, | |||||
const char **array); | |||||
void | |||||
jack_dbus_send_signal( | |||||
const char *sender_object_path, | |||||
const char *iface, | |||||
const char *signal_name, | |||||
int first_arg_type, | |||||
...); | |||||
#define JACK_CONTROLLER_OBJECT_PATH "/org/jackaudio/Controller" | |||||
extern struct jack_dbus_interface_descriptor * g_jackcontroller_interfaces[]; | |||||
#endif /* #ifndef DBUS_H__3DB2458F_44B2_43EA_882A_9F888DF71A88__INCLUDED */ | |||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007,2008 Nedko Arnaudov | |||||
Copyright (C) 2007-2008 Juuso Alasuutari | |||||
Copyright (C) 2008 Marc-Olivier Barre | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef DBUS_H__3DB2458F_44B2_43EA_882A_9F888DF71A88__INCLUDED | |||||
#define DBUS_H__3DB2458F_44B2_43EA_882A_9F888DF71A88__INCLUDED | |||||
#include <stdbool.h> | |||||
#define JACK_DBUS_DEBUG | |||||
//#define DISABLE_SIGNAL_MAGIC | |||||
#define DEFAULT_XDG_CONFIG "/.config" | |||||
#define DEFAULT_XDG_LOG "/.log" | |||||
#define JACKDBUS_DIR "/jack" | |||||
#define JACKDBUS_LOG "/jackdbus.log" | |||||
#define JACKDBUS_CONF "/conf.xml" | |||||
extern char *g_jackdbus_config_dir; | |||||
extern size_t g_jackdbus_config_dir_len; /* without terminating '\0' char */ | |||||
extern int g_exit_command; | |||||
bool | |||||
jack_controller_settings_init(); | |||||
void | |||||
jack_controller_settings_uninit(); | |||||
#define JACK_DBUS_ERROR_UNKNOWN_METHOD "org.jackaudio.Error.UnknownMethod" | |||||
#define JACK_DBUS_ERROR_SERVER_NOT_RUNNING "org.jackaudio.Error.ServerNotRunning" | |||||
#define JACK_DBUS_ERROR_UNKNOWN_DRIVER "org.jackaudio.Error.UnknownDriver" | |||||
#define JACK_DBUS_ERROR_NEED_DRIVER "org.jackaudio.Error.NeedDriver" | |||||
#define JACK_DBUS_ERROR_UNKNOWN_DRIVER_PARAMETER "org.jackaudio.Error.UnknownDriverParameter" | |||||
#define JACK_DBUS_ERROR_UNKNOWN_ENGINE_PARAMETER "org.jackaudio.Error.UnknownEngineParameter" | |||||
#define JACK_DBUS_ERROR_INVALID_ARGS "org.jackaudio.Error.InvalidArgs" | |||||
#define JACK_DBUS_ERROR_GENERIC "org.jackaudio.Error.Generic" | |||||
#define JACK_DBUS_ERROR_FATAL "org.jackaudio.Error.Fatal" | |||||
struct jack_dbus_method_call | |||||
{ | |||||
void *context; | |||||
DBusConnection *connection; | |||||
const char *method_name; | |||||
DBusMessage *message; | |||||
DBusMessage *reply; | |||||
}; | |||||
struct jack_dbus_interface_method_argument_descriptor | |||||
{ | |||||
const char * name; | |||||
const char * type; | |||||
bool direction_out; /* true - out, false - in */ | |||||
}; | |||||
struct jack_dbus_interface_method_descriptor | |||||
{ | |||||
const char * name; | |||||
const struct jack_dbus_interface_method_argument_descriptor * arguments; | |||||
void (* handler)(struct jack_dbus_method_call * call); | |||||
}; | |||||
struct jack_dbus_interface_signal_argument_descriptor | |||||
{ | |||||
const char * name; | |||||
const char * type; | |||||
}; | |||||
struct jack_dbus_interface_signal_descriptor | |||||
{ | |||||
const char * name; | |||||
const struct jack_dbus_interface_signal_argument_descriptor * arguments; | |||||
}; | |||||
struct jack_dbus_interface_descriptor | |||||
{ | |||||
const char * name; | |||||
bool | |||||
(* handler)( | |||||
struct jack_dbus_method_call * call, | |||||
const struct jack_dbus_interface_method_descriptor * methods); | |||||
const struct jack_dbus_interface_method_descriptor * methods; | |||||
const struct jack_dbus_interface_signal_descriptor * signals; | |||||
}; | |||||
struct jack_dbus_object_descriptor | |||||
{ | |||||
struct jack_dbus_interface_descriptor ** interfaces; | |||||
void * context; | |||||
}; | |||||
typedef union | |||||
{ | |||||
unsigned char byte; | |||||
dbus_bool_t boolean; | |||||
dbus_int16_t int16; | |||||
dbus_uint16_t uint16; | |||||
dbus_int32_t int32; | |||||
dbus_uint32_t uint32; | |||||
dbus_int64_t int64; | |||||
dbus_uint64_t uint64; | |||||
double doubl; | |||||
const char *string; | |||||
} message_arg_t; | |||||
#define JACK_DBUS_METHOD_ARGUMENTS_BEGIN(method_name) \ | |||||
static const \ | |||||
struct jack_dbus_interface_method_argument_descriptor method_name ## _arguments[] = \ | |||||
{ | |||||
#define JACK_DBUS_METHOD_ARGUMENT(argument_name, argument_type, argument_direction_out) \ | |||||
{ \ | |||||
.name = argument_name, \ | |||||
.type = argument_type, \ | |||||
.direction_out = argument_direction_out \ | |||||
}, | |||||
#define JACK_DBUS_METHOD_ARGUMENTS_END \ | |||||
JACK_DBUS_METHOD_ARGUMENT(NULL, NULL, false) \ | |||||
}; | |||||
#define JACK_DBUS_METHODS_BEGIN \ | |||||
static const \ | |||||
struct jack_dbus_interface_method_descriptor methods_dtor[] = \ | |||||
{ | |||||
#define JACK_DBUS_METHOD_DESCRIBE(method_name, handler_name) \ | |||||
{ \ | |||||
.name = # method_name, \ | |||||
.arguments = method_name ## _arguments, \ | |||||
.handler = handler_name \ | |||||
}, | |||||
#define JACK_DBUS_METHODS_END \ | |||||
{ \ | |||||
.name = NULL, \ | |||||
.arguments = NULL, \ | |||||
.handler = NULL \ | |||||
} \ | |||||
}; | |||||
#define JACK_DBUS_SIGNAL_ARGUMENTS_BEGIN(signal_name) \ | |||||
static const \ | |||||
struct jack_dbus_interface_signal_argument_descriptor signal_name ## _arguments[] = \ | |||||
{ | |||||
#define JACK_DBUS_SIGNAL_ARGUMENT(argument_name, argument_type) \ | |||||
{ \ | |||||
.name = argument_name, \ | |||||
.type = argument_type \ | |||||
}, | |||||
#define JACK_DBUS_SIGNAL_ARGUMENTS_END \ | |||||
JACK_DBUS_SIGNAL_ARGUMENT(NULL, NULL) \ | |||||
}; | |||||
#define JACK_DBUS_SIGNALS_BEGIN \ | |||||
static const \ | |||||
struct jack_dbus_interface_signal_descriptor signals_dtor[] = \ | |||||
{ | |||||
#define JACK_DBUS_SIGNAL_DESCRIBE(signal_name) \ | |||||
{ \ | |||||
.name = # signal_name, \ | |||||
.arguments = signal_name ## _arguments \ | |||||
}, | |||||
#define JACK_DBUS_SIGNALS_END \ | |||||
{ \ | |||||
.name = NULL, \ | |||||
.arguments = NULL, \ | |||||
} \ | |||||
}; | |||||
#define JACK_DBUS_IFACE_BEGIN(iface_var, iface_name) \ | |||||
struct jack_dbus_interface_descriptor iface_var = \ | |||||
{ \ | |||||
.name = iface_name, \ | |||||
.handler = jack_dbus_run_method, | |||||
#define JACK_DBUS_IFACE_HANDLER(handler_func) \ | |||||
.handler = handler_func, | |||||
#define JACK_DBUS_IFACE_EXPOSE_METHODS \ | |||||
.methods = methods_dtor, | |||||
#define JACK_DBUS_IFACE_EXPOSE_SIGNALS \ | |||||
.signals = signals_dtor, | |||||
#define JACK_DBUS_IFACE_END \ | |||||
}; | |||||
DBusHandlerResult | |||||
jack_dbus_message_handler( | |||||
DBusConnection *connection, | |||||
DBusMessage *message, | |||||
void *data); | |||||
void | |||||
jack_dbus_message_handler_unregister( | |||||
DBusConnection *connection, | |||||
void *data); | |||||
bool | |||||
jack_dbus_run_method( | |||||
struct jack_dbus_method_call * call, | |||||
const struct jack_dbus_interface_method_descriptor * methods); | |||||
void | |||||
jack_dbus_error( | |||||
void *dbus_call_context_ptr, | |||||
const char *error_name, | |||||
const char *format, | |||||
...); | |||||
bool | |||||
jack_dbus_get_method_args( | |||||
struct jack_dbus_method_call *call, | |||||
int type, | |||||
...); | |||||
bool | |||||
jack_dbus_get_method_args_string_and_variant( | |||||
struct jack_dbus_method_call *call, | |||||
const char **arg1, | |||||
message_arg_t *arg2, | |||||
int *type_ptr); | |||||
bool | |||||
jack_dbus_message_append_variant( | |||||
DBusMessageIter *iter, | |||||
int type, | |||||
const char *signature, | |||||
message_arg_t *arg); | |||||
void | |||||
jack_dbus_construct_method_return_empty( | |||||
struct jack_dbus_method_call * call); | |||||
void | |||||
jack_dbus_construct_method_return_single( | |||||
struct jack_dbus_method_call *call, | |||||
int type, | |||||
message_arg_t arg); | |||||
void | |||||
jack_dbus_construct_method_return_array_of_strings( | |||||
struct jack_dbus_method_call *call, | |||||
unsigned int num_members, | |||||
const char **array); | |||||
void | |||||
jack_dbus_send_signal( | |||||
const char *sender_object_path, | |||||
const char *iface, | |||||
const char *signal_name, | |||||
int first_arg_type, | |||||
...); | |||||
#define JACK_CONTROLLER_OBJECT_PATH "/org/jackaudio/Controller" | |||||
extern struct jack_dbus_interface_descriptor * g_jackcontroller_interfaces[]; | |||||
#endif /* #ifndef DBUS_H__3DB2458F_44B2_43EA_882A_9F888DF71A88__INCLUDED */ |
@@ -1,12 +1,3 @@ | |||||
[D-BUS Service] | [D-BUS Service] | ||||
Name=org.jackaudio.service | Name=org.jackaudio.service | ||||
Exec=${BINDIR}/jackdbus auto | Exec=${BINDIR}/jackdbus auto | ||||
[D-BUS Service] | |||||
Name=org.jackaudio.service | |||||
Exec=${BINDIR}/jackdbus auto | |||||
[D-BUS Service] | |||||
Name=org.jackaudio.service | |||||
Exec=${BINDIR}/jackdbus auto | |||||
[D-BUS Service] | |||||
Name=org.jackaudio.service | |||||
Exec=${BINDIR}/jackdbus auto |
@@ -34,111 +34,3 @@ jack_controller_settings_save_auto( | |||||
struct jack_controller * controller_ptr); | struct jack_controller * controller_ptr); | ||||
#endif /* #ifndef XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED */ | #endif /* #ifndef XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED */ | ||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007,2008 Nedko Arnaudov | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED | |||||
#define XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED | |||||
bool | |||||
jack_controller_settings_save( | |||||
struct jack_controller * controller_ptr, | |||||
void *dbus_call_context_ptr); | |||||
void | |||||
jack_controller_settings_load( | |||||
struct jack_controller * controller_ptr); | |||||
void | |||||
jack_controller_settings_save_auto( | |||||
struct jack_controller * controller_ptr); | |||||
#endif /* #ifndef XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED */ | |||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007,2008 Nedko Arnaudov | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED | |||||
#define XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED | |||||
bool | |||||
jack_controller_settings_save( | |||||
struct jack_controller * controller_ptr, | |||||
void *dbus_call_context_ptr); | |||||
void | |||||
jack_controller_settings_load( | |||||
struct jack_controller * controller_ptr); | |||||
void | |||||
jack_controller_settings_save_auto( | |||||
struct jack_controller * controller_ptr); | |||||
#endif /* #ifndef XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED */ | |||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007,2008 Nedko Arnaudov | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED | |||||
#define XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED | |||||
bool | |||||
jack_controller_settings_save( | |||||
struct jack_controller * controller_ptr, | |||||
void *dbus_call_context_ptr); | |||||
void | |||||
jack_controller_settings_load( | |||||
struct jack_controller * controller_ptr); | |||||
void | |||||
jack_controller_settings_save_auto( | |||||
struct jack_controller * controller_ptr); | |||||
#endif /* #ifndef XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED */ |
@@ -56,177 +56,3 @@ jack_controller_settings_save_auto( | |||||
struct jack_controller * controller_ptr) | struct jack_controller * controller_ptr) | ||||
{ | { | ||||
} | } | ||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007,2008 Nedko Arnaudov | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#include <stdbool.h> | |||||
#include <dbus/dbus.h> | |||||
#include <jack/driver.h> | |||||
#include <jack/engine.h> | |||||
#include "dbus.h" | |||||
#include "controller_internal.h" | |||||
bool | |||||
jack_controller_settings_init() | |||||
{ | |||||
return true; | |||||
} | |||||
void | |||||
jack_controller_settings_uninit() | |||||
{ | |||||
} | |||||
bool | |||||
jack_controller_settings_save( | |||||
struct jack_controller * controller_ptr, | |||||
void *dbus_call_context_ptr) | |||||
{ | |||||
jack_dbus_error(dbus_call_context_ptr, JACK_DBUS_ERROR_GENERIC, "jackdbus compiled without settings persistence"); | |||||
return true; | |||||
} | |||||
void | |||||
jack_controller_settings_load( | |||||
struct jack_controller * controller_ptr) | |||||
{ | |||||
} | |||||
void | |||||
jack_controller_settings_save_auto( | |||||
struct jack_controller * controller_ptr) | |||||
{ | |||||
} | |||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007,2008 Nedko Arnaudov | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#include <stdbool.h> | |||||
#include <dbus/dbus.h> | |||||
#include <jack/driver.h> | |||||
#include <jack/engine.h> | |||||
#include "dbus.h" | |||||
#include "controller_internal.h" | |||||
bool | |||||
jack_controller_settings_init() | |||||
{ | |||||
return true; | |||||
} | |||||
void | |||||
jack_controller_settings_uninit() | |||||
{ | |||||
} | |||||
bool | |||||
jack_controller_settings_save( | |||||
struct jack_controller * controller_ptr, | |||||
void *dbus_call_context_ptr) | |||||
{ | |||||
jack_dbus_error(dbus_call_context_ptr, JACK_DBUS_ERROR_GENERIC, "jackdbus compiled without settings persistence"); | |||||
return true; | |||||
} | |||||
void | |||||
jack_controller_settings_load( | |||||
struct jack_controller * controller_ptr) | |||||
{ | |||||
} | |||||
void | |||||
jack_controller_settings_save_auto( | |||||
struct jack_controller * controller_ptr) | |||||
{ | |||||
} | |||||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||||
/* | |||||
Copyright (C) 2007,2008 Nedko Arnaudov | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 of the License. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#include <stdbool.h> | |||||
#include <dbus/dbus.h> | |||||
#include <jack/driver.h> | |||||
#include <jack/engine.h> | |||||
#include "dbus.h" | |||||
#include "controller_internal.h" | |||||
bool | |||||
jack_controller_settings_init() | |||||
{ | |||||
return true; | |||||
} | |||||
void | |||||
jack_controller_settings_uninit() | |||||
{ | |||||
} | |||||
bool | |||||
jack_controller_settings_save( | |||||
struct jack_controller * controller_ptr, | |||||
void *dbus_call_context_ptr) | |||||
{ | |||||
jack_dbus_error(dbus_call_context_ptr, JACK_DBUS_ERROR_GENERIC, "jackdbus compiled without settings persistence"); | |||||
return true; | |||||
} | |||||
void | |||||
jack_controller_settings_load( | |||||
struct jack_controller * controller_ptr) | |||||
{ | |||||
} | |||||
void | |||||
jack_controller_settings_save_auto( | |||||
struct jack_controller * controller_ptr) | |||||
{ | |||||
} |