sound: Prevent > 100% volume showing up as 100%

When the output of input bar changes from a non-decibel capable
output, to one that is (such as on startup), don't clip the
volume displayed at 100%, by setting the level of the bar again.

https://bugzilla.gnome.org/show_bug.cgi?id=646254
This commit is contained in:
Bastien Nocera 2011-04-08 16:12:56 +01:00
parent 58e4fab6be
commit ce561eb68f

View file

@ -232,6 +232,7 @@ update_output_settings (GvcMixerDialog *dialog)
GvcMixerStream *stream;
const GvcChannelMap *map;
const GList *ports;
GtkAdjustment *adj;
g_debug ("Updating output settings");
if (dialog->priv->output_balance_bar != NULL) {
@ -266,6 +267,12 @@ update_output_settings (GvcMixerDialog *dialog)
gvc_channel_bar_set_is_amplified (GVC_CHANNEL_BAR (dialog->priv->output_bar),
gvc_mixer_stream_get_can_decibel (stream));
/* Update the adjustment in case the previous bar wasn't decibel
* capable, and we clipped it */
adj = GTK_ADJUSTMENT (gvc_channel_bar_get_adjustment (GVC_CHANNEL_BAR (dialog->priv->output_bar)));
gtk_adjustment_set_value (adj,
gvc_mixer_stream_get_volume (stream));
map = gvc_mixer_stream_get_channel_map (stream);
if (map == NULL) {
g_warning ("Default sink stream has no channel map");
@ -586,8 +593,9 @@ stop_monitor_stream_for_source (GvcMixerDialog *dialog)
static void
update_input_settings (GvcMixerDialog *dialog)
{
const GList *ports;
const GList *ports;
GvcMixerStream *stream;
GtkAdjustment *adj;
g_debug ("Updating input settings");
@ -610,6 +618,12 @@ update_input_settings (GvcMixerDialog *dialog)
gvc_channel_bar_set_is_amplified (GVC_CHANNEL_BAR (dialog->priv->input_bar),
gvc_mixer_stream_get_can_decibel (stream));
/* Update the adjustment in case the previous bar wasn't decibel
* capable, and we clipped it */
adj = GTK_ADJUSTMENT (gvc_channel_bar_get_adjustment (GVC_CHANNEL_BAR (dialog->priv->input_bar)));
gtk_adjustment_set_value (adj,
gvc_mixer_stream_get_volume (stream));
ports = gvc_mixer_stream_get_ports (stream);
if (ports != NULL) {
const GvcMixerStreamPort *port;