Commit 3e71962f authored by Giovanni Campagna's avatar Giovanni Campagna

sound: show a different icon for different input/output ports

Use the new API in libgnome-volume-control to create the icon shown
next to the port name in the selector. This avoids ugly audio-card icons,
and shows a speaker, microphone or headphones as appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=689931
parent ed896b80
gvc @ 74c08620
Subproject commit 03894efbcd010faf53bbc6e27256d27485f721b8
Subproject commit 74c08620b45a806df7531a434449f612c87c5ea4
......@@ -1115,14 +1115,12 @@ add_input_ui_entry (GvcMixerDialog *dialog,
GtkTreeModel *model;
GtkTreeIter iter;
GIcon *icon;
GvcMixerCard *card;
g_debug ("Add input ui entry with id :%u",
gvc_mixer_ui_device_get_id (input));
g_object_get (G_OBJECT (input),
"stream-id", &stream_id,
"card", &card,
"origin", &origin,
"description", &description,
"port-name", &port_name,
......@@ -1138,7 +1136,9 @@ add_input_ui_entry (GvcMixerDialog *dialog,
g_free (origin);
g_free (description);
if (card == NULL) {
icon = gvc_mixer_ui_device_get_gicon (input);
if (icon == NULL) {
GvcMixerStream *stream;
g_debug ("just detected a network source");
stream = gvc_mixer_control_get_stream_from_device (dialog->priv->mixer_control, input);
......@@ -1148,9 +1148,7 @@ add_input_ui_entry (GvcMixerDialog *dialog,
return;
}
icon = gvc_mixer_stream_get_gicon (stream);
} else
icon = gvc_mixer_card_get_gicon (card);
}
model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->priv->input_treeview));
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
......@@ -1182,14 +1180,12 @@ add_output_ui_entry (GvcMixerDialog *dialog,
GtkTreeModel *model;
GtkTreeIter iter;
GIcon *icon;
GvcMixerCard *card;
g_debug ("Add output ui entry with id :%u",
gvc_mixer_ui_device_get_id (output));
g_object_get (G_OBJECT (output),
"stream-id", &sink_stream_id,
"card", &card,
"origin", &origin,
"description", &description,
"port-name", &sink_port_name,
......@@ -1205,7 +1201,9 @@ add_output_ui_entry (GvcMixerDialog *dialog,
g_free (origin);
g_free (description);
if (card == NULL) {
icon = gvc_mixer_ui_device_get_gicon (output);
if (icon == NULL) {
GvcMixerStream *stream;
g_debug ("just detected a network sink");
......@@ -1217,8 +1215,7 @@ add_output_ui_entry (GvcMixerDialog *dialog,
return;
}
icon = gvc_mixer_stream_get_gicon (stream);
} else
icon = gvc_mixer_card_get_gicon (card);
}
model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->priv->output_treeview));
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment