[gnome-media] Don't emit volume-changed on startup



commit a273370e7696deb820f81b683759ff1629a2fbe7
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Aug 13 15:18:43 2009 +0100

    Don't emit volume-changed on startup
    
    Only emit it when the volume has actually been changed by somebody
    else.

 gnome-volume-control/src/gvc-channel-map.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gnome-volume-control/src/gvc-channel-map.c b/gnome-volume-control/src/gvc-channel-map.c
index 32750ef..402804d 100644
--- a/gnome-volume-control/src/gvc-channel-map.c
+++ b/gnome-volume-control/src/gvc-channel-map.c
@@ -44,6 +44,7 @@
 struct GvcChannelMapPrivate
 {
         pa_channel_map        pa_map;
+        gboolean              pa_volume_is_set;
         pa_cvolume            pa_volume;
         gdouble               extern_volume[NUM_TYPES]; /* volume, balance, fade, lfe */
         gboolean              can_balance;
@@ -227,6 +228,10 @@ gvc_channel_map_volume_changed (GvcChannelMap     *map,
 
         map->priv->pa_volume = *cv;
 
+        if (map->priv->pa_volume_is_set == FALSE) {
+                map->priv->pa_volume_is_set = TRUE;
+                return;
+        }
         g_signal_emit (map, signals[VOLUME_CHANGED], 0);
 }
 
@@ -234,6 +239,7 @@ static void
 gvc_channel_map_init (GvcChannelMap *map)
 {
         map->priv = GVC_CHANNEL_MAP_GET_PRIVATE (map);
+        map->priv->pa_volume_is_set = FALSE;
 }
 
 static void



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