From bdd1f827775f490fc9c119091efb1dce69ce1208 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 11 Mar 2011 15:45:11 +0000 Subject: [PATCH] volume: Use constants from GVC Instead of defining our own. https://bugzilla.gnome.org/show_bug.cgi?id=644511 --- js/ui/status/volume.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index dde673d1f..36aa65d12 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -16,7 +16,6 @@ const Util = imports.misc.util; const Gettext = imports.gettext.domain('gnome-shell'); const _ = Gettext.gettext; -const VOLUME_MAX = 65536.0; /* PA_VOLUME_NORM */ const VOLUME_ADJUSTMENT_STEP = 0.05; /* Volume adjustment step in % */ const VOLUME_NOTIFY_ID = 1; @@ -37,6 +36,8 @@ Indicator.prototype = { this._control.connect('default-source-changed', Lang.bind(this, this._readInput)); this._control.connect('stream-added', Lang.bind(this, this._maybeShowInput)); this._control.connect('stream-removed', Lang.bind(this, this._maybeShowInput)); + this._volumeMax = this._control.get_vol_max_norm(); + this._volumeMaxAmplified = this._control.get_vol_max_amplified(); this._output = null; this._outputVolumeId = 0; @@ -72,9 +73,9 @@ Indicator.prototype = { _getMaxVolume: function(property) { if (this[property].get_can_decibel()) - return (VOLUME_MAX * 1.5); + return this._volumeMaxAmplified; else - return VOLUME_MAX; + return this._volumeMax; }, _onScrollEvent: function(actor, event) {