From ce253994af37137d4c29221e7914f437c3dcb510 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Mon, 2 Oct 2017 16:22:02 +0900 Subject: Add agl-service-soundmanager-2017 Add a new binding agl-service-soundmanager-2017. A image about this see JIRA SPEC-916 Packaging via cmake [PatchSet3] Pass to afb-binding version 2 Fix typo Fix libsoundmanager bug [PatchSet4] Modified commit message [PatchSet5] Re-add root CMakeLists.txt Prevent memory leak of json object Bug-AGL: SPEC-926 Change-Id: I24c0280210777778c379ac7027f3d71fa28d6d85 Signed-off-by: Kazumasa Mitsunari --- src/CMakeLists.txt | 65 + src/dbus/audio_manager_interface.c | 9554 ++++++++++++++++++++++++++++++++++ src/dbus/audio_manager_interface.h | 1517 ++++++ src/dbus/command_interface.xml | 60 + src/dbus/generate_dbus.sh | 24 + src/dbus/routing_interface.xml | 85 + src/dbus/sound_manager_interface.xml | 36 + src/export.map | 1 + src/sm-error.h | 52 + src/sm-helper.c | 231 + src/sm-helper.h | 94 + src/soundmanager.c | 1570 ++++++ 12 files changed, 13289 insertions(+) create mode 100644 src/CMakeLists.txt create mode 100644 src/dbus/audio_manager_interface.c create mode 100644 src/dbus/audio_manager_interface.h create mode 100644 src/dbus/command_interface.xml create mode 100755 src/dbus/generate_dbus.sh create mode 100644 src/dbus/routing_interface.xml create mode 100644 src/dbus/sound_manager_interface.xml create mode 100644 src/export.map create mode 100644 src/sm-error.h create mode 100644 src/sm-helper.c create mode 100644 src/sm-helper.h create mode 100644 src/soundmanager.c (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..c29aa89 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,65 @@ +# +# Copyright (c) 2017 TOYOTA MOTOR CORPORATION +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +cmake_minimum_required(VERSION 2.8) + +set(TARGETS_SMBINDER soundmanager-service) + +INCLUDE(FindThreads) +FIND_PACKAGE(Threads) + +pkg_check_modules(sm_binding_depends afb-daemon glib-2.0 gio-2.0 gio-unix-2.0 json-c) +set(binding_sm_sources + soundmanager.c + sm-helper.c + dbus/audio_manager_interface.c) + +include_directories(dbus) +link_libraries(-Wl,--as-needed -Wl,--gc-sections -Wl,--no-undefined) + +add_library(${TARGETS_SMBINDER} MODULE ${binding_sm_sources}) + +target_compile_options(${TARGETS_SMBINDER} PRIVATE ${sm_binding_depends_CFLAGS}) +if(DEFINED DEBUGMODE) + target_compile_options(${TARGETS_SMBINDER} PRIVATE -g -O0) +else(DEFINED DEBUGMODE) + target_compile_options(${TARGETS_SMBINDER} PRIVATE -g -O2) +endif(DEFINED DEBUGMODE) + +target_include_directories(${TARGETS_SMBINDER} PRIVATE ${sm_binding_depends_INCLUDE_DIRS}) +target_link_libraries(${TARGETS_SMBINDER} ${CMAKE_THREAD_LIBS_INIT} ${link_libraries} ${sm_binding_depends_LIBRARIES}) + +# Binder exposes a unique public entry point + +set_target_properties(${TARGETS_SMBINDER} PROPERTIES + PREFIX "" + LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map" + ) + +if(NOT EXISTS ${PROJECT_BINARY_DIR}/package) + add_custom_command(TARGET ${TARGETS_SMBINDER} POST_BUILD + COMMAND cp -rf ${PROJECT_SOURCE_DIR}/package ${PROJECT_BINARY_DIR} + ) +endif() + +add_custom_command(TARGET ${TARGETS_SMBINDER} POST_BUILD + COMMAND mkdir -p ${PROJECT_BINARY_DIR}/package/root/lib + COMMAND cp -rf ${PROJECT_BINARY_DIR}/src/${TARGETS_SMBINDER}.so ${PROJECT_BINARY_DIR}/package/root/lib +) + +add_custom_target(package DEPENDS ${PROJECT_BINARY_DIR}/package/root + COMMAND wgtpkg-pack -f -o ${PROJECT_BINARY_DIR}/package/${TARGETS_SMBINDER}-2017.wgt ${PROJECT_BINARY_DIR}/package/root +) diff --git a/src/dbus/audio_manager_interface.c b/src/dbus/audio_manager_interface.c new file mode 100644 index 0000000..c276d70 --- /dev/null +++ b/src/dbus/audio_manager_interface.c @@ -0,0 +1,9554 @@ +/* + * Generated by gdbus-codegen 2.40.2. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "audio_manager_interface.h" + +#include +#ifdef G_OS_UNIX +# include +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + { + /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ + gdouble da = g_value_get_double (a); + gdouble db = g_value_get_double (b); + ret = memcmp (&da, &db, sizeof (gdouble)) == 0; + } + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface org.genivi.audiomanager.commandinterface + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:AudiomanagerCommandinterface + * @title: AudiomanagerCommandinterface + * @short_description: Generated C code for the org.genivi.audiomanager.commandinterface D-Bus interface + * + * This section contains code for working with the org.genivi.audiomanager.commandinterface D-Bus interface in C. + */ + +/* ---- Introspection data for org.genivi.audiomanager.commandinterface ---- */ + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_connect_IN_ARG_sourceID = +{ + { + -1, + (gchar *) "sourceID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_connect_IN_ARG_sinkID = +{ + { + -1, + (gchar *) "sinkID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_method_info_connect_IN_ARG_pointers[] = +{ + &_audiomanager_commandinterface_method_info_connect_IN_ARG_sourceID, + &_audiomanager_commandinterface_method_info_connect_IN_ARG_sinkID, + NULL +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_connect_OUT_ARG_result = +{ + { + -1, + (gchar *) "result", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_connect_OUT_ARG_mainConnectionID = +{ + { + -1, + (gchar *) "mainConnectionID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_method_info_connect_OUT_ARG_pointers[] = +{ + &_audiomanager_commandinterface_method_info_connect_OUT_ARG_result, + &_audiomanager_commandinterface_method_info_connect_OUT_ARG_mainConnectionID, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_commandinterface_method_info_connect = +{ + { + -1, + (gchar *) "Connect", + (GDBusArgInfo **) &_audiomanager_commandinterface_method_info_connect_IN_ARG_pointers, + (GDBusArgInfo **) &_audiomanager_commandinterface_method_info_connect_OUT_ARG_pointers, + NULL + }, + "handle-connect", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_disconnect_IN_ARG_mainConnectionID = +{ + { + -1, + (gchar *) "mainConnectionID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_method_info_disconnect_IN_ARG_pointers[] = +{ + &_audiomanager_commandinterface_method_info_disconnect_IN_ARG_mainConnectionID, + NULL +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_disconnect_OUT_ARG_result = +{ + { + -1, + (gchar *) "result", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_method_info_disconnect_OUT_ARG_pointers[] = +{ + &_audiomanager_commandinterface_method_info_disconnect_OUT_ARG_result, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_commandinterface_method_info_disconnect = +{ + { + -1, + (gchar *) "Disconnect", + (GDBusArgInfo **) &_audiomanager_commandinterface_method_info_disconnect_IN_ARG_pointers, + (GDBusArgInfo **) &_audiomanager_commandinterface_method_info_disconnect_OUT_ARG_pointers, + NULL + }, + "handle-disconnect", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_set_volume_IN_ARG_sinkID = +{ + { + -1, + (gchar *) "sinkID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_set_volume_IN_ARG_volume = +{ + { + -1, + (gchar *) "volume", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_method_info_set_volume_IN_ARG_pointers[] = +{ + &_audiomanager_commandinterface_method_info_set_volume_IN_ARG_sinkID, + &_audiomanager_commandinterface_method_info_set_volume_IN_ARG_volume, + NULL +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_set_volume_OUT_ARG_result = +{ + { + -1, + (gchar *) "result", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_method_info_set_volume_OUT_ARG_pointers[] = +{ + &_audiomanager_commandinterface_method_info_set_volume_OUT_ARG_result, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_commandinterface_method_info_set_volume = +{ + { + -1, + (gchar *) "SetVolume", + (GDBusArgInfo **) &_audiomanager_commandinterface_method_info_set_volume_IN_ARG_pointers, + (GDBusArgInfo **) &_audiomanager_commandinterface_method_info_set_volume_OUT_ARG_pointers, + NULL + }, + "handle-set-volume", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_volume_step_IN_ARG_sinkID = +{ + { + -1, + (gchar *) "sinkID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_volume_step_IN_ARG_volumeStep = +{ + { + -1, + (gchar *) "volumeStep", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_method_info_volume_step_IN_ARG_pointers[] = +{ + &_audiomanager_commandinterface_method_info_volume_step_IN_ARG_sinkID, + &_audiomanager_commandinterface_method_info_volume_step_IN_ARG_volumeStep, + NULL +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_volume_step_OUT_ARG_result = +{ + { + -1, + (gchar *) "result", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_method_info_volume_step_OUT_ARG_pointers[] = +{ + &_audiomanager_commandinterface_method_info_volume_step_OUT_ARG_result, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_commandinterface_method_info_volume_step = +{ + { + -1, + (gchar *) "VolumeStep", + (GDBusArgInfo **) &_audiomanager_commandinterface_method_info_volume_step_IN_ARG_pointers, + (GDBusArgInfo **) &_audiomanager_commandinterface_method_info_volume_step_OUT_ARG_pointers, + NULL + }, + "handle-volume-step", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_set_sink_mute_state_IN_ARG_sinkID = +{ + { + -1, + (gchar *) "sinkID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_set_sink_mute_state_IN_ARG_muteState = +{ + { + -1, + (gchar *) "muteState", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_method_info_set_sink_mute_state_IN_ARG_pointers[] = +{ + &_audiomanager_commandinterface_method_info_set_sink_mute_state_IN_ARG_sinkID, + &_audiomanager_commandinterface_method_info_set_sink_mute_state_IN_ARG_muteState, + NULL +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_set_sink_mute_state_OUT_ARG_result = +{ + { + -1, + (gchar *) "result", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_method_info_set_sink_mute_state_OUT_ARG_pointers[] = +{ + &_audiomanager_commandinterface_method_info_set_sink_mute_state_OUT_ARG_result, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_commandinterface_method_info_set_sink_mute_state = +{ + { + -1, + (gchar *) "SetSinkMuteState", + (GDBusArgInfo **) &_audiomanager_commandinterface_method_info_set_sink_mute_state_IN_ARG_pointers, + (GDBusArgInfo **) &_audiomanager_commandinterface_method_info_set_sink_mute_state_OUT_ARG_pointers, + NULL + }, + "handle-set-sink-mute-state", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_get_list_main_connections_OUT_ARG_result = +{ + { + -1, + (gchar *) "result", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_get_list_main_connections_OUT_ARG_listConnections = +{ + { + -1, + (gchar *) "listConnections", + (gchar *) "a(qqqnn)", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_method_info_get_list_main_connections_OUT_ARG_pointers[] = +{ + &_audiomanager_commandinterface_method_info_get_list_main_connections_OUT_ARG_result, + &_audiomanager_commandinterface_method_info_get_list_main_connections_OUT_ARG_listConnections, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_commandinterface_method_info_get_list_main_connections = +{ + { + -1, + (gchar *) "GetListMainConnections", + NULL, + (GDBusArgInfo **) &_audiomanager_commandinterface_method_info_get_list_main_connections_OUT_ARG_pointers, + NULL + }, + "handle-get-list-main-connections", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_get_list_main_sinks_OUT_ARG_result = +{ + { + -1, + (gchar *) "result", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_method_info_get_list_main_sinks_OUT_ARG_listMainSinks = +{ + { + -1, + (gchar *) "listMainSinks", + (gchar *) "a(qs(nn)nnq)", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_method_info_get_list_main_sinks_OUT_ARG_pointers[] = +{ + &_audiomanager_commandinterface_method_info_get_list_main_sinks_OUT_ARG_result, + &_audiomanager_commandinterface_method_info_get_list_main_sinks_OUT_ARG_listMainSinks, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_commandinterface_method_info_get_list_main_sinks = +{ + { + -1, + (gchar *) "GetListMainSinks", + NULL, + (GDBusArgInfo **) &_audiomanager_commandinterface_method_info_get_list_main_sinks_OUT_ARG_pointers, + NULL + }, + "handle-get-list-main-sinks", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _audiomanager_commandinterface_method_info_pointers[] = +{ + &_audiomanager_commandinterface_method_info_connect, + &_audiomanager_commandinterface_method_info_disconnect, + &_audiomanager_commandinterface_method_info_set_volume, + &_audiomanager_commandinterface_method_info_volume_step, + &_audiomanager_commandinterface_method_info_set_sink_mute_state, + &_audiomanager_commandinterface_method_info_get_list_main_connections, + &_audiomanager_commandinterface_method_info_get_list_main_sinks, + NULL +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_signal_info_new_main_connection_ARG_mainConnection = +{ + { + -1, + (gchar *) "mainConnection", + (gchar *) "(qqqnn)", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_signal_info_new_main_connection_ARG_pointers[] = +{ + &_audiomanager_commandinterface_signal_info_new_main_connection_ARG_mainConnection, + NULL +}; + +static const _ExtendedGDBusSignalInfo _audiomanager_commandinterface_signal_info_new_main_connection = +{ + { + -1, + (gchar *) "NewMainConnection", + (GDBusArgInfo **) &_audiomanager_commandinterface_signal_info_new_main_connection_ARG_pointers, + NULL + }, + "new-main-connection" +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_signal_info_removed_main_connection_ARG_mainConnectionId = +{ + { + -1, + (gchar *) "mainConnectionId", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_signal_info_removed_main_connection_ARG_pointers[] = +{ + &_audiomanager_commandinterface_signal_info_removed_main_connection_ARG_mainConnectionId, + NULL +}; + +static const _ExtendedGDBusSignalInfo _audiomanager_commandinterface_signal_info_removed_main_connection = +{ + { + -1, + (gchar *) "RemovedMainConnection", + (GDBusArgInfo **) &_audiomanager_commandinterface_signal_info_removed_main_connection_ARG_pointers, + NULL + }, + "removed-main-connection" +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_signal_info_main_connection_state_changed_ARG_connectionID = +{ + { + -1, + (gchar *) "connectionID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_signal_info_main_connection_state_changed_ARG_connectionState = +{ + { + -1, + (gchar *) "connectionState", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_signal_info_main_connection_state_changed_ARG_pointers[] = +{ + &_audiomanager_commandinterface_signal_info_main_connection_state_changed_ARG_connectionID, + &_audiomanager_commandinterface_signal_info_main_connection_state_changed_ARG_connectionState, + NULL +}; + +static const _ExtendedGDBusSignalInfo _audiomanager_commandinterface_signal_info_main_connection_state_changed = +{ + { + -1, + (gchar *) "MainConnectionStateChanged", + (GDBusArgInfo **) &_audiomanager_commandinterface_signal_info_main_connection_state_changed_ARG_pointers, + NULL + }, + "main-connection-state-changed" +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_signal_info_volume_changed_ARG_sinkID = +{ + { + -1, + (gchar *) "sinkID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_signal_info_volume_changed_ARG_volume = +{ + { + -1, + (gchar *) "volume", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_signal_info_volume_changed_ARG_pointers[] = +{ + &_audiomanager_commandinterface_signal_info_volume_changed_ARG_sinkID, + &_audiomanager_commandinterface_signal_info_volume_changed_ARG_volume, + NULL +}; + +static const _ExtendedGDBusSignalInfo _audiomanager_commandinterface_signal_info_volume_changed = +{ + { + -1, + (gchar *) "VolumeChanged", + (GDBusArgInfo **) &_audiomanager_commandinterface_signal_info_volume_changed_ARG_pointers, + NULL + }, + "volume-changed" +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_signal_info_sink_mute_state_changed_ARG_sinkID = +{ + { + -1, + (gchar *) "sinkID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_signal_info_sink_mute_state_changed_ARG_muteState = +{ + { + -1, + (gchar *) "muteState", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_signal_info_sink_mute_state_changed_ARG_pointers[] = +{ + &_audiomanager_commandinterface_signal_info_sink_mute_state_changed_ARG_sinkID, + &_audiomanager_commandinterface_signal_info_sink_mute_state_changed_ARG_muteState, + NULL +}; + +static const _ExtendedGDBusSignalInfo _audiomanager_commandinterface_signal_info_sink_mute_state_changed = +{ + { + -1, + (gchar *) "SinkMuteStateChanged", + (GDBusArgInfo **) &_audiomanager_commandinterface_signal_info_sink_mute_state_changed_ARG_pointers, + NULL + }, + "sink-mute-state-changed" +}; + +static const _ExtendedGDBusArgInfo _audiomanager_commandinterface_signal_info_system_property_changed_ARG_SystemProperty = +{ + { + -1, + (gchar *) "SystemProperty", + (gchar *) "(nn)", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_commandinterface_signal_info_system_property_changed_ARG_pointers[] = +{ + &_audiomanager_commandinterface_signal_info_system_property_changed_ARG_SystemProperty, + NULL +}; + +static const _ExtendedGDBusSignalInfo _audiomanager_commandinterface_signal_info_system_property_changed = +{ + { + -1, + (gchar *) "SystemPropertyChanged", + (GDBusArgInfo **) &_audiomanager_commandinterface_signal_info_system_property_changed_ARG_pointers, + NULL + }, + "system-property-changed" +}; + +static const _ExtendedGDBusSignalInfo * const _audiomanager_commandinterface_signal_info_pointers[] = +{ + &_audiomanager_commandinterface_signal_info_new_main_connection, + &_audiomanager_commandinterface_signal_info_removed_main_connection, + &_audiomanager_commandinterface_signal_info_main_connection_state_changed, + &_audiomanager_commandinterface_signal_info_volume_changed, + &_audiomanager_commandinterface_signal_info_sink_mute_state_changed, + &_audiomanager_commandinterface_signal_info_system_property_changed, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _audiomanager_commandinterface_interface_info = +{ + { + -1, + (gchar *) "org.genivi.audiomanager.commandinterface", + (GDBusMethodInfo **) &_audiomanager_commandinterface_method_info_pointers, + (GDBusSignalInfo **) &_audiomanager_commandinterface_signal_info_pointers, + NULL, + NULL + }, + "audiomanager-commandinterface", +}; + + +/** + * audiomanager_commandinterface_interface_info: + * + * Gets a machine-readable description of the org.genivi.audiomanager.commandinterface D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +audiomanager_commandinterface_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_audiomanager_commandinterface_interface_info.parent_struct; +} + +/** + * audiomanager_commandinterface_override_properties: + * @klass: The class structure for a #GObject-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #AudiomanagerCommandinterface interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +audiomanager_commandinterface_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * AudiomanagerCommandinterface: + * + * Abstract interface type for the D-Bus interface org.genivi.audiomanager.commandinterface. + */ + +/** + * AudiomanagerCommandinterfaceIface: + * @parent_iface: The parent interface. + * @handle_connect: Handler for the #AudiomanagerCommandinterface::handle-connect signal. + * @handle_disconnect: Handler for the #AudiomanagerCommandinterface::handle-disconnect signal. + * @handle_get_list_main_connections: Handler for the #AudiomanagerCommandinterface::handle-get-list-main-connections signal. + * @handle_get_list_main_sinks: Handler for the #AudiomanagerCommandinterface::handle-get-list-main-sinks signal. + * @handle_set_sink_mute_state: Handler for the #AudiomanagerCommandinterface::handle-set-sink-mute-state signal. + * @handle_set_volume: Handler for the #AudiomanagerCommandinterface::handle-set-volume signal. + * @handle_volume_step: Handler for the #AudiomanagerCommandinterface::handle-volume-step signal. + * @main_connection_state_changed: Handler for the #AudiomanagerCommandinterface::main-connection-state-changed signal. + * @new_main_connection: Handler for the #AudiomanagerCommandinterface::new-main-connection signal. + * @removed_main_connection: Handler for the #AudiomanagerCommandinterface::removed-main-connection signal. + * @sink_mute_state_changed: Handler for the #AudiomanagerCommandinterface::sink-mute-state-changed signal. + * @system_property_changed: Handler for the #AudiomanagerCommandinterface::system-property-changed signal. + * @volume_changed: Handler for the #AudiomanagerCommandinterface::volume-changed signal. + * + * Virtual table for the D-Bus interface org.genivi.audiomanager.commandinterface. + */ + +typedef AudiomanagerCommandinterfaceIface AudiomanagerCommandinterfaceInterface; +G_DEFINE_INTERFACE (AudiomanagerCommandinterface, audiomanager_commandinterface, G_TYPE_OBJECT); + +static void +audiomanager_commandinterface_default_init (AudiomanagerCommandinterfaceIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * AudiomanagerCommandinterface::handle-connect: + * @object: A #AudiomanagerCommandinterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_sourceID: Argument passed by remote caller. + * @arg_sinkID: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the Connect() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_commandinterface_complete_connect() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-connect", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, handle_connect), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_UINT); + + /** + * AudiomanagerCommandinterface::handle-disconnect: + * @object: A #AudiomanagerCommandinterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_mainConnectionID: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the Disconnect() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_commandinterface_complete_disconnect() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-disconnect", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, handle_disconnect), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT); + + /** + * AudiomanagerCommandinterface::handle-set-volume: + * @object: A #AudiomanagerCommandinterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_sinkID: Argument passed by remote caller. + * @arg_volume: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the SetVolume() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_commandinterface_complete_set_volume() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-set-volume", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, handle_set_volume), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_INT); + + /** + * AudiomanagerCommandinterface::handle-volume-step: + * @object: A #AudiomanagerCommandinterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_sinkID: Argument passed by remote caller. + * @arg_volumeStep: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the VolumeStep() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_commandinterface_complete_volume_step() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-volume-step", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, handle_volume_step), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_INT); + + /** + * AudiomanagerCommandinterface::handle-set-sink-mute-state: + * @object: A #AudiomanagerCommandinterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_sinkID: Argument passed by remote caller. + * @arg_muteState: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the SetSinkMuteState() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_commandinterface_complete_set_sink_mute_state() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-set-sink-mute-state", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, handle_set_sink_mute_state), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_INT); + + /** + * AudiomanagerCommandinterface::handle-get-list-main-connections: + * @object: A #AudiomanagerCommandinterface. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the GetListMainConnections() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_commandinterface_complete_get_list_main_connections() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-list-main-connections", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, handle_get_list_main_connections), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * AudiomanagerCommandinterface::handle-get-list-main-sinks: + * @object: A #AudiomanagerCommandinterface. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the GetListMainSinks() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_commandinterface_complete_get_list_main_sinks() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-list-main-sinks", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, handle_get_list_main_sinks), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /* GObject signals for received D-Bus signals: */ + /** + * AudiomanagerCommandinterface::new-main-connection: + * @object: A #AudiomanagerCommandinterface. + * @arg_mainConnection: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "NewMainConnection" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("new-main-connection", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, new_main_connection), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_VARIANT); + + /** + * AudiomanagerCommandinterface::removed-main-connection: + * @object: A #AudiomanagerCommandinterface. + * @arg_mainConnectionId: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "RemovedMainConnection" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("removed-main-connection", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, removed_main_connection), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_UINT); + + /** + * AudiomanagerCommandinterface::main-connection-state-changed: + * @object: A #AudiomanagerCommandinterface. + * @arg_connectionID: Argument. + * @arg_connectionState: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "MainConnectionStateChanged" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("main-connection-state-changed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, main_connection_state_changed), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 2, G_TYPE_UINT, G_TYPE_INT); + + /** + * AudiomanagerCommandinterface::volume-changed: + * @object: A #AudiomanagerCommandinterface. + * @arg_sinkID: Argument. + * @arg_volume: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "VolumeChanged" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("volume-changed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, volume_changed), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 2, G_TYPE_UINT, G_TYPE_INT); + + /** + * AudiomanagerCommandinterface::sink-mute-state-changed: + * @object: A #AudiomanagerCommandinterface. + * @arg_sinkID: Argument. + * @arg_muteState: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "SinkMuteStateChanged" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("sink-mute-state-changed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, sink_mute_state_changed), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 2, G_TYPE_UINT, G_TYPE_INT); + + /** + * AudiomanagerCommandinterface::system-property-changed: + * @object: A #AudiomanagerCommandinterface. + * @arg_SystemProperty: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "SystemPropertyChanged" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("system-property-changed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerCommandinterfaceIface, system_property_changed), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_VARIANT); + +} + +/** + * audiomanager_commandinterface_emit_new_main_connection: + * @object: A #AudiomanagerCommandinterface. + * @arg_mainConnection: Argument to pass with the signal. + * + * Emits the "NewMainConnection" D-Bus signal. + */ +void +audiomanager_commandinterface_emit_new_main_connection ( + AudiomanagerCommandinterface *object, + GVariant *arg_mainConnection) +{ + g_signal_emit_by_name (object, "new-main-connection", arg_mainConnection); +} + +/** + * audiomanager_commandinterface_emit_removed_main_connection: + * @object: A #AudiomanagerCommandinterface. + * @arg_mainConnectionId: Argument to pass with the signal. + * + * Emits the "RemovedMainConnection" D-Bus signal. + */ +void +audiomanager_commandinterface_emit_removed_main_connection ( + AudiomanagerCommandinterface *object, + guint16 arg_mainConnectionId) +{ + g_signal_emit_by_name (object, "removed-main-connection", arg_mainConnectionId); +} + +/** + * audiomanager_commandinterface_emit_main_connection_state_changed: + * @object: A #AudiomanagerCommandinterface. + * @arg_connectionID: Argument to pass with the signal. + * @arg_connectionState: Argument to pass with the signal. + * + * Emits the "MainConnectionStateChanged" D-Bus signal. + */ +void +audiomanager_commandinterface_emit_main_connection_state_changed ( + AudiomanagerCommandinterface *object, + guint16 arg_connectionID, + gint16 arg_connectionState) +{ + g_signal_emit_by_name (object, "main-connection-state-changed", arg_connectionID, arg_connectionState); +} + +/** + * audiomanager_commandinterface_emit_volume_changed: + * @object: A #AudiomanagerCommandinterface. + * @arg_sinkID: Argument to pass with the signal. + * @arg_volume: Argument to pass with the signal. + * + * Emits the "VolumeChanged" D-Bus signal. + */ +void +audiomanager_commandinterface_emit_volume_changed ( + AudiomanagerCommandinterface *object, + guint16 arg_sinkID, + gint16 arg_volume) +{ + g_signal_emit_by_name (object, "volume-changed", arg_sinkID, arg_volume); +} + +/** + * audiomanager_commandinterface_emit_sink_mute_state_changed: + * @object: A #AudiomanagerCommandinterface. + * @arg_sinkID: Argument to pass with the signal. + * @arg_muteState: Argument to pass with the signal. + * + * Emits the "SinkMuteStateChanged" D-Bus signal. + */ +void +audiomanager_commandinterface_emit_sink_mute_state_changed ( + AudiomanagerCommandinterface *object, + guint16 arg_sinkID, + gint16 arg_muteState) +{ + g_signal_emit_by_name (object, "sink-mute-state-changed", arg_sinkID, arg_muteState); +} + +/** + * audiomanager_commandinterface_emit_system_property_changed: + * @object: A #AudiomanagerCommandinterface. + * @arg_SystemProperty: Argument to pass with the signal. + * + * Emits the "SystemPropertyChanged" D-Bus signal. + */ +void +audiomanager_commandinterface_emit_system_property_changed ( + AudiomanagerCommandinterface *object, + GVariant *arg_SystemProperty) +{ + g_signal_emit_by_name (object, "system-property-changed", arg_SystemProperty); +} + +/** + * audiomanager_commandinterface_call_connect: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @arg_sourceID: Argument to pass with the method invocation. + * @arg_sinkID: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the Connect() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_commandinterface_call_connect_finish() to get the result of the operation. + * + * See audiomanager_commandinterface_call_connect_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_commandinterface_call_connect ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sourceID, + guint16 arg_sinkID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Connect", + g_variant_new ("(qq)", + arg_sourceID, + arg_sinkID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_commandinterface_call_connect_finish: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @out_mainConnectionID: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_commandinterface_call_connect(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_commandinterface_call_connect(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_connect_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + guint16 *out_mainConnectionID, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(nq)", + out_result, + out_mainConnectionID); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_connect_sync: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @arg_sourceID: Argument to pass with the method invocation. + * @arg_sinkID: Argument to pass with the method invocation. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @out_mainConnectionID: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the Connect() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_commandinterface_call_connect() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_connect_sync ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sourceID, + guint16 arg_sinkID, + gint16 *out_result, + guint16 *out_mainConnectionID, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Connect", + g_variant_new ("(qq)", + arg_sourceID, + arg_sinkID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(nq)", + out_result, + out_mainConnectionID); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_disconnect: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @arg_mainConnectionID: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the Disconnect() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_commandinterface_call_disconnect_finish() to get the result of the operation. + * + * See audiomanager_commandinterface_call_disconnect_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_commandinterface_call_disconnect ( + AudiomanagerCommandinterface *proxy, + guint16 arg_mainConnectionID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Disconnect", + g_variant_new ("(q)", + arg_mainConnectionID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_commandinterface_call_disconnect_finish: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_commandinterface_call_disconnect(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_commandinterface_call_disconnect(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_disconnect_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n)", + out_result); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_disconnect_sync: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @arg_mainConnectionID: Argument to pass with the method invocation. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the Disconnect() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_commandinterface_call_disconnect() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_disconnect_sync ( + AudiomanagerCommandinterface *proxy, + guint16 arg_mainConnectionID, + gint16 *out_result, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Disconnect", + g_variant_new ("(q)", + arg_mainConnectionID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n)", + out_result); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_set_volume: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @arg_sinkID: Argument to pass with the method invocation. + * @arg_volume: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the SetVolume() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_commandinterface_call_set_volume_finish() to get the result of the operation. + * + * See audiomanager_commandinterface_call_set_volume_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_commandinterface_call_set_volume ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sinkID, + gint16 arg_volume, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "SetVolume", + g_variant_new ("(qn)", + arg_sinkID, + arg_volume), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_commandinterface_call_set_volume_finish: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_commandinterface_call_set_volume(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_commandinterface_call_set_volume(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_set_volume_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n)", + out_result); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_set_volume_sync: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @arg_sinkID: Argument to pass with the method invocation. + * @arg_volume: Argument to pass with the method invocation. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the SetVolume() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_commandinterface_call_set_volume() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_set_volume_sync ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sinkID, + gint16 arg_volume, + gint16 *out_result, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "SetVolume", + g_variant_new ("(qn)", + arg_sinkID, + arg_volume), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n)", + out_result); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_volume_step: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @arg_sinkID: Argument to pass with the method invocation. + * @arg_volumeStep: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the VolumeStep() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_commandinterface_call_volume_step_finish() to get the result of the operation. + * + * See audiomanager_commandinterface_call_volume_step_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_commandinterface_call_volume_step ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sinkID, + gint16 arg_volumeStep, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "VolumeStep", + g_variant_new ("(qn)", + arg_sinkID, + arg_volumeStep), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_commandinterface_call_volume_step_finish: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_commandinterface_call_volume_step(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_commandinterface_call_volume_step(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_volume_step_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n)", + out_result); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_volume_step_sync: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @arg_sinkID: Argument to pass with the method invocation. + * @arg_volumeStep: Argument to pass with the method invocation. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the VolumeStep() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_commandinterface_call_volume_step() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_volume_step_sync ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sinkID, + gint16 arg_volumeStep, + gint16 *out_result, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "VolumeStep", + g_variant_new ("(qn)", + arg_sinkID, + arg_volumeStep), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n)", + out_result); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_set_sink_mute_state: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @arg_sinkID: Argument to pass with the method invocation. + * @arg_muteState: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the SetSinkMuteState() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_commandinterface_call_set_sink_mute_state_finish() to get the result of the operation. + * + * See audiomanager_commandinterface_call_set_sink_mute_state_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_commandinterface_call_set_sink_mute_state ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sinkID, + gint16 arg_muteState, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "SetSinkMuteState", + g_variant_new ("(qn)", + arg_sinkID, + arg_muteState), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_commandinterface_call_set_sink_mute_state_finish: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_commandinterface_call_set_sink_mute_state(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_commandinterface_call_set_sink_mute_state(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_set_sink_mute_state_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n)", + out_result); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_set_sink_mute_state_sync: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @arg_sinkID: Argument to pass with the method invocation. + * @arg_muteState: Argument to pass with the method invocation. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the SetSinkMuteState() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_commandinterface_call_set_sink_mute_state() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_set_sink_mute_state_sync ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sinkID, + gint16 arg_muteState, + gint16 *out_result, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "SetSinkMuteState", + g_variant_new ("(qn)", + arg_sinkID, + arg_muteState), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n)", + out_result); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_get_list_main_connections: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the GetListMainConnections() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_commandinterface_call_get_list_main_connections_finish() to get the result of the operation. + * + * See audiomanager_commandinterface_call_get_list_main_connections_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_commandinterface_call_get_list_main_connections ( + AudiomanagerCommandinterface *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "GetListMainConnections", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_commandinterface_call_get_list_main_connections_finish: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @out_listConnections: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_commandinterface_call_get_list_main_connections(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_commandinterface_call_get_list_main_connections(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_get_list_main_connections_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GVariant **out_listConnections, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n@a(qqqnn))", + out_result, + out_listConnections); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_get_list_main_connections_sync: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @out_listConnections: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetListMainConnections() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_commandinterface_call_get_list_main_connections() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_get_list_main_connections_sync ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GVariant **out_listConnections, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "GetListMainConnections", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n@a(qqqnn))", + out_result, + out_listConnections); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_get_list_main_sinks: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the GetListMainSinks() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_commandinterface_call_get_list_main_sinks_finish() to get the result of the operation. + * + * See audiomanager_commandinterface_call_get_list_main_sinks_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_commandinterface_call_get_list_main_sinks ( + AudiomanagerCommandinterface *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "GetListMainSinks", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_commandinterface_call_get_list_main_sinks_finish: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @out_listMainSinks: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_commandinterface_call_get_list_main_sinks(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_commandinterface_call_get_list_main_sinks(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_get_list_main_sinks_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GVariant **out_listMainSinks, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n@a(qs(nn)nnq))", + out_result, + out_listMainSinks); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_call_get_list_main_sinks_sync: + * @proxy: A #AudiomanagerCommandinterfaceProxy. + * @out_result: (out): Return location for return parameter or %NULL to ignore. + * @out_listMainSinks: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetListMainSinks() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_commandinterface_call_get_list_main_sinks() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_commandinterface_call_get_list_main_sinks_sync ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GVariant **out_listMainSinks, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "GetListMainSinks", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n@a(qs(nn)nnq))", + out_result, + out_listMainSinks); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_commandinterface_complete_connect: + * @object: A #AudiomanagerCommandinterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @result: Parameter to return. + * @mainConnectionID: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the Connect() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_commandinterface_complete_connect ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result, + guint16 mainConnectionID) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(nq)", + result, + mainConnectionID)); +} + +/** + * audiomanager_commandinterface_complete_disconnect: + * @object: A #AudiomanagerCommandinterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @result: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the Disconnect() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_commandinterface_complete_disconnect ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(n)", + result)); +} + +/** + * audiomanager_commandinterface_complete_set_volume: + * @object: A #AudiomanagerCommandinterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @result: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the SetVolume() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_commandinterface_complete_set_volume ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(n)", + result)); +} + +/** + * audiomanager_commandinterface_complete_volume_step: + * @object: A #AudiomanagerCommandinterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @result: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the VolumeStep() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_commandinterface_complete_volume_step ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(n)", + result)); +} + +/** + * audiomanager_commandinterface_complete_set_sink_mute_state: + * @object: A #AudiomanagerCommandinterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @result: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the SetSinkMuteState() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_commandinterface_complete_set_sink_mute_state ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(n)", + result)); +} + +/** + * audiomanager_commandinterface_complete_get_list_main_connections: + * @object: A #AudiomanagerCommandinterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @result: Parameter to return. + * @listConnections: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetListMainConnections() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_commandinterface_complete_get_list_main_connections ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result, + GVariant *listConnections) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(n@a(qqqnn))", + result, + listConnections)); +} + +/** + * audiomanager_commandinterface_complete_get_list_main_sinks: + * @object: A #AudiomanagerCommandinterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @result: Parameter to return. + * @listMainSinks: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetListMainSinks() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_commandinterface_complete_get_list_main_sinks ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result, + GVariant *listMainSinks) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(n@a(qs(nn)nnq))", + result, + listMainSinks)); +} + +/* ------------------------------------------------------------------------ */ + +/** + * AudiomanagerCommandinterfaceProxy: + * + * The #AudiomanagerCommandinterfaceProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * AudiomanagerCommandinterfaceProxyClass: + * @parent_class: The parent class. + * + * Class structure for #AudiomanagerCommandinterfaceProxy. + */ + +struct _AudiomanagerCommandinterfaceProxyPrivate +{ + GData *qdata; +}; + +static void audiomanager_commandinterface_proxy_iface_init (AudiomanagerCommandinterfaceIface *iface); + +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (AudiomanagerCommandinterfaceProxy, audiomanager_commandinterface_proxy, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (AudiomanagerCommandinterfaceProxy) + G_IMPLEMENT_INTERFACE (TYPE_AUDIOMANAGER_COMMANDINTERFACE, audiomanager_commandinterface_proxy_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (AudiomanagerCommandinterfaceProxy, audiomanager_commandinterface_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_AUDIOMANAGER_COMMANDINTERFACE, audiomanager_commandinterface_proxy_iface_init)); + +#endif +static void +audiomanager_commandinterface_proxy_finalize (GObject *object) +{ + AudiomanagerCommandinterfaceProxy *proxy = AUDIOMANAGER_COMMANDINTERFACE_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (audiomanager_commandinterface_proxy_parent_class)->finalize (object); +} + +static void +audiomanager_commandinterface_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +audiomanager_commandinterface_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +audiomanager_commandinterface_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name G_GNUC_UNUSED, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_audiomanager_commandinterface_interface_info.parent_struct, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], TYPE_AUDIOMANAGER_COMMANDINTERFACE); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_AUDIOMANAGER_COMMANDINTERFACE); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +audiomanager_commandinterface_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + AudiomanagerCommandinterfaceProxy *proxy = AUDIOMANAGER_COMMANDINTERFACE_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_audiomanager_commandinterface_interface_info.parent_struct, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_audiomanager_commandinterface_interface_info.parent_struct, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +audiomanager_commandinterface_proxy_init (AudiomanagerCommandinterfaceProxy *proxy) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + proxy->priv = audiomanager_commandinterface_proxy_get_instance_private (proxy); +#else + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_AUDIOMANAGER_COMMANDINTERFACE_PROXY, AudiomanagerCommandinterfaceProxyPrivate); +#endif + + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), audiomanager_commandinterface_interface_info ()); +} + +static void +audiomanager_commandinterface_proxy_class_init (AudiomanagerCommandinterfaceProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = audiomanager_commandinterface_proxy_finalize; + gobject_class->get_property = audiomanager_commandinterface_proxy_get_property; + gobject_class->set_property = audiomanager_commandinterface_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = audiomanager_commandinterface_proxy_g_signal; + proxy_class->g_properties_changed = audiomanager_commandinterface_proxy_g_properties_changed; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (AudiomanagerCommandinterfaceProxyPrivate)); +#endif +} + +static void +audiomanager_commandinterface_proxy_iface_init (AudiomanagerCommandinterfaceIface *iface) +{ +} + +/** + * audiomanager_commandinterface_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface org.genivi.audiomanager.commandinterface. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_commandinterface_proxy_new_finish() to get the result of the operation. + * + * See audiomanager_commandinterface_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +audiomanager_commandinterface_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_AUDIOMANAGER_COMMANDINTERFACE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.genivi.audiomanager.commandinterface", NULL); +} + +/** + * audiomanager_commandinterface_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_commandinterface_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with audiomanager_commandinterface_proxy_new(). + * + * Returns: (transfer full) (type AudiomanagerCommandinterfaceProxy): The constructed proxy object or %NULL if @error is set. + */ +AudiomanagerCommandinterface * +audiomanager_commandinterface_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return AUDIOMANAGER_COMMANDINTERFACE (ret); + else + return NULL; +} + +/** + * audiomanager_commandinterface_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface org.genivi.audiomanager.commandinterface. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See audiomanager_commandinterface_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type AudiomanagerCommandinterfaceProxy): The constructed proxy object or %NULL if @error is set. + */ +AudiomanagerCommandinterface * +audiomanager_commandinterface_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_AUDIOMANAGER_COMMANDINTERFACE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.genivi.audiomanager.commandinterface", NULL); + if (ret != NULL) + return AUDIOMANAGER_COMMANDINTERFACE (ret); + else + return NULL; +} + + +/** + * audiomanager_commandinterface_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like audiomanager_commandinterface_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_commandinterface_proxy_new_for_bus_finish() to get the result of the operation. + * + * See audiomanager_commandinterface_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +audiomanager_commandinterface_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_AUDIOMANAGER_COMMANDINTERFACE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.genivi.audiomanager.commandinterface", NULL); +} + +/** + * audiomanager_commandinterface_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_commandinterface_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with audiomanager_commandinterface_proxy_new_for_bus(). + * + * Returns: (transfer full) (type AudiomanagerCommandinterfaceProxy): The constructed proxy object or %NULL if @error is set. + */ +AudiomanagerCommandinterface * +audiomanager_commandinterface_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return AUDIOMANAGER_COMMANDINTERFACE (ret); + else + return NULL; +} + +/** + * audiomanager_commandinterface_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like audiomanager_commandinterface_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See audiomanager_commandinterface_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type AudiomanagerCommandinterfaceProxy): The constructed proxy object or %NULL if @error is set. + */ +AudiomanagerCommandinterface * +audiomanager_commandinterface_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_AUDIOMANAGER_COMMANDINTERFACE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.genivi.audiomanager.commandinterface", NULL); + if (ret != NULL) + return AUDIOMANAGER_COMMANDINTERFACE (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * AudiomanagerCommandinterfaceSkeleton: + * + * The #AudiomanagerCommandinterfaceSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * AudiomanagerCommandinterfaceSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #AudiomanagerCommandinterfaceSkeleton. + */ + +struct _AudiomanagerCommandinterfaceSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_audiomanager_commandinterface_skeleton_handle_method_call ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + AudiomanagerCommandinterfaceSkeleton *skeleton = AUDIOMANAGER_COMMANDINTERFACE_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], TYPE_AUDIOMANAGER_COMMANDINTERFACE); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_AUDIOMANAGER_COMMANDINTERFACE); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_audiomanager_commandinterface_skeleton_handle_get_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + AudiomanagerCommandinterfaceSkeleton *skeleton = AUDIOMANAGER_COMMANDINTERFACE_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_audiomanager_commandinterface_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_audiomanager_commandinterface_skeleton_handle_set_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + AudiomanagerCommandinterfaceSkeleton *skeleton = AUDIOMANAGER_COMMANDINTERFACE_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_audiomanager_commandinterface_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _audiomanager_commandinterface_skeleton_vtable = +{ + _audiomanager_commandinterface_skeleton_handle_method_call, + _audiomanager_commandinterface_skeleton_handle_get_property, + _audiomanager_commandinterface_skeleton_handle_set_property, + {NULL} +}; + +static GDBusInterfaceInfo * +audiomanager_commandinterface_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return audiomanager_commandinterface_interface_info (); +} + +static GDBusInterfaceVTable * +audiomanager_commandinterface_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return (GDBusInterfaceVTable *) &_audiomanager_commandinterface_skeleton_vtable; +} + +static GVariant * +audiomanager_commandinterface_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + AudiomanagerCommandinterfaceSkeleton *skeleton = AUDIOMANAGER_COMMANDINTERFACE_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_audiomanager_commandinterface_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _audiomanager_commandinterface_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _audiomanager_commandinterface_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _audiomanager_commandinterface_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.genivi.audiomanager.commandinterface", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +audiomanager_commandinterface_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void +_audiomanager_commandinterface_on_signal_new_main_connection ( + AudiomanagerCommandinterface *object, + GVariant *arg_mainConnection) +{ + AudiomanagerCommandinterfaceSkeleton *skeleton = AUDIOMANAGER_COMMANDINTERFACE_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(@(qqqnn))", + arg_mainConnection)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.genivi.audiomanager.commandinterface", "NewMainConnection", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_audiomanager_commandinterface_on_signal_removed_main_connection ( + AudiomanagerCommandinterface *object, + guint16 arg_mainConnectionId) +{ + AudiomanagerCommandinterfaceSkeleton *skeleton = AUDIOMANAGER_COMMANDINTERFACE_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(q)", + arg_mainConnectionId)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.genivi.audiomanager.commandinterface", "RemovedMainConnection", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_audiomanager_commandinterface_on_signal_main_connection_state_changed ( + AudiomanagerCommandinterface *object, + guint16 arg_connectionID, + gint16 arg_connectionState) +{ + AudiomanagerCommandinterfaceSkeleton *skeleton = AUDIOMANAGER_COMMANDINTERFACE_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(qn)", + arg_connectionID, + arg_connectionState)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.genivi.audiomanager.commandinterface", "MainConnectionStateChanged", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_audiomanager_commandinterface_on_signal_volume_changed ( + AudiomanagerCommandinterface *object, + guint16 arg_sinkID, + gint16 arg_volume) +{ + AudiomanagerCommandinterfaceSkeleton *skeleton = AUDIOMANAGER_COMMANDINTERFACE_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(qn)", + arg_sinkID, + arg_volume)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.genivi.audiomanager.commandinterface", "VolumeChanged", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_audiomanager_commandinterface_on_signal_sink_mute_state_changed ( + AudiomanagerCommandinterface *object, + guint16 arg_sinkID, + gint16 arg_muteState) +{ + AudiomanagerCommandinterfaceSkeleton *skeleton = AUDIOMANAGER_COMMANDINTERFACE_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(qn)", + arg_sinkID, + arg_muteState)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.genivi.audiomanager.commandinterface", "SinkMuteStateChanged", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_audiomanager_commandinterface_on_signal_system_property_changed ( + AudiomanagerCommandinterface *object, + GVariant *arg_SystemProperty) +{ + AudiomanagerCommandinterfaceSkeleton *skeleton = AUDIOMANAGER_COMMANDINTERFACE_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(@(nn))", + arg_SystemProperty)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.genivi.audiomanager.commandinterface", "SystemPropertyChanged", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void audiomanager_commandinterface_skeleton_iface_init (AudiomanagerCommandinterfaceIface *iface); +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (AudiomanagerCommandinterfaceSkeleton, audiomanager_commandinterface_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_ADD_PRIVATE (AudiomanagerCommandinterfaceSkeleton) + G_IMPLEMENT_INTERFACE (TYPE_AUDIOMANAGER_COMMANDINTERFACE, audiomanager_commandinterface_skeleton_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (AudiomanagerCommandinterfaceSkeleton, audiomanager_commandinterface_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_AUDIOMANAGER_COMMANDINTERFACE, audiomanager_commandinterface_skeleton_iface_init)); + +#endif +static void +audiomanager_commandinterface_skeleton_finalize (GObject *object) +{ + AudiomanagerCommandinterfaceSkeleton *skeleton = AUDIOMANAGER_COMMANDINTERFACE_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (audiomanager_commandinterface_skeleton_parent_class)->finalize (object); +} + +static void +audiomanager_commandinterface_skeleton_init (AudiomanagerCommandinterfaceSkeleton *skeleton) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + skeleton->priv = audiomanager_commandinterface_skeleton_get_instance_private (skeleton); +#else + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_AUDIOMANAGER_COMMANDINTERFACE_SKELETON, AudiomanagerCommandinterfaceSkeletonPrivate); +#endif + + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +audiomanager_commandinterface_skeleton_class_init (AudiomanagerCommandinterfaceSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = audiomanager_commandinterface_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = audiomanager_commandinterface_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = audiomanager_commandinterface_skeleton_dbus_interface_get_properties; + skeleton_class->flush = audiomanager_commandinterface_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = audiomanager_commandinterface_skeleton_dbus_interface_get_vtable; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (AudiomanagerCommandinterfaceSkeletonPrivate)); +#endif +} + +static void +audiomanager_commandinterface_skeleton_iface_init (AudiomanagerCommandinterfaceIface *iface) +{ + iface->new_main_connection = _audiomanager_commandinterface_on_signal_new_main_connection; + iface->removed_main_connection = _audiomanager_commandinterface_on_signal_removed_main_connection; + iface->main_connection_state_changed = _audiomanager_commandinterface_on_signal_main_connection_state_changed; + iface->volume_changed = _audiomanager_commandinterface_on_signal_volume_changed; + iface->sink_mute_state_changed = _audiomanager_commandinterface_on_signal_sink_mute_state_changed; + iface->system_property_changed = _audiomanager_commandinterface_on_signal_system_property_changed; +} + +/** + * audiomanager_commandinterface_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface org.genivi.audiomanager.commandinterface. + * + * Returns: (transfer full) (type AudiomanagerCommandinterfaceSkeleton): The skeleton object. + */ +AudiomanagerCommandinterface * +audiomanager_commandinterface_skeleton_new (void) +{ + return AUDIOMANAGER_COMMANDINTERFACE (g_object_new (TYPE_AUDIOMANAGER_COMMANDINTERFACE_SKELETON, NULL)); +} + +/* ------------------------------------------------------------------------ + * Code for interface org.genivi.audiomanager.routinginterface + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:AudiomanagerRoutinginterface + * @title: AudiomanagerRoutinginterface + * @short_description: Generated C code for the org.genivi.audiomanager.routinginterface D-Bus interface + * + * This section contains code for working with the org.genivi.audiomanager.routinginterface D-Bus interface in C. + */ + +/* ---- Introspection data for org.genivi.audiomanager.routinginterface ---- */ + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_connect_IN_ARG_handle = +{ + { + -1, + (gchar *) "handle", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_connect_IN_ARG_connectionID = +{ + { + -1, + (gchar *) "connectionID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_connect_IN_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_ack_connect_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_ack_connect_IN_ARG_handle, + &_audiomanager_routinginterface_method_info_ack_connect_IN_ARG_connectionID, + &_audiomanager_routinginterface_method_info_ack_connect_IN_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_ack_connect = +{ + { + -1, + (gchar *) "ackConnect", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_ack_connect_IN_ARG_pointers, + NULL, + NULL + }, + "handle-ack-connect", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_disconnect_IN_ARG_handle = +{ + { + -1, + (gchar *) "handle", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_disconnect_IN_ARG_connectionID = +{ + { + -1, + (gchar *) "connectionID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_disconnect_IN_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_ack_disconnect_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_ack_disconnect_IN_ARG_handle, + &_audiomanager_routinginterface_method_info_ack_disconnect_IN_ARG_connectionID, + &_audiomanager_routinginterface_method_info_ack_disconnect_IN_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_ack_disconnect = +{ + { + -1, + (gchar *) "ackDisconnect", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_ack_disconnect_IN_ARG_pointers, + NULL, + NULL + }, + "handle-ack-disconnect", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_set_source_state_IN_ARG_handle = +{ + { + -1, + (gchar *) "handle", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_set_source_state_IN_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_ack_set_source_state_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_ack_set_source_state_IN_ARG_handle, + &_audiomanager_routinginterface_method_info_ack_set_source_state_IN_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_ack_set_source_state = +{ + { + -1, + (gchar *) "ackSetSourceState", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_ack_set_source_state_IN_ARG_pointers, + NULL, + NULL + }, + "handle-ack-set-source-state", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_set_sink_volume_IN_ARG_handle = +{ + { + -1, + (gchar *) "handle", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_set_sink_volume_IN_ARG_volume = +{ + { + -1, + (gchar *) "volume", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_set_sink_volume_IN_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_ack_set_sink_volume_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_ack_set_sink_volume_IN_ARG_handle, + &_audiomanager_routinginterface_method_info_ack_set_sink_volume_IN_ARG_volume, + &_audiomanager_routinginterface_method_info_ack_set_sink_volume_IN_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_ack_set_sink_volume = +{ + { + -1, + (gchar *) "ackSetSinkVolume", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_ack_set_sink_volume_IN_ARG_pointers, + NULL, + NULL + }, + "handle-ack-set-sink-volume", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_register_sink_IN_ARG_sinkData = +{ + { + -1, + (gchar *) "sinkData", + (gchar *) "(qsqinb(ii)nna(in)aia(in)a(iin)a(iin))", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_register_sink_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_register_sink_IN_ARG_sinkData, + NULL +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_register_sink_OUT_ARG_sinkID = +{ + { + -1, + (gchar *) "sinkID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_register_sink_OUT_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_register_sink_OUT_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_register_sink_OUT_ARG_sinkID, + &_audiomanager_routinginterface_method_info_register_sink_OUT_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_register_sink = +{ + { + -1, + (gchar *) "registerSink", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_register_sink_IN_ARG_pointers, + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_register_sink_OUT_ARG_pointers, + NULL + }, + "handle-register-sink", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_deregister_sink_IN_ARG_sinkID = +{ + { + -1, + (gchar *) "sinkID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_deregister_sink_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_deregister_sink_IN_ARG_sinkID, + NULL +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_deregister_sink_OUT_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "i", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_deregister_sink_OUT_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_deregister_sink_OUT_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_deregister_sink = +{ + { + -1, + (gchar *) "deregisterSink", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_deregister_sink_IN_ARG_pointers, + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_deregister_sink_OUT_ARG_pointers, + NULL + }, + "handle-deregister-sink", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_register_source_IN_ARG_sourceData = +{ + { + -1, + (gchar *) "sourceData", + (gchar *) "(qqsqinb(ii)qa(in)aia(in)a(iin)a(iin))", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_register_source_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_register_source_IN_ARG_sourceData, + NULL +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_register_source_OUT_ARG_sourceID = +{ + { + -1, + (gchar *) "sourceID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_register_source_OUT_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_register_source_OUT_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_register_source_OUT_ARG_sourceID, + &_audiomanager_routinginterface_method_info_register_source_OUT_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_register_source = +{ + { + -1, + (gchar *) "registerSource", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_register_source_IN_ARG_pointers, + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_register_source_OUT_ARG_pointers, + NULL + }, + "handle-register-source", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_deregister_source_IN_ARG_sourceID = +{ + { + -1, + (gchar *) "sourceID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_deregister_source_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_deregister_source_IN_ARG_sourceID, + NULL +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_deregister_source_OUT_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_deregister_source_OUT_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_deregister_source_OUT_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_deregister_source = +{ + { + -1, + (gchar *) "deregisterSource", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_deregister_source_IN_ARG_pointers, + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_deregister_source_OUT_ARG_pointers, + NULL + }, + "handle-deregister-source", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_hook_interrupt_status_change_IN_ARG_sourceID = +{ + { + -1, + (gchar *) "sourceID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_hook_interrupt_status_change_IN_ARG_interruptState = +{ + { + -1, + (gchar *) "interruptState", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_hook_interrupt_status_change_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_hook_interrupt_status_change_IN_ARG_sourceID, + &_audiomanager_routinginterface_method_info_hook_interrupt_status_change_IN_ARG_interruptState, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_hook_interrupt_status_change = +{ + { + -1, + (gchar *) "hookInterruptStatusChange", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_hook_interrupt_status_change_IN_ARG_pointers, + NULL, + NULL + }, + "handle-hook-interrupt-status-change", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_hook_source_availablity_status_change_IN_ARG_sourceID = +{ + { + -1, + (gchar *) "sourceID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_hook_source_availablity_status_change_IN_ARG_availability = +{ + { + -1, + (gchar *) "availability", + (gchar *) "(nn)", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_hook_source_availablity_status_change_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_hook_source_availablity_status_change_IN_ARG_sourceID, + &_audiomanager_routinginterface_method_info_hook_source_availablity_status_change_IN_ARG_availability, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_hook_source_availablity_status_change = +{ + { + -1, + (gchar *) "hookSourceAvailablityStatusChange", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_hook_source_availablity_status_change_IN_ARG_pointers, + NULL, + NULL + }, + "handle-hook-source-availablity-status-change", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_confirm_routing_ready_IN_ARG_domainID = +{ + { + -1, + (gchar *) "domainID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_confirm_routing_ready_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_confirm_routing_ready_IN_ARG_domainID, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_confirm_routing_ready = +{ + { + -1, + (gchar *) "confirmRoutingReady", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_confirm_routing_ready_IN_ARG_pointers, + NULL, + NULL + }, + "handle-confirm-routing-ready", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_confirm_routing_rundown_IN_ARG_domainID = +{ + { + -1, + (gchar *) "domainID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_confirm_routing_rundown_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_confirm_routing_rundown_IN_ARG_domainID, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_confirm_routing_rundown = +{ + { + -1, + (gchar *) "confirmRoutingRundown", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_confirm_routing_rundown_IN_ARG_pointers, + NULL, + NULL + }, + "handle-confirm-routing-rundown", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_set_volumes_IN_ARG_handle = +{ + { + -1, + (gchar *) "handle", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_set_volumes_IN_ARG_listvolumes = +{ + { + -1, + (gchar *) "listvolumes", + (gchar *) "a(nqqnq)", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_set_volumes_IN_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_ack_set_volumes_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_ack_set_volumes_IN_ARG_handle, + &_audiomanager_routinginterface_method_info_ack_set_volumes_IN_ARG_listvolumes, + &_audiomanager_routinginterface_method_info_ack_set_volumes_IN_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_ack_set_volumes = +{ + { + -1, + (gchar *) "ackSetVolumes", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_ack_set_volumes_IN_ARG_pointers, + NULL, + NULL + }, + "handle-ack-set-volumes", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_sink_notification_configuration_IN_ARG_handle = +{ + { + -1, + (gchar *) "handle", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_sink_notification_configuration_IN_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_ack_sink_notification_configuration_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_ack_sink_notification_configuration_IN_ARG_handle, + &_audiomanager_routinginterface_method_info_ack_sink_notification_configuration_IN_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_ack_sink_notification_configuration = +{ + { + -1, + (gchar *) "ackSinkNotificationConfiguration", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_ack_sink_notification_configuration_IN_ARG_pointers, + NULL, + NULL + }, + "handle-ack-sink-notification-configuration", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_source_notification_configuration_IN_ARG_handle = +{ + { + -1, + (gchar *) "handle", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_ack_source_notification_configuration_IN_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_ack_source_notification_configuration_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_ack_source_notification_configuration_IN_ARG_handle, + &_audiomanager_routinginterface_method_info_ack_source_notification_configuration_IN_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_ack_source_notification_configuration = +{ + { + -1, + (gchar *) "ackSourceNotificationConfiguration", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_ack_source_notification_configuration_IN_ARG_pointers, + NULL, + NULL + }, + "handle-ack-source-notification-configuration", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_register_domain_IN_ARG_domaindata = +{ + { + -1, + (gchar *) "domaindata", + (gchar *) "(qsssbbn)", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_register_domain_IN_ARG_returnBusname = +{ + { + -1, + (gchar *) "returnBusname", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_register_domain_IN_ARG_returnPath = +{ + { + -1, + (gchar *) "returnPath", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_register_domain_IN_ARG_returnInterface = +{ + { + -1, + (gchar *) "returnInterface", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_register_domain_IN_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_register_domain_IN_ARG_domaindata, + &_audiomanager_routinginterface_method_info_register_domain_IN_ARG_returnBusname, + &_audiomanager_routinginterface_method_info_register_domain_IN_ARG_returnPath, + &_audiomanager_routinginterface_method_info_register_domain_IN_ARG_returnInterface, + NULL +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_register_domain_OUT_ARG_domainid = +{ + { + -1, + (gchar *) "domainid", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routinginterface_method_info_register_domain_OUT_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routinginterface_method_info_register_domain_OUT_ARG_pointers[] = +{ + &_audiomanager_routinginterface_method_info_register_domain_OUT_ARG_domainid, + &_audiomanager_routinginterface_method_info_register_domain_OUT_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routinginterface_method_info_register_domain = +{ + { + -1, + (gchar *) "registerDomain", + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_register_domain_IN_ARG_pointers, + (GDBusArgInfo **) &_audiomanager_routinginterface_method_info_register_domain_OUT_ARG_pointers, + NULL + }, + "handle-register-domain", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _audiomanager_routinginterface_method_info_pointers[] = +{ + &_audiomanager_routinginterface_method_info_ack_connect, + &_audiomanager_routinginterface_method_info_ack_disconnect, + &_audiomanager_routinginterface_method_info_ack_set_source_state, + &_audiomanager_routinginterface_method_info_ack_set_sink_volume, + &_audiomanager_routinginterface_method_info_register_sink, + &_audiomanager_routinginterface_method_info_deregister_sink, + &_audiomanager_routinginterface_method_info_register_source, + &_audiomanager_routinginterface_method_info_deregister_source, + &_audiomanager_routinginterface_method_info_hook_interrupt_status_change, + &_audiomanager_routinginterface_method_info_hook_source_availablity_status_change, + &_audiomanager_routinginterface_method_info_confirm_routing_ready, + &_audiomanager_routinginterface_method_info_confirm_routing_rundown, + &_audiomanager_routinginterface_method_info_ack_set_volumes, + &_audiomanager_routinginterface_method_info_ack_sink_notification_configuration, + &_audiomanager_routinginterface_method_info_ack_source_notification_configuration, + &_audiomanager_routinginterface_method_info_register_domain, + NULL +}; + +static const _ExtendedGDBusSignalInfo _audiomanager_routinginterface_signal_info_set_routing_ready = +{ + { + -1, + (gchar *) "setRoutingReady", + NULL, + NULL + }, + "set-routing-ready" +}; + +static const _ExtendedGDBusSignalInfo _audiomanager_routinginterface_signal_info_set_routing_rundown = +{ + { + -1, + (gchar *) "setRoutingRundown", + NULL, + NULL + }, + "set-routing-rundown" +}; + +static const _ExtendedGDBusSignalInfo * const _audiomanager_routinginterface_signal_info_pointers[] = +{ + &_audiomanager_routinginterface_signal_info_set_routing_ready, + &_audiomanager_routinginterface_signal_info_set_routing_rundown, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _audiomanager_routinginterface_interface_info = +{ + { + -1, + (gchar *) "org.genivi.audiomanager.routinginterface", + (GDBusMethodInfo **) &_audiomanager_routinginterface_method_info_pointers, + (GDBusSignalInfo **) &_audiomanager_routinginterface_signal_info_pointers, + NULL, + NULL + }, + "audiomanager-routinginterface", +}; + + +/** + * audiomanager_routinginterface_interface_info: + * + * Gets a machine-readable description of the org.genivi.audiomanager.routinginterface D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +audiomanager_routinginterface_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_audiomanager_routinginterface_interface_info.parent_struct; +} + +/** + * audiomanager_routinginterface_override_properties: + * @klass: The class structure for a #GObject-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #AudiomanagerRoutinginterface interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +audiomanager_routinginterface_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * AudiomanagerRoutinginterface: + * + * Abstract interface type for the D-Bus interface org.genivi.audiomanager.routinginterface. + */ + +/** + * AudiomanagerRoutinginterfaceIface: + * @parent_iface: The parent interface. + * @handle_ack_connect: Handler for the #AudiomanagerRoutinginterface::handle-ack-connect signal. + * @handle_ack_disconnect: Handler for the #AudiomanagerRoutinginterface::handle-ack-disconnect signal. + * @handle_ack_set_sink_volume: Handler for the #AudiomanagerRoutinginterface::handle-ack-set-sink-volume signal. + * @handle_ack_set_source_state: Handler for the #AudiomanagerRoutinginterface::handle-ack-set-source-state signal. + * @handle_ack_set_volumes: Handler for the #AudiomanagerRoutinginterface::handle-ack-set-volumes signal. + * @handle_ack_sink_notification_configuration: Handler for the #AudiomanagerRoutinginterface::handle-ack-sink-notification-configuration signal. + * @handle_ack_source_notification_configuration: Handler for the #AudiomanagerRoutinginterface::handle-ack-source-notification-configuration signal. + * @handle_confirm_routing_ready: Handler for the #AudiomanagerRoutinginterface::handle-confirm-routing-ready signal. + * @handle_confirm_routing_rundown: Handler for the #AudiomanagerRoutinginterface::handle-confirm-routing-rundown signal. + * @handle_deregister_sink: Handler for the #AudiomanagerRoutinginterface::handle-deregister-sink signal. + * @handle_deregister_source: Handler for the #AudiomanagerRoutinginterface::handle-deregister-source signal. + * @handle_hook_interrupt_status_change: Handler for the #AudiomanagerRoutinginterface::handle-hook-interrupt-status-change signal. + * @handle_hook_source_availablity_status_change: Handler for the #AudiomanagerRoutinginterface::handle-hook-source-availablity-status-change signal. + * @handle_register_domain: Handler for the #AudiomanagerRoutinginterface::handle-register-domain signal. + * @handle_register_sink: Handler for the #AudiomanagerRoutinginterface::handle-register-sink signal. + * @handle_register_source: Handler for the #AudiomanagerRoutinginterface::handle-register-source signal. + * @set_routing_ready: Handler for the #AudiomanagerRoutinginterface::set-routing-ready signal. + * @set_routing_rundown: Handler for the #AudiomanagerRoutinginterface::set-routing-rundown signal. + * + * Virtual table for the D-Bus interface org.genivi.audiomanager.routinginterface. + */ + +typedef AudiomanagerRoutinginterfaceIface AudiomanagerRoutinginterfaceInterface; +G_DEFINE_INTERFACE (AudiomanagerRoutinginterface, audiomanager_routinginterface, G_TYPE_OBJECT); + +static void +audiomanager_routinginterface_default_init (AudiomanagerRoutinginterfaceIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * AudiomanagerRoutinginterface::handle-ack-connect: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_handle: Argument passed by remote caller. + * @arg_connectionID: Argument passed by remote caller. + * @arg_error: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the ackConnect() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_ack_connect() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-ack-connect", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_ack_connect), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 4, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT); + + /** + * AudiomanagerRoutinginterface::handle-ack-disconnect: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_handle: Argument passed by remote caller. + * @arg_connectionID: Argument passed by remote caller. + * @arg_error: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the ackDisconnect() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_ack_disconnect() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-ack-disconnect", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_ack_disconnect), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 4, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT); + + /** + * AudiomanagerRoutinginterface::handle-ack-set-source-state: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_handle: Argument passed by remote caller. + * @arg_error: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the ackSetSourceState() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_ack_set_source_state() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-ack-set-source-state", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_ack_set_source_state), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_UINT); + + /** + * AudiomanagerRoutinginterface::handle-ack-set-sink-volume: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_handle: Argument passed by remote caller. + * @arg_volume: Argument passed by remote caller. + * @arg_error: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the ackSetSinkVolume() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_ack_set_sink_volume() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-ack-set-sink-volume", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_ack_set_sink_volume), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 4, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_INT, G_TYPE_UINT); + + /** + * AudiomanagerRoutinginterface::handle-register-sink: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_sinkData: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the registerSink() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_register_sink() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-register-sink", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_register_sink), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * AudiomanagerRoutinginterface::handle-deregister-sink: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_sinkID: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the deregisterSink() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_deregister_sink() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-deregister-sink", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_deregister_sink), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT); + + /** + * AudiomanagerRoutinginterface::handle-register-source: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_sourceData: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the registerSource() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_register_source() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-register-source", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_register_source), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * AudiomanagerRoutinginterface::handle-deregister-source: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_sourceID: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the deregisterSource() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_deregister_source() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-deregister-source", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_deregister_source), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT); + + /** + * AudiomanagerRoutinginterface::handle-hook-interrupt-status-change: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_sourceID: Argument passed by remote caller. + * @arg_interruptState: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the hookInterruptStatusChange() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_hook_interrupt_status_change() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-hook-interrupt-status-change", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_hook_interrupt_status_change), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_UINT); + + /** + * AudiomanagerRoutinginterface::handle-hook-source-availablity-status-change: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_sourceID: Argument passed by remote caller. + * @arg_availability: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the hookSourceAvailablityStatusChange() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_hook_source_availablity_status_change() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-hook-source-availablity-status-change", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_hook_source_availablity_status_change), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_VARIANT); + + /** + * AudiomanagerRoutinginterface::handle-confirm-routing-ready: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_domainID: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the confirmRoutingReady() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_confirm_routing_ready() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-confirm-routing-ready", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_confirm_routing_ready), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT); + + /** + * AudiomanagerRoutinginterface::handle-confirm-routing-rundown: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_domainID: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the confirmRoutingRundown() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_confirm_routing_rundown() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-confirm-routing-rundown", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_confirm_routing_rundown), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT); + + /** + * AudiomanagerRoutinginterface::handle-ack-set-volumes: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_handle: Argument passed by remote caller. + * @arg_listvolumes: Argument passed by remote caller. + * @arg_error: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the ackSetVolumes() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_ack_set_volumes() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-ack-set-volumes", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_ack_set_volumes), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 4, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_VARIANT, G_TYPE_UINT); + + /** + * AudiomanagerRoutinginterface::handle-ack-sink-notification-configuration: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_handle: Argument passed by remote caller. + * @arg_error: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the ackSinkNotificationConfiguration() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_ack_sink_notification_configuration() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-ack-sink-notification-configuration", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_ack_sink_notification_configuration), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_UINT); + + /** + * AudiomanagerRoutinginterface::handle-ack-source-notification-configuration: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_handle: Argument passed by remote caller. + * @arg_error: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the ackSourceNotificationConfiguration() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_ack_source_notification_configuration() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-ack-source-notification-configuration", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_ack_source_notification_configuration), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_UINT); + + /** + * AudiomanagerRoutinginterface::handle-register-domain: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: A #GDBusMethodInvocation. + * @arg_domaindata: Argument passed by remote caller. + * @arg_returnBusname: Argument passed by remote caller. + * @arg_returnPath: Argument passed by remote caller. + * @arg_returnInterface: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the registerDomain() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routinginterface_complete_register_domain() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-register-domain", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, handle_register_domain), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 5, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); + + /* GObject signals for received D-Bus signals: */ + /** + * AudiomanagerRoutinginterface::set-routing-ready: + * @object: A #AudiomanagerRoutinginterface. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "setRoutingReady" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("set-routing-ready", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, set_routing_ready), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 0); + + /** + * AudiomanagerRoutinginterface::set-routing-rundown: + * @object: A #AudiomanagerRoutinginterface. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "setRoutingRundown" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("set-routing-rundown", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutinginterfaceIface, set_routing_rundown), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 0); + +} + +/** + * audiomanager_routinginterface_emit_set_routing_ready: + * @object: A #AudiomanagerRoutinginterface. + * + * Emits the "setRoutingReady" D-Bus signal. + */ +void +audiomanager_routinginterface_emit_set_routing_ready ( + AudiomanagerRoutinginterface *object) +{ + g_signal_emit_by_name (object, "set-routing-ready"); +} + +/** + * audiomanager_routinginterface_emit_set_routing_rundown: + * @object: A #AudiomanagerRoutinginterface. + * + * Emits the "setRoutingRundown" D-Bus signal. + */ +void +audiomanager_routinginterface_emit_set_routing_rundown ( + AudiomanagerRoutinginterface *object) +{ + g_signal_emit_by_name (object, "set-routing-rundown"); +} + +/** + * audiomanager_routinginterface_call_ack_connect: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_connectionID: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ackConnect() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_ack_connect_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_ack_connect_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_ack_connect ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "ackConnect", + g_variant_new ("(qqq)", + arg_handle, + arg_connectionID, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_ack_connect_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_ack_connect(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_ack_connect(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_connect_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_connect_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_connectionID: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ackConnect() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_ack_connect() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_connect_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "ackConnect", + g_variant_new ("(qqq)", + arg_handle, + arg_connectionID, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_disconnect: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_connectionID: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ackDisconnect() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_ack_disconnect_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_ack_disconnect_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_ack_disconnect ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "ackDisconnect", + g_variant_new ("(qqq)", + arg_handle, + arg_connectionID, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_ack_disconnect_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_ack_disconnect(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_ack_disconnect(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_disconnect_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_disconnect_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_connectionID: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ackDisconnect() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_ack_disconnect() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_disconnect_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "ackDisconnect", + g_variant_new ("(qqq)", + arg_handle, + arg_connectionID, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_set_source_state: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ackSetSourceState() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_ack_set_source_state_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_ack_set_source_state_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_ack_set_source_state ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "ackSetSourceState", + g_variant_new ("(qq)", + arg_handle, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_ack_set_source_state_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_ack_set_source_state(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_ack_set_source_state(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_set_source_state_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_set_source_state_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ackSetSourceState() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_ack_set_source_state() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_set_source_state_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "ackSetSourceState", + g_variant_new ("(qq)", + arg_handle, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_set_sink_volume: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_volume: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ackSetSinkVolume() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_ack_set_sink_volume_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_ack_set_sink_volume_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_ack_set_sink_volume ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + gint16 arg_volume, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "ackSetSinkVolume", + g_variant_new ("(qnq)", + arg_handle, + arg_volume, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_ack_set_sink_volume_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_ack_set_sink_volume(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_ack_set_sink_volume(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_set_sink_volume_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_set_sink_volume_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_volume: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ackSetSinkVolume() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_ack_set_sink_volume() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_set_sink_volume_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + gint16 arg_volume, + guint16 arg_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "ackSetSinkVolume", + g_variant_new ("(qnq)", + arg_handle, + arg_volume, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_register_sink: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_sinkData: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the registerSink() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_register_sink_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_register_sink_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_register_sink ( + AudiomanagerRoutinginterface *proxy, + GVariant *arg_sinkData, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "registerSink", + g_variant_new ("(@(qsqinb(ii)nna(in)aia(in)a(iin)a(iin)))", + arg_sinkData), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_register_sink_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @out_sinkID: (out): Return location for return parameter or %NULL to ignore. + * @out_error: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_register_sink(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_register_sink(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_register_sink_finish ( + AudiomanagerRoutinginterface *proxy, + guint16 *out_sinkID, + guint16 *out_error, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(qq)", + out_sinkID, + out_error); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_register_sink_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_sinkData: Argument to pass with the method invocation. + * @out_sinkID: (out): Return location for return parameter or %NULL to ignore. + * @out_error: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the registerSink() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_register_sink() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_register_sink_sync ( + AudiomanagerRoutinginterface *proxy, + GVariant *arg_sinkData, + guint16 *out_sinkID, + guint16 *out_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "registerSink", + g_variant_new ("(@(qsqinb(ii)nna(in)aia(in)a(iin)a(iin)))", + arg_sinkData), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(qq)", + out_sinkID, + out_error); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_deregister_sink: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_sinkID: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the deregisterSink() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_deregister_sink_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_deregister_sink_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_deregister_sink ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sinkID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "deregisterSink", + g_variant_new ("(q)", + arg_sinkID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_deregister_sink_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @out_error: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_deregister_sink(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_deregister_sink(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_deregister_sink_finish ( + AudiomanagerRoutinginterface *proxy, + gint *out_error, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(i)", + out_error); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_deregister_sink_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_sinkID: Argument to pass with the method invocation. + * @out_error: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the deregisterSink() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_deregister_sink() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_deregister_sink_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sinkID, + gint *out_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "deregisterSink", + g_variant_new ("(q)", + arg_sinkID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(i)", + out_error); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_register_source: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_sourceData: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the registerSource() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_register_source_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_register_source_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_register_source ( + AudiomanagerRoutinginterface *proxy, + GVariant *arg_sourceData, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "registerSource", + g_variant_new ("(@(qqsqinb(ii)qa(in)aia(in)a(iin)a(iin)))", + arg_sourceData), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_register_source_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @out_sourceID: (out): Return location for return parameter or %NULL to ignore. + * @out_error: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_register_source(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_register_source(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_register_source_finish ( + AudiomanagerRoutinginterface *proxy, + guint16 *out_sourceID, + guint16 *out_error, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(qq)", + out_sourceID, + out_error); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_register_source_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_sourceData: Argument to pass with the method invocation. + * @out_sourceID: (out): Return location for return parameter or %NULL to ignore. + * @out_error: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the registerSource() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_register_source() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_register_source_sync ( + AudiomanagerRoutinginterface *proxy, + GVariant *arg_sourceData, + guint16 *out_sourceID, + guint16 *out_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "registerSource", + g_variant_new ("(@(qqsqinb(ii)qa(in)aia(in)a(iin)a(iin)))", + arg_sourceData), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(qq)", + out_sourceID, + out_error); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_deregister_source: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_sourceID: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the deregisterSource() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_deregister_source_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_deregister_source_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_deregister_source ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sourceID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "deregisterSource", + g_variant_new ("(q)", + arg_sourceID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_deregister_source_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @out_error: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_deregister_source(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_deregister_source(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_deregister_source_finish ( + AudiomanagerRoutinginterface *proxy, + guint16 *out_error, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(q)", + out_error); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_deregister_source_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_sourceID: Argument to pass with the method invocation. + * @out_error: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the deregisterSource() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_deregister_source() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_deregister_source_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sourceID, + guint16 *out_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "deregisterSource", + g_variant_new ("(q)", + arg_sourceID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(q)", + out_error); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_hook_interrupt_status_change: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_sourceID: Argument to pass with the method invocation. + * @arg_interruptState: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the hookInterruptStatusChange() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_hook_interrupt_status_change_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_hook_interrupt_status_change_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_hook_interrupt_status_change ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sourceID, + guint16 arg_interruptState, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "hookInterruptStatusChange", + g_variant_new ("(qq)", + arg_sourceID, + arg_interruptState), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_hook_interrupt_status_change_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_hook_interrupt_status_change(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_hook_interrupt_status_change(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_hook_interrupt_status_change_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_hook_interrupt_status_change_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_sourceID: Argument to pass with the method invocation. + * @arg_interruptState: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the hookInterruptStatusChange() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_hook_interrupt_status_change() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_hook_interrupt_status_change_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sourceID, + guint16 arg_interruptState, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "hookInterruptStatusChange", + g_variant_new ("(qq)", + arg_sourceID, + arg_interruptState), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_hook_source_availablity_status_change: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_sourceID: Argument to pass with the method invocation. + * @arg_availability: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the hookSourceAvailablityStatusChange() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_hook_source_availablity_status_change_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_hook_source_availablity_status_change_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_hook_source_availablity_status_change ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sourceID, + GVariant *arg_availability, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "hookSourceAvailablityStatusChange", + g_variant_new ("(q@(nn))", + arg_sourceID, + arg_availability), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_hook_source_availablity_status_change_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_hook_source_availablity_status_change(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_hook_source_availablity_status_change(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_hook_source_availablity_status_change_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_hook_source_availablity_status_change_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_sourceID: Argument to pass with the method invocation. + * @arg_availability: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the hookSourceAvailablityStatusChange() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_hook_source_availablity_status_change() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_hook_source_availablity_status_change_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sourceID, + GVariant *arg_availability, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "hookSourceAvailablityStatusChange", + g_variant_new ("(q@(nn))", + arg_sourceID, + arg_availability), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_confirm_routing_ready: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_domainID: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the confirmRoutingReady() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_confirm_routing_ready_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_confirm_routing_ready_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_confirm_routing_ready ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_domainID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "confirmRoutingReady", + g_variant_new ("(q)", + arg_domainID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_confirm_routing_ready_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_confirm_routing_ready(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_confirm_routing_ready(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_confirm_routing_ready_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_confirm_routing_ready_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_domainID: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the confirmRoutingReady() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_confirm_routing_ready() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_confirm_routing_ready_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_domainID, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "confirmRoutingReady", + g_variant_new ("(q)", + arg_domainID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_confirm_routing_rundown: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_domainID: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the confirmRoutingRundown() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_confirm_routing_rundown_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_confirm_routing_rundown_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_confirm_routing_rundown ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_domainID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "confirmRoutingRundown", + g_variant_new ("(q)", + arg_domainID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_confirm_routing_rundown_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_confirm_routing_rundown(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_confirm_routing_rundown(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_confirm_routing_rundown_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_confirm_routing_rundown_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_domainID: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the confirmRoutingRundown() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_confirm_routing_rundown() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_confirm_routing_rundown_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_domainID, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "confirmRoutingRundown", + g_variant_new ("(q)", + arg_domainID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_set_volumes: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_listvolumes: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ackSetVolumes() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_ack_set_volumes_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_ack_set_volumes_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_ack_set_volumes ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + GVariant *arg_listvolumes, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "ackSetVolumes", + g_variant_new ("(q@a(nqqnq)q)", + arg_handle, + arg_listvolumes, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_ack_set_volumes_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_ack_set_volumes(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_ack_set_volumes(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_set_volumes_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_set_volumes_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_listvolumes: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ackSetVolumes() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_ack_set_volumes() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_set_volumes_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + GVariant *arg_listvolumes, + guint16 arg_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "ackSetVolumes", + g_variant_new ("(q@a(nqqnq)q)", + arg_handle, + arg_listvolumes, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_sink_notification_configuration: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ackSinkNotificationConfiguration() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_ack_sink_notification_configuration_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_ack_sink_notification_configuration_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_ack_sink_notification_configuration ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "ackSinkNotificationConfiguration", + g_variant_new ("(qq)", + arg_handle, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_ack_sink_notification_configuration_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_ack_sink_notification_configuration(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_ack_sink_notification_configuration(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_sink_notification_configuration_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_sink_notification_configuration_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ackSinkNotificationConfiguration() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_ack_sink_notification_configuration() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_sink_notification_configuration_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "ackSinkNotificationConfiguration", + g_variant_new ("(qq)", + arg_handle, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_source_notification_configuration: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ackSourceNotificationConfiguration() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_ack_source_notification_configuration_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_ack_source_notification_configuration_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_ack_source_notification_configuration ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "ackSourceNotificationConfiguration", + g_variant_new ("(qq)", + arg_handle, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_ack_source_notification_configuration_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_ack_source_notification_configuration(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_ack_source_notification_configuration(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_source_notification_configuration_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_ack_source_notification_configuration_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_error: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ackSourceNotificationConfiguration() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_ack_source_notification_configuration() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_ack_source_notification_configuration_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "ackSourceNotificationConfiguration", + g_variant_new ("(qq)", + arg_handle, + arg_error), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_register_domain: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_domaindata: Argument to pass with the method invocation. + * @arg_returnBusname: Argument to pass with the method invocation. + * @arg_returnPath: Argument to pass with the method invocation. + * @arg_returnInterface: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the registerDomain() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_call_register_domain_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_call_register_domain_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routinginterface_call_register_domain ( + AudiomanagerRoutinginterface *proxy, + GVariant *arg_domaindata, + const gchar *arg_returnBusname, + const gchar *arg_returnPath, + const gchar *arg_returnInterface, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "registerDomain", + g_variant_new ("(@(qsssbbn)sss)", + arg_domaindata, + arg_returnBusname, + arg_returnPath, + arg_returnInterface), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routinginterface_call_register_domain_finish: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @out_domainid: (out): Return location for return parameter or %NULL to ignore. + * @out_error: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_call_register_domain(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routinginterface_call_register_domain(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_register_domain_finish ( + AudiomanagerRoutinginterface *proxy, + guint16 *out_domainid, + guint16 *out_error, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(qq)", + out_domainid, + out_error); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_call_register_domain_sync: + * @proxy: A #AudiomanagerRoutinginterfaceProxy. + * @arg_domaindata: Argument to pass with the method invocation. + * @arg_returnBusname: Argument to pass with the method invocation. + * @arg_returnPath: Argument to pass with the method invocation. + * @arg_returnInterface: Argument to pass with the method invocation. + * @out_domainid: (out): Return location for return parameter or %NULL to ignore. + * @out_error: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the registerDomain() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_call_register_domain() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routinginterface_call_register_domain_sync ( + AudiomanagerRoutinginterface *proxy, + GVariant *arg_domaindata, + const gchar *arg_returnBusname, + const gchar *arg_returnPath, + const gchar *arg_returnInterface, + guint16 *out_domainid, + guint16 *out_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "registerDomain", + g_variant_new ("(@(qsssbbn)sss)", + arg_domaindata, + arg_returnBusname, + arg_returnPath, + arg_returnInterface), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(qq)", + out_domainid, + out_error); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routinginterface_complete_ack_connect: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the ackConnect() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_ack_connect ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routinginterface_complete_ack_disconnect: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the ackDisconnect() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_ack_disconnect ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routinginterface_complete_ack_set_source_state: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the ackSetSourceState() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_ack_set_source_state ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routinginterface_complete_ack_set_sink_volume: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the ackSetSinkVolume() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_ack_set_sink_volume ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routinginterface_complete_register_sink: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @sinkID: Parameter to return. + * @error: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the registerSink() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_register_sink ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 sinkID, + guint16 error) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(qq)", + sinkID, + error)); +} + +/** + * audiomanager_routinginterface_complete_deregister_sink: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @error: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the deregisterSink() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_deregister_sink ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + gint error) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(i)", + error)); +} + +/** + * audiomanager_routinginterface_complete_register_source: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @sourceID: Parameter to return. + * @error: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the registerSource() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_register_source ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 sourceID, + guint16 error) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(qq)", + sourceID, + error)); +} + +/** + * audiomanager_routinginterface_complete_deregister_source: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @error: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the deregisterSource() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_deregister_source ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 error) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(q)", + error)); +} + +/** + * audiomanager_routinginterface_complete_hook_interrupt_status_change: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the hookInterruptStatusChange() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_hook_interrupt_status_change ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routinginterface_complete_hook_source_availablity_status_change: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the hookSourceAvailablityStatusChange() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_hook_source_availablity_status_change ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routinginterface_complete_confirm_routing_ready: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the confirmRoutingReady() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_confirm_routing_ready ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routinginterface_complete_confirm_routing_rundown: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the confirmRoutingRundown() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_confirm_routing_rundown ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routinginterface_complete_ack_set_volumes: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the ackSetVolumes() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_ack_set_volumes ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routinginterface_complete_ack_sink_notification_configuration: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the ackSinkNotificationConfiguration() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_ack_sink_notification_configuration ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routinginterface_complete_ack_source_notification_configuration: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the ackSourceNotificationConfiguration() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_ack_source_notification_configuration ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routinginterface_complete_register_domain: + * @object: A #AudiomanagerRoutinginterface. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @domainid: Parameter to return. + * @error: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the registerDomain() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routinginterface_complete_register_domain ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 domainid, + guint16 error) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(qq)", + domainid, + error)); +} + +/* ------------------------------------------------------------------------ */ + +/** + * AudiomanagerRoutinginterfaceProxy: + * + * The #AudiomanagerRoutinginterfaceProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * AudiomanagerRoutinginterfaceProxyClass: + * @parent_class: The parent class. + * + * Class structure for #AudiomanagerRoutinginterfaceProxy. + */ + +struct _AudiomanagerRoutinginterfaceProxyPrivate +{ + GData *qdata; +}; + +static void audiomanager_routinginterface_proxy_iface_init (AudiomanagerRoutinginterfaceIface *iface); + +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (AudiomanagerRoutinginterfaceProxy, audiomanager_routinginterface_proxy, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (AudiomanagerRoutinginterfaceProxy) + G_IMPLEMENT_INTERFACE (TYPE_AUDIOMANAGER_ROUTINGINTERFACE, audiomanager_routinginterface_proxy_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (AudiomanagerRoutinginterfaceProxy, audiomanager_routinginterface_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_AUDIOMANAGER_ROUTINGINTERFACE, audiomanager_routinginterface_proxy_iface_init)); + +#endif +static void +audiomanager_routinginterface_proxy_finalize (GObject *object) +{ + AudiomanagerRoutinginterfaceProxy *proxy = AUDIOMANAGER_ROUTINGINTERFACE_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (audiomanager_routinginterface_proxy_parent_class)->finalize (object); +} + +static void +audiomanager_routinginterface_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +audiomanager_routinginterface_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +audiomanager_routinginterface_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name G_GNUC_UNUSED, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_audiomanager_routinginterface_interface_info.parent_struct, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], TYPE_AUDIOMANAGER_ROUTINGINTERFACE); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_AUDIOMANAGER_ROUTINGINTERFACE); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +audiomanager_routinginterface_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + AudiomanagerRoutinginterfaceProxy *proxy = AUDIOMANAGER_ROUTINGINTERFACE_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_audiomanager_routinginterface_interface_info.parent_struct, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_audiomanager_routinginterface_interface_info.parent_struct, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +audiomanager_routinginterface_proxy_init (AudiomanagerRoutinginterfaceProxy *proxy) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + proxy->priv = audiomanager_routinginterface_proxy_get_instance_private (proxy); +#else + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_AUDIOMANAGER_ROUTINGINTERFACE_PROXY, AudiomanagerRoutinginterfaceProxyPrivate); +#endif + + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), audiomanager_routinginterface_interface_info ()); +} + +static void +audiomanager_routinginterface_proxy_class_init (AudiomanagerRoutinginterfaceProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = audiomanager_routinginterface_proxy_finalize; + gobject_class->get_property = audiomanager_routinginterface_proxy_get_property; + gobject_class->set_property = audiomanager_routinginterface_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = audiomanager_routinginterface_proxy_g_signal; + proxy_class->g_properties_changed = audiomanager_routinginterface_proxy_g_properties_changed; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (AudiomanagerRoutinginterfaceProxyPrivate)); +#endif +} + +static void +audiomanager_routinginterface_proxy_iface_init (AudiomanagerRoutinginterfaceIface *iface) +{ +} + +/** + * audiomanager_routinginterface_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface org.genivi.audiomanager.routinginterface. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_proxy_new_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +audiomanager_routinginterface_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_AUDIOMANAGER_ROUTINGINTERFACE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.genivi.audiomanager.routinginterface", NULL); +} + +/** + * audiomanager_routinginterface_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with audiomanager_routinginterface_proxy_new(). + * + * Returns: (transfer full) (type AudiomanagerRoutinginterfaceProxy): The constructed proxy object or %NULL if @error is set. + */ +AudiomanagerRoutinginterface * +audiomanager_routinginterface_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return AUDIOMANAGER_ROUTINGINTERFACE (ret); + else + return NULL; +} + +/** + * audiomanager_routinginterface_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface org.genivi.audiomanager.routinginterface. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type AudiomanagerRoutinginterfaceProxy): The constructed proxy object or %NULL if @error is set. + */ +AudiomanagerRoutinginterface * +audiomanager_routinginterface_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_AUDIOMANAGER_ROUTINGINTERFACE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.genivi.audiomanager.routinginterface", NULL); + if (ret != NULL) + return AUDIOMANAGER_ROUTINGINTERFACE (ret); + else + return NULL; +} + + +/** + * audiomanager_routinginterface_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like audiomanager_routinginterface_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routinginterface_proxy_new_for_bus_finish() to get the result of the operation. + * + * See audiomanager_routinginterface_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +audiomanager_routinginterface_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_AUDIOMANAGER_ROUTINGINTERFACE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.genivi.audiomanager.routinginterface", NULL); +} + +/** + * audiomanager_routinginterface_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routinginterface_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with audiomanager_routinginterface_proxy_new_for_bus(). + * + * Returns: (transfer full) (type AudiomanagerRoutinginterfaceProxy): The constructed proxy object or %NULL if @error is set. + */ +AudiomanagerRoutinginterface * +audiomanager_routinginterface_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return AUDIOMANAGER_ROUTINGINTERFACE (ret); + else + return NULL; +} + +/** + * audiomanager_routinginterface_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like audiomanager_routinginterface_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See audiomanager_routinginterface_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type AudiomanagerRoutinginterfaceProxy): The constructed proxy object or %NULL if @error is set. + */ +AudiomanagerRoutinginterface * +audiomanager_routinginterface_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_AUDIOMANAGER_ROUTINGINTERFACE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.genivi.audiomanager.routinginterface", NULL); + if (ret != NULL) + return AUDIOMANAGER_ROUTINGINTERFACE (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * AudiomanagerRoutinginterfaceSkeleton: + * + * The #AudiomanagerRoutinginterfaceSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * AudiomanagerRoutinginterfaceSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #AudiomanagerRoutinginterfaceSkeleton. + */ + +struct _AudiomanagerRoutinginterfaceSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_audiomanager_routinginterface_skeleton_handle_method_call ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + AudiomanagerRoutinginterfaceSkeleton *skeleton = AUDIOMANAGER_ROUTINGINTERFACE_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], TYPE_AUDIOMANAGER_ROUTINGINTERFACE); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_AUDIOMANAGER_ROUTINGINTERFACE); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_audiomanager_routinginterface_skeleton_handle_get_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + AudiomanagerRoutinginterfaceSkeleton *skeleton = AUDIOMANAGER_ROUTINGINTERFACE_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_audiomanager_routinginterface_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_audiomanager_routinginterface_skeleton_handle_set_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + AudiomanagerRoutinginterfaceSkeleton *skeleton = AUDIOMANAGER_ROUTINGINTERFACE_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_audiomanager_routinginterface_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _audiomanager_routinginterface_skeleton_vtable = +{ + _audiomanager_routinginterface_skeleton_handle_method_call, + _audiomanager_routinginterface_skeleton_handle_get_property, + _audiomanager_routinginterface_skeleton_handle_set_property, + {NULL} +}; + +static GDBusInterfaceInfo * +audiomanager_routinginterface_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return audiomanager_routinginterface_interface_info (); +} + +static GDBusInterfaceVTable * +audiomanager_routinginterface_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return (GDBusInterfaceVTable *) &_audiomanager_routinginterface_skeleton_vtable; +} + +static GVariant * +audiomanager_routinginterface_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + AudiomanagerRoutinginterfaceSkeleton *skeleton = AUDIOMANAGER_ROUTINGINTERFACE_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_audiomanager_routinginterface_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _audiomanager_routinginterface_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _audiomanager_routinginterface_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _audiomanager_routinginterface_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.genivi.audiomanager.routinginterface", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +audiomanager_routinginterface_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void +_audiomanager_routinginterface_on_signal_set_routing_ready ( + AudiomanagerRoutinginterface *object) +{ + AudiomanagerRoutinginterfaceSkeleton *skeleton = AUDIOMANAGER_ROUTINGINTERFACE_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("()")); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.genivi.audiomanager.routinginterface", "setRoutingReady", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_audiomanager_routinginterface_on_signal_set_routing_rundown ( + AudiomanagerRoutinginterface *object) +{ + AudiomanagerRoutinginterfaceSkeleton *skeleton = AUDIOMANAGER_ROUTINGINTERFACE_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("()")); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.genivi.audiomanager.routinginterface", "setRoutingRundown", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void audiomanager_routinginterface_skeleton_iface_init (AudiomanagerRoutinginterfaceIface *iface); +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (AudiomanagerRoutinginterfaceSkeleton, audiomanager_routinginterface_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_ADD_PRIVATE (AudiomanagerRoutinginterfaceSkeleton) + G_IMPLEMENT_INTERFACE (TYPE_AUDIOMANAGER_ROUTINGINTERFACE, audiomanager_routinginterface_skeleton_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (AudiomanagerRoutinginterfaceSkeleton, audiomanager_routinginterface_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_AUDIOMANAGER_ROUTINGINTERFACE, audiomanager_routinginterface_skeleton_iface_init)); + +#endif +static void +audiomanager_routinginterface_skeleton_finalize (GObject *object) +{ + AudiomanagerRoutinginterfaceSkeleton *skeleton = AUDIOMANAGER_ROUTINGINTERFACE_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (audiomanager_routinginterface_skeleton_parent_class)->finalize (object); +} + +static void +audiomanager_routinginterface_skeleton_init (AudiomanagerRoutinginterfaceSkeleton *skeleton) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + skeleton->priv = audiomanager_routinginterface_skeleton_get_instance_private (skeleton); +#else + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_AUDIOMANAGER_ROUTINGINTERFACE_SKELETON, AudiomanagerRoutinginterfaceSkeletonPrivate); +#endif + + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +audiomanager_routinginterface_skeleton_class_init (AudiomanagerRoutinginterfaceSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = audiomanager_routinginterface_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = audiomanager_routinginterface_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = audiomanager_routinginterface_skeleton_dbus_interface_get_properties; + skeleton_class->flush = audiomanager_routinginterface_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = audiomanager_routinginterface_skeleton_dbus_interface_get_vtable; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (AudiomanagerRoutinginterfaceSkeletonPrivate)); +#endif +} + +static void +audiomanager_routinginterface_skeleton_iface_init (AudiomanagerRoutinginterfaceIface *iface) +{ + iface->set_routing_ready = _audiomanager_routinginterface_on_signal_set_routing_ready; + iface->set_routing_rundown = _audiomanager_routinginterface_on_signal_set_routing_rundown; +} + +/** + * audiomanager_routinginterface_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface org.genivi.audiomanager.routinginterface. + * + * Returns: (transfer full) (type AudiomanagerRoutinginterfaceSkeleton): The skeleton object. + */ +AudiomanagerRoutinginterface * +audiomanager_routinginterface_skeleton_new (void) +{ + return AUDIOMANAGER_ROUTINGINTERFACE (g_object_new (TYPE_AUDIOMANAGER_ROUTINGINTERFACE_SKELETON, NULL)); +} + +/* ------------------------------------------------------------------------ + * Code for interface org.genivi.audiomanager.routing.soundmanager + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:AudiomanagerRoutingSoundmanager + * @title: AudiomanagerRoutingSoundmanager + * @short_description: Generated C code for the org.genivi.audiomanager.routing.soundmanager D-Bus interface + * + * This section contains code for working with the org.genivi.audiomanager.routing.soundmanager D-Bus interface in C. + */ + +/* ---- Introspection data for org.genivi.audiomanager.routing.soundmanager ---- */ + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_abort_IN_ARG_handle = +{ + { + -1, + (gchar *) "handle", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routing_soundmanager_method_info_async_abort_IN_ARG_pointers[] = +{ + &_audiomanager_routing_soundmanager_method_info_async_abort_IN_ARG_handle, + NULL +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_abort_OUT_ARG_error = +{ + { + -1, + (gchar *) "error", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routing_soundmanager_method_info_async_abort_OUT_ARG_pointers[] = +{ + &_audiomanager_routing_soundmanager_method_info_async_abort_OUT_ARG_error, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routing_soundmanager_method_info_async_abort = +{ + { + -1, + (gchar *) "asyncAbort", + (GDBusArgInfo **) &_audiomanager_routing_soundmanager_method_info_async_abort_IN_ARG_pointers, + (GDBusArgInfo **) &_audiomanager_routing_soundmanager_method_info_async_abort_OUT_ARG_pointers, + NULL + }, + "handle-async-abort", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_connect_IN_ARG_handle = +{ + { + -1, + (gchar *) "handle", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_connect_IN_ARG_connectionID = +{ + { + -1, + (gchar *) "connectionID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_connect_IN_ARG_sourceID = +{ + { + -1, + (gchar *) "sourceID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_connect_IN_ARG_sinkID = +{ + { + -1, + (gchar *) "sinkID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_connect_IN_ARG_connectionFormat = +{ + { + -1, + (gchar *) "connectionFormat", + (gchar *) "i", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routing_soundmanager_method_info_async_connect_IN_ARG_pointers[] = +{ + &_audiomanager_routing_soundmanager_method_info_async_connect_IN_ARG_handle, + &_audiomanager_routing_soundmanager_method_info_async_connect_IN_ARG_connectionID, + &_audiomanager_routing_soundmanager_method_info_async_connect_IN_ARG_sourceID, + &_audiomanager_routing_soundmanager_method_info_async_connect_IN_ARG_sinkID, + &_audiomanager_routing_soundmanager_method_info_async_connect_IN_ARG_connectionFormat, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routing_soundmanager_method_info_async_connect = +{ + { + -1, + (gchar *) "asyncConnect", + (GDBusArgInfo **) &_audiomanager_routing_soundmanager_method_info_async_connect_IN_ARG_pointers, + NULL, + NULL + }, + "handle-async-connect", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_disconnect_IN_ARG_handle = +{ + { + -1, + (gchar *) "handle", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_disconnect_IN_ARG_connectionID = +{ + { + -1, + (gchar *) "connectionID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routing_soundmanager_method_info_async_disconnect_IN_ARG_pointers[] = +{ + &_audiomanager_routing_soundmanager_method_info_async_disconnect_IN_ARG_handle, + &_audiomanager_routing_soundmanager_method_info_async_disconnect_IN_ARG_connectionID, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routing_soundmanager_method_info_async_disconnect = +{ + { + -1, + (gchar *) "asyncDisconnect", + (GDBusArgInfo **) &_audiomanager_routing_soundmanager_method_info_async_disconnect_IN_ARG_pointers, + NULL, + NULL + }, + "handle-async-disconnect", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_set_sink_volume_IN_ARG_handle = +{ + { + -1, + (gchar *) "handle", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_set_sink_volume_IN_ARG_sinkID = +{ + { + -1, + (gchar *) "sinkID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_set_sink_volume_IN_ARG_volume = +{ + { + -1, + (gchar *) "volume", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_set_sink_volume_IN_ARG_ramp = +{ + { + -1, + (gchar *) "ramp", + (gchar *) "n", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_set_sink_volume_IN_ARG_time = +{ + { + -1, + (gchar *) "time", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routing_soundmanager_method_info_async_set_sink_volume_IN_ARG_pointers[] = +{ + &_audiomanager_routing_soundmanager_method_info_async_set_sink_volume_IN_ARG_handle, + &_audiomanager_routing_soundmanager_method_info_async_set_sink_volume_IN_ARG_sinkID, + &_audiomanager_routing_soundmanager_method_info_async_set_sink_volume_IN_ARG_volume, + &_audiomanager_routing_soundmanager_method_info_async_set_sink_volume_IN_ARG_ramp, + &_audiomanager_routing_soundmanager_method_info_async_set_sink_volume_IN_ARG_time, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routing_soundmanager_method_info_async_set_sink_volume = +{ + { + -1, + (gchar *) "asyncSetSinkVolume", + (GDBusArgInfo **) &_audiomanager_routing_soundmanager_method_info_async_set_sink_volume_IN_ARG_pointers, + NULL, + NULL + }, + "handle-async-set-sink-volume", + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_set_source_state_IN_ARG_handle = +{ + { + -1, + (gchar *) "handle", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_set_source_state_IN_ARG_sourceID = +{ + { + -1, + (gchar *) "sourceID", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _audiomanager_routing_soundmanager_method_info_async_set_source_state_IN_ARG_sourceState = +{ + { + -1, + (gchar *) "sourceState", + (gchar *) "i", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _audiomanager_routing_soundmanager_method_info_async_set_source_state_IN_ARG_pointers[] = +{ + &_audiomanager_routing_soundmanager_method_info_async_set_source_state_IN_ARG_handle, + &_audiomanager_routing_soundmanager_method_info_async_set_source_state_IN_ARG_sourceID, + &_audiomanager_routing_soundmanager_method_info_async_set_source_state_IN_ARG_sourceState, + NULL +}; + +static const _ExtendedGDBusMethodInfo _audiomanager_routing_soundmanager_method_info_async_set_source_state = +{ + { + -1, + (gchar *) "asyncSetSourceState", + (GDBusArgInfo **) &_audiomanager_routing_soundmanager_method_info_async_set_source_state_IN_ARG_pointers, + NULL, + NULL + }, + "handle-async-set-source-state", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _audiomanager_routing_soundmanager_method_info_pointers[] = +{ + &_audiomanager_routing_soundmanager_method_info_async_abort, + &_audiomanager_routing_soundmanager_method_info_async_connect, + &_audiomanager_routing_soundmanager_method_info_async_disconnect, + &_audiomanager_routing_soundmanager_method_info_async_set_sink_volume, + &_audiomanager_routing_soundmanager_method_info_async_set_source_state, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _audiomanager_routing_soundmanager_interface_info = +{ + { + -1, + (gchar *) "org.genivi.audiomanager.routing.soundmanager", + (GDBusMethodInfo **) &_audiomanager_routing_soundmanager_method_info_pointers, + NULL, + NULL, + NULL + }, + "audiomanager-routing-soundmanager", +}; + + +/** + * audiomanager_routing_soundmanager_interface_info: + * + * Gets a machine-readable description of the org.genivi.audiomanager.routing.soundmanager D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +audiomanager_routing_soundmanager_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_audiomanager_routing_soundmanager_interface_info.parent_struct; +} + +/** + * audiomanager_routing_soundmanager_override_properties: + * @klass: The class structure for a #GObject-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #AudiomanagerRoutingSoundmanager interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +audiomanager_routing_soundmanager_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * AudiomanagerRoutingSoundmanager: + * + * Abstract interface type for the D-Bus interface org.genivi.audiomanager.routing.soundmanager. + */ + +/** + * AudiomanagerRoutingSoundmanagerIface: + * @parent_iface: The parent interface. + * @handle_async_abort: Handler for the #AudiomanagerRoutingSoundmanager::handle-async-abort signal. + * @handle_async_connect: Handler for the #AudiomanagerRoutingSoundmanager::handle-async-connect signal. + * @handle_async_disconnect: Handler for the #AudiomanagerRoutingSoundmanager::handle-async-disconnect signal. + * @handle_async_set_sink_volume: Handler for the #AudiomanagerRoutingSoundmanager::handle-async-set-sink-volume signal. + * @handle_async_set_source_state: Handler for the #AudiomanagerRoutingSoundmanager::handle-async-set-source-state signal. + * + * Virtual table for the D-Bus interface org.genivi.audiomanager.routing.soundmanager. + */ + +typedef AudiomanagerRoutingSoundmanagerIface AudiomanagerRoutingSoundmanagerInterface; +G_DEFINE_INTERFACE (AudiomanagerRoutingSoundmanager, audiomanager_routing_soundmanager, G_TYPE_OBJECT); + +static void +audiomanager_routing_soundmanager_default_init (AudiomanagerRoutingSoundmanagerIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * AudiomanagerRoutingSoundmanager::handle-async-abort: + * @object: A #AudiomanagerRoutingSoundmanager. + * @invocation: A #GDBusMethodInvocation. + * @arg_handle: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the asyncAbort() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routing_soundmanager_complete_async_abort() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-async-abort", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutingSoundmanagerIface, handle_async_abort), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT); + + /** + * AudiomanagerRoutingSoundmanager::handle-async-connect: + * @object: A #AudiomanagerRoutingSoundmanager. + * @invocation: A #GDBusMethodInvocation. + * @arg_handle: Argument passed by remote caller. + * @arg_connectionID: Argument passed by remote caller. + * @arg_sourceID: Argument passed by remote caller. + * @arg_sinkID: Argument passed by remote caller. + * @arg_connectionFormat: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the asyncConnect() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routing_soundmanager_complete_async_connect() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-async-connect", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutingSoundmanagerIface, handle_async_connect), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 6, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INT); + + /** + * AudiomanagerRoutingSoundmanager::handle-async-disconnect: + * @object: A #AudiomanagerRoutingSoundmanager. + * @invocation: A #GDBusMethodInvocation. + * @arg_handle: Argument passed by remote caller. + * @arg_connectionID: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the asyncDisconnect() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routing_soundmanager_complete_async_disconnect() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-async-disconnect", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutingSoundmanagerIface, handle_async_disconnect), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_UINT); + + /** + * AudiomanagerRoutingSoundmanager::handle-async-set-sink-volume: + * @object: A #AudiomanagerRoutingSoundmanager. + * @invocation: A #GDBusMethodInvocation. + * @arg_handle: Argument passed by remote caller. + * @arg_sinkID: Argument passed by remote caller. + * @arg_volume: Argument passed by remote caller. + * @arg_ramp: Argument passed by remote caller. + * @arg_time: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the asyncSetSinkVolume() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routing_soundmanager_complete_async_set_sink_volume() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-async-set-sink-volume", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutingSoundmanagerIface, handle_async_set_sink_volume), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 6, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INT, G_TYPE_INT, G_TYPE_UINT); + + /** + * AudiomanagerRoutingSoundmanager::handle-async-set-source-state: + * @object: A #AudiomanagerRoutingSoundmanager. + * @invocation: A #GDBusMethodInvocation. + * @arg_handle: Argument passed by remote caller. + * @arg_sourceID: Argument passed by remote caller. + * @arg_sourceState: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the asyncSetSourceState() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call audiomanager_routing_soundmanager_complete_async_set_source_state() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-async-set-source-state", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AudiomanagerRoutingSoundmanagerIface, handle_async_set_source_state), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 4, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INT); + +} + +/** + * audiomanager_routing_soundmanager_call_async_abort: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @arg_handle: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the asyncAbort() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routing_soundmanager_call_async_abort_finish() to get the result of the operation. + * + * See audiomanager_routing_soundmanager_call_async_abort_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routing_soundmanager_call_async_abort ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "asyncAbort", + g_variant_new ("(q)", + arg_handle), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routing_soundmanager_call_async_abort_finish: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @out_error: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routing_soundmanager_call_async_abort(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routing_soundmanager_call_async_abort(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routing_soundmanager_call_async_abort_finish ( + AudiomanagerRoutingSoundmanager *proxy, + gint16 *out_error, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n)", + out_error); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routing_soundmanager_call_async_abort_sync: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @arg_handle: Argument to pass with the method invocation. + * @out_error: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the asyncAbort() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routing_soundmanager_call_async_abort() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routing_soundmanager_call_async_abort_sync ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + gint16 *out_error, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "asyncAbort", + g_variant_new ("(q)", + arg_handle), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(n)", + out_error); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routing_soundmanager_call_async_connect: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_connectionID: Argument to pass with the method invocation. + * @arg_sourceID: Argument to pass with the method invocation. + * @arg_sinkID: Argument to pass with the method invocation. + * @arg_connectionFormat: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the asyncConnect() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routing_soundmanager_call_async_connect_finish() to get the result of the operation. + * + * See audiomanager_routing_soundmanager_call_async_connect_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routing_soundmanager_call_async_connect ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_sourceID, + guint16 arg_sinkID, + gint arg_connectionFormat, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "asyncConnect", + g_variant_new ("(qqqqi)", + arg_handle, + arg_connectionID, + arg_sourceID, + arg_sinkID, + arg_connectionFormat), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routing_soundmanager_call_async_connect_finish: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routing_soundmanager_call_async_connect(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routing_soundmanager_call_async_connect(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routing_soundmanager_call_async_connect_finish ( + AudiomanagerRoutingSoundmanager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routing_soundmanager_call_async_connect_sync: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_connectionID: Argument to pass with the method invocation. + * @arg_sourceID: Argument to pass with the method invocation. + * @arg_sinkID: Argument to pass with the method invocation. + * @arg_connectionFormat: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the asyncConnect() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routing_soundmanager_call_async_connect() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routing_soundmanager_call_async_connect_sync ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_sourceID, + guint16 arg_sinkID, + gint arg_connectionFormat, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "asyncConnect", + g_variant_new ("(qqqqi)", + arg_handle, + arg_connectionID, + arg_sourceID, + arg_sinkID, + arg_connectionFormat), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routing_soundmanager_call_async_disconnect: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_connectionID: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the asyncDisconnect() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routing_soundmanager_call_async_disconnect_finish() to get the result of the operation. + * + * See audiomanager_routing_soundmanager_call_async_disconnect_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routing_soundmanager_call_async_disconnect ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "asyncDisconnect", + g_variant_new ("(qq)", + arg_handle, + arg_connectionID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routing_soundmanager_call_async_disconnect_finish: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routing_soundmanager_call_async_disconnect(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routing_soundmanager_call_async_disconnect(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routing_soundmanager_call_async_disconnect_finish ( + AudiomanagerRoutingSoundmanager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routing_soundmanager_call_async_disconnect_sync: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_connectionID: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the asyncDisconnect() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routing_soundmanager_call_async_disconnect() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routing_soundmanager_call_async_disconnect_sync ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "asyncDisconnect", + g_variant_new ("(qq)", + arg_handle, + arg_connectionID), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routing_soundmanager_call_async_set_sink_volume: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_sinkID: Argument to pass with the method invocation. + * @arg_volume: Argument to pass with the method invocation. + * @arg_ramp: Argument to pass with the method invocation. + * @arg_time: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the asyncSetSinkVolume() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routing_soundmanager_call_async_set_sink_volume_finish() to get the result of the operation. + * + * See audiomanager_routing_soundmanager_call_async_set_sink_volume_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routing_soundmanager_call_async_set_sink_volume ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_sinkID, + gint16 arg_volume, + gint16 arg_ramp, + guint16 arg_time, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "asyncSetSinkVolume", + g_variant_new ("(qqnnq)", + arg_handle, + arg_sinkID, + arg_volume, + arg_ramp, + arg_time), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routing_soundmanager_call_async_set_sink_volume_finish: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routing_soundmanager_call_async_set_sink_volume(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routing_soundmanager_call_async_set_sink_volume(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routing_soundmanager_call_async_set_sink_volume_finish ( + AudiomanagerRoutingSoundmanager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routing_soundmanager_call_async_set_sink_volume_sync: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_sinkID: Argument to pass with the method invocation. + * @arg_volume: Argument to pass with the method invocation. + * @arg_ramp: Argument to pass with the method invocation. + * @arg_time: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the asyncSetSinkVolume() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routing_soundmanager_call_async_set_sink_volume() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routing_soundmanager_call_async_set_sink_volume_sync ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_sinkID, + gint16 arg_volume, + gint16 arg_ramp, + guint16 arg_time, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "asyncSetSinkVolume", + g_variant_new ("(qqnnq)", + arg_handle, + arg_sinkID, + arg_volume, + arg_ramp, + arg_time), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routing_soundmanager_call_async_set_source_state: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_sourceID: Argument to pass with the method invocation. + * @arg_sourceState: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the asyncSetSourceState() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routing_soundmanager_call_async_set_source_state_finish() to get the result of the operation. + * + * See audiomanager_routing_soundmanager_call_async_set_source_state_sync() for the synchronous, blocking version of this method. + */ +void +audiomanager_routing_soundmanager_call_async_set_source_state ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_sourceID, + gint arg_sourceState, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "asyncSetSourceState", + g_variant_new ("(qqi)", + arg_handle, + arg_sourceID, + arg_sourceState), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * audiomanager_routing_soundmanager_call_async_set_source_state_finish: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routing_soundmanager_call_async_set_source_state(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with audiomanager_routing_soundmanager_call_async_set_source_state(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routing_soundmanager_call_async_set_source_state_finish ( + AudiomanagerRoutingSoundmanager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routing_soundmanager_call_async_set_source_state_sync: + * @proxy: A #AudiomanagerRoutingSoundmanagerProxy. + * @arg_handle: Argument to pass with the method invocation. + * @arg_sourceID: Argument to pass with the method invocation. + * @arg_sourceState: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the asyncSetSourceState() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See audiomanager_routing_soundmanager_call_async_set_source_state() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +audiomanager_routing_soundmanager_call_async_set_source_state_sync ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_sourceID, + gint arg_sourceState, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "asyncSetSourceState", + g_variant_new ("(qqi)", + arg_handle, + arg_sourceID, + arg_sourceState), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * audiomanager_routing_soundmanager_complete_async_abort: + * @object: A #AudiomanagerRoutingSoundmanager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @error: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the asyncAbort() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routing_soundmanager_complete_async_abort ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation, + gint16 error) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(n)", + error)); +} + +/** + * audiomanager_routing_soundmanager_complete_async_connect: + * @object: A #AudiomanagerRoutingSoundmanager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the asyncConnect() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routing_soundmanager_complete_async_connect ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routing_soundmanager_complete_async_disconnect: + * @object: A #AudiomanagerRoutingSoundmanager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the asyncDisconnect() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routing_soundmanager_complete_async_disconnect ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routing_soundmanager_complete_async_set_sink_volume: + * @object: A #AudiomanagerRoutingSoundmanager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the asyncSetSinkVolume() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routing_soundmanager_complete_async_set_sink_volume ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * audiomanager_routing_soundmanager_complete_async_set_source_state: + * @object: A #AudiomanagerRoutingSoundmanager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the asyncSetSourceState() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +audiomanager_routing_soundmanager_complete_async_set_source_state ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/* ------------------------------------------------------------------------ */ + +/** + * AudiomanagerRoutingSoundmanagerProxy: + * + * The #AudiomanagerRoutingSoundmanagerProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * AudiomanagerRoutingSoundmanagerProxyClass: + * @parent_class: The parent class. + * + * Class structure for #AudiomanagerRoutingSoundmanagerProxy. + */ + +struct _AudiomanagerRoutingSoundmanagerProxyPrivate +{ + GData *qdata; +}; + +static void audiomanager_routing_soundmanager_proxy_iface_init (AudiomanagerRoutingSoundmanagerIface *iface); + +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (AudiomanagerRoutingSoundmanagerProxy, audiomanager_routing_soundmanager_proxy, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (AudiomanagerRoutingSoundmanagerProxy) + G_IMPLEMENT_INTERFACE (TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER, audiomanager_routing_soundmanager_proxy_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (AudiomanagerRoutingSoundmanagerProxy, audiomanager_routing_soundmanager_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER, audiomanager_routing_soundmanager_proxy_iface_init)); + +#endif +static void +audiomanager_routing_soundmanager_proxy_finalize (GObject *object) +{ + AudiomanagerRoutingSoundmanagerProxy *proxy = AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (audiomanager_routing_soundmanager_proxy_parent_class)->finalize (object); +} + +static void +audiomanager_routing_soundmanager_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +audiomanager_routing_soundmanager_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +audiomanager_routing_soundmanager_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name G_GNUC_UNUSED, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_audiomanager_routing_soundmanager_interface_info.parent_struct, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +audiomanager_routing_soundmanager_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + AudiomanagerRoutingSoundmanagerProxy *proxy = AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_audiomanager_routing_soundmanager_interface_info.parent_struct, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_audiomanager_routing_soundmanager_interface_info.parent_struct, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +audiomanager_routing_soundmanager_proxy_init (AudiomanagerRoutingSoundmanagerProxy *proxy) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + proxy->priv = audiomanager_routing_soundmanager_proxy_get_instance_private (proxy); +#else + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY, AudiomanagerRoutingSoundmanagerProxyPrivate); +#endif + + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), audiomanager_routing_soundmanager_interface_info ()); +} + +static void +audiomanager_routing_soundmanager_proxy_class_init (AudiomanagerRoutingSoundmanagerProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = audiomanager_routing_soundmanager_proxy_finalize; + gobject_class->get_property = audiomanager_routing_soundmanager_proxy_get_property; + gobject_class->set_property = audiomanager_routing_soundmanager_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = audiomanager_routing_soundmanager_proxy_g_signal; + proxy_class->g_properties_changed = audiomanager_routing_soundmanager_proxy_g_properties_changed; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (AudiomanagerRoutingSoundmanagerProxyPrivate)); +#endif +} + +static void +audiomanager_routing_soundmanager_proxy_iface_init (AudiomanagerRoutingSoundmanagerIface *iface) +{ +} + +/** + * audiomanager_routing_soundmanager_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface org.genivi.audiomanager.routing.soundmanager. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routing_soundmanager_proxy_new_finish() to get the result of the operation. + * + * See audiomanager_routing_soundmanager_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +audiomanager_routing_soundmanager_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.genivi.audiomanager.routing.soundmanager", NULL); +} + +/** + * audiomanager_routing_soundmanager_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routing_soundmanager_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with audiomanager_routing_soundmanager_proxy_new(). + * + * Returns: (transfer full) (type AudiomanagerRoutingSoundmanagerProxy): The constructed proxy object or %NULL if @error is set. + */ +AudiomanagerRoutingSoundmanager * +audiomanager_routing_soundmanager_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return AUDIOMANAGER_ROUTING_SOUNDMANAGER (ret); + else + return NULL; +} + +/** + * audiomanager_routing_soundmanager_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface org.genivi.audiomanager.routing.soundmanager. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See audiomanager_routing_soundmanager_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type AudiomanagerRoutingSoundmanagerProxy): The constructed proxy object or %NULL if @error is set. + */ +AudiomanagerRoutingSoundmanager * +audiomanager_routing_soundmanager_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.genivi.audiomanager.routing.soundmanager", NULL); + if (ret != NULL) + return AUDIOMANAGER_ROUTING_SOUNDMANAGER (ret); + else + return NULL; +} + + +/** + * audiomanager_routing_soundmanager_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like audiomanager_routing_soundmanager_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call audiomanager_routing_soundmanager_proxy_new_for_bus_finish() to get the result of the operation. + * + * See audiomanager_routing_soundmanager_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +audiomanager_routing_soundmanager_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.genivi.audiomanager.routing.soundmanager", NULL); +} + +/** + * audiomanager_routing_soundmanager_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to audiomanager_routing_soundmanager_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with audiomanager_routing_soundmanager_proxy_new_for_bus(). + * + * Returns: (transfer full) (type AudiomanagerRoutingSoundmanagerProxy): The constructed proxy object or %NULL if @error is set. + */ +AudiomanagerRoutingSoundmanager * +audiomanager_routing_soundmanager_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return AUDIOMANAGER_ROUTING_SOUNDMANAGER (ret); + else + return NULL; +} + +/** + * audiomanager_routing_soundmanager_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like audiomanager_routing_soundmanager_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See audiomanager_routing_soundmanager_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type AudiomanagerRoutingSoundmanagerProxy): The constructed proxy object or %NULL if @error is set. + */ +AudiomanagerRoutingSoundmanager * +audiomanager_routing_soundmanager_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.genivi.audiomanager.routing.soundmanager", NULL); + if (ret != NULL) + return AUDIOMANAGER_ROUTING_SOUNDMANAGER (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * AudiomanagerRoutingSoundmanagerSkeleton: + * + * The #AudiomanagerRoutingSoundmanagerSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * AudiomanagerRoutingSoundmanagerSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #AudiomanagerRoutingSoundmanagerSkeleton. + */ + +struct _AudiomanagerRoutingSoundmanagerSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_audiomanager_routing_soundmanager_skeleton_handle_method_call ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + AudiomanagerRoutingSoundmanagerSkeleton *skeleton = AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_audiomanager_routing_soundmanager_skeleton_handle_get_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + AudiomanagerRoutingSoundmanagerSkeleton *skeleton = AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_audiomanager_routing_soundmanager_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_audiomanager_routing_soundmanager_skeleton_handle_set_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + AudiomanagerRoutingSoundmanagerSkeleton *skeleton = AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_audiomanager_routing_soundmanager_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _audiomanager_routing_soundmanager_skeleton_vtable = +{ + _audiomanager_routing_soundmanager_skeleton_handle_method_call, + _audiomanager_routing_soundmanager_skeleton_handle_get_property, + _audiomanager_routing_soundmanager_skeleton_handle_set_property, + {NULL} +}; + +static GDBusInterfaceInfo * +audiomanager_routing_soundmanager_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return audiomanager_routing_soundmanager_interface_info (); +} + +static GDBusInterfaceVTable * +audiomanager_routing_soundmanager_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return (GDBusInterfaceVTable *) &_audiomanager_routing_soundmanager_skeleton_vtable; +} + +static GVariant * +audiomanager_routing_soundmanager_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + AudiomanagerRoutingSoundmanagerSkeleton *skeleton = AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_audiomanager_routing_soundmanager_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _audiomanager_routing_soundmanager_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _audiomanager_routing_soundmanager_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _audiomanager_routing_soundmanager_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.genivi.audiomanager.routing.soundmanager", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +audiomanager_routing_soundmanager_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void audiomanager_routing_soundmanager_skeleton_iface_init (AudiomanagerRoutingSoundmanagerIface *iface); +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (AudiomanagerRoutingSoundmanagerSkeleton, audiomanager_routing_soundmanager_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_ADD_PRIVATE (AudiomanagerRoutingSoundmanagerSkeleton) + G_IMPLEMENT_INTERFACE (TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER, audiomanager_routing_soundmanager_skeleton_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (AudiomanagerRoutingSoundmanagerSkeleton, audiomanager_routing_soundmanager_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER, audiomanager_routing_soundmanager_skeleton_iface_init)); + +#endif +static void +audiomanager_routing_soundmanager_skeleton_finalize (GObject *object) +{ + AudiomanagerRoutingSoundmanagerSkeleton *skeleton = AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (audiomanager_routing_soundmanager_skeleton_parent_class)->finalize (object); +} + +static void +audiomanager_routing_soundmanager_skeleton_init (AudiomanagerRoutingSoundmanagerSkeleton *skeleton) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + skeleton->priv = audiomanager_routing_soundmanager_skeleton_get_instance_private (skeleton); +#else + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON, AudiomanagerRoutingSoundmanagerSkeletonPrivate); +#endif + + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +audiomanager_routing_soundmanager_skeleton_class_init (AudiomanagerRoutingSoundmanagerSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = audiomanager_routing_soundmanager_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = audiomanager_routing_soundmanager_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = audiomanager_routing_soundmanager_skeleton_dbus_interface_get_properties; + skeleton_class->flush = audiomanager_routing_soundmanager_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = audiomanager_routing_soundmanager_skeleton_dbus_interface_get_vtable; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (AudiomanagerRoutingSoundmanagerSkeletonPrivate)); +#endif +} + +static void +audiomanager_routing_soundmanager_skeleton_iface_init (AudiomanagerRoutingSoundmanagerIface *iface) +{ +} + +/** + * audiomanager_routing_soundmanager_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface org.genivi.audiomanager.routing.soundmanager. + * + * Returns: (transfer full) (type AudiomanagerRoutingSoundmanagerSkeleton): The skeleton object. + */ +AudiomanagerRoutingSoundmanager * +audiomanager_routing_soundmanager_skeleton_new (void) +{ + return AUDIOMANAGER_ROUTING_SOUNDMANAGER (g_object_new (TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON, NULL)); +} + +/* ------------------------------------------------------------------------ + * Code for Object, ObjectProxy and ObjectSkeleton + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:Object + * @title: Object + * @short_description: Specialized GDBusObject types + * + * This section contains the #Object, #ObjectProxy, and #ObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces. + */ + +/** + * Object: + * + * The #Object type is a specialized container of interfaces. + */ + +/** + * ObjectIface: + * @parent_iface: The parent interface. + * + * Virtual table for the #Object interface. + */ + +typedef ObjectIface ObjectInterface; +G_DEFINE_INTERFACE_WITH_CODE (Object, object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT)); + +static void +object_default_init (ObjectIface *iface) +{ + /** + * Object:audiomanager-commandinterface: + * + * The #AudiomanagerCommandinterface instance corresponding to the D-Bus interface org.genivi.audiomanager.commandinterface, if any. + * + * Connect to the #GObject::notify signal to get informed of property changes. + */ + g_object_interface_install_property (iface, g_param_spec_object ("audiomanager-commandinterface", "audiomanager-commandinterface", "audiomanager-commandinterface", TYPE_AUDIOMANAGER_COMMANDINTERFACE, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)); + + /** + * Object:audiomanager-routinginterface: + * + * The #AudiomanagerRoutinginterface instance corresponding to the D-Bus interface org.genivi.audiomanager.routinginterface, if any. + * + * Connect to the #GObject::notify signal to get informed of property changes. + */ + g_object_interface_install_property (iface, g_param_spec_object ("audiomanager-routinginterface", "audiomanager-routinginterface", "audiomanager-routinginterface", TYPE_AUDIOMANAGER_ROUTINGINTERFACE, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)); + + /** + * Object:audiomanager-routing-soundmanager: + * + * The #AudiomanagerRoutingSoundmanager instance corresponding to the D-Bus interface org.genivi.audiomanager.routing.soundmanager, if any. + * + * Connect to the #GObject::notify signal to get informed of property changes. + */ + g_object_interface_install_property (iface, g_param_spec_object ("audiomanager-routing-soundmanager", "audiomanager-routing-soundmanager", "audiomanager-routing-soundmanager", TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)); + +} + +/** + * object_get_audiomanager_commandinterface: + * @object: A #Object. + * + * Gets the #AudiomanagerCommandinterface instance for the D-Bus interface org.genivi.audiomanager.commandinterface on @object, if any. + * + * Returns: (transfer full): A #AudiomanagerCommandinterface that must be freed with g_object_unref() or %NULL if @object does not implement the interface. + */ +AudiomanagerCommandinterface *object_get_audiomanager_commandinterface (Object *object) +{ + GDBusInterface *ret; + ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.genivi.audiomanager.commandinterface"); + if (ret == NULL) + return NULL; + return AUDIOMANAGER_COMMANDINTERFACE (ret); +} + +/** + * object_get_audiomanager_routinginterface: + * @object: A #Object. + * + * Gets the #AudiomanagerRoutinginterface instance for the D-Bus interface org.genivi.audiomanager.routinginterface on @object, if any. + * + * Returns: (transfer full): A #AudiomanagerRoutinginterface that must be freed with g_object_unref() or %NULL if @object does not implement the interface. + */ +AudiomanagerRoutinginterface *object_get_audiomanager_routinginterface (Object *object) +{ + GDBusInterface *ret; + ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.genivi.audiomanager.routinginterface"); + if (ret == NULL) + return NULL; + return AUDIOMANAGER_ROUTINGINTERFACE (ret); +} + +/** + * object_get_audiomanager_routing_soundmanager: + * @object: A #Object. + * + * Gets the #AudiomanagerRoutingSoundmanager instance for the D-Bus interface org.genivi.audiomanager.routing.soundmanager on @object, if any. + * + * Returns: (transfer full): A #AudiomanagerRoutingSoundmanager that must be freed with g_object_unref() or %NULL if @object does not implement the interface. + */ +AudiomanagerRoutingSoundmanager *object_get_audiomanager_routing_soundmanager (Object *object) +{ + GDBusInterface *ret; + ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.genivi.audiomanager.routing.soundmanager"); + if (ret == NULL) + return NULL; + return AUDIOMANAGER_ROUTING_SOUNDMANAGER (ret); +} + + +/** + * object_peek_audiomanager_commandinterface: (skip) + * @object: A #Object. + * + * Like object_get_audiomanager_commandinterface() but doesn't increase the reference count on the returned object. + * + * It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running. + * + * Returns: (transfer none): A #AudiomanagerCommandinterface or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. + */ +AudiomanagerCommandinterface *object_peek_audiomanager_commandinterface (Object *object) +{ + GDBusInterface *ret; + ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.genivi.audiomanager.commandinterface"); + if (ret == NULL) + return NULL; + g_object_unref (ret); + return AUDIOMANAGER_COMMANDINTERFACE (ret); +} + +/** + * object_peek_audiomanager_routinginterface: (skip) + * @object: A #Object. + * + * Like object_get_audiomanager_routinginterface() but doesn't increase the reference count on the returned object. + * + * It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running. + * + * Returns: (transfer none): A #AudiomanagerRoutinginterface or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. + */ +AudiomanagerRoutinginterface *object_peek_audiomanager_routinginterface (Object *object) +{ + GDBusInterface *ret; + ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.genivi.audiomanager.routinginterface"); + if (ret == NULL) + return NULL; + g_object_unref (ret); + return AUDIOMANAGER_ROUTINGINTERFACE (ret); +} + +/** + * object_peek_audiomanager_routing_soundmanager: (skip) + * @object: A #Object. + * + * Like object_get_audiomanager_routing_soundmanager() but doesn't increase the reference count on the returned object. + * + * It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running. + * + * Returns: (transfer none): A #AudiomanagerRoutingSoundmanager or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. + */ +AudiomanagerRoutingSoundmanager *object_peek_audiomanager_routing_soundmanager (Object *object) +{ + GDBusInterface *ret; + ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.genivi.audiomanager.routing.soundmanager"); + if (ret == NULL) + return NULL; + g_object_unref (ret); + return AUDIOMANAGER_ROUTING_SOUNDMANAGER (ret); +} + + +static void +object_notify (GDBusObject *object, GDBusInterface *interface) +{ + _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface); + /* info can be NULL if the other end is using a D-Bus interface we don't know + * anything about, for example old generated code in this process talking to + * newer generated code in the other process. */ + if (info != NULL) + g_object_notify (G_OBJECT (object), info->hyphen_name); +} + +/** + * ObjectProxy: + * + * The #ObjectProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * ObjectProxyClass: + * @parent_class: The parent class. + * + * Class structure for #ObjectProxy. + */ + +static void +object_proxy__object_iface_init (ObjectIface *iface G_GNUC_UNUSED) +{ +} + +static void +object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface) +{ + iface->interface_added = object_notify; + iface->interface_removed = object_notify; +} + + +G_DEFINE_TYPE_WITH_CODE (ObjectProxy, object_proxy, G_TYPE_DBUS_OBJECT_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_proxy__object_iface_init) + G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_proxy__g_dbus_object_iface_init)); + +static void +object_proxy_init (ObjectProxy *object G_GNUC_UNUSED) +{ +} + +static void +object_proxy_set_property (GObject *gobject, + guint prop_id, + const GValue *value G_GNUC_UNUSED, + GParamSpec *pspec) +{ + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); +} + +static void +object_proxy_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ObjectProxy *object = OBJECT_PROXY (gobject); + GDBusInterface *interface; + + switch (prop_id) + { + case 1: + interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.genivi.audiomanager.commandinterface"); + g_value_take_object (value, interface); + break; + + case 2: + interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.genivi.audiomanager.routinginterface"); + g_value_take_object (value, interface); + break; + + case 3: + interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.genivi.audiomanager.routing.soundmanager"); + g_value_take_object (value, interface); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +object_proxy_class_init (ObjectProxyClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = object_proxy_set_property; + gobject_class->get_property = object_proxy_get_property; + + g_object_class_override_property (gobject_class, 1, "audiomanager-commandinterface"); + g_object_class_override_property (gobject_class, 2, "audiomanager-routinginterface"); + g_object_class_override_property (gobject_class, 3, "audiomanager-routing-soundmanager"); +} + +/** + * object_proxy_new: + * @connection: A #GDBusConnection. + * @object_path: An object path. + * + * Creates a new proxy object. + * + * Returns: (transfer full): The proxy object. + */ +ObjectProxy * +object_proxy_new (GDBusConnection *connection, + const gchar *object_path) +{ + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); + g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); + return OBJECT_PROXY (g_object_new (TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL)); +} + +/** + * ObjectSkeleton: + * + * The #ObjectSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * ObjectSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #ObjectSkeleton. + */ + +static void +object_skeleton__object_iface_init (ObjectIface *iface G_GNUC_UNUSED) +{ +} + + +static void +object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface) +{ + iface->interface_added = object_notify; + iface->interface_removed = object_notify; +} + +G_DEFINE_TYPE_WITH_CODE (ObjectSkeleton, object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_skeleton__object_iface_init) + G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_skeleton__g_dbus_object_iface_init)); + +static void +object_skeleton_init (ObjectSkeleton *object G_GNUC_UNUSED) +{ +} + +static void +object_skeleton_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ObjectSkeleton *object = OBJECT_SKELETON (gobject); + GDBusInterfaceSkeleton *interface; + + switch (prop_id) + { + case 1: + interface = g_value_get_object (value); + if (interface != NULL) + { + g_warn_if_fail (IS_AUDIOMANAGER_COMMANDINTERFACE (interface)); + g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface); + } + else + { + g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.genivi.audiomanager.commandinterface"); + } + break; + + case 2: + interface = g_value_get_object (value); + if (interface != NULL) + { + g_warn_if_fail (IS_AUDIOMANAGER_ROUTINGINTERFACE (interface)); + g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface); + } + else + { + g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.genivi.audiomanager.routinginterface"); + } + break; + + case 3: + interface = g_value_get_object (value); + if (interface != NULL) + { + g_warn_if_fail (IS_AUDIOMANAGER_ROUTING_SOUNDMANAGER (interface)); + g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface); + } + else + { + g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.genivi.audiomanager.routing.soundmanager"); + } + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +object_skeleton_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ObjectSkeleton *object = OBJECT_SKELETON (gobject); + GDBusInterface *interface; + + switch (prop_id) + { + case 1: + interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.genivi.audiomanager.commandinterface"); + g_value_take_object (value, interface); + break; + + case 2: + interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.genivi.audiomanager.routinginterface"); + g_value_take_object (value, interface); + break; + + case 3: + interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.genivi.audiomanager.routing.soundmanager"); + g_value_take_object (value, interface); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +object_skeleton_class_init (ObjectSkeletonClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = object_skeleton_set_property; + gobject_class->get_property = object_skeleton_get_property; + + g_object_class_override_property (gobject_class, 1, "audiomanager-commandinterface"); + g_object_class_override_property (gobject_class, 2, "audiomanager-routinginterface"); + g_object_class_override_property (gobject_class, 3, "audiomanager-routing-soundmanager"); +} + +/** + * object_skeleton_new: + * @object_path: An object path. + * + * Creates a new skeleton object. + * + * Returns: (transfer full): The skeleton object. + */ +ObjectSkeleton * +object_skeleton_new (const gchar *object_path) +{ + g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); + return OBJECT_SKELETON (g_object_new (TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL)); +} + +/** + * object_skeleton_set_audiomanager_commandinterface: + * @object: A #ObjectSkeleton. + * @interface_: (allow-none): A #AudiomanagerCommandinterface or %NULL to clear the interface. + * + * Sets the #AudiomanagerCommandinterface instance for the D-Bus interface org.genivi.audiomanager.commandinterface on @object. + */ +void object_skeleton_set_audiomanager_commandinterface (ObjectSkeleton *object, AudiomanagerCommandinterface *interface_) +{ + g_object_set (G_OBJECT (object), "audiomanager-commandinterface", interface_, NULL); +} + +/** + * object_skeleton_set_audiomanager_routinginterface: + * @object: A #ObjectSkeleton. + * @interface_: (allow-none): A #AudiomanagerRoutinginterface or %NULL to clear the interface. + * + * Sets the #AudiomanagerRoutinginterface instance for the D-Bus interface org.genivi.audiomanager.routinginterface on @object. + */ +void object_skeleton_set_audiomanager_routinginterface (ObjectSkeleton *object, AudiomanagerRoutinginterface *interface_) +{ + g_object_set (G_OBJECT (object), "audiomanager-routinginterface", interface_, NULL); +} + +/** + * object_skeleton_set_audiomanager_routing_soundmanager: + * @object: A #ObjectSkeleton. + * @interface_: (allow-none): A #AudiomanagerRoutingSoundmanager or %NULL to clear the interface. + * + * Sets the #AudiomanagerRoutingSoundmanager instance for the D-Bus interface org.genivi.audiomanager.routing.soundmanager on @object. + */ +void object_skeleton_set_audiomanager_routing_soundmanager (ObjectSkeleton *object, AudiomanagerRoutingSoundmanager *interface_) +{ + g_object_set (G_OBJECT (object), "audiomanager-routing-soundmanager", interface_, NULL); +} + + +/* ------------------------------------------------------------------------ + * Code for ObjectManager client + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:ObjectManagerClient + * @title: ObjectManagerClient + * @short_description: Generated GDBusObjectManagerClient type + * + * This section contains a #GDBusObjectManagerClient that uses object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. + */ + +/** + * ObjectManagerClient: + * + * The #ObjectManagerClient structure contains only private data and should only be accessed using the provided API. + */ + +/** + * ObjectManagerClientClass: + * @parent_class: The parent class. + * + * Class structure for #ObjectManagerClient. + */ + +G_DEFINE_TYPE (ObjectManagerClient, object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT); + +static void +object_manager_client_init (ObjectManagerClient *manager G_GNUC_UNUSED) +{ +} + +static void +object_manager_client_class_init (ObjectManagerClientClass *klass G_GNUC_UNUSED) +{ +} + +/** + * object_manager_client_get_proxy_type: + * @manager: A #GDBusObjectManagerClient. + * @object_path: The object path of the remote object (unused). + * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType. + * @user_data: User data (unused). + * + * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy- and #GDBusProxy-derived types. + * + * Returns: A #GDBusProxy-derived #GType if @interface_name is not %NULL, otherwise the #GType for #ObjectProxy. + */ +GType +object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED) +{ + static gsize once_init_value = 0; + static GHashTable *lookup_hash; + GType ret; + + if (interface_name == NULL) + return TYPE_OBJECT_PROXY; + if (g_once_init_enter (&once_init_value)) + { + lookup_hash = g_hash_table_new (g_str_hash, g_str_equal); + g_hash_table_insert (lookup_hash, (gpointer) "org.genivi.audiomanager.commandinterface", GSIZE_TO_POINTER (TYPE_AUDIOMANAGER_COMMANDINTERFACE_PROXY)); + g_hash_table_insert (lookup_hash, (gpointer) "org.genivi.audiomanager.routinginterface", GSIZE_TO_POINTER (TYPE_AUDIOMANAGER_ROUTINGINTERFACE_PROXY)); + g_hash_table_insert (lookup_hash, (gpointer) "org.genivi.audiomanager.routing.soundmanager", GSIZE_TO_POINTER (TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY)); + g_once_init_leave (&once_init_value, 1); + } + ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name)); + if (ret == (GType) 0) + ret = G_TYPE_DBUS_PROXY; + return ret; +} + +/** + * object_manager_client_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call object_manager_client_new_finish() to get the result of the operation. + * + * See object_manager_client_new_sync() for the synchronous, blocking version of this constructor. + */ +void +object_manager_client_new ( + GDBusConnection *connection, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL); +} + +/** + * object_manager_client_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with object_manager_client_new(). + * + * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set. + */ +GDBusObjectManager * +object_manager_client_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return G_DBUS_OBJECT_MANAGER (ret); + else + return NULL; +} + +/** + * object_manager_client_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See object_manager_client_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set. + */ +GDBusObjectManager * +object_manager_client_new_sync ( + GDBusConnection *connection, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL); + if (ret != NULL) + return G_DBUS_OBJECT_MANAGER (ret); + else + return NULL; +} + + +/** + * object_manager_client_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call object_manager_client_new_for_bus_finish() to get the result of the operation. + * + * See object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +object_manager_client_new_for_bus ( + GBusType bus_type, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL); +} + +/** + * object_manager_client_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with object_manager_client_new_for_bus(). + * + * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set. + */ +GDBusObjectManager * +object_manager_client_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return G_DBUS_OBJECT_MANAGER (ret); + else + return NULL; +} + +/** + * object_manager_client_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See object_manager_client_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set. + */ +GDBusObjectManager * +object_manager_client_new_for_bus_sync ( + GBusType bus_type, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL); + if (ret != NULL) + return G_DBUS_OBJECT_MANAGER (ret); + else + return NULL; +} + + diff --git a/src/dbus/audio_manager_interface.h b/src/dbus/audio_manager_interface.h new file mode 100644 index 0000000..c2568f1 --- /dev/null +++ b/src/dbus/audio_manager_interface.h @@ -0,0 +1,1517 @@ +/* + * Generated by gdbus-codegen 2.40.2. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __AUDIO_MANAGER_INTERFACE_H__ +#define __AUDIO_MANAGER_INTERFACE_H__ + +#include + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for org.genivi.audiomanager.commandinterface */ + +#define TYPE_AUDIOMANAGER_COMMANDINTERFACE (audiomanager_commandinterface_get_type ()) +#define AUDIOMANAGER_COMMANDINTERFACE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_AUDIOMANAGER_COMMANDINTERFACE, AudiomanagerCommandinterface)) +#define IS_AUDIOMANAGER_COMMANDINTERFACE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_AUDIOMANAGER_COMMANDINTERFACE)) +#define AUDIOMANAGER_COMMANDINTERFACE_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_AUDIOMANAGER_COMMANDINTERFACE, AudiomanagerCommandinterfaceIface)) + +struct _AudiomanagerCommandinterface; +typedef struct _AudiomanagerCommandinterface AudiomanagerCommandinterface; +typedef struct _AudiomanagerCommandinterfaceIface AudiomanagerCommandinterfaceIface; + +struct _AudiomanagerCommandinterfaceIface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_connect) ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_sourceID, + guint16 arg_sinkID); + + gboolean (*handle_disconnect) ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_mainConnectionID); + + gboolean (*handle_get_list_main_connections) ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_get_list_main_sinks) ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_set_sink_mute_state) ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_sinkID, + gint16 arg_muteState); + + gboolean (*handle_set_volume) ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_sinkID, + gint16 arg_volume); + + gboolean (*handle_volume_step) ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_sinkID, + gint16 arg_volumeStep); + + void (*main_connection_state_changed) ( + AudiomanagerCommandinterface *object, + guint16 arg_connectionID, + gint16 arg_connectionState); + + void (*new_main_connection) ( + AudiomanagerCommandinterface *object, + GVariant *arg_mainConnection); + + void (*removed_main_connection) ( + AudiomanagerCommandinterface *object, + guint16 arg_mainConnectionId); + + void (*sink_mute_state_changed) ( + AudiomanagerCommandinterface *object, + guint16 arg_sinkID, + gint16 arg_muteState); + + void (*system_property_changed) ( + AudiomanagerCommandinterface *object, + GVariant *arg_SystemProperty); + + void (*volume_changed) ( + AudiomanagerCommandinterface *object, + guint16 arg_sinkID, + gint16 arg_volume); + +}; + +GType audiomanager_commandinterface_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *audiomanager_commandinterface_interface_info (void); +guint audiomanager_commandinterface_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void audiomanager_commandinterface_complete_connect ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result, + guint16 mainConnectionID); + +void audiomanager_commandinterface_complete_disconnect ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result); + +void audiomanager_commandinterface_complete_set_volume ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result); + +void audiomanager_commandinterface_complete_volume_step ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result); + +void audiomanager_commandinterface_complete_set_sink_mute_state ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result); + +void audiomanager_commandinterface_complete_get_list_main_connections ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result, + GVariant *listConnections); + +void audiomanager_commandinterface_complete_get_list_main_sinks ( + AudiomanagerCommandinterface *object, + GDBusMethodInvocation *invocation, + gint16 result, + GVariant *listMainSinks); + + + +/* D-Bus signal emissions functions: */ +void audiomanager_commandinterface_emit_new_main_connection ( + AudiomanagerCommandinterface *object, + GVariant *arg_mainConnection); + +void audiomanager_commandinterface_emit_removed_main_connection ( + AudiomanagerCommandinterface *object, + guint16 arg_mainConnectionId); + +void audiomanager_commandinterface_emit_main_connection_state_changed ( + AudiomanagerCommandinterface *object, + guint16 arg_connectionID, + gint16 arg_connectionState); + +void audiomanager_commandinterface_emit_volume_changed ( + AudiomanagerCommandinterface *object, + guint16 arg_sinkID, + gint16 arg_volume); + +void audiomanager_commandinterface_emit_sink_mute_state_changed ( + AudiomanagerCommandinterface *object, + guint16 arg_sinkID, + gint16 arg_muteState); + +void audiomanager_commandinterface_emit_system_property_changed ( + AudiomanagerCommandinterface *object, + GVariant *arg_SystemProperty); + + + +/* D-Bus method calls: */ +void audiomanager_commandinterface_call_connect ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sourceID, + guint16 arg_sinkID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_commandinterface_call_connect_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + guint16 *out_mainConnectionID, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_commandinterface_call_connect_sync ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sourceID, + guint16 arg_sinkID, + gint16 *out_result, + guint16 *out_mainConnectionID, + GCancellable *cancellable, + GError **error); + +void audiomanager_commandinterface_call_disconnect ( + AudiomanagerCommandinterface *proxy, + guint16 arg_mainConnectionID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_commandinterface_call_disconnect_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_commandinterface_call_disconnect_sync ( + AudiomanagerCommandinterface *proxy, + guint16 arg_mainConnectionID, + gint16 *out_result, + GCancellable *cancellable, + GError **error); + +void audiomanager_commandinterface_call_set_volume ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sinkID, + gint16 arg_volume, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_commandinterface_call_set_volume_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_commandinterface_call_set_volume_sync ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sinkID, + gint16 arg_volume, + gint16 *out_result, + GCancellable *cancellable, + GError **error); + +void audiomanager_commandinterface_call_volume_step ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sinkID, + gint16 arg_volumeStep, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_commandinterface_call_volume_step_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_commandinterface_call_volume_step_sync ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sinkID, + gint16 arg_volumeStep, + gint16 *out_result, + GCancellable *cancellable, + GError **error); + +void audiomanager_commandinterface_call_set_sink_mute_state ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sinkID, + gint16 arg_muteState, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_commandinterface_call_set_sink_mute_state_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_commandinterface_call_set_sink_mute_state_sync ( + AudiomanagerCommandinterface *proxy, + guint16 arg_sinkID, + gint16 arg_muteState, + gint16 *out_result, + GCancellable *cancellable, + GError **error); + +void audiomanager_commandinterface_call_get_list_main_connections ( + AudiomanagerCommandinterface *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_commandinterface_call_get_list_main_connections_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GVariant **out_listConnections, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_commandinterface_call_get_list_main_connections_sync ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GVariant **out_listConnections, + GCancellable *cancellable, + GError **error); + +void audiomanager_commandinterface_call_get_list_main_sinks ( + AudiomanagerCommandinterface *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_commandinterface_call_get_list_main_sinks_finish ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GVariant **out_listMainSinks, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_commandinterface_call_get_list_main_sinks_sync ( + AudiomanagerCommandinterface *proxy, + gint16 *out_result, + GVariant **out_listMainSinks, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define TYPE_AUDIOMANAGER_COMMANDINTERFACE_PROXY (audiomanager_commandinterface_proxy_get_type ()) +#define AUDIOMANAGER_COMMANDINTERFACE_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_AUDIOMANAGER_COMMANDINTERFACE_PROXY, AudiomanagerCommandinterfaceProxy)) +#define AUDIOMANAGER_COMMANDINTERFACE_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_AUDIOMANAGER_COMMANDINTERFACE_PROXY, AudiomanagerCommandinterfaceProxyClass)) +#define AUDIOMANAGER_COMMANDINTERFACE_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_AUDIOMANAGER_COMMANDINTERFACE_PROXY, AudiomanagerCommandinterfaceProxyClass)) +#define IS_AUDIOMANAGER_COMMANDINTERFACE_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_AUDIOMANAGER_COMMANDINTERFACE_PROXY)) +#define IS_AUDIOMANAGER_COMMANDINTERFACE_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_AUDIOMANAGER_COMMANDINTERFACE_PROXY)) + +typedef struct _AudiomanagerCommandinterfaceProxy AudiomanagerCommandinterfaceProxy; +typedef struct _AudiomanagerCommandinterfaceProxyClass AudiomanagerCommandinterfaceProxyClass; +typedef struct _AudiomanagerCommandinterfaceProxyPrivate AudiomanagerCommandinterfaceProxyPrivate; + +struct _AudiomanagerCommandinterfaceProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + AudiomanagerCommandinterfaceProxyPrivate *priv; +}; + +struct _AudiomanagerCommandinterfaceProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType audiomanager_commandinterface_proxy_get_type (void) G_GNUC_CONST; + +void audiomanager_commandinterface_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +AudiomanagerCommandinterface *audiomanager_commandinterface_proxy_new_finish ( + GAsyncResult *res, + GError **error); +AudiomanagerCommandinterface *audiomanager_commandinterface_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void audiomanager_commandinterface_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +AudiomanagerCommandinterface *audiomanager_commandinterface_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +AudiomanagerCommandinterface *audiomanager_commandinterface_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define TYPE_AUDIOMANAGER_COMMANDINTERFACE_SKELETON (audiomanager_commandinterface_skeleton_get_type ()) +#define AUDIOMANAGER_COMMANDINTERFACE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_AUDIOMANAGER_COMMANDINTERFACE_SKELETON, AudiomanagerCommandinterfaceSkeleton)) +#define AUDIOMANAGER_COMMANDINTERFACE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_AUDIOMANAGER_COMMANDINTERFACE_SKELETON, AudiomanagerCommandinterfaceSkeletonClass)) +#define AUDIOMANAGER_COMMANDINTERFACE_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_AUDIOMANAGER_COMMANDINTERFACE_SKELETON, AudiomanagerCommandinterfaceSkeletonClass)) +#define IS_AUDIOMANAGER_COMMANDINTERFACE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_AUDIOMANAGER_COMMANDINTERFACE_SKELETON)) +#define IS_AUDIOMANAGER_COMMANDINTERFACE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_AUDIOMANAGER_COMMANDINTERFACE_SKELETON)) + +typedef struct _AudiomanagerCommandinterfaceSkeleton AudiomanagerCommandinterfaceSkeleton; +typedef struct _AudiomanagerCommandinterfaceSkeletonClass AudiomanagerCommandinterfaceSkeletonClass; +typedef struct _AudiomanagerCommandinterfaceSkeletonPrivate AudiomanagerCommandinterfaceSkeletonPrivate; + +struct _AudiomanagerCommandinterfaceSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + AudiomanagerCommandinterfaceSkeletonPrivate *priv; +}; + +struct _AudiomanagerCommandinterfaceSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType audiomanager_commandinterface_skeleton_get_type (void) G_GNUC_CONST; + +AudiomanagerCommandinterface *audiomanager_commandinterface_skeleton_new (void); + + +/* ------------------------------------------------------------------------ */ +/* Declarations for org.genivi.audiomanager.routinginterface */ + +#define TYPE_AUDIOMANAGER_ROUTINGINTERFACE (audiomanager_routinginterface_get_type ()) +#define AUDIOMANAGER_ROUTINGINTERFACE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_AUDIOMANAGER_ROUTINGINTERFACE, AudiomanagerRoutinginterface)) +#define IS_AUDIOMANAGER_ROUTINGINTERFACE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_AUDIOMANAGER_ROUTINGINTERFACE)) +#define AUDIOMANAGER_ROUTINGINTERFACE_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_AUDIOMANAGER_ROUTINGINTERFACE, AudiomanagerRoutinginterfaceIface)) + +struct _AudiomanagerRoutinginterface; +typedef struct _AudiomanagerRoutinginterface AudiomanagerRoutinginterface; +typedef struct _AudiomanagerRoutinginterfaceIface AudiomanagerRoutinginterfaceIface; + +struct _AudiomanagerRoutinginterfaceIface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_ack_connect) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_error); + + gboolean (*handle_ack_disconnect) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_error); + + gboolean (*handle_ack_set_sink_volume) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + gint16 arg_volume, + guint16 arg_error); + + gboolean (*handle_ack_set_source_state) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_error); + + gboolean (*handle_ack_set_volumes) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + GVariant *arg_listvolumes, + guint16 arg_error); + + gboolean (*handle_ack_sink_notification_configuration) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_error); + + gboolean (*handle_ack_source_notification_configuration) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_error); + + gboolean (*handle_confirm_routing_ready) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_domainID); + + gboolean (*handle_confirm_routing_rundown) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_domainID); + + gboolean (*handle_deregister_sink) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_sinkID); + + gboolean (*handle_deregister_source) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_sourceID); + + gboolean (*handle_hook_interrupt_status_change) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_sourceID, + guint16 arg_interruptState); + + gboolean (*handle_hook_source_availablity_status_change) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 arg_sourceID, + GVariant *arg_availability); + + gboolean (*handle_register_domain) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + GVariant *arg_domaindata, + const gchar *arg_returnBusname, + const gchar *arg_returnPath, + const gchar *arg_returnInterface); + + gboolean (*handle_register_sink) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + GVariant *arg_sinkData); + + gboolean (*handle_register_source) ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + GVariant *arg_sourceData); + + void (*set_routing_ready) ( + AudiomanagerRoutinginterface *object); + + void (*set_routing_rundown) ( + AudiomanagerRoutinginterface *object); + +}; + +GType audiomanager_routinginterface_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *audiomanager_routinginterface_interface_info (void); +guint audiomanager_routinginterface_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void audiomanager_routinginterface_complete_ack_connect ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routinginterface_complete_ack_disconnect ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routinginterface_complete_ack_set_source_state ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routinginterface_complete_ack_set_sink_volume ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routinginterface_complete_register_sink ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 sinkID, + guint16 error); + +void audiomanager_routinginterface_complete_deregister_sink ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + gint error); + +void audiomanager_routinginterface_complete_register_source ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 sourceID, + guint16 error); + +void audiomanager_routinginterface_complete_deregister_source ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 error); + +void audiomanager_routinginterface_complete_hook_interrupt_status_change ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routinginterface_complete_hook_source_availablity_status_change ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routinginterface_complete_confirm_routing_ready ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routinginterface_complete_confirm_routing_rundown ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routinginterface_complete_ack_set_volumes ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routinginterface_complete_ack_sink_notification_configuration ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routinginterface_complete_ack_source_notification_configuration ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routinginterface_complete_register_domain ( + AudiomanagerRoutinginterface *object, + GDBusMethodInvocation *invocation, + guint16 domainid, + guint16 error); + + + +/* D-Bus signal emissions functions: */ +void audiomanager_routinginterface_emit_set_routing_ready ( + AudiomanagerRoutinginterface *object); + +void audiomanager_routinginterface_emit_set_routing_rundown ( + AudiomanagerRoutinginterface *object); + + + +/* D-Bus method calls: */ +void audiomanager_routinginterface_call_ack_connect ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_ack_connect_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_ack_connect_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_error, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_ack_disconnect ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_ack_disconnect_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_ack_disconnect_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_error, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_ack_set_source_state ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_ack_set_source_state_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_ack_set_source_state_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_error, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_ack_set_sink_volume ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + gint16 arg_volume, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_ack_set_sink_volume_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_ack_set_sink_volume_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + gint16 arg_volume, + guint16 arg_error, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_register_sink ( + AudiomanagerRoutinginterface *proxy, + GVariant *arg_sinkData, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_register_sink_finish ( + AudiomanagerRoutinginterface *proxy, + guint16 *out_sinkID, + guint16 *out_error, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_register_sink_sync ( + AudiomanagerRoutinginterface *proxy, + GVariant *arg_sinkData, + guint16 *out_sinkID, + guint16 *out_error, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_deregister_sink ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sinkID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_deregister_sink_finish ( + AudiomanagerRoutinginterface *proxy, + gint *out_error, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_deregister_sink_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sinkID, + gint *out_error, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_register_source ( + AudiomanagerRoutinginterface *proxy, + GVariant *arg_sourceData, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_register_source_finish ( + AudiomanagerRoutinginterface *proxy, + guint16 *out_sourceID, + guint16 *out_error, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_register_source_sync ( + AudiomanagerRoutinginterface *proxy, + GVariant *arg_sourceData, + guint16 *out_sourceID, + guint16 *out_error, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_deregister_source ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sourceID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_deregister_source_finish ( + AudiomanagerRoutinginterface *proxy, + guint16 *out_error, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_deregister_source_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sourceID, + guint16 *out_error, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_hook_interrupt_status_change ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sourceID, + guint16 arg_interruptState, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_hook_interrupt_status_change_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_hook_interrupt_status_change_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sourceID, + guint16 arg_interruptState, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_hook_source_availablity_status_change ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sourceID, + GVariant *arg_availability, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_hook_source_availablity_status_change_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_hook_source_availablity_status_change_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_sourceID, + GVariant *arg_availability, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_confirm_routing_ready ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_domainID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_confirm_routing_ready_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_confirm_routing_ready_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_domainID, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_confirm_routing_rundown ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_domainID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_confirm_routing_rundown_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_confirm_routing_rundown_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_domainID, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_ack_set_volumes ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + GVariant *arg_listvolumes, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_ack_set_volumes_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_ack_set_volumes_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + GVariant *arg_listvolumes, + guint16 arg_error, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_ack_sink_notification_configuration ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_ack_sink_notification_configuration_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_ack_sink_notification_configuration_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_error, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_ack_source_notification_configuration ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_error, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_ack_source_notification_configuration_finish ( + AudiomanagerRoutinginterface *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_ack_source_notification_configuration_sync ( + AudiomanagerRoutinginterface *proxy, + guint16 arg_handle, + guint16 arg_error, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_call_register_domain ( + AudiomanagerRoutinginterface *proxy, + GVariant *arg_domaindata, + const gchar *arg_returnBusname, + const gchar *arg_returnPath, + const gchar *arg_returnInterface, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routinginterface_call_register_domain_finish ( + AudiomanagerRoutinginterface *proxy, + guint16 *out_domainid, + guint16 *out_error, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routinginterface_call_register_domain_sync ( + AudiomanagerRoutinginterface *proxy, + GVariant *arg_domaindata, + const gchar *arg_returnBusname, + const gchar *arg_returnPath, + const gchar *arg_returnInterface, + guint16 *out_domainid, + guint16 *out_error, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define TYPE_AUDIOMANAGER_ROUTINGINTERFACE_PROXY (audiomanager_routinginterface_proxy_get_type ()) +#define AUDIOMANAGER_ROUTINGINTERFACE_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_AUDIOMANAGER_ROUTINGINTERFACE_PROXY, AudiomanagerRoutinginterfaceProxy)) +#define AUDIOMANAGER_ROUTINGINTERFACE_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_AUDIOMANAGER_ROUTINGINTERFACE_PROXY, AudiomanagerRoutinginterfaceProxyClass)) +#define AUDIOMANAGER_ROUTINGINTERFACE_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_AUDIOMANAGER_ROUTINGINTERFACE_PROXY, AudiomanagerRoutinginterfaceProxyClass)) +#define IS_AUDIOMANAGER_ROUTINGINTERFACE_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_AUDIOMANAGER_ROUTINGINTERFACE_PROXY)) +#define IS_AUDIOMANAGER_ROUTINGINTERFACE_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_AUDIOMANAGER_ROUTINGINTERFACE_PROXY)) + +typedef struct _AudiomanagerRoutinginterfaceProxy AudiomanagerRoutinginterfaceProxy; +typedef struct _AudiomanagerRoutinginterfaceProxyClass AudiomanagerRoutinginterfaceProxyClass; +typedef struct _AudiomanagerRoutinginterfaceProxyPrivate AudiomanagerRoutinginterfaceProxyPrivate; + +struct _AudiomanagerRoutinginterfaceProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + AudiomanagerRoutinginterfaceProxyPrivate *priv; +}; + +struct _AudiomanagerRoutinginterfaceProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType audiomanager_routinginterface_proxy_get_type (void) G_GNUC_CONST; + +void audiomanager_routinginterface_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +AudiomanagerRoutinginterface *audiomanager_routinginterface_proxy_new_finish ( + GAsyncResult *res, + GError **error); +AudiomanagerRoutinginterface *audiomanager_routinginterface_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void audiomanager_routinginterface_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +AudiomanagerRoutinginterface *audiomanager_routinginterface_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +AudiomanagerRoutinginterface *audiomanager_routinginterface_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define TYPE_AUDIOMANAGER_ROUTINGINTERFACE_SKELETON (audiomanager_routinginterface_skeleton_get_type ()) +#define AUDIOMANAGER_ROUTINGINTERFACE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_AUDIOMANAGER_ROUTINGINTERFACE_SKELETON, AudiomanagerRoutinginterfaceSkeleton)) +#define AUDIOMANAGER_ROUTINGINTERFACE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_AUDIOMANAGER_ROUTINGINTERFACE_SKELETON, AudiomanagerRoutinginterfaceSkeletonClass)) +#define AUDIOMANAGER_ROUTINGINTERFACE_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_AUDIOMANAGER_ROUTINGINTERFACE_SKELETON, AudiomanagerRoutinginterfaceSkeletonClass)) +#define IS_AUDIOMANAGER_ROUTINGINTERFACE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_AUDIOMANAGER_ROUTINGINTERFACE_SKELETON)) +#define IS_AUDIOMANAGER_ROUTINGINTERFACE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_AUDIOMANAGER_ROUTINGINTERFACE_SKELETON)) + +typedef struct _AudiomanagerRoutinginterfaceSkeleton AudiomanagerRoutinginterfaceSkeleton; +typedef struct _AudiomanagerRoutinginterfaceSkeletonClass AudiomanagerRoutinginterfaceSkeletonClass; +typedef struct _AudiomanagerRoutinginterfaceSkeletonPrivate AudiomanagerRoutinginterfaceSkeletonPrivate; + +struct _AudiomanagerRoutinginterfaceSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + AudiomanagerRoutinginterfaceSkeletonPrivate *priv; +}; + +struct _AudiomanagerRoutinginterfaceSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType audiomanager_routinginterface_skeleton_get_type (void) G_GNUC_CONST; + +AudiomanagerRoutinginterface *audiomanager_routinginterface_skeleton_new (void); + + +/* ------------------------------------------------------------------------ */ +/* Declarations for org.genivi.audiomanager.routing.soundmanager */ + +#define TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER (audiomanager_routing_soundmanager_get_type ()) +#define AUDIOMANAGER_ROUTING_SOUNDMANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER, AudiomanagerRoutingSoundmanager)) +#define IS_AUDIOMANAGER_ROUTING_SOUNDMANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER)) +#define AUDIOMANAGER_ROUTING_SOUNDMANAGER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER, AudiomanagerRoutingSoundmanagerIface)) + +struct _AudiomanagerRoutingSoundmanager; +typedef struct _AudiomanagerRoutingSoundmanager AudiomanagerRoutingSoundmanager; +typedef struct _AudiomanagerRoutingSoundmanagerIface AudiomanagerRoutingSoundmanagerIface; + +struct _AudiomanagerRoutingSoundmanagerIface +{ + GTypeInterface parent_iface; + + gboolean (*handle_async_abort) ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle); + + gboolean (*handle_async_connect) ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_sourceID, + guint16 arg_sinkID, + gint arg_connectionFormat); + + gboolean (*handle_async_disconnect) ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_connectionID); + + gboolean (*handle_async_set_sink_volume) ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_sinkID, + gint16 arg_volume, + gint16 arg_ramp, + guint16 arg_time); + + gboolean (*handle_async_set_source_state) ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_sourceID, + gint arg_sourceState); + +}; + +GType audiomanager_routing_soundmanager_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *audiomanager_routing_soundmanager_interface_info (void); +guint audiomanager_routing_soundmanager_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void audiomanager_routing_soundmanager_complete_async_abort ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation, + gint16 error); + +void audiomanager_routing_soundmanager_complete_async_connect ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routing_soundmanager_complete_async_disconnect ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routing_soundmanager_complete_async_set_sink_volume ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation); + +void audiomanager_routing_soundmanager_complete_async_set_source_state ( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation); + + + +/* D-Bus method calls: */ +void audiomanager_routing_soundmanager_call_async_abort ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routing_soundmanager_call_async_abort_finish ( + AudiomanagerRoutingSoundmanager *proxy, + gint16 *out_error, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routing_soundmanager_call_async_abort_sync ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + gint16 *out_error, + GCancellable *cancellable, + GError **error); + +void audiomanager_routing_soundmanager_call_async_connect ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_sourceID, + guint16 arg_sinkID, + gint arg_connectionFormat, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routing_soundmanager_call_async_connect_finish ( + AudiomanagerRoutingSoundmanager *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routing_soundmanager_call_async_connect_sync ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_sourceID, + guint16 arg_sinkID, + gint arg_connectionFormat, + GCancellable *cancellable, + GError **error); + +void audiomanager_routing_soundmanager_call_async_disconnect ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routing_soundmanager_call_async_disconnect_finish ( + AudiomanagerRoutingSoundmanager *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routing_soundmanager_call_async_disconnect_sync ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_connectionID, + GCancellable *cancellable, + GError **error); + +void audiomanager_routing_soundmanager_call_async_set_sink_volume ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_sinkID, + gint16 arg_volume, + gint16 arg_ramp, + guint16 arg_time, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routing_soundmanager_call_async_set_sink_volume_finish ( + AudiomanagerRoutingSoundmanager *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routing_soundmanager_call_async_set_sink_volume_sync ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_sinkID, + gint16 arg_volume, + gint16 arg_ramp, + guint16 arg_time, + GCancellable *cancellable, + GError **error); + +void audiomanager_routing_soundmanager_call_async_set_source_state ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_sourceID, + gint arg_sourceState, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean audiomanager_routing_soundmanager_call_async_set_source_state_finish ( + AudiomanagerRoutingSoundmanager *proxy, + GAsyncResult *res, + GError **error); + +gboolean audiomanager_routing_soundmanager_call_async_set_source_state_sync ( + AudiomanagerRoutingSoundmanager *proxy, + guint16 arg_handle, + guint16 arg_sourceID, + gint arg_sourceState, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY (audiomanager_routing_soundmanager_proxy_get_type ()) +#define AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY, AudiomanagerRoutingSoundmanagerProxy)) +#define AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY, AudiomanagerRoutingSoundmanagerProxyClass)) +#define AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY, AudiomanagerRoutingSoundmanagerProxyClass)) +#define IS_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY)) +#define IS_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_PROXY)) + +typedef struct _AudiomanagerRoutingSoundmanagerProxy AudiomanagerRoutingSoundmanagerProxy; +typedef struct _AudiomanagerRoutingSoundmanagerProxyClass AudiomanagerRoutingSoundmanagerProxyClass; +typedef struct _AudiomanagerRoutingSoundmanagerProxyPrivate AudiomanagerRoutingSoundmanagerProxyPrivate; + +struct _AudiomanagerRoutingSoundmanagerProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + AudiomanagerRoutingSoundmanagerProxyPrivate *priv; +}; + +struct _AudiomanagerRoutingSoundmanagerProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType audiomanager_routing_soundmanager_proxy_get_type (void) G_GNUC_CONST; + +void audiomanager_routing_soundmanager_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +AudiomanagerRoutingSoundmanager *audiomanager_routing_soundmanager_proxy_new_finish ( + GAsyncResult *res, + GError **error); +AudiomanagerRoutingSoundmanager *audiomanager_routing_soundmanager_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void audiomanager_routing_soundmanager_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +AudiomanagerRoutingSoundmanager *audiomanager_routing_soundmanager_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +AudiomanagerRoutingSoundmanager *audiomanager_routing_soundmanager_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON (audiomanager_routing_soundmanager_skeleton_get_type ()) +#define AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON, AudiomanagerRoutingSoundmanagerSkeleton)) +#define AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON, AudiomanagerRoutingSoundmanagerSkeletonClass)) +#define AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON, AudiomanagerRoutingSoundmanagerSkeletonClass)) +#define IS_AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON)) +#define IS_AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_AUDIOMANAGER_ROUTING_SOUNDMANAGER_SKELETON)) + +typedef struct _AudiomanagerRoutingSoundmanagerSkeleton AudiomanagerRoutingSoundmanagerSkeleton; +typedef struct _AudiomanagerRoutingSoundmanagerSkeletonClass AudiomanagerRoutingSoundmanagerSkeletonClass; +typedef struct _AudiomanagerRoutingSoundmanagerSkeletonPrivate AudiomanagerRoutingSoundmanagerSkeletonPrivate; + +struct _AudiomanagerRoutingSoundmanagerSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + AudiomanagerRoutingSoundmanagerSkeletonPrivate *priv; +}; + +struct _AudiomanagerRoutingSoundmanagerSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType audiomanager_routing_soundmanager_skeleton_get_type (void) G_GNUC_CONST; + +AudiomanagerRoutingSoundmanager *audiomanager_routing_soundmanager_skeleton_new (void); + + +/* ---- */ + +#define TYPE_OBJECT (object_get_type ()) +#define OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT, Object)) +#define IS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT)) +#define OBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_OBJECT, Object)) + +struct _Object; +typedef struct _Object Object; +typedef struct _ObjectIface ObjectIface; + +struct _ObjectIface +{ + GTypeInterface parent_iface; +}; + +GType object_get_type (void) G_GNUC_CONST; + +AudiomanagerCommandinterface *object_get_audiomanager_commandinterface (Object *object); +AudiomanagerRoutinginterface *object_get_audiomanager_routinginterface (Object *object); +AudiomanagerRoutingSoundmanager *object_get_audiomanager_routing_soundmanager (Object *object); +AudiomanagerCommandinterface *object_peek_audiomanager_commandinterface (Object *object); +AudiomanagerRoutinginterface *object_peek_audiomanager_routinginterface (Object *object); +AudiomanagerRoutingSoundmanager *object_peek_audiomanager_routing_soundmanager (Object *object); + +#define TYPE_OBJECT_PROXY (object_proxy_get_type ()) +#define OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_PROXY, ObjectProxy)) +#define OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_PROXY, ObjectProxyClass)) +#define OBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_PROXY, ObjectProxyClass)) +#define IS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_PROXY)) +#define IS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_PROXY)) + +typedef struct _ObjectProxy ObjectProxy; +typedef struct _ObjectProxyClass ObjectProxyClass; +typedef struct _ObjectProxyPrivate ObjectProxyPrivate; + +struct _ObjectProxy +{ + /*< private >*/ + GDBusObjectProxy parent_instance; + ObjectProxyPrivate *priv; +}; + +struct _ObjectProxyClass +{ + GDBusObjectProxyClass parent_class; +}; + +GType object_proxy_get_type (void) G_GNUC_CONST; +ObjectProxy *object_proxy_new (GDBusConnection *connection, const gchar *object_path); + +#define TYPE_OBJECT_SKELETON (object_skeleton_get_type ()) +#define OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_SKELETON, ObjectSkeleton)) +#define OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_SKELETON, ObjectSkeletonClass)) +#define OBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_SKELETON, ObjectSkeletonClass)) +#define IS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_SKELETON)) +#define IS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_SKELETON)) + +typedef struct _ObjectSkeleton ObjectSkeleton; +typedef struct _ObjectSkeletonClass ObjectSkeletonClass; +typedef struct _ObjectSkeletonPrivate ObjectSkeletonPrivate; + +struct _ObjectSkeleton +{ + /*< private >*/ + GDBusObjectSkeleton parent_instance; + ObjectSkeletonPrivate *priv; +}; + +struct _ObjectSkeletonClass +{ + GDBusObjectSkeletonClass parent_class; +}; + +GType object_skeleton_get_type (void) G_GNUC_CONST; +ObjectSkeleton *object_skeleton_new (const gchar *object_path); +void object_skeleton_set_audiomanager_commandinterface (ObjectSkeleton *object, AudiomanagerCommandinterface *interface_); +void object_skeleton_set_audiomanager_routinginterface (ObjectSkeleton *object, AudiomanagerRoutinginterface *interface_); +void object_skeleton_set_audiomanager_routing_soundmanager (ObjectSkeleton *object, AudiomanagerRoutingSoundmanager *interface_); + +/* ---- */ + +#define TYPE_OBJECT_MANAGER_CLIENT (object_manager_client_get_type ()) +#define OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClient)) +#define OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass)) +#define OBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass)) +#define IS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_MANAGER_CLIENT)) +#define IS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_MANAGER_CLIENT)) + +typedef struct _ObjectManagerClient ObjectManagerClient; +typedef struct _ObjectManagerClientClass ObjectManagerClientClass; +typedef struct _ObjectManagerClientPrivate ObjectManagerClientPrivate; + +struct _ObjectManagerClient +{ + /*< private >*/ + GDBusObjectManagerClient parent_instance; + ObjectManagerClientPrivate *priv; +}; + +struct _ObjectManagerClientClass +{ + GDBusObjectManagerClientClass parent_class; +}; + +GType object_manager_client_get_type (void) G_GNUC_CONST; + +GType object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data); + +void object_manager_client_new ( + GDBusConnection *connection, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GDBusObjectManager *object_manager_client_new_finish ( + GAsyncResult *res, + GError **error); +GDBusObjectManager *object_manager_client_new_sync ( + GDBusConnection *connection, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void object_manager_client_new_for_bus ( + GBusType bus_type, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GDBusObjectManager *object_manager_client_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +GDBusObjectManager *object_manager_client_new_for_bus_sync ( + GBusType bus_type, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +G_END_DECLS + +#endif /* __AUDIO_MANAGER_INTERFACE_H__ */ diff --git a/src/dbus/command_interface.xml b/src/dbus/command_interface.xml new file mode 100644 index 0000000..e33d7fb --- /dev/null +++ b/src/dbus/command_interface.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/dbus/generate_dbus.sh b/src/dbus/generate_dbus.sh new file mode 100755 index 0000000..cacf518 --- /dev/null +++ b/src/dbus/generate_dbus.sh @@ -0,0 +1,24 @@ +# +# Copyright (c) 2017 TOYOTA MOTOR CORPORATION +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +#!/bin/sh +echo "generate dbus c code" +gdbus-codegen \ + --interface-prefix org.genivi. \ + --generate-c-code audio_manager_interface \ + --c-generate-object-manager \ + command_interface.xml routing_interface.xml sound_manager_interface.xml + +echo "end generate dbus c code" diff --git a/src/dbus/routing_interface.xml b/src/dbus/routing_interface.xml new file mode 100644 index 0000000..a91d6eb --- /dev/null +++ b/src/dbus/routing_interface.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/dbus/sound_manager_interface.xml b/src/dbus/sound_manager_interface.xml new file mode 100644 index 0000000..df7df04 --- /dev/null +++ b/src/dbus/sound_manager_interface.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/export.map b/src/export.map new file mode 100644 index 0000000..f3961c0 --- /dev/null +++ b/src/export.map @@ -0,0 +1 @@ +{ global: afbBindingV*; local: *; }; \ No newline at end of file diff --git a/src/sm-error.h b/src/sm-error.h new file mode 100644 index 0000000..a963d47 --- /dev/null +++ b/src/sm-error.h @@ -0,0 +1,52 @@ +#ifndef SM_ERROR_H +#define SM_ERROR_H + +char* get_response_audiomanager_massage_error(int am_error_code) +{ + switch (am_error_code){ + case 0: + return "OK"; + case 1: + return "unknown error"; + case 2: + return "value out of range"; + case 3: + return "not used"; + case 4: + return "database error occured"; + case 5: + return "the desired object already exists"; + case 6: + return "there is no change"; + case 7: + return "the desired action is not possible"; + case 8: + return "the desired object is non existent"; + case 9: + return "the asynchronous action was aborted"; + case 10: + return "connectionFormat is not selected"; + case 11: + return "communication error"; + case 100: + return "desired event doesn't exist"; + default: + return "Audio Manager responsed unknown error number"; + } +} + +char* get_source_state_key(int am_source_state){ + switch (am_source_state){ + case 0: + return "unknown"; + case 1: + return "on"; + case 2: + return "off"; + case 3: + return "paused"; + default: + return ""; + } +} +#endif diff --git a/src/sm-helper.c b/src/sm-helper.c new file mode 100644 index 0000000..3300d67 --- /dev/null +++ b/src/sm-helper.c @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2017 TOYOTA MOTOR CORPORATION + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "sm-helper.h" +#include +#include +#include +#include +#include + +REQ_ERROR get_value_uint16(const struct afb_req request, const char *source, uint16_t *out_id) +{ + char* endptr; + const char* tmp = afb_req_value (request, source); + if(!tmp) + { + return REQ_FAIL; + } + long tmp_id = strtol(tmp,&endptr,10); + + /* error check of range */ + if( (tmp_id > UINT16_MAX) || (tmp_id < 0) ) + { + return OUT_RANGE; + } + if(*endptr != '\0') + { + return NOT_NUMBER; + } + + *out_id = (uint16_t)tmp_id; + return REQ_OK; +} + +REQ_ERROR get_value_int16(const struct afb_req request, const char *source, int16_t *out_id) +{ + char* endptr; + const char* tmp = afb_req_value (request, source); + if(!tmp) + { + return REQ_FAIL; + } + long tmp_id = strtol(tmp,&endptr,10); + + /* error check of range */ + if( (tmp_id > INT16_MAX) || (tmp_id < INT16_MIN) ) + { + return OUT_RANGE; + } + if(*endptr != '\0') + { + return NOT_NUMBER; + } + + *out_id = (int16_t)tmp_id; + return REQ_OK; +} + +REQ_ERROR get_value_int32(const struct afb_req request, const char *source, int32_t *out_id) +{ + char* endptr; + const char* tmp = afb_req_value (request, source); + if(!tmp) + { + return REQ_FAIL; + } + long tmp_id = strtol(tmp,&endptr,10); + + /* error check of range */ + if( (tmp_id > INT32_MAX) || (tmp_id < INT32_MIN) ) + { + return OUT_RANGE; + } + if(*endptr != '\0') + { + return NOT_NUMBER; + } + + *out_id = (int32_t)tmp_id; + return REQ_OK; +} + +void sm_add_object_to_json_object(struct json_object* j_obj, int count,...) +{ + va_list args; + va_start(args, count); + for(int i = 0; i < count; ++i ) + { + char *key = va_arg(args, char*); + int value = va_arg(args, int); + json_object_object_add(j_obj, key, json_object_new_int((int32_t)value)); + ++i; + } + va_end(args); +} + +void sm_add_object_to_json_object_func(struct json_object* j_obj, const char* verb_name, int count, ...) +{ + va_list args; + va_start(args, count); + + json_object_object_add(j_obj,"verb", json_object_new_string(verb_name)); + + for(int i = 0; i < count; ++i ) + { + char *key = va_arg(args, char*); + int value = va_arg(args, int); + json_object_object_add(j_obj, key, json_object_new_int((int32_t)value)); + ++i; + } + va_end(args); +} + +int sm_search_event_name_index(const char* value) +{ + size_t buf_size = 50; + size_t size = sizeof cmd_evlist / sizeof *cmd_evlist; + int ret = -1; + for(size_t i = 0 ; i < size ; ++i) + { + if(!strncmp(value, cmd_evlist[i], buf_size)) + { + ret = i; + break; + } + } + return ret; +} + +int sm_search_routing_event_name_index(const char* value) +{ + size_t buf_size = 50; + size_t size = sizeof route_evlist / sizeof *route_evlist; + int ret = -1; + for(size_t i = 0 ; i < size ; ++i) + { + if(!strncmp(value, route_evlist[i], buf_size)) + { + ret = i; + break; + } + } + return ret; +} + +GVariant* create_source_data(guint16 sourceID, guint16 domainID, const char* appname, guint16 sourceClassID, + gint32 sourceState, gint16 volume, gboolean visible, struct availability_s availables, + guint16 interrupt, struct sound_property_s soundPropertyList, gint32 connectionFormatList, + struct main_sound_property_s mainPropertyList, struct notification_config_s NConfRouting, + struct notification_config_s NConfCommand) +{ + GVariantBuilder builder; + + AFB_DEBUG("create sourceData %d", __LINE__); + g_variant_builder_init (&builder, G_VARIANT_TYPE ("(qqsqinb(ii)qa(in)aia(in)a(iin)a(iin))")); + g_variant_builder_add (&builder, "q", sourceID); + g_variant_builder_add (&builder, "q", domainID); + g_variant_builder_add (&builder, "s", appname); + g_variant_builder_add (&builder, "q", sourceClassID); + g_variant_builder_add (&builder, "i", sourceState); + g_variant_builder_add (&builder, "n", volume); + g_variant_builder_add (&builder, "b", visible); + g_variant_builder_add (&builder, "(ii)", availables.availability, availables.avalilable_reason); + g_variant_builder_add (&builder, "q", interrupt); + + g_variant_builder_open(&builder, G_VARIANT_TYPE("a(in)")); + g_variant_builder_open(&builder, G_VARIANT_TYPE("(in)")); + g_variant_builder_add (&builder, "i", soundPropertyList.type); + g_variant_builder_add (&builder, "n", soundPropertyList.value); + g_variant_builder_close(&builder); + g_variant_builder_close (&builder); + + g_variant_builder_open(&builder, G_VARIANT_TYPE("ai")); + g_variant_builder_add (&builder, "i", connectionFormatList); + g_variant_builder_close (&builder); + + g_variant_builder_open(&builder, G_VARIANT_TYPE("a(in)")); + g_variant_builder_open(&builder, G_VARIANT_TYPE("(in)")); + g_variant_builder_add (&builder, "i", mainPropertyList.type); + g_variant_builder_add (&builder, "n", mainPropertyList.value); + g_variant_builder_close (&builder); + g_variant_builder_close(&builder); + + g_variant_builder_open(&builder, G_VARIANT_TYPE("a(iin)")); + g_variant_builder_open(&builder, G_VARIANT_TYPE("(iin)")); + g_variant_builder_add (&builder, "i", NConfRouting.type); + g_variant_builder_add (&builder, "i", NConfRouting.status); + g_variant_builder_add (&builder, "n", NConfRouting.parameter); + g_variant_builder_close(&builder); + g_variant_builder_close (&builder); + + + g_variant_builder_open(&builder, G_VARIANT_TYPE("a(iin)")); + g_variant_builder_open(&builder, G_VARIANT_TYPE("(iin)")); + g_variant_builder_add (&builder, "i", NConfCommand.type); + g_variant_builder_add (&builder, "i", NConfCommand.status); + g_variant_builder_add (&builder, "n", NConfCommand.parameter); + g_variant_builder_close(&builder); + g_variant_builder_close (&builder); + + AFB_DEBUG("created sourceData %d", __LINE__); + return g_variant_builder_end (&builder); +} + +GVariant* create_domain_data(struct domain_data* data) +{ + GVariantBuilder builder; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("(qsssbbn)")); + g_variant_builder_add (&builder, "q", data->domainID); + g_variant_builder_add (&builder, "s", data->name); + g_variant_builder_add (&builder, "s", data->busname); + g_variant_builder_add (&builder, "s", data->nodename); + g_variant_builder_add (&builder, "b", data->early); + g_variant_builder_add (&builder, "b", data->complete); + g_variant_builder_add (&builder, "n", data->state); + AFB_DEBUG("created domainData %d", __LINE__); + return g_variant_builder_end (&builder); +} diff --git a/src/sm-helper.h b/src/sm-helper.h new file mode 100644 index 0000000..f6a3601 --- /dev/null +++ b/src/sm-helper.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2017 TOYOTA MOTOR CORPORATION + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef AM_HELPER_H +#define AM_HELPER_H +#define _GNU_SOURCE +#define AFB_BINDING_VERSION 2 +#include +#include +#include +//#include + +typedef enum REQ_ERROR +{ + REQ_FAIL = -1, + REQ_OK=0, + NOT_NUMBER, + OUT_RANGE +}REQ_ERROR; + +static const char* cmd_evlist[] = { + "volumeChanged", + "newMainConnection", + "removedMainConnection", + "sinkMuteStateChanged", + "mainConnectionStateChanged" +}; + +static const char* route_evlist[] = { + /* Routing event*/ + "setRoutingReady", + "setRoutingRundown", + "asyncConnect", + "asyncSetSourceState", + "asyncDisconnect" +}; + +struct sound_property_s{ + guint16 type; + gint16 value; +}; +struct availability_s{ + gint32 availability; + gint32 avalilable_reason; +}; +struct notification_config_s{ + gint32 type; + gint32 status; + gint16 parameter; +}; +struct main_sound_property_s{ + gint32 type; /* am_CustomMainSoundPropertyType_t */ + gint16 value; +}; + +struct domain_data{ + guint16 domainID; + gchar* name; + gchar* busname; + gchar* nodename; + gboolean early; + gboolean complete; + gint16 state; +}; + +REQ_ERROR get_value_uint16(const struct afb_req request, const char *source, uint16_t *out_id); +REQ_ERROR get_value_int16(const struct afb_req request, const char *source, int16_t *out_id); +REQ_ERROR get_value_int32(const struct afb_req request, const char *source, int32_t *out_id); +void sm_add_object_to_json_object(struct json_object* j_obj, int count, ...); +void sm_add_object_to_json_object_func(struct json_object* j_obj, const char* verb_name, int count, ...); +int sm_search_event_name_index(const char* value); +int sm_search_routing_event_name_index(const char* value); +GVariant* create_source_data(guint16 sourceID, guint16 domainID, const char* appname, guint16 sourceClassID, + gint32 sourceState, gint16 volume, gboolean visible, struct availability_s availables, + guint16 interrupt, struct sound_property_s soundPropertyList, gint32 connectionFormatList, + struct main_sound_property_s mainPropertyList, struct notification_config_s NConfRouting, + struct notification_config_s NConfCommand); +GVariant* create_domain_data(struct domain_data*); + + +#endif /*AM_HELPER_H*/ \ No newline at end of file diff --git a/src/soundmanager.c b/src/soundmanager.c new file mode 100644 index 0000000..030b1ab --- /dev/null +++ b/src/soundmanager.c @@ -0,0 +1,1570 @@ +/* + * Copyright (c) 2017 TOYOTA MOTOR CORPORATION + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define _GNU_SOURCE +#define AFB_BINDING_VERSION 2 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "sm-error.h" +#include "sm-helper.h" +#include "dbus/audio_manager_interface.h" + +#define AM_NAME "org.genivi.audiomanager" +#define AM_CMD_PATH "/org/genivi/audiomanager/commandinterface" +#define AM_ROUTE_PATH "/org/genivi/audiomanager/routinginterface" +#define AM_ROUTE_NAME "org.genivi.audiomanager.routinginterface" +#define SOUND_MANAGER_RETURN_INTERFACE "org.genivi.audiomanager.routing.soundmanager" +#define SOUND_MANAGER_BUS_NAME "org.genivi.audiomanager.routing.soundmanager" +#define SOUND_MANAGER_PATH "/org/genivi/audiomanager/routing/soundmanager" + +#define COMMAND_EVENT_NUM 10 +#define ROUTING_EVENT_NUM 10 +#define DEFAULT_SINK 1 +#define DEFAULT_SOURCE_CLASS_ID 100 +#define DYNAMIC_DOMAIN_ID 100 +#define DEFAULT_DOMAIN_ID 0 +#define DYNAMIC_SOURCE_ID 0 +#define DEFAULT_VOLUME 100 +#define DEFAULT_AVAILABLES 1 +#define DEFAULT_CONNECTION_FORMAT 2 +#define DEFAULT_INTERRUPT 0 +#define DEFAULT_SOURCE_STATE 2 +#define DS_CONTROLLED 1 + +#define EVENT_SUBSCRIBE_ERROR_CODE 100 + +const static struct afb_binding_interface *afbitf; +static AudiomanagerCommandinterface *am_cmd_bus; +static AudiomanagerRoutinginterface *am_route_bus; +static AudiomanagerRoutingSoundmanager *sm_adapter; +static AudiomanagerRoutingSoundmanagerIface* sm_itf; +static GDBusConnection* system_conn = NULL; + +static GMainLoop *loop = NULL; +static guint16 SOUNDMANAGER_DOMAIN_ID; +/* To Do hash table is better */ +struct event{ + char* name; + struct afb_event* event; + }; +static struct event command_event_list[COMMAND_EVENT_NUM]; +static struct event routing_event_list[ROUTING_EVENT_NUM]; + +static struct afb_event ev_new_connection; +static struct afb_event ev_removed_main_connection; +static struct afb_event ev_volume_changed; +static struct afb_event ev_sink_mute_state_changed; +static struct afb_event ev_main_connection_state_changed; + +/* Routing interface event */ +static struct afb_event ev_set_routing_ready; +static struct afb_event ev_set_routing_rundown; +static struct afb_event ev_async_connect; +static struct afb_event ev_async_disconnect; +static struct afb_event ev_async_set_source_state; + +static const char _source_id[] = "sourceID"; +static const char _sink_id[] = "sinkID" ; +static const char _sink_name[] = "sinkName" ; +static const char _main_connection_id[] = "mainConnectionID"; +static const char _delay[] = "delay"; +static const char _connection_state[] = "connectionState"; +static const char _connection_id[] = "connectionID"; +static const char _volume[] = "volume"; +static const char _volume_step[] = "volumeStep"; +static const char _mute_state[] = "muteState"; + +static const char _domain_id[] = "domainID"; +static const char _handle[] = "handle"; +static const char _appname[] = "appname"; +static const char _ramp[] = "ramp"; +static const char _time[] = "time"; +static const char _source_state[] = "sourceState"; +static const char _source_class_id[] = "sourceClassID"; +static const char _sink_class_id[] = "sinkClassID"; +static const char _error[] = "error"; +static const char _sink_data[] = "sinkData"; +static const char _source_data[] = "sourceData"; +static const char _interrupt_state[] = "interruptState"; +static const char _availability[] = "availability"; +static const char _list_volumes[] = "listVolumes"; +static const char _payload[] = "payload"; +static const char _connection_format[] = "connectionFormat"; +/* +********** Method of Sound Manager (API) ********** +*/ + +/** + * Call "connect" function of Audio Manager. + * Getting resource right to output audio stream. + * Please input following keys with value into json string object in argument. + * In case of using libsoundmanager, + * json_object *jobj = json_object_new_object(); + * json_object_object_add(jobj, "sourceID", json_object_new_int(100)); + * json_object_object_add(jobj, "sinkID", json_object_new_int(100)); + * call("connect", jobj); + * + * The order of arguments is not important. + * + * #### Parameters + * Request key + * - sourceID : Source ID getting in return value in registerSource or appname. + * - sinkID : Sink ID. This should be more than 0. If no request, defalut value is set by sound manager + * + * This will be changed in near future because these arguments should be aliased like + * sinkID:100 -> sinkID:"speaker" + * + * This will be modified after integrating + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. + * + * #### Note + * sourceID and sinkID should be more than 0 + * + */ +static void connect (struct afb_req request) +{ + AFB_DEBUG("call %s", __FUNCTION__); + guint16 source_id = 0, sink_id = 0; + guint16 main_connectionID = 0; + gint16 ret = -1; + REQ_ERROR req_err1 = REQ_FAIL; + REQ_ERROR req_err2 = REQ_FAIL; + GError *err = NULL; + + req_err1 = get_value_uint16(request, _source_id, &source_id); + /* ToDo: Hardware abstraction for application user is needed. + select appname(speaker) or sourceID(sinkID). If appname is desired, it changes to sourceID(sinkID) */ + + const char* default_sink = afb_req_value (request, _sink_id); + if(default_sink != NULL){ + if((strlen("default") == strlen(default_sink)) && + (0 == strncmp("default", default_sink, strlen("default")))){ + sink_id = DEFAULT_SINK; + req_err2 = REQ_OK; + } + else{ + req_err2 = get_value_uint16(request, _sink_id, &sink_id); + } + } + + if((req_err1 != REQ_OK) || (req_err2 != REQ_OK)) + { + AFB_INFO("get_value_uint16 source ret = %d,sink ret = %d", source_id, sink_id); + AFB_NOTICE("wrong request"); + afb_req_fail(request,"wrong-request",NULL); + return; + } + + audiomanager_commandinterface_call_connect_sync( + am_cmd_bus, + source_id, + sink_id, + &ret, + &main_connectionID, + NULL, &err); + + if(err != NULL) + { + afb_req_fail_f(request, "failed", "Unable to call %s", __FUNCTION__); + return; + } + + /* ToDo Remember appname(key) and tie to sourceID(value) */ + + /*create response json object*/ + struct json_object *res = json_object_new_object(); + sm_add_object_to_json_object_func(res, __FUNCTION__, 4, + "error", ret, + _main_connection_id, main_connectionID); + char *info = get_response_audiomanager_massage_error(ret); + afb_req_success(request, res, info); +} + +/** + * Call "disconnect" function of Audio Manager. + * Release resource right to output audio stream. + * + * #### Parameters + * Request key + * - sourceID : Source ID getting in return value in registerSource or appname. + * + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. + * + * #### Note + * sourceID should be more than 0 + * + */ +static void disconnect (struct afb_req request) +{ + AFB_DEBUG("call %s", __FUNCTION__); + + guint16 id; + gint16 ret; + REQ_ERROR req_err; + GError *err = NULL; + + req_err = get_value_uint16(request, _main_connection_id, &id); + AFB_DEBUG( "requested %s = %d", _main_connection_id, id); + + if(req_err != REQ_OK) + { + afb_req_fail(request,"wrong-request",afb_req_value (request, _main_connection_id)); + return; + } + audiomanager_commandinterface_call_disconnect_sync( + am_cmd_bus, + id, + &ret, + NULL, &err); + AFB_DEBUG( "ret = %d", ret); + + if(err != NULL) + { + afb_req_fail_f(request, "failed", "Unable to call %s", __FUNCTION__); + return; + } + + struct json_object* res_obj = json_object_new_object(); + sm_add_object_to_json_object_func(res_obj, __FUNCTION__, 2, + _error, ret); + char *info = get_response_audiomanager_massage_error(ret); + + afb_req_success(request, res_obj, info); /* return error num as status */ +} + +/** + * Call "setVolume" function of Audio Manager. + * Set sink volume. + * + * #### Parameters + * Request key + * - volume : volume value. The range of value should be [0-100] + * - sinkID : sinkID you would like to change volume at + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. + * + * #### Note + * + */ +static void setVolume (struct afb_req request) +{ + AFB_DEBUG("call %s", __FUNCTION__); + + guint16 sink_id, vol; + gint16 ret; + REQ_ERROR req_err1, req_err2; + GError *err = NULL; + + req_err1 = get_value_uint16(request, _sink_id, &sink_id); + req_err2 = get_value_int16(request, _volume, &vol); + AFB_DEBUG( "requested %s = %d, %s = %d",_sink_id, sink_id, _volume, vol); + if((req_err1 != REQ_OK) || (req_err2 != REQ_OK)) + { + afb_req_fail(request,"wrong-request", NULL); + return; + } + + audiomanager_commandinterface_call_set_volume_sync( + am_cmd_bus, + sink_id, + vol, + &ret, + NULL, &err); + AFB_DEBUG( "ret = %d", ret); + + if(err != NULL) + { + afb_req_fail_f(request, "failed", "Unable to call %s", __FUNCTION__); + return; + } + + struct json_object* res_obj = json_object_new_object(); + sm_add_object_to_json_object_func(res_obj, __FUNCTION__, 2, + "error", ret); + char *info = get_response_audiomanager_massage_error(ret); + + afb_req_success(request, res_obj, info); /* return error num as status */ +} + +/** + * Call "volumeStep" function of Audio Manager. + * Change volume step of sink + * + * #### Parameters + * Request key + * - sinkID : sinkID you would to change volume step + * - volumeStep : Step size of volume + * + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. + * + * #### Note + * + */ +static void volumeStep (struct afb_req request) +{ + AFB_DEBUG("call %s", __FUNCTION__); + + guint16 sink_id, vol; + gint16 ret; + REQ_ERROR req_err1, req_err2; + GError *err = NULL; + + req_err1 = get_value_uint16(request, _sink_id, &sink_id); + req_err2 = get_value_int16(request, _volume_step, &vol); + AFB_DEBUG( "requested %s = %d, %s = %d",_sink_id, sink_id, _volume_step, vol); + if((req_err1 != REQ_OK) || (req_err2 != REQ_OK)) + { + afb_req_fail(request,"wrong-request", NULL); + return; + } + + audiomanager_commandinterface_call_volume_step_sync( + am_cmd_bus, + sink_id, + vol, + &ret, + NULL, &err); + AFB_DEBUG( "ret = %d", ret); + + if(err != NULL) + { + afb_req_fail_f(request, "failed", "Unable to call %s", __FUNCTION__); + return; + } + + struct json_object* res_obj = json_object_new_object(); + sm_add_object_to_json_object_func(res_obj, __FUNCTION__, 2, + "error", ret); + char *info = get_response_audiomanager_massage_error(ret); + + afb_req_success(request, res_obj, info); /* return error num as status */ +} + +/** + * Call "volumeStep" function of Audio Manager. + * Change volume step of sink + * + * #### Parameters + * Request key + * - sinkID : sinkID you would like to change mute state + * - muteState : muteState, 1 means mute, 2 means unmute. Or you can designate as "mute" or "unmute" + * + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. + * + * #### Note + * + */ +static void setSinkMuteState(struct afb_req request) +{ + AFB_DEBUG("call %s", __FUNCTION__); + + guint16 sink_id, mute; + gint16 ret; + REQ_ERROR req_err1, req_err2; + GError *err = NULL; + + req_err1 = get_value_uint16(request, _sink_id, &sink_id); + req_err2 = get_value_int16(request, _mute_state, &mute); + AFB_DEBUG( "requested %s = %d, %s = %d",_sink_id, sink_id, _mute_state, mute); + if((req_err1 != REQ_OK) || (req_err2 != REQ_OK)) + { + afb_req_fail(request,"wrong-request", NULL); + return; + } + + audiomanager_commandinterface_call_set_sink_mute_state_sync( + am_cmd_bus, + sink_id, + mute, + &ret, + NULL, &err); + AFB_DEBUG( "ret = %d", ret); + + if(err != NULL) + { + afb_req_fail_f(request, "failed", "Unable to call %s", __FUNCTION__); + return; + } + + struct json_object* res_obj = json_object_new_object(); + sm_add_object_to_json_object_func(res_obj, __FUNCTION__, 2, + "error", ret); + char *info = get_response_audiomanager_massage_error(ret); + + afb_req_success(request, res_obj, info); /* return error num as status */ +} + +/** + * Call "getListMainConnections" function of Audio Manager. + * Get mainc connection list + * + * #### Parameters + * Request key + * None + * + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. Even if there is no connection list, + * Sound Manager return success. + * + * #### Note + * + */ +static void getListMainConnections(struct afb_req request) +{ + AFB_DEBUG("call getListMainConnections"); + guint16 ret; + GVariant* mainConnectionList; + GError *err = NULL; + + audiomanager_commandinterface_call_get_list_main_connections_sync( + am_cmd_bus, + &ret, + &mainConnectionList, + NULL, + &err + ); + + if(err != NULL) + { + afb_req_fail_f(request, "failed", "Unable to call %s", __FUNCTION__); + return; + } + + /* create response */ + struct json_object *array_res = json_object_new_array(); + gsize size = g_variant_n_children(mainConnectionList); + AFB_DEBUG("mainConnectionList size is %u",(uint16_t)size); + struct json_object *verb_obj = json_object_new_object(); + sm_add_object_to_json_object_func(verb_obj, __FUNCTION__, 0); + json_object_array_add(array_res, verb_obj); + if(size <= 0) + { + AFB_NOTICE( "mainConnectionList size is 0"); + } + else{ + for(int i = 0; i < size; ++i) + { + guint16 mcid, srcid, sinkid; + gint16 delay, constate; + g_variant_get_child( + mainConnectionList,i,"(qqqnn)", + &mcid, &srcid, &sinkid, &delay, &constate + ); + + struct json_object* res_obj = json_object_new_object(); + sm_add_object_to_json_object(res_obj,10, + _main_connection_id, mcid, + _source_id, srcid, + _sink_id, sinkid, + _delay, delay, + _connection_state, constate + ); + json_object_array_add(array_res,res_obj); + } + } + AFB_DEBUG("json object :%s:",json_object_to_json_string(array_res)); + afb_req_success(request, array_res, "Success to get main connection list"); +} + +/** + * Call "getListMainSinks" function of Audio Manager. + * Get main sink list + * + * #### Parameters + * Request key + * None + * + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. Even if there is no connection list, + * Sound Manager return success. + * + * #### Note + * + */ +static void getListMainSinks(struct afb_req request) +{ + AFB_DEBUG("call %s", __FUNCTION__); + guint16 ret; + GVariant* mainSinkList; + GError *err = NULL; + + audiomanager_commandinterface_call_get_list_main_sinks_sync( + am_cmd_bus, + &ret, + &mainSinkList, + NULL, + &err + ); + + if(err != NULL) + { + afb_req_fail_f(request, "failed", "Unable to call %s", __FUNCTION__); + return; + } + + /* create response */ + struct json_object *array_res = json_object_new_array(); + gsize size = g_variant_n_children(mainSinkList); + AFB_DEBUG( "%s size is %u",__FUNCTION__, (uint16_t)size); + struct json_object *verb_obj = json_object_new_object(); + sm_add_object_to_json_object_func(verb_obj, __FUNCTION__, 0); + json_object_array_add(array_res, verb_obj); + if(size <= 0) + { + AFB_NOTICE("%s size is 0", __FUNCTION__); + } + else{ + /*for(int i = 0; i < size; ++i) + { + guint16 sinkid, sinkclassid; + gchar* sinkname; + GVariant* available = g_variant_new("(nn)", -1, -1); + gint16 volume, mutestate; + g_variant_get_child( + mainSinkList,i,"(qs(nn)nnq)", + &sinkid, sinkname, &volume, &mutestate, &sinkclassid); + struct json_object* res_obj = json_object_new_object(); + sm_add_object_to_json_object(res_obj,2,_sink_id, sinkid); + json_object_object_add(res_obj, _sink_name, json_object_new_string(sinkname)); + sm_add_object_to_json_object(res_obj,6, + _volume, volume, + _mute_state, mutestate, + _sink_class_id, sinkclassid); + json_object_array_add(array_res,res_obj); + }*/ + } + AFB_DEBUG("json object :%s:",json_object_to_json_string(array_res)); + //afb_req_success(request, array_res, "Success to get main sink list"); + afb_req_success(request, array_res, "This is not implemented yet"); +} +/* +* +****** Routing Interface method(API) *********** +* +*/ + +/** + * Call "ackConnect" function of Audio Manager. + * Return acknowledge of connect against asyncConnect + * + * #### Parameters + * - handle : Handle id when you get on asyncConnect + * - connectionID : connection id when you got on connect return value + * - error : Error Number you would like to send. If error is 0, it means OK. + * If an application has some error, send error number in function then AM release + * resources the application got in connect. + * + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. Even if there is no connection list, + * Sound Manager return success. So you should check the contents size of return json object + * + * #### Note + * + */ +static void ackConnect(struct afb_req request) +{ + /* This function will be deprecated */ + AFB_DEBUG("call %s", __FUNCTION__); + guint16 handle, connection_id, error; + guint16 ret = 0; + REQ_ERROR req_err1, req_err2 , req_err3; + GError *err = NULL; + + req_err1 = get_value_uint16(request, _handle, &handle); + req_err2 = get_value_uint16(request, _connection_id, &connection_id); + req_err3 = get_value_uint16(request, _error, &error); + + if((req_err1 != REQ_OK) || (req_err2 != REQ_OK) || (req_err3 != REQ_OK)) + { + afb_req_fail(request,"wrong-request", NULL); + return; + } + if(connection_id == 0) + { + afb_req_fail(request,"wrong-request", "connectionID is more than 0"); + return; + } + + audiomanager_routinginterface_call_ack_connect_sync( + am_route_bus, + handle, + connection_id, + error, + NULL, &err); + + if(err != NULL) + { + afb_req_fail_f(request, "failed", "Unable to call %s", __FUNCTION__); + return; + } + /*create response json object*/ + struct json_object *res = json_object_new_object(); + sm_add_object_to_json_object_func(res, __FUNCTION__, 2, + _error, ret); + char *info = get_response_audiomanager_massage_error(ret); + afb_req_success(request, res, info); +} + +/** + * Call "ackDisconnect" function of Audio Manager. + * Return acknowledge of disconnect against asyncDisconnect + * + * #### Parameters + * - handle : Handle id when you get on asyncDisconnect + * - connectionID : connection id when you got on connect return value + * - error : Error Number you would like to send. If error is 0, it means OK. + * If an application has some error, send error number in function then AM + * + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. Even if there is no connection list, + * Sound Manager return success. So you should check the contents size of return json object + * + * #### Note + * + */ +static void ackDisconnect(struct afb_req request) +{ + /* This function will be deprecated */ + AFB_DEBUG("call %s", __FUNCTION__); + guint16 handle, connection_id, error; + guint16 ret = 0; + REQ_ERROR req_err1, req_err2 , req_err3; + GError *err = NULL; + + req_err1 = get_value_uint16(request, _handle, &handle); + req_err2 = get_value_uint16(request, _connection_id, &connection_id); + req_err3 = get_value_uint16(request, _error, &error); + + if((req_err1 != REQ_OK) || (req_err2 != REQ_OK) || (req_err3 != REQ_OK)) + { + afb_req_fail(request,"wrong-request", "connectionID is more than 0"); + return; + } + if(connection_id == 0) + { + afb_req_fail(request,"wrong-request", "connectionID is more than 0"); + return; + } + + audiomanager_routinginterface_call_ack_disconnect_sync( + am_route_bus, + handle, + connection_id, + error, + NULL, &err); + + if(err != NULL) + { + afb_req_fail_f(request, "failed", "Unable to call %s", __FUNCTION__); + return; + } + /*create response json object*/ + struct json_object *res = json_object_new_object(); + sm_add_object_to_json_object_func(res, __FUNCTION__, 2, + _error, ret); + char *info = get_response_audiomanager_massage_error(ret); + afb_req_success(request, res, info); +} + +/** + * Call "ackSetSourceState" function of Audio Manager. + * Return acknowledge of setSourceState against asyncSetSourceState. + * + * #### Parameters + * - handle : Handle id when you get on asyncSetSourceState + * - error : Error Number you would like to send. If error is 0, it means OK. + * If an application has some errors, send error number in function + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. + * + * #### Note + * This function is very important for applications to realise the sequence of Audio Management. + * An Application which matches with sourceID in the parameter of asyncSetSourceState has to return ack to use this function + * + */ +static void ackSetSourceState(struct afb_req request) +{ + AFB_DEBUG("call %s", __FUNCTION__); + guint16 handle, error; + guint16 ret = 0; + REQ_ERROR req_err1, req_err2; + GError *err = NULL; + + req_err1 = get_value_uint16(request, _handle, &handle); + req_err2 = get_value_uint16(request, _error, &error); + + if((req_err1 != REQ_OK) || (req_err2 != REQ_OK)) + { + AFB_DEBUG("wrong request"); + afb_req_fail(request,"wrong-request", NULL); + return; + } + + audiomanager_routinginterface_call_ack_set_source_state_sync( + am_route_bus, + handle, + error, + NULL, &err); + + if(err != NULL) + { + afb_req_fail_f(request, "failed", "Unable to call %s", __FUNCTION__); + return; + } + /*create response json object*/ + struct json_object *res = json_object_new_object(); + sm_add_object_to_json_object_func(res, __FUNCTION__, 2, + _error, ret); + char *info = get_response_audiomanager_massage_error(ret); + afb_req_success(request, res, info); +} + +/** + * Call "registerSource" function of Audio Manager. + * Register source(application) to Audio Manager Policy Management + * Application must call this function on its initialization + * + * #### Parameters + * - appname : Application unieque name + * [Option] + * It is not necessary to designate following argument, because these are default value is selected y soundmanager + * If you would like to set value, please input the following key and value + * - sourceClassID : + * - sourceState : + * + * #### Return + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. + * + * #### Note + * + */ +static void registerSource(struct afb_req request) +{ + AFB_DEBUG("call %s", __FUNCTION__); + GError *err = NULL; + + + guint16 source_id; /* q 0 is for dynamic id*/ + guint16 domain_id; /* q */ + guint16 source_class_id; /* q */ + gint32 source_state; /* i */ + gint16 volume; /* n */ + + if(REQ_OK != get_value_uint16(request, _source_id, &source_id)){ + source_id = DYNAMIC_SOURCE_ID; /* if 0, dynamic source id will be applied */ + } + REQ_ERROR req_err = get_value_uint16(request, _domain_id, &domain_id); + if( req_err != REQ_OK){ + if(req_err == REQ_FAIL) + { + domain_id = SOUNDMANAGER_DOMAIN_ID; /* default in AGL */ + } + else{ + afb_req_fail(request,"wrong-request", "Please input domainID as uint16, otherwise no value is OK"); + return; + } + } + if(domain_id == 0) + { + afb_req_fail(request,"wrong-request", "domainID should be more than 0"); + return; + } + const gchar* name = afb_req_value(request, _appname); /* s */ + if(!name) + { + char* info = "Must specify the name. Please input json arg such as {\"appname\":\"radio\"}"; + afb_req_fail(request, NULL, info); + return; + } + if(REQ_OK != get_value_uint16(request, _source_class_id, &source_class_id)){ + source_class_id = DEFAULT_SOURCE_CLASS_ID; /* BASE */ + } + if(REQ_OK != get_value_int32(request, _source_state, &source_state)){ + source_state = DEFAULT_SOURCE_STATE; /* SS_OFF */ + } + if(REQ_OK != get_value_int16(request, _volume, &volume)){ + volume = DEFAULT_VOLUME; + } + gboolean visible = TRUE; /* b */ + struct availability_s available; /* (ii) */ + available.availability = DEFAULT_AVAILABLES; /* A_UNKNOWN */ + available.avalilable_reason = 0; /* AR_UNKNOWN */ + guint16 interrupt = DEFAULT_INTERRUPT; /* q IS_OFF */ + + struct sound_property_s sound_property_list; /* a(in) */ + sound_property_list.type = 0; + sound_property_list.value = 0; /* in reality, this is array of struct */ + + gint32 connection_format_list = DEFAULT_CONNECTION_FORMAT; /* ai */ + struct main_sound_property_s main_property_list; /* a(in) */ + main_property_list.type = 0; + main_property_list.value = 0; + + struct notification_config_s nconf_routing; + struct notification_config_s nconf_command; /* a(iin)a(iin) */ + nconf_routing.type = 0; + nconf_routing.status = 0; + nconf_routing.parameter = 0; + + nconf_command.type = 0; + nconf_command.status = 0; + nconf_command.parameter = 0; + + /* acquire data */ + guint16 acquire_source_id; + guint16 ret; + + GVariant* sourceData = create_source_data (source_id, domain_id, name, source_class_id, + source_state, volume, visible, available, interrupt, + sound_property_list, connection_format_list, main_property_list, + nconf_routing, nconf_command); + + GVariant* input = g_variant_ref_sink(sourceData); + audiomanager_routinginterface_call_register_source_sync( + am_route_bus, + input, + &acquire_source_id, + &ret, + NULL, &err); + g_variant_unref(input); + + if(err != NULL) + { + afb_req_fail_f(request, "failed", "Unable to call %s", __FUNCTION__); + return; + } + + /*create response json object*/ + struct json_object *res = json_object_new_object(); + sm_add_object_to_json_object_func(res, __FUNCTION__, 4, + _error, ret, + _source_id, acquire_source_id); + char *info = get_response_audiomanager_massage_error(ret); + afb_req_success(request, res, info); +} + +/** + * Call "deregisterSource" function of Audio Manager. + * Deregister source(application) to Audio Manager Policy Management + * + * #### Parameters + * - sourceID : sourceID returned in resisterSource + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. + * + * #### Note + * + */ +static void deregisterSource(struct afb_req request) +{ + guint16 source_id; + guint16 ret; + + GError *err = NULL; + + if(REQ_OK != get_value_uint16(request, _source_id, &source_id)){ + afb_req_fail(request, "wrong-request", NULL); + } + audiomanager_routinginterface_call_deregister_source_sync( + am_route_bus, + source_id, + &ret, + NULL, &err + ); + if(err != NULL) + { + afb_req_fail_f(request, "failed", "Unable to call %s", __FUNCTION__); + return; + } + /*create response json object*/ + struct json_object *res = json_object_new_object(); + sm_add_object_to_json_object_func(res, __FUNCTION__, 2, + _error, ret); + char *info = get_response_audiomanager_massage_error(ret); + afb_req_success(request, res, info); + +} + +/** + * Subscribe event + * + * #### Parameters + * - event : Event name. Event list is written in libsoundmanager.hpp + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. + * + * #### Note + * + */ +static void subscribe(struct afb_req request) +{ + const char *value = afb_req_value(request, "event"); + AFB_DEBUG( "value is %s", value); + int ret = 0; + if(value) { + int index = sm_search_event_name_index(value); + if(index < 0) + { + index = sm_search_routing_event_name_index(value); + if(index < 0) + { + AFB_NOTICE( "dedicated event doesn't exist"); + ret = EVENT_SUBSCRIBE_ERROR_CODE; + } + else + { + afb_req_subscribe(request, *routing_event_list[index].event); + } + } + else + { + afb_req_subscribe(request, *command_event_list[index].event); + } + } + else{ + AFB_NOTICE( "Please input event name"); + ret = EVENT_SUBSCRIBE_ERROR_CODE; + } + /*create response json object*/ + struct json_object *res = json_object_new_object(); + sm_add_object_to_json_object_func(res, __FUNCTION__, 2, + _error, ret); + char *info = get_response_audiomanager_massage_error(ret); + afb_req_success(request, res, info); +} + +/** + * Unsubscribe event + * + * #### Parameters + * - event : Event name. Event list is written in libsoundmanager.hpp + * + * #### Rreturn + * - error : Error status number. If error is 0, it means the request is accepted, otherwise error message is attached with error code in reply message. + * + * #### Note + * + */ +static void unsubscribe(struct afb_req request) +{ + const char *value = afb_req_value(request, "event"); + AFB_DEBUG( "value is %s", value); + int ret = 0; + if(value) { + int index = sm_search_event_name_index(value); + if(index < 0) + { + index = sm_search_routing_event_name_index(value); + if(index < 0) + { + AFB_NOTICE( "dedicated event doesn't exist"); + ret = EVENT_SUBSCRIBE_ERROR_CODE; + } + else + { + afb_req_unsubscribe(request, *routing_event_list[index].event); + } + } + else + { + afb_req_unsubscribe(request, *command_event_list[index].event); + } + } + else{ + AFB_NOTICE( "Please input event name"); + ret = EVENT_SUBSCRIBE_ERROR_CODE; + } + /*create response json object*/ + struct json_object *res = json_object_new_object(); + sm_add_object_to_json_object_func(res, __FUNCTION__, 2, + _error, ret); + char *info = get_response_audiomanager_massage_error(ret); + afb_req_success(request, res, info); +} + +/* +********** Callback Function invoked by Audio Manager ********** +*/ + +static void on_new_main_connection(AudiomanagerCommandinterface* interface, + GVariant* mainConnection) +{ + AFB_DEBUG("%s is called",__FUNCTION__); + + guint16 mcid, srcid, sinkid; + gint16 delay, constate; + g_variant_get( + mainConnection,"(qqqnn)", &mcid, &srcid, &sinkid, &delay, &constate); + + struct json_object* res_obj = json_object_new_object(); + sm_add_object_to_json_object(res_obj,10, + _main_connection_id, mcid, + _source_id, srcid, + _sink_id, sinkid, + _delay, delay, + _connection_state, constate + ); + AFB_DEBUG("json object :%s:",json_object_to_json_string(res_obj)); + + afb_event_push(ev_new_connection, res_obj); +} + +static void on_removed_main_connection( + AudiomanagerCommandinterface* interface, guint16 mainConnectionID) +{ + AFB_DEBUG("%s is called",__FUNCTION__); + + struct json_object* res_obj = json_object_new_object(); + sm_add_object_to_json_object(res_obj, 2, + _main_connection_id, mainConnectionID); + afb_event_push(ev_removed_main_connection, res_obj); +} + +static void on_main_connection_state_changed( + AudiomanagerCommandinterface* interface, guint16 connectionID, gint16 connectionState) +{ + AFB_DEBUG("%s is called",__FUNCTION__); + + struct json_object* res_obj = json_object_new_object(); + sm_add_object_to_json_object(res_obj, 4, + _connection_id, connectionID, + _connection_state, connectionState); + afb_event_push(ev_main_connection_state_changed, res_obj); +} + +static void on_volume_changed( + AudiomanagerCommandinterface* interface, guint16 sinkID, gint16 volume) +{ + AFB_DEBUG("%s is called",__FUNCTION__); + struct json_object* res_obj = json_object_new_object(); + sm_add_object_to_json_object(res_obj, 4, + _sink_id, sinkID, + _volume, volume); + afb_event_push(ev_volume_changed, res_obj); +} + +static void on_sink_mute_state_changed( + AudiomanagerCommandinterface* interface, guint16 sinkID, gint16 mute) +{ + AFB_DEBUG("%s is called",__FUNCTION__); + struct json_object* res_obj = json_object_new_object(); + sm_add_object_to_json_object(res_obj, 4, + _sink_id, sinkID, + _mute_state, mute); + afb_event_push(ev_sink_mute_state_changed, res_obj); +} + +/* +********** Callback Function invoked by Audio Manager Routing Interface********** +*/ +static void on_set_routing_ready( + AudiomanagerRoutinginterface* interface) +{ + AFB_DEBUG("%s is called",__FUNCTION__); + afb_event_push(ev_set_routing_ready, NULL); +} + +static void on_set_routing_rundown( + AudiomanagerRoutinginterface* interface) +{ + AFB_DEBUG("%s is called",__FUNCTION__); + afb_event_push(ev_set_routing_ready, NULL); +} + + + +/* +********** Callback Function invoked by Sound Manager Adapter Interface********** +* +* For now, there may be no need to send events to applications from these invocation. +* Sound Manager just sends ack to Audio Manager in charge of applications. +* +*/ +static gboolean on_async_abort( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle) +{ + AFB_DEBUG( "%s called", __FUNCTION__); + /* Nothing To Do. If it is better to implement something, I will implement */ + return TRUE; +} + +static gboolean on_async_connect( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_connectionID, + guint16 arg_sourceID, + guint16 arg_sinkID, + gint arg_connectionFormat) +{ + AFB_DEBUG( "%s called", __FUNCTION__); + + struct json_object* ev_obj = json_object_new_object(); + sm_add_object_to_json_object(ev_obj, 10, + _handle, arg_handle, + _connection_id, arg_connectionID, + _source_id, arg_sourceID, + _sink_id, arg_sinkID, + _connection_format, arg_connectionFormat); + afb_event_push(ev_async_connect, ev_obj); + + /* GError must be initialized here because it is same as grobal errno, + so if afb_event_push is failed due to something, number will be changed */ + GError* err = NULL; + audiomanager_routinginterface_call_ack_connect_sync( + am_route_bus, + arg_handle, + arg_connectionID, + 0, + NULL, &err); + if(err != NULL) + { + AFB_ERROR( "Can't send ack to sound manager adapter %s", __FUNCTION__); + return FALSE; + } + return TRUE; +} + +static gboolean on_async_disconnect( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_connectionID) +{ + AFB_DEBUG( "%s called", __FUNCTION__); + struct json_object* ev_obj = json_object_new_object(); + sm_add_object_to_json_object(ev_obj, 4, + _handle, arg_handle, + _connection_id, arg_connectionID); + afb_event_push(ev_async_disconnect, ev_obj); + GError* err = NULL; + audiomanager_routinginterface_call_ack_disconnect_sync( + am_route_bus, + arg_handle, + arg_connectionID, + 0, + NULL, &err); + if(err != NULL) + { + AFB_ERROR( "Can't send ack to sound manager adapter %s", __FUNCTION__); + return FALSE; + } + return TRUE; +} + +static gboolean on_async_set_sink_volume( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_sinkID, + gint16 arg_volume, + gint16 arg_ramp, + guint16 arg_time) +{ + AFB_DEBUG( "%s called", __FUNCTION__); + GError* err = NULL; + audiomanager_routinginterface_call_ack_set_sink_volume_sync( + am_route_bus, + arg_handle, + arg_volume, + 0, NULL, &err); + if(err != NULL);{ + AFB_ERROR( "Can't send ack to sound manager adapter %s", __FUNCTION__); + return FALSE; + } + return TRUE; +} + +/** + * Event "asyncSetSourceState" + * This event is one of the result of Audio Management for connect/disconnect. + * + * #### Parameters + * Request key + * - sourceID : sourceID to be commanded by Audio Manager. The contents of command is sourceState + * - handle : handle is the dynamic number managed by Audio Manager. Please return this parameter to input ackSetSourceState as is + * - sourceState : "on" is the instruction that application can output sound + * "off" is the instruction that application sound right will be removed_main_connection + * "pause" is the instruction that application must stop output sound because other applications temporaly got sound right and will output sound + * + * #### Note + * This function is very important for applications to realise the sequence of Audio Management. + * An Application which matches with sourceID in the parameter of asyncSetSourceState has to return ack to use this function + * + */ +static gboolean on_async_set_source_state( + AudiomanagerRoutingSoundmanager *object, + GDBusMethodInvocation *invocation, + guint16 arg_handle, + guint16 arg_sourceID, + gint arg_sourceState) +{ + AFB_DEBUG( "%s called", __FUNCTION__); + struct json_object* ev_obj = json_object_new_object(); + char* ss_key = get_source_state_key(arg_sourceState); + sm_add_object_to_json_object(ev_obj, 4, + _handle, arg_handle, + _source_id, arg_sourceID); + json_object_object_add(ev_obj, _source_state, json_object_new_string(ss_key)); + afb_event_push(ev_async_set_source_state, ev_obj); + /* Applications must return ackSetSourceState to look sourceID, then Sound Manager doen't return ackSetSourceState */ + /*audiomanager_routinginterface_call_ack_set_source_state_sync( + am_route_bus, + arg_handle, + NULL, + NULL, &err);*/ +} + + +/* + * array of the verbs exported to afb-daemon + */ +static const struct afb_verb_v2 binding_verbs[]= { +{ .verb = "connect", .callback = connect, .auth = NULL, + .info = "Connect source id and sink id" , .session = AFB_SESSION_NONE}, +{ .verb = "disconnect", .callback = disconnect, .auth = NULL, + .info = "Disconnect source id and sink id" , .session = AFB_SESSION_NONE}, +{ .verb = "setVolume", .callback = setVolume, .auth = NULL, + .info = "Set volume value" , .session = AFB_SESSION_NONE}, /* it is better to show the range*/ +{ .verb = "volumeStep", .callback = volumeStep, .auth = NULL, + .info = "Set volume step range" , .session = AFB_SESSION_NONE}, +{ .verb = "setSinkMuteState", .callback = setSinkMuteState, .auth = NULL, + .info = "Set Mute state: 1 means mute, 2 means umute. Others are invalid" ,.session = AFB_SESSION_NONE}, +{ .verb = "getListMainConnections", .callback = getListMainConnections, .auth = NULL, + .info = "Get MainConnection List" , .session = AFB_SESSION_NONE}, +{ .verb = "getListMainSinks", .callback = getListMainSinks, .auth = NULL, + .info = "Get MainSink List" , .session = AFB_SESSION_NONE}, +{ .verb = "registerSource", .callback = registerSource, .auth = NULL, + .info = "Register Application" , .session = AFB_SESSION_NONE}, +{ .verb = "deregisterSource", .callback = deregisterSource, .auth = NULL, + .info = "Deregister Application" , .session = AFB_SESSION_NONE}, +{ .verb = "ackConnect", .callback = ackConnect, .auth = NULL, + .info = "Acknowledge of asyncConnect" , .session = AFB_SESSION_NONE}, +{ .verb = "ackDisconnect", .callback = ackDisconnect, .auth = NULL, + .info = "Acknowledge of asyncConnect" , .session = AFB_SESSION_NONE}, +{ .verb = "ackSetSourceState", .callback = ackSetSourceState, .auth = NULL, + .info = "Acknowledge of asyncSetSourceState" , .session = AFB_SESSION_NONE}, +{ .verb = "subscribe", .callback = subscribe, .auth = NULL, + .info = "Subscribe event" , .session = AFB_SESSION_NONE}, +{ .verb = "unsubscribe", .callback = unsubscribe, .auth = NULL, + .info = "Unsubscribe event" , .session = AFB_SESSION_NONE}, +{ .verb = NULL } /* marker for end of the array */}; + +static void *dbus_event_loop_run(void *args) +{ + loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(loop); +} + +/* +* +********** Internal Function used by Sound Manager ********** +* +*/ + +static int registerDomain() +{ + /* Default Setting of Sound Manager Domain */ + struct domain_data ddata = { + .domainID = DYNAMIC_DOMAIN_ID, + .name = "SoundManager", + .busname = SOUND_MANAGER_BUS_NAME, + .nodename = "soundmanager", + .early = FALSE, + .complete = TRUE, + .state = DS_CONTROLLED + }; + GVariant* domainData = create_domain_data(&ddata); + gchar* retBusName = SOUND_MANAGER_BUS_NAME; + gchar* retPath = SOUND_MANAGER_PATH; + gchar* retInterface = SOUND_MANAGER_RETURN_INTERFACE; + guint16 domain_id; + GError *err = NULL; + guint16 error; + + audiomanager_routinginterface_call_register_domain_sync( + am_route_bus, + domainData, + retBusName, + retPath, + retInterface, + &domain_id, &error, + NULL, &err); + if(err != NULL){ + AFB_ERROR( "Failed to call %s", __FUNCTION__); + return -1; + } + if(error != 0) + { + AFB_ERROR( "Failed to register domain"); + return error; + } + SOUNDMANAGER_DOMAIN_ID = domain_id; + AFB_NOTICE( "Complete registered domain id:%d",SOUNDMANAGER_DOMAIN_ID); + return 0; +} + +static int preinit() +{ + int ret; + AFB_INFO("Initialize Dbus object"); + /* Initialize Dbus interface */ + if(am_cmd_bus || am_route_bus) + { + AFB_ERROR( "Dbus object to Audio Manager is already created"); + goto out; + } + am_cmd_bus = audiomanager_commandinterface_proxy_new_for_bus_sync( + G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_NONE, + AM_NAME, + AM_CMD_PATH, + NULL, + NULL + ); + am_route_bus = audiomanager_routinginterface_proxy_new_for_bus_sync( + G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_NONE, + AM_NAME, + AM_ROUTE_PATH, + NULL, + NULL + ); + + if(!am_cmd_bus || !am_route_bus) + { + goto out; + } + + AFB_NOTICE( "Finish Initialize"); + return 0; +out: + AFB_ERROR("Failed to initialize"); + return -1; +} + +static int create_adapter() +{ + GError *error = NULL; + gboolean ret; + GVariant *value; + system_conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error); + if (error) + { + g_error_free(error); + return -1; + } + sm_adapter = audiomanager_routing_soundmanager_skeleton_new(); + sm_itf = AUDIOMANAGER_ROUTING_SOUNDMANAGER_GET_IFACE(sm_adapter); + + /* initialize sound manager adapter */ + sm_itf->handle_async_abort = on_async_abort; + sm_itf->handle_async_connect = on_async_connect; + sm_itf->handle_async_disconnect = on_async_disconnect; + sm_itf->handle_async_set_sink_volume = on_async_set_sink_volume; + sm_itf->handle_async_set_source_state = on_async_set_source_state; + + int sigret = g_signal_connect(sm_adapter, "handle-async-abort", G_CALLBACK(on_async_abort),NULL); + sigret = g_signal_connect(sm_adapter, "handle-async-connect", G_CALLBACK(on_async_connect),NULL); + sigret = g_signal_connect(sm_adapter, "handle-async-disconnect", G_CALLBACK(on_async_disconnect),NULL); + sigret = g_signal_connect(sm_adapter, "handle-async-set-sink-volume", G_CALLBACK(on_async_set_sink_volume),NULL); + sigret = g_signal_connect(sm_adapter, "handle-async-set-source-state", G_CALLBACK(on_async_set_source_state),NULL); + ret = g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(sm_adapter), system_conn, SOUND_MANAGER_PATH, &error); + if (FALSE == ret) + { + AFB_ERROR( "failed to export"); + g_error_free(error); + g_object_unref(system_conn); + + return -1; + } + + return 0; +} + + +static void on_name_lost(GDBusServer *server, GDBusConnection *conn, gpointer data) +{ + AFB_WARNING("%s called", __FUNCTION__); +} + + +static int sm_event_init() +{ + AFB_NOTICE("Initialize event receive setting"); + printf("Initialize event receive setting"); + int ret; + /* Initialize make event */ + size_t size = sizeof cmd_evlist / sizeof *cmd_evlist; + + /*create event*/ + /*ToDo Hash table is better. And event should be created in the loop + I would like to change */ + ev_volume_changed = afb_daemon_make_event(cmd_evlist[0]); + ev_new_connection = afb_daemon_make_event(cmd_evlist[1]); + ev_removed_main_connection = afb_daemon_make_event(cmd_evlist[2]); + ev_sink_mute_state_changed = afb_daemon_make_event(cmd_evlist[3]); + ev_main_connection_state_changed = afb_daemon_make_event(cmd_evlist[4]); + command_event_list[0].name = cmd_evlist[0]; + command_event_list[0].event = &ev_volume_changed; + command_event_list[1].name = cmd_evlist[1]; + command_event_list[1].event = &ev_new_connection; + command_event_list[2].name = cmd_evlist[2]; + command_event_list[2].event = &ev_removed_main_connection; + command_event_list[3].name = cmd_evlist[3]; + command_event_list[3].event = &ev_sink_mute_state_changed; + command_event_list[4].name = cmd_evlist[4]; + command_event_list[4].event = &ev_main_connection_state_changed; + + /* create routing event */ + ev_set_routing_ready = afb_daemon_make_event(route_evlist[0]); + ev_set_routing_rundown = afb_daemon_make_event(route_evlist[1]); + ev_async_connect = afb_daemon_make_event(route_evlist[2]); + ev_async_set_source_state = afb_daemon_make_event(route_evlist[3]); + ev_async_disconnect = afb_daemon_make_event(route_evlist[4]); + + routing_event_list[0].name = route_evlist[0]; + routing_event_list[0].event = &ev_set_routing_ready; + routing_event_list[1].name = route_evlist[1]; + routing_event_list[1].event = &ev_set_routing_rundown; + routing_event_list[2].name = route_evlist[2]; + routing_event_list[2].event = &ev_async_connect; + routing_event_list[3].name = route_evlist[3]; + routing_event_list[3].event = &ev_async_set_source_state; + routing_event_list[4].name = route_evlist[4]; + routing_event_list[4].event = &ev_async_disconnect; + /*for(size_t i = 0; i < size; ++i) + { + struct afb_event afbev = afb_daemon_make_event(afbitf->daemon, cmd_evlist[i])); + size_t afbev_size = sizeof afbev; + size_t key_size = sizeof cmd_evlist[i]; + + struct event ev = {cmd_evlist[i],afbev}; + command_event_list[i] = malloc(key_size + afbev_size); + command_event_list[i] = ev; + search_result = hsearch(entry, FIND); + if(search_result) + AFB_NOTICE( "event name is %s", search_result->key); + }*/ + + /* Initialize dbus event thread */ + if(!am_cmd_bus || !am_route_bus) + { + goto ev_init_out; + } + pthread_t thread_id; + ret = pthread_create(&thread_id, NULL, dbus_event_loop_run, NULL); + if(ret != 0) + { + goto ev_init_out; + } + /* initialize signal from audio manager command interface */ + g_signal_connect(am_cmd_bus, + "volume_changed", + G_CALLBACK(on_volume_changed), + NULL); + g_signal_connect(am_cmd_bus, + "new_main_connection", + G_CALLBACK(on_new_main_connection), + NULL); + g_signal_connect(am_cmd_bus, + "removed_main_connection", + G_CALLBACK(on_removed_main_connection), + NULL); + g_signal_connect(am_cmd_bus, + "sink_mute_state_changed", + G_CALLBACK(on_sink_mute_state_changed), + NULL); + g_signal_connect(am_cmd_bus, + "main_connection_state_changed", + G_CALLBACK(on_main_connection_state_changed), + NULL); + g_signal_connect(am_route_bus, + "set_routing_ready", + G_CALLBACK(on_set_routing_ready), + NULL); + g_signal_connect(am_route_bus, + "set_routing_rundown", + G_CALLBACK(on_set_routing_rundown), + NULL); + + /* Get soundmanager adapter bus */ + ret = g_bus_own_name(G_BUS_TYPE_SYSTEM, SOUND_MANAGER_BUS_NAME, G_BUS_NAME_OWNER_FLAGS_NONE, + NULL,NULL, NULL, NULL, NULL); + AFB_DEBUG( "g_bus_own_name ret: %d", ret); + ret = create_adapter(); + if(ret != 0) + { + goto ev_init_out; + } + ret = registerDomain(); + + if(ret != 0) + { + AFB_ERROR("registerDomain error: %s",get_response_audiomanager_massage_error(ret)); + goto ev_init_out; + } + + AFB_INFO("Finish Initialize event receive setting"); + return 0; + +ev_init_out: + if(loop != NULL) + { + g_main_loop_unref(loop); + } + AFB_WARNING( "DBus connection is not created"); + return -1; +} + +static void onevent(const char *event, struct json_object *object) +{ + AFB_NOTICE("on_event %s", event); +} + +const struct afb_binding_v2 afbBindingV2 = { + .api = "soundmanager", + .specification = NULL, + .verbs = binding_verbs, + .preinit = preinit, + .init = sm_event_init, + .onevent = onevent +}; -- cgit 1.2.3-korg