summaryrefslogtreecommitdiff
path: root/gui.js
diff options
context:
space:
mode:
authorGubolin <gubolin@fantasymail.de>2014-08-03 12:41:23 +0200
committerGubolin <gubolin@fantasymail.de>2014-08-03 12:41:23 +0200
commitb700eaa3f35b931445df06ba1ff952a709f82cc5 (patch)
tree585c65e055fd1513af005a39df45a6f272746b68 /gui.js
parent51387ddfbc536c5ecc88658682f1894411f60631 (diff)
downloadsnap-b700eaa3f35b931445df06ba1ff952a709f82cc5.tar.gz
snap-b700eaa3f35b931445df06ba1ff952a709f82cc5.zip
add mute functions
Diffstat (limited to 'gui.js')
-rw-r--r--gui.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/gui.js b/gui.js
index 38e70ac..28549df 100644
--- a/gui.js
+++ b/gui.js
@@ -3407,10 +3407,21 @@ IDE_Morph.prototype.toggleMuteSounds = function (isMuted) {
this.isMuted = isNil(isMuted) ? !this.isMuted : isMuted;
this.controlBar.muteSoundsButton.refresh();
- this.sprites.asArray().forEach(function (sprt) {
- sprt.refreshVolumeOfAllActiveSounds();
- });
- this.stage.refreshVolumeOfAllActiveSounds();
+ /* stage.activeSounds holds all active sounds
+ * a sprite's .activeSounds holds just its own
+ * so you have to use the stage to mute
+ * and the sprite to unmute, because the stage's volume
+ * overrides the sprite's one.
+ */
+
+ if (this.isMuted === false) {
+ this.stage.unmuteAllSounds();
+ this.sprites.asArray().forEach(function (sprt) {
+ sprt.unmuteAllSounds();
+ });
+ } else {
+ this.stage.muteAllSounds();
+ }
};
IDE_Morph.prototype.createNewProject = function () {