gnome-media r4076 - in trunk/gnome-volume-control: . src



Author: mccann
Date: Fri Dec  5 05:40:54 2008
New Revision: 4076
URL: http://svn.gnome.org/viewvc/gnome-media?rev=4076&view=rev

Log:
2008-12-05  William Jon McCann  <jmccann redhat com>

	* src/gvc-mixer-control.c (update_sink), (update_sink_input),
	(update_client), (remove_client), (gvc_mixer_control_init):
	Use application/client name instead of stream name.



Modified:
   trunk/gnome-volume-control/ChangeLog
   trunk/gnome-volume-control/src/gvc-mixer-control.c

Modified: trunk/gnome-volume-control/src/gvc-mixer-control.c
==============================================================================
--- trunk/gnome-volume-control/src/gvc-mixer-control.c	(original)
+++ trunk/gnome-volume-control/src/gvc-mixer-control.c	Fri Dec  5 05:40:54 2008
@@ -480,6 +480,7 @@
         GvcMixerStream *stream;
         gboolean        is_new;
         pa_volume_t     avg_volume;
+
 #if 0
         g_debug ("Updating sink: index=%u name='%s' description='%s'",
                  info->index,
@@ -631,11 +632,13 @@
         GvcMixerStream *stream;
         gboolean        is_new;
         pa_volume_t     avg_volume;
+        const char     *name;
 
 #if 1
-        g_debug ("Updating sink input: index=%u name='%s' sink=%u",
+        g_debug ("Updating sink input: index=%u name='%s' client=%u sink=%u",
                  info->index,
                  info->name,
+                 info->client,
                  info->sink);
 #endif
 
@@ -652,7 +655,10 @@
 
         avg_volume = pa_cvolume_avg (&info->volume);
 
-        gvc_mixer_stream_set_name (stream, info->name);
+        name = (const char *)g_hash_table_lookup (control->priv->clients,
+                                                  GUINT_TO_POINTER (info->client));
+        gvc_mixer_stream_set_name (stream, name);
+        gvc_mixer_stream_set_description (stream, info->name);
 
         set_icon_name_from_proplist (stream, info->proplist, "applications-multimedia");
         gvc_mixer_stream_set_volume (stream, (guint)avg_volume);
@@ -681,11 +687,14 @@
 update_client (GvcMixerControl      *control,
                const pa_client_info *info)
 {
-#if 0
+#if 1
         g_debug ("Updating client: index=%u name='%s'",
                  info->index,
                  info->name);
 #endif
+        g_hash_table_insert (control->priv->clients,
+                             GUINT_TO_POINTER (info->index),
+                             g_strdup (info->name));
 }
 
 static void
@@ -1061,7 +1070,8 @@
 remove_client (GvcMixerControl *control,
                guint            index)
 {
-        /* FIXME: */
+        g_hash_table_remove (control->priv->clients,
+                             GUINT_TO_POINTER (index));
 }
 
 static void
@@ -1480,7 +1490,8 @@
         control->priv->sources = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify)g_object_unref);
         control->priv->sink_inputs = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify)g_object_unref);
         control->priv->source_outputs = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify)g_object_unref);
-        control->priv->clients = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify)g_object_unref);
+
+        control->priv->clients = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify)g_free);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]