Add ModerUI mute by clicking "VOL"

serial
William Toohey 10 years ago
parent aa175b0414
commit 0196197f58
  1. 1
      css/hues-m.css
  2. 10
      js/HuesUI.js
  3. 3
      js/SoundManager.js

@ -367,6 +367,7 @@
width: 100%;
background: transparent;
border: none;
cursor: pointer;
}
.hues-m-vol-bar > input {
display: block;

@ -27,9 +27,6 @@ function HuesUI(parent) {
this.songPrev = null;
this.songNext = null;
this.volInput = null;
this.volLabel = null;
this.beatCount = null;
this.timer = null;
this.xBlur = null;
@ -423,6 +420,13 @@ ModernUI.prototype.initUI = function() {
var label = document.createElement("div");
label.textContent = "VOL";
label.className = "hues-m-vol-label";
label.onclick = function() {
if(that.core.soundManager.toggleMute()) {
this.textContent = "(VOL)";
} else {
this.textContent = "VOL";
};
};
volBar.appendChild(label);
var infoToggle = document.createElement("div");

@ -259,10 +259,11 @@ SoundManager.prototype.setMute = function(mute) {
}
this.core.userInterface.updateVolume(this.gainNode.gain.value);
this.mute = mute;
return mute;
}
SoundManager.prototype.toggleMute = function() {
this.setMute(!this.mute);
return this.setMute(!this.mute);
}
SoundManager.prototype.decreaseVolume = function() {

Loading…
Cancel
Save