[gnome-media] Show unamplified volume on outputs as well



commit 966dc218dfc7ffc5e35e2c21b07097fb9beead8f
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Feb 2 15:46:52 2010 +0000

    Show unamplified volume on outputs as well
    
    So that people don't start complaining when the sound sounds bad.
    We only show the 100% mark if it's higher than the unamplified mark,
    to work-around some GtkScale marks problems.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=606325

 gnome-volume-control/src/gvc-channel-bar.c   |    6 ++++++
 gnome-volume-control/src/gvc-mixer-control.c |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gnome-volume-control/src/gvc-channel-bar.c b/gnome-volume-control/src/gvc-channel-bar.c
index 60fd088..0e33d03 100644
--- a/gnome-volume-control/src/gvc-channel-bar.c
+++ b/gnome-volume-control/src/gvc-channel-bar.c
@@ -597,6 +597,12 @@ gvc_channel_bar_set_is_amplified (GvcChannelBar *bar, gboolean amplified)
                         str = g_strdup_printf ("<small>%s</small>", C_("volume", "Unamplified"));
                         gtk_scale_add_mark (GTK_SCALE (bar->priv->scale), bar->priv->base_volume,
                                             GTK_POS_BOTTOM, str);
+                        /* Only show 100% if it's higher than the base volume */
+                        if (bar->priv->base_volume < ADJUSTMENT_MAX_NORMAL) {
+                                str = g_strdup_printf ("<small>%s</small>", C_("volume", "100%"));
+                                gtk_scale_add_mark (GTK_SCALE (bar->priv->scale), ADJUSTMENT_MAX_NORMAL,
+                                                    GTK_POS_BOTTOM, str);
+                        }
                 }
 
                 g_free (str);
diff --git a/gnome-volume-control/src/gvc-mixer-control.c b/gnome-volume-control/src/gvc-mixer-control.c
index b5636d9..52c7cfd 100644
--- a/gnome-volume-control/src/gvc-mixer-control.c
+++ b/gnome-volume-control/src/gvc-mixer-control.c
@@ -688,6 +688,7 @@ update_sink (GvcMixerControl    *control,
         gvc_mixer_stream_set_volume (stream, (guint)max_volume);
         gvc_mixer_stream_set_is_muted (stream, info->mute);
         gvc_mixer_stream_set_can_decibel (stream, !!(info->flags & PA_SINK_DECIBEL_VOLUME));
+        gvc_mixer_stream_set_base_volume (stream, (guint32) info->base_volume);
 #if PA_MICRO > 15
         if (info->active_port != NULL)
                 gvc_mixer_stream_set_port (stream, info->active_port->name);



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