aboutsummaryrefslogtreecommitdiff
path: root/src/pulse-manager.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-02-26 14:40:28 +0000
committerConor Curran <conor.curran@canonical.com>2010-02-26 14:40:28 +0000
commit8ab71867cb6d028ade4e72ee6efeb563fba07c9a (patch)
tree9c0bd797c82c39f859ee189ba4706d5971c6751a /src/pulse-manager.c
parent11f1982a7b23d55be2306ab6da80879d2f9d8e03 (diff)
downloadayatana-indicator-sound-8ab71867cb6d028ade4e72ee6efeb563fba07c9a.tar.gz
ayatana-indicator-sound-8ab71867cb6d028ade4e72ee6efeb563fba07c9a.tar.bz2
ayatana-indicator-sound-8ab71867cb6d028ade4e72ee6efeb563fba07c9a.zip
new sink inserts are now cached in our hash
Diffstat (limited to 'src/pulse-manager.c')
-rw-r--r--src/pulse-manager.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/pulse-manager.c b/src/pulse-manager.c
index 4436561..d5377bf 100644
--- a/src/pulse-manager.c
+++ b/src/pulse-manager.c
@@ -397,12 +397,20 @@ static void update_sink_info(pa_context *c, const pa_sink_info *info, int eol, v
}
else
{
- // TODO ADD new sink - part of big refactor
- g_debug("attempting to add new sink with name %s", info->name);
- //sink_info *s;
- //s = g_new0(sink_info, 1);
- //update the sinks hash with new sink.
- }
+ sink_info *value;
+ value = g_new0(sink_info, 1);
+ value->index = value->device_index = info->index;
+ value->name = g_strdup(info->name);
+ value->description = g_strdup(info->description);
+ value->icon_name = g_strdup(pa_proplist_gets(info->proplist, PA_PROP_DEVICE_ICON_NAME));
+ value->active_port = (info->active_port != NULL);
+ value->mute = !!info->mute;
+ value->volume = info->volume;
+ value->base_volume = info->base_volume;
+ 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");
+ }
}