aboutsummaryrefslogtreecommitdiff
path: root/src/pulse-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulse-manager.c')
-rw-r--r--src/pulse-manager.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/pulse-manager.c b/src/pulse-manager.c
index 36e6351..40add4e 100644
--- a/src/pulse-manager.c
+++ b/src/pulse-manager.c
@@ -282,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{
@@ -398,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;
@@ -411,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);
+ }
}
@@ -460,8 +462,11 @@ 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
- } else
+ if(index == DEFAULT_SINK_INDEX)
+ g_debug("PA_SUBSCRIPTION_EVENT_SINK REMOVAL event triggered");
+ sound_service_dbus_update_sink_availability(dbus_service, FALSE);
+ }
+ else
{
pa_operation_unref(pa_context_get_sink_info_by_index(c, index, update_sink_info, userdata));
}
@@ -470,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
{