[gnome-shell] volume: Use constants from GVC



commit bdd1f827775f490fc9c119091efb1dce69ce1208
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Mar 11 15:45:11 2011 +0000

    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 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js
index dde673d..36aa65d 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) {



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