aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-sound.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-02-08 17:21:05 +0000
committerConor Curran <conor.curran@canonical.com>2010-02-08 17:21:05 +0000
commitea417ae84133c26aed0b257376ab1d1c567a9779 (patch)
treef889cfcbaf1efe9f20e338b27f516bf8f6f3976b /src/indicator-sound.c
parentf9ef87f71c488f6791e32b1cf7205fb65db81ce8 (diff)
downloadayatana-indicator-sound-ea417ae84133c26aed0b257376ab1d1c567a9779.tar.gz
ayatana-indicator-sound-ea417ae84133c26aed0b257376ab1d1c567a9779.tar.bz2
ayatana-indicator-sound-ea417ae84133c26aed0b257376ab1d1c567a9779.zip
automatic slider volume updates working
Diffstat (limited to 'src/indicator-sound.c')
-rw-r--r--src/indicator-sound.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 9ceebd1..fe1b6fb 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -90,7 +90,7 @@ static gboolean slider_value_changed_event_cb(GtkRange *range, gpointer user_da
static DBusGProxy *sound_dbus_proxy = NULL;
static void connection_changed (IndicatorServiceManager * sm, gboolean connected, gpointer userdata);
static void catch_signal_sink_input_while_muted(DBusGProxy * proxy, gint sink_index, gboolean value, gpointer userdata);
-void catch_signal_sink_volume_update(DBusGProxy * proxy, gint sink_volume, gpointer userdata);
+static void catch_signal_sink_volume_update(DBusGProxy * proxy, gdouble volume_percent, gpointer userdata);
/****Volume States 'members' ***/
static const gint STATE_MUTED = 0;
@@ -193,8 +193,8 @@ connection_changed (IndicatorServiceManager * sm, gboolean connected, gpointer u
g_debug("about to connect to the signals");
dbus_g_proxy_add_signal(sound_dbus_proxy, SIGNAL_SINK_INPUT_WHILE_MUTED, G_TYPE_INT, G_TYPE_BOOLEAN, G_TYPE_INVALID);
dbus_g_proxy_connect_signal(sound_dbus_proxy, SIGNAL_SINK_INPUT_WHILE_MUTED, G_CALLBACK(catch_signal_sink_input_while_muted), NULL, NULL);
- dbus_g_proxy_add_signal(sound_dbus_proxy, SIGNAL_UPDATE_SINK_VOLUME, G_TYPE_INT, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal(sound_dbus_proxy, SIGNAL_UPDATE_SINK_VOLUME, G_CALLBACK(catch_signal_sink_volume_update), NULL, NULL);
+ dbus_g_proxy_add_signal(sound_dbus_proxy, SIGNAL_SINK_VOLUME_UPDATE, G_TYPE_DOUBLE, G_TYPE_INVALID);
+ dbus_g_proxy_connect_signal(sound_dbus_proxy, SIGNAL_SINK_VOLUME_UPDATE, G_CALLBACK(catch_signal_sink_volume_update), NULL, NULL);
}
@@ -211,9 +211,12 @@ static void catch_signal_sink_input_while_muted(DBusGProxy * proxy, gint sink_in
g_debug("signal caught - I don't believe it ! with index %i and value %i", sink_index, value);
}
-void catch_signal_sink_volume_update(DBusGProxy * proxy, gint sink_volume, gpointer userdata)
+static void catch_signal_sink_volume_update(DBusGProxy * proxy, gdouble volume_percent, gpointer userdata)
{
- g_debug("signal caught - update sink volume with value : %i", sink_volume);
+ g_debug("signal caught - update sink volume with value : %f", volume_percent);
+ GtkWidget* slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)volume_slider);
+ GtkRange* range = (GtkRange*)slider;
+ gtk_range_set_value(range, volume_percent);
}
static void