diff options
author | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2008-08-28 09:38:24 +0000 |
---|---|---|
committer | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2008-08-28 09:38:24 +0000 |
commit | 58596f44f349cdd51e0aaa71bbfa6402c7d80437 (patch) | |
tree | d3809f158ddf56cc817fd63f03b7b41c6473e035 /linux | |
parent | cc46a63bbc8048b1234d5579e06df5a83ab53ea1 (diff) | |
download | jack2-58596f44f349cdd51e0aaa71bbfa6402c7d80437.tar.gz |
Implement internal clients enumeration.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2816 0c269be4-1314-0410-8aa9-9f06e86f4224
Diffstat (limited to 'linux')
-rw-r--r-- | linux/dbus/controller.c | 26 | ||||
-rw-r--r-- | linux/dbus/controller_internal.h | 3 |
2 files changed, 27 insertions, 2 deletions
diff --git a/linux/dbus/controller.c b/linux/dbus/controller.c index d2c9dc73..d2083024 100644 --- a/linux/dbus/controller.c +++ b/linux/dbus/controller.c @@ -247,7 +247,9 @@ jack_controller_create( struct jack_controller *controller_ptr; const JSList * node_ptr; const char ** driver_name_target; + const char ** internal_name_target; JSList * drivers; + JSList * internals; DBusObjectPathVTable vtable = { jack_dbus_message_handler_unregister, @@ -289,6 +291,24 @@ jack_controller_create( node_ptr = jack_slist_next(node_ptr); driver_name_target++; } + + internals = (JSList *)jackctl_server_get_internals_list(controller_ptr->server); + controller_ptr->drivers_count = jack_slist_length(internals); + controller_ptr->internal_names = malloc(controller_ptr->internals_count * sizeof(const char *)); + if (controller_ptr->internal_names == NULL) + { + jack_error("Ran out of memory trying to allocate internals names array"); + goto fail_destroy_server; + } + + internal_name_target = controller_ptr->internal_names; + node_ptr = jackctl_server_get_drivers_list(controller_ptr->server); + while (node_ptr != NULL) + { + *internal_name_target = jackctl_internal_get_name((jackctl_internal_t *)node_ptr->data); + node_ptr = jack_slist_next(node_ptr); + internal_name_target++; + } controller_ptr->dbus_descriptor.context = controller_ptr; controller_ptr->dbus_descriptor.interfaces = g_jackcontroller_interfaces; @@ -300,15 +320,16 @@ jack_controller_create( &controller_ptr->dbus_descriptor)) { jack_error("Ran out of memory trying to register D-Bus object path"); - goto fail_free_driver_names_array; + goto fail_free_names_array; } jack_controller_settings_load(controller_ptr); return controller_ptr; -fail_free_driver_names_array: +fail_free_names_array: free(controller_ptr->driver_names); + free(controller_ptr->internal_names); fail_destroy_server: jackctl_server_destroy(controller_ptr->server); @@ -332,6 +353,7 @@ jack_controller_destroy( } free(controller_ptr->driver_names); + free(controller_ptr->internal_names); jackctl_server_destroy(controller_ptr->server); diff --git a/linux/dbus/controller_internal.h b/linux/dbus/controller_internal.h index 37923a20..aad44eed 100644 --- a/linux/dbus/controller_internal.h +++ b/linux/dbus/controller_internal.h @@ -39,6 +39,9 @@ struct jack_controller const char **driver_names; unsigned int drivers_count; + + const char **internal_names; + unsigned int internals_count; /* current driver, NULL if not driver is selected */ jackctl_driver_t *driver; |