[gnome-shell] Revert "volume: Increase maximum by 50% for outputs with decibel support"
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Revert "volume: Increase maximum by 50% for outputs with decibel support"
- Date: Mon, 5 Sep 2011 10:48:53 +0000 (UTC)
commit d99a2f19a57b50254456dd2c356cf4944866b69f
Author: Bastien Nocera <hadess hadess net>
Date: Wed Aug 31 11:46:57 2011 +0100
Revert "volume: Increase maximum by 50% for outputs with decibel support"
This reverts commit bdd805a3eea2a4bf88bb77e5ad7da50b0bd9fdd5.
Conflicts:
js/ui/status/volume.js
https://bugzilla.gnome.org/show_bug.cgi?id=657607
js/ui/status/volume.js | 24 ++++++------------------
1 files changed, 6 insertions(+), 18 deletions(-)
---
diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js
index 76726a8..5dc2507 100644
--- a/js/ui/status/volume.js
+++ b/js/ui/status/volume.js
@@ -35,7 +35,6 @@ Indicator.prototype = {
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;
@@ -66,21 +65,13 @@ Indicator.prototype = {
this._control.open();
},
- _getMaxVolume: function(property) {
- if (this[property].get_can_decibel())
- return this._volumeMaxAmplified;
- else
- return this._volumeMax;
- },
-
_onScrollEvent: function(actor, event) {
let direction = event.get_scroll_direction();
let currentVolume = this._output.volume;
- let maxVolume = this._getMaxVolume('_output');
if (direction == Clutter.ScrollDirection.DOWN) {
let prev_muted = this._output.is_muted;
- this._output.volume = Math.max(0, currentVolume - maxVolume * VOLUME_ADJUSTMENT_STEP);
+ this._output.volume = Math.max(0, currentVolume - this._volumeMax * VOLUME_ADJUSTMENT_STEP);
if (this._output.volume < 1) {
this._output.volume = 0;
if (!prev_muted)
@@ -89,7 +80,7 @@ Indicator.prototype = {
this._output.push_volume();
}
else if (direction == Clutter.ScrollDirection.UP) {
- this._output.volume = Math.min(maxVolume, currentVolume + maxVolume * VOLUME_ADJUSTMENT_STEP);
+ this._output.volume = Math.min(this._volumeMax, currentVolume + this._volumeMax * VOLUME_ADJUSTMENT_STEP);
this._output.change_is_muted(false);
this._output.push_volume();
}
@@ -171,11 +162,10 @@ Indicator.prototype = {
},
_volumeToIcon: function(volume) {
- let maxVolume = this._getMaxVolume('_output');
if (volume <= 0) {
return 'audio-volume-muted';
} else {
- let n = Math.floor(3 * volume / maxVolume) + 1;
+ let n = Math.floor(3 * volume / this._volumeMax) + 1;
if (n < 2)
return 'audio-volume-low';
if (n >= 3)
@@ -189,7 +179,7 @@ Indicator.prototype = {
log ('Volume slider changed for %s, but %s does not exist'.format(property, property));
return;
}
- let volume = value * this._getMaxVolume(property);
+ let volume = value * this._volumeMax;
let prev_muted = this[property].is_muted;
if (volume < 1) {
this[property].volume = 0;
@@ -211,8 +201,7 @@ Indicator.prototype = {
_mutedChanged: function(object, param_spec, property) {
let muted = this[property].is_muted;
let slider = this[property+'Slider'];
- let maxVolume = this._getMaxVolume(property);
- slider.setValue(muted ? 0 : (this[property].volume / maxVolume));
+ slider.setValue(muted ? 0 : (this[property].volume / this._volumeMax));
if (property == '_output') {
if (muted)
this.setIcon('audio-volume-muted');
@@ -222,8 +211,7 @@ Indicator.prototype = {
},
_volumeChanged: function(object, param_spec, property) {
- let maxVolume = this._getMaxVolume(property);
- this[property+'Slider'].setValue(this[property].volume / maxVolume);
+ this[property+'Slider'].setValue(this[property].volume / this._volumeMax);
if (property == '_output' && !this._output.is_muted)
this.setIcon(this._volumeToIcon(this._output.volume));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]