aboutsummaryrefslogtreecommitdiff
path: root/src/active-sink.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-02-04 18:25:54 +0000
committerConor Curran <conor.curran@canonical.com>2011-02-04 18:25:54 +0000
commit6bfc46de9234f0ef39d90b934fb406eebec4c59c (patch)
tree35b612485f2b6f198caaaf54f92442f219ae6a2d /src/active-sink.c
parent39430b4d1797d16b2152fddb864a38c26f8fb97f (diff)
downloadayatana-indicator-sound-6bfc46de9234f0ef39d90b934fb406eebec4c59c.tar.gz
ayatana-indicator-sound-6bfc46de9234f0ef39d90b934fb406eebec4c59c.tar.bz2
ayatana-indicator-sound-6bfc46de9234f0ef39d90b934fb406eebec4c59c.zip
tidy ups
Diffstat (limited to 'src/active-sink.c')
-rw-r--r--src/active-sink.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/src/active-sink.c b/src/active-sink.c
index 1aa6c67..37cdf51 100644
--- a/src/active-sink.c
+++ b/src/active-sink.c
@@ -35,8 +35,8 @@ struct _ActiveSinkPrivate
gint index;
gchar* name;
pa_cvolume volume;
- pa_channel_map channel_map;
- pa_volume_t base_volume;
+ pa_channel_map channel_map;
+ pa_volume_t base_volume;
};
#define ACTIVE_SINK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ACTIVE_SINK_TYPE, ActiveSinkPrivate))
@@ -82,15 +82,7 @@ active_sink_init(ActiveSink *self)
static void
active_sink_dispose (GObject *object)
-{
- ActiveSink * self = ACTIVE_SINK(object);
- ActiveSinkPrivate* priv = ACTIVE_SINK_GET_PRIVATE (self);
-
- /*if (priv->details != NULL) {
- g_free (priv->details->name);
- g_free (priv->details);
- }*/
-
+{
G_OBJECT_CLASS (active_sink_parent_class)->dispose (object);
}
@@ -127,11 +119,18 @@ active_sink_is_populated (ActiveSink* sink)
return (priv->index != -1);
}
-gboolean
-active_sink_is_muted (ActiveSink* self)
+void
+active_sink_determine_blocking_state (ActiveSink* self)
{
ActiveSinkPrivate* priv = ACTIVE_SINK_GET_PRIVATE (self);
- return mute_menu_item_is_muted (priv->mute_menuitem);
+ if (mute_menu_item_is_muted (priv->mute_menuitem)){
+ /**
+ We don't want to set the current state to blocking
+ as this is a fire and forget event.
+ */
+ sound_service_dbus_update_sound_state (priv->service,
+ BLOCKED);
+ }
}
gint
@@ -154,6 +153,18 @@ active_sink_update_volume (ActiveSink* self, gdouble percent)
}
void
+active_sink_deactivate (ActiveSink* self)
+{
+ ActiveSinkPrivate* priv = ACTIVE_SINK_GET_PRIVATE (self);
+ priv->current_sound_state = UNAVAILABLE;
+ sound_service_dbus_update_sound_state (priv->service,
+ priv->current_sound_state);
+ priv->index = -1;
+ g_free(priv->name);
+ priv->name = NULL;
+}
+
+void
active_sink_update_mute (ActiveSink* self, gboolean muted)
{
ActiveSinkPrivate* priv = ACTIVE_SINK_GET_PRIVATE (self);
@@ -211,8 +222,8 @@ active_sink_construct_mono_volume (const pa_cvolume* vol)
return new_volume;
}
-
-ActiveSink* active_sink_new (SoundServiceDbus* service)
+ActiveSink*
+active_sink_new (SoundServiceDbus* service)
{
ActiveSink* sink = g_object_new (ACTIVE_SINK_TYPE, NULL);
ActiveSinkPrivate* priv = ACTIVE_SINK_GET_PRIVATE (sink);