aboutsummaryrefslogtreecommitdiff
path: root/src/pulse-manager.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-03-18 20:20:26 +0000
committerConor Curran <conor.curran@canonical.com>2010-03-18 20:20:26 +0000
commitb26c97936312634da3fb30e818a76ce2a5a03992 (patch)
tree7bd1abcdb49ab687338e40068ec75a24a199e1ca /src/pulse-manager.c
parent69049dd2d6011e9ab96f4f439d00e1de98178449 (diff)
parentda7146ab578829c406c4d3ccde8b89443ba634c9 (diff)
downloadayatana-indicator-sound-b26c97936312634da3fb30e818a76ce2a5a03992.tar.gz
ayatana-indicator-sound-b26c97936312634da3fb30e818a76ce2a5a03992.tar.bz2
ayatana-indicator-sound-b26c97936312634da3fb30e818a76ce2a5a03992.zip
merged in updates from trunk and fixed the tests on the indicator
Diffstat (limited to 'src/pulse-manager.c')
-rw-r--r--src/pulse-manager.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/pulse-manager.c b/src/pulse-manager.c
index 04f842a..2f86a90 100644
--- a/src/pulse-manager.c
+++ b/src/pulse-manager.c
@@ -67,9 +67,8 @@ void establish_pulse_activities(SoundServiceDbus *service)
// Establish event callback registration
pa_context_set_state_callback(pulse_context, context_state_callback, NULL);
- // BUILD MENU ANYWHO - it will be updated
- dbus_menu_manager_update_pa_state(FALSE, FALSE, FALSE, 0);
-
+ // Broadcast init state (assume we have a device - if not the signals will handle it)
+ dbus_menu_manager_update_pa_state(FALSE, TRUE, FALSE, 0);
pa_context_connect(pulse_context, NULL, PA_CONTEXT_NOFAIL, NULL);
}
@@ -283,7 +282,7 @@ static void pulse_sink_info_callback(pa_context *c, const pa_sink_info *sink, in
else{
//Update the indicator to show PA either is not ready or has no available sink
g_warning("Cannot find a suitable default sink ...");
- dbus_menu_manager_update_pa_state(FALSE, device_available, TRUE, 0);
+ dbus_menu_manager_update_pa_state(FALSE, device_available, default_sink_is_muted(), get_default_sink_volume());
}
}
else{
@@ -399,6 +398,7 @@ static void update_sink_info(pa_context *c, const pa_sink_info *info, int eol, v
}
else
{
+
sink_info *value;
value = g_new0(sink_info, 1);
value->index = value->device_index = info->index;
@@ -412,7 +412,8 @@ static void update_sink_info(pa_context *c, const pa_sink_info *info, int eol, v
value->channel_map = info->channel_map;
g_hash_table_insert(sink_hash, GINT_TO_POINTER(value->index), value);
g_debug("pulse-manager:update_sink_info -> After adding a new sink to our hash");
- }
+ sound_service_dbus_update_sink_availability(dbus_service, TRUE);
+ }
}
@@ -461,7 +462,9 @@ static void subscribed_events_callback(pa_context *c, enum pa_subscription_event
g_debug("PA_SUBSCRIPTION_EVENT_SINK event triggered");
if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE)
{
- //TODO handle the remove event => if its our default sink - update date pa state
+ if(index == DEFAULT_SINK_INDEX)
+ g_debug("PA_SUBSCRIPTION_EVENT_SINK REMOVAL event triggered - default sink has been removed !!");
+ sound_service_dbus_update_sink_availability(dbus_service, FALSE);
}
else
{
@@ -472,7 +475,7 @@ static void subscribed_events_callback(pa_context *c, enum pa_subscription_event
g_debug("PA_SUBSCRIPTION_EVENT_SINK_INPUT event triggered!!");
if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE)
{
- //TODO handle the remove event
+ //handle the remove event - not relevant for current design
}
else
{