aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-02-18 17:11:08 +0000
committerConor Curran <conor.curran@canonical.com>2011-02-18 17:11:08 +0000
commit80afbbce02c5d31fc4375b84c8647628333b7cc2 (patch)
tree42f29be398ca6f4fcdaaef3da2089145bdd6fbd5
parent9a424c26c67544aafdd7cff2d66519b1c72e8aa0 (diff)
downloadayatana-indicator-sound-80afbbce02c5d31fc4375b84c8647628333b7cc2.tar.gz
ayatana-indicator-sound-80afbbce02c5d31fc4375b84c8647628333b7cc2.tar.bz2
ayatana-indicator-sound-80afbbce02c5d31fc4375b84c8647628333b7cc2.zip
the last bug really
-rw-r--r--src/active-sink.c52
-rw-r--r--src/voip-input-menu-item.c7
-rw-r--r--src/voip-input-menu-item.h1
3 files changed, 34 insertions, 26 deletions
diff --git a/src/active-sink.c b/src/active-sink.c
index ce0e135..a78d33e 100644
--- a/src/active-sink.c
+++ b/src/active-sink.c
@@ -86,32 +86,6 @@ active_sink_init (ActiveSink *self)
slider_menu_item_enable (priv->volume_slider_menuitem, FALSE);
}
-void
-active_sink_activate_voip_item (ActiveSink* self, gint sink_input_index, gint client_index)
-{
- ActiveSinkPrivate* priv = ACTIVE_SINK_GET_PRIVATE (self);
- if (voip_input_menu_item_is_interested (priv->voip_input_menu_item,
- sink_input_index,
- client_index)){
- voip_input_menu_item_enable (priv->voip_input_menu_item, TRUE);
- }
-}
-
-void
-active_sink_deactivate_voip_source (ActiveSink* self, gboolean visible)
-{
- ActiveSinkPrivate* priv = ACTIVE_SINK_GET_PRIVATE (self);
- voip_input_menu_item_deactivate_source (priv->voip_input_menu_item, visible);
-}
-
-void
-active_sink_deactivate_voip_client (ActiveSink* self)
-{
- ActiveSinkPrivate* priv = ACTIVE_SINK_GET_PRIVATE (self);
- voip_input_menu_item_deactivate_voip_client (priv->voip_input_menu_item);
-}
-
-
static void
active_sink_dispose (GObject *object)
{
@@ -149,6 +123,32 @@ active_sink_populate (ActiveSink* sink,
}
void
+active_sink_activate_voip_item (ActiveSink* self, gint sink_input_index, gint client_index)
+{
+ ActiveSinkPrivate* priv = ACTIVE_SINK_GET_PRIVATE (self);
+ if (voip_input_menu_item_is_interested (priv->voip_input_menu_item,
+ sink_input_index,
+ client_index)){
+ voip_input_menu_item_enable (priv->voip_input_menu_item, TRUE);
+ }
+}
+
+void
+active_sink_deactivate_voip_source (ActiveSink* self, gboolean visible)
+{
+ ActiveSinkPrivate* priv = ACTIVE_SINK_GET_PRIVATE (self);
+ visible &= voip_input_menu_item_is_active (priv->voip_input_menu_item);
+ voip_input_menu_item_deactivate_source (priv->voip_input_menu_item, visible);
+}
+
+void
+active_sink_deactivate_voip_client (ActiveSink* self)
+{
+ ActiveSinkPrivate* priv = ACTIVE_SINK_GET_PRIVATE (self);
+ voip_input_menu_item_deactivate_voip_client (priv->voip_input_menu_item);
+}
+
+void
active_sink_update (ActiveSink* sink,
const pa_sink_info* update)
{
diff --git a/src/voip-input-menu-item.c b/src/voip-input-menu-item.c
index b98be8d..a742654 100644
--- a/src/voip-input-menu-item.c
+++ b/src/voip-input-menu-item.c
@@ -199,6 +199,13 @@ voip_input_menu_item_is_interested (VoipInputMenuItem* item,
return TRUE;
}
+gboolean
+voip_input_menu_item_is_active (VoipInputMenuItem* item)
+{
+ VoipInputMenuItemPrivate* priv = VOIP_INPUT_MENU_ITEM_GET_PRIVATE (item);
+ return (priv->sink_input_index != NOT_ACTIVE && priv->client_index != NOT_ACTIVE);
+}
+
gboolean
voip_input_menu_item_is_populated (VoipInputMenuItem* item)
diff --git a/src/voip-input-menu-item.h b/src/voip-input-menu-item.h
index 5a39d8a..6f4ed85 100644
--- a/src/voip-input-menu-item.h
+++ b/src/voip-input-menu-item.h
@@ -52,6 +52,7 @@ void voip_input_menu_item_enable (VoipInputMenuItem* item, gboolean active);
gboolean voip_input_menu_item_is_interested (VoipInputMenuItem* item,
gint sink_input_index,
gint client_index);
+gboolean voip_input_menu_item_is_active (VoipInputMenuItem* item);
gboolean voip_input_menu_item_is_populated (VoipInputMenuItem* item);
// TODO rename get source index
gint voip_input_menu_item_get_index (VoipInputMenuItem* item);