[gnome-media] Update sink and source descriptions when they change
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-media] Update sink and source descriptions when they change
- Date: Fri, 9 Oct 2009 16:15:49 +0000 (UTC)
commit 60d3430b999a6012b6f344f5d40953204c05d898
Author: Bastien Nocera <hadess hadess net>
Date: Fri Oct 9 17:14:27 2009 +0100
Update sink and source descriptions when they change
As they can be updated on the fly
https://bugzilla.gnome.org/show_bug.cgi?id=597025
gnome-volume-control/src/gvc-mixer-dialog.c | 54 +++++++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)
---
diff --git a/gnome-volume-control/src/gvc-mixer-dialog.c b/gnome-volume-control/src/gvc-mixer-dialog.c
index 4a67d70..7d7d566 100644
--- a/gnome-volume-control/src/gvc-mixer-dialog.c
+++ b/gnome-volume-control/src/gvc-mixer-dialog.c
@@ -162,6 +162,42 @@ update_default_input (GvcMixerDialog *dialog)
}
static void
+update_description (GvcMixerDialog *dialog,
+ guint column,
+ const char *value,
+ GvcMixerStream *stream)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ guint id;
+
+ if (GVC_IS_MIXER_SOURCE (stream))
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->priv->input_treeview));
+ else if (GVC_IS_MIXER_SINK (stream))
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->priv->output_treeview));
+ else
+ g_assert_not_reached ();
+ gtk_tree_model_get_iter_first (model, &iter);
+
+ id = gvc_mixer_stream_get_id (stream);
+ do {
+ guint current_id;
+
+ gtk_tree_model_get (model, &iter,
+ ID_COLUMN, ¤t_id,
+ -1);
+ if (id != current_id)
+ continue;
+
+ gtk_list_store_set (GTK_LIST_STORE (model),
+ &iter,
+ column, value,
+ -1);
+ break;
+ } while (gtk_tree_model_iter_next (model, &iter));
+}
+
+static void
port_selection_changed (GvcComboBox *combo_box,
const char *port,
GvcMixerDialog *dialog)
@@ -736,6 +772,16 @@ lookup_combo_box_for_stream (GvcMixerDialog *dialog,
}
static void
+on_stream_description_notify (GvcMixerStream *stream,
+ GParamSpec *pspec,
+ GvcMixerDialog *dialog)
+{
+ update_description (dialog, NAME_COLUMN,
+ gvc_mixer_stream_get_description (stream),
+ stream);
+}
+
+static void
on_stream_port_notify (GObject *object,
GParamSpec *pspec,
GvcMixerDialog *dialog)
@@ -1001,6 +1047,10 @@ add_stream (GvcMixerDialog *dialog,
ACTIVE_COLUMN, is_default,
ID_COLUMN, gvc_mixer_stream_get_id (stream),
-1);
+ g_signal_connect (stream,
+ "notify::description",
+ G_CALLBACK (on_stream_description_notify),
+ dialog);
} else if (GVC_IS_MIXER_SINK (stream)) {
GtkTreeModel *model;
GtkTreeIter iter;
@@ -1017,6 +1067,10 @@ add_stream (GvcMixerDialog *dialog,
ID_COLUMN, gvc_mixer_stream_get_id (stream),
SPEAKERS_COLUMN, gvc_channel_map_get_mapping (map),
-1);
+ g_signal_connect (stream,
+ "notify::description",
+ G_CALLBACK (on_stream_description_notify),
+ dialog);
}
if (bar != NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]