aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-01-11 05:51:06 -0600
committerConor Curran <conor.curran@canonical.com>2011-01-11 05:51:06 -0600
commitf5858b0a17a43bd46fcd2351a160a6ec74171cc6 (patch)
treeba4bb1e05882496078414e5afd30245d2c73b44f
parent7440e8668c7d018e8ef85aea08ee5924da813d9d (diff)
downloadayatana-indicator-sound-f5858b0a17a43bd46fcd2351a160a6ec74171cc6.tar.gz
ayatana-indicator-sound-f5858b0a17a43bd46fcd2351a160a6ec74171cc6.tar.bz2
ayatana-indicator-sound-f5858b0a17a43bd46fcd2351a160a6ec74171cc6.zip
signals being sent correctly
-rw-r--r--src/indicator-sound.c8
-rw-r--r--src/sound-service-dbus.c25
2 files changed, 18 insertions, 15 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 1ca3447..ed35d7a 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -112,8 +112,6 @@ static void get_sink_availability_cb ( GObject *object,
GAsyncResult *res,
gpointer user_data );
-
-
/****Volume States 'members' ***/
static void update_state(const gint state);
@@ -704,8 +702,12 @@ static void g_signal_cb ( GDBusProxy *proxy,
gpointer user_data)
{
IndicatorSound *self = INDICATOR_SOUND(user_data);
- gboolean input = g_variant_get_boolean (parameters);
g_return_if_fail ( IS_INDICATOR_SOUND(self) );
+
+ g_variant_ref (parameters);
+ GVariant *value = g_variant_get_child_value (parameters, 0);
+ gboolean input = g_variant_get_boolean (value);
+ g_variant_unref (parameters);
if (g_strcmp0(signal_name, INDICATOR_SOUND_SIGNAL_SINK_AVAILABLE_UPDATE) == 0){
react_to_signal_sink_availability_update ( input, self );
diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c
index 223c1d9..d9db2b6 100644
--- a/src/sound-service-dbus.c
+++ b/src/sound-service-dbus.c
@@ -124,7 +124,7 @@ sound_service_dbus_init (SoundServiceDbus *self)
INDICATOR_SOUND_SERVICE_DBUS_OBJECT,
interface_info,
&interface_table,
- NULL,
+ self,
NULL,
&error);
if (error != NULL) {
@@ -158,19 +158,20 @@ bus_method_call (GDBusConnection * connection,
const gchar * method,
GVariant * params,
GDBusMethodInvocation * invocation,
- gpointer user_data)
+ gpointer user_data)
{
- IndicatorService* service = INDICATOR_SERVICE(user_data);
+ SoundServiceDbus* service = SOUND_SERVICE_DBUS(user_data);
+ g_return_if_fail ( IS_SOUND_SERVICE_DBUS(service) );
GVariant * retval = NULL;
SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (service);
if (g_strcmp0(method, "GetSinkMute") == 0) {
g_debug("Get sink mute - sound service dbus!,about to send over mute_value of %i", priv->mute);
- retval = g_variant_new_boolean (priv->mute);
+ retval = g_variant_new ( "(b)", priv->mute);
}
else if (g_strcmp0(method, "GetSinkAvailability") == 0) {
g_debug("Get sink availability - sound service dbus!, about to send over availability_value of %i", priv->sink_availability);
- retval = g_variant_new_boolean (priv->sink_availability);
+ retval = g_variant_new ( "(b)", priv->sink_availability);
}
else {
g_warning("Calling method '%s' on the sound service but it's unknown", method);
@@ -189,7 +190,7 @@ void sound_service_dbus_sink_input_while_muted(SoundServiceDbus* obj,
g_debug("Emitting signal: SINK_INPUT_WHILE_MUTED, with block_value: %i",
block_value);
SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (obj);
- GVariant* v_output = g_variant_new_boolean (block_value);
+ GVariant* v_output = g_variant_new("(b)", block_value);
GError * error = NULL;
@@ -212,10 +213,10 @@ void sound_service_dbus_update_sink_mute(SoundServiceDbus* obj,
{
g_debug("Emitting signal: SINK_MUTE_UPDATE, with sink mute %i", sink_mute);
SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (obj);
- GVariant* v_output = g_variant_new_boolean (sink_mute);
+ priv->mute = sink_mute;
+ GVariant* v_output = g_variant_new("(b)", sink_mute);
GError * error = NULL;
-
g_dbus_connection_emit_signal( priv->connection,
INDICATOR_SOUND_DBUS_NAME,
INDICATOR_SOUND_DBUS_OBJECT,
@@ -233,13 +234,13 @@ void sound_service_dbus_update_sink_mute(SoundServiceDbus* obj,
void sound_service_dbus_update_sink_availability(SoundServiceDbus* obj,
gboolean sink_availability)
{
- /* g_debug("Emitting signal: SINK_AVAILABILITY_UPDATE, with value %i", sink_availability);*/
g_debug("Emitting signal: SinkAvailableUpdate, with %i", sink_availability);
SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (obj);
- GVariant* v_output = g_variant_new_boolean (sink_availability);
-
+ priv->sink_availability = sink_availability;
+
+ GVariant* v_output = g_variant_new("(b)", priv->sink_availability);
GError * error = NULL;
-
+
g_dbus_connection_emit_signal( priv->connection,
INDICATOR_SOUND_DBUS_NAME,
INDICATOR_SOUND_DBUS_OBJECT,