From 373edeffca311e41078b78950834a1e6f71bb1e8 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Thu, 31 Jul 2014 19:08:30 +0200 Subject: fix #405 --- objects.js | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index fbb9e84..a09818c 100644 --- a/objects.js +++ b/objects.js @@ -459,6 +459,17 @@ SpriteMorph.prototype.initBlocks = function () { category: 'sound', spec: 'stop all sounds' }, + doSetVolume: { + type: 'command', + category: 'sound', + spec: 'set volume to %n', + defaults: [100] + }, + reportVolume: { + type: 'reporter', + category: 'sound', + spec: 'volume' + }, doRest: { type: 'command', category: 'sound', @@ -1296,6 +1307,7 @@ SpriteMorph.prototype.init = function (globals) { this.version = Date.now(); // for observer optimization this.isClone = false; // indicate a "temporary" Scratch-style clone this.cloneOriginName = ''; + this.volume = 100; // sprite nesting properties this.parts = []; // not serialized, only anchor (name) @@ -1754,6 +1766,8 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('playSound')); blocks.push(block('doPlaySoundUntilDone')); blocks.push(block('doStopAllSounds')); + blocks.push(block('doSetVolume')); + blocks.push(block('reportVolume')); blocks.push('-'); blocks.push(block('doRest')); blocks.push('-'); @@ -2580,7 +2594,8 @@ SpriteMorph.prototype.reportCostumes = function () { // SpriteMorph sound management SpriteMorph.prototype.addSound = function (audio, name) { - this.sounds.add(new Sound(audio, name)); + var volume = this.parentThatIsA(StageMorph).volume; + this.sounds.add(new Sound(audio, name, volume)); }; SpriteMorph.prototype.playSound = function (name) { @@ -2591,6 +2606,7 @@ SpriteMorph.prototype.playSound = function (name) { ), active; if (sound) { + sound.volume = stage.volume; active = sound.play(); if (stage) { stage.activeSounds.push(active); @@ -2602,6 +2618,22 @@ SpriteMorph.prototype.playSound = function (name) { } }; +SpriteMorph.prototype.doSetVolume = function(val) { + var stage = this.parentThatIsA(StageMorph); + + stage.volume = val; + stage.sounds.asArray().forEach(function (snd) { + if (snd.audio !== undefined) { + snd.audio.volume = Math.min(Math.max(0, stage.volume), 100) / 100; + } + }); +}; + +SpriteMorph.prototype.reportVolume = function() { + var stage = this.parentThatIsA(StageMorph); + return stage.volume; +} + SpriteMorph.prototype.reportSounds = function () { return this.sounds; }; @@ -4884,6 +4916,8 @@ StageMorph.prototype.blockTemplates = function (category) { blocks.push(block('playSound')); blocks.push(block('doPlaySoundUntilDone')); blocks.push(block('doStopAllSounds')); + blocks.push(block('doSetVolume')); + blocks.push(block('reportVolume')); blocks.push('-'); blocks.push(block('doRest')); blocks.push('-'); @@ -5424,6 +5458,12 @@ StageMorph.prototype.addSound StageMorph.prototype.playSound = SpriteMorph.prototype.playSound; +StageMorph.prototype.doSetVolume + = SpriteMorph.prototype.doSetVolume; + +StageMorph.prototype.reportVolume + = SpriteMorph.prototype.reportVolume; + StageMorph.prototype.stopAllActiveSounds = function () { this.activeSounds.forEach(function (audio) { audio.pause(); @@ -6193,9 +6233,10 @@ CostumeEditorMorph.prototype.mouseMove // Sound instance creation -function Sound(audio, name) { +function Sound(audio, name, volume) { this.audio = audio; // mandatory this.name = name || "Sound"; + this.volume = volume || 100; } Sound.prototype.play = function () { @@ -6203,6 +6244,7 @@ Sound.prototype.play = function () { // externally (i.e. by the stage) var aud = document.createElement('audio'); aud.src = this.audio.src; + aud.volume = Math.min(Math.max(0, this.volume), 100) / 100; aud.play(); return aud; }; @@ -6212,7 +6254,8 @@ Sound.prototype.copy = function () { cpy; snd.src = this.audio.src; - cpy = new Sound(snd, this.name ? copy(this.name) : null); + snd.volume = this.volume; + cpy = new Sound(snd, this.name ? copy(this.name) : null, this.volume ? copy(this.volume) : null); return cpy; }; -- cgit v1.3.1 From 450fd058270196385eb0d1ba584318291f110a1b Mon Sep 17 00:00:00 2001 From: Gubolin Date: Fri, 1 Aug 2014 20:09:17 +0200 Subject: typo - error bugfix --- objects.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index a09818c..076fc9c 100644 --- a/objects.js +++ b/objects.js @@ -1307,7 +1307,6 @@ SpriteMorph.prototype.init = function (globals) { this.version = Date.now(); // for observer optimization this.isClone = false; // indicate a "temporary" Scratch-style clone this.cloneOriginName = ''; - this.volume = 100; // sprite nesting properties this.parts = []; // not serialized, only anchor (name) @@ -4275,6 +4274,7 @@ StageMorph.prototype.init = function (globals) { this.version = Date.now(); // for observers this.isFastTracked = false; this.cloneCount = 0; + this.volume = 100; this.timerStart = Date.now(); this.tempo = 60; // bpm -- cgit v1.3.1 From a15885abf4965ecc6edf83348300f2885bacc2f2 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sat, 2 Aug 2014 09:54:51 +0200 Subject: change volume of active sounds --- objects.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index 076fc9c..ee53127 100644 --- a/objects.js +++ b/objects.js @@ -2617,18 +2617,17 @@ SpriteMorph.prototype.playSound = function (name) { } }; -SpriteMorph.prototype.doSetVolume = function(val) { +SpriteMorph.prototype.doSetVolume = function (val) { var stage = this.parentThatIsA(StageMorph); stage.volume = val; - stage.sounds.asArray().forEach(function (snd) { - if (snd.audio !== undefined) { - snd.audio.volume = Math.min(Math.max(0, stage.volume), 100) / 100; - } + + stage.activeSounds.forEach(function (snd) { + snd.volume = Math.min(Math.max(0, stage.volume), 100) / 100; // 'audio' objects }); }; -SpriteMorph.prototype.reportVolume = function() { +SpriteMorph.prototype.reportVolume = function () { var stage = this.parentThatIsA(StageMorph); return stage.volume; } -- cgit v1.3.1 From 842227292090074383b18e49b3d51ed7cc7d7035 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sat, 2 Aug 2014 09:59:55 +0200 Subject: volume reporter: show percent sign, add watcher --- objects.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index ee53127..2ccc6fb 100644 --- a/objects.js +++ b/objects.js @@ -462,7 +462,7 @@ SpriteMorph.prototype.initBlocks = function () { doSetVolume: { type: 'command', category: 'sound', - spec: 'set volume to %n', + spec: 'set volume to %n %', defaults: [100] }, reportVolume: { @@ -1766,6 +1766,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('doPlaySoundUntilDone')); blocks.push(block('doStopAllSounds')); blocks.push(block('doSetVolume')); + blocks.push(watcherToggle('reportVolume')); blocks.push(block('reportVolume')); blocks.push('-'); blocks.push(block('doRest')); -- cgit v1.3.1 From c8d27ee26adffdae1a11dec64b0cf00a5c8b7b9d Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sat, 2 Aug 2014 10:02:52 +0200 Subject: volume blocks: add a gap --- objects.js | 1 + 1 file changed, 1 insertion(+) (limited to 'objects.js') diff --git a/objects.js b/objects.js index 2ccc6fb..65d483d 100644 --- a/objects.js +++ b/objects.js @@ -1765,6 +1765,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('playSound')); blocks.push(block('doPlaySoundUntilDone')); blocks.push(block('doStopAllSounds')); + blocks.push('-'); blocks.push(block('doSetVolume')); blocks.push(watcherToggle('reportVolume')); blocks.push(block('reportVolume')); -- cgit v1.3.1 From 2e00359fbb4b692dbbdc69a413b53ec9cd2579c6 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sat, 2 Aug 2014 12:08:56 +0200 Subject: add block to change volume --- objects.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index 65d483d..c898cd9 100644 --- a/objects.js +++ b/objects.js @@ -465,6 +465,12 @@ SpriteMorph.prototype.initBlocks = function () { spec: 'set volume to %n %', defaults: [100] }, + doChangeVolume: { + type: 'command', + category: 'sound', + spec: 'change volume by %n', + defaults: [-10] + }, reportVolume: { type: 'reporter', category: 'sound', @@ -1767,6 +1773,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('doStopAllSounds')); blocks.push('-'); blocks.push(block('doSetVolume')); + blocks.push(block('doChangeVolume')); blocks.push(watcherToggle('reportVolume')); blocks.push(block('reportVolume')); blocks.push('-'); @@ -2622,13 +2629,18 @@ SpriteMorph.prototype.playSound = function (name) { SpriteMorph.prototype.doSetVolume = function (val) { var stage = this.parentThatIsA(StageMorph); - stage.volume = val; + stage.volume = Math.min(Math.max(0, val), 100); stage.activeSounds.forEach(function (snd) { - snd.volume = Math.min(Math.max(0, stage.volume), 100) / 100; // 'audio' objects + snd.volume = stage.volume / 100; // 'audio' objects }); }; +SpriteMorph.prototype.doChangeVolume = function (val) { + var stage = this.parentThatIsA(StageMorph); + this.doSetVolume(stage.volume + val); +}; + SpriteMorph.prototype.reportVolume = function () { var stage = this.parentThatIsA(StageMorph); return stage.volume; -- cgit v1.3.1 From cc2f9bc84d5085e1380ceb3043d4ad5af3384b54 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sat, 2 Aug 2014 15:56:55 +0200 Subject: volume blocks: user sprite's volume, apply previous changes to stage --- objects.js | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index c898cd9..317a96a 100644 --- a/objects.js +++ b/objects.js @@ -1313,6 +1313,8 @@ SpriteMorph.prototype.init = function (globals) { this.version = Date.now(); // for observer optimization this.isClone = false; // indicate a "temporary" Scratch-style clone this.cloneOriginName = ''; + this.volume = 100; + this.activeSounds = []; // sprite nesting properties this.parts = []; // not serialized, only anchor (name) @@ -2602,7 +2604,7 @@ SpriteMorph.prototype.reportCostumes = function () { // SpriteMorph sound management SpriteMorph.prototype.addSound = function (audio, name) { - var volume = this.parentThatIsA(StageMorph).volume; + var volume = this.volume; this.sounds.add(new Sound(audio, name, volume)); }; @@ -2614,8 +2616,14 @@ SpriteMorph.prototype.playSound = function (name) { ), active; if (sound) { - sound.volume = stage.volume; + sound.volume = this.volume; active = sound.play(); + + this.activeSounds.push(active); + this.activeSounds = this.activeSounds.filter(function (aud) { + return !aud.ended && !aud.terminated; + }); + if (stage) { stage.activeSounds.push(active); stage.activeSounds = stage.activeSounds.filter(function (aud) { @@ -2627,23 +2635,20 @@ SpriteMorph.prototype.playSound = function (name) { }; SpriteMorph.prototype.doSetVolume = function (val) { - var stage = this.parentThatIsA(StageMorph); - - stage.volume = Math.min(Math.max(0, val), 100); + var myself = this; - stage.activeSounds.forEach(function (snd) { - snd.volume = stage.volume / 100; // 'audio' objects + myself.volume = val; + myself.activeSounds.forEach(function (snd) { + snd.volume = Math.min(Math.max(0, myself.volume), 100) / 100; // 'audio' objects }); }; SpriteMorph.prototype.doChangeVolume = function (val) { - var stage = this.parentThatIsA(StageMorph); - this.doSetVolume(stage.volume + val); + this.doSetVolume(this.volume + val); }; SpriteMorph.prototype.reportVolume = function () { - var stage = this.parentThatIsA(StageMorph); - return stage.volume; + return this.volume; } SpriteMorph.prototype.reportSounds = function () { @@ -4929,7 +4934,10 @@ StageMorph.prototype.blockTemplates = function (category) { blocks.push(block('playSound')); blocks.push(block('doPlaySoundUntilDone')); blocks.push(block('doStopAllSounds')); + blocks.push('-'); blocks.push(block('doSetVolume')); + blocks.push(block('doChangeVolume')); + blocks.push(watcherToggle('reportVolume')); blocks.push(block('reportVolume')); blocks.push('-'); blocks.push(block('doRest')); @@ -5474,6 +5482,9 @@ StageMorph.prototype.playSound StageMorph.prototype.doSetVolume = SpriteMorph.prototype.doSetVolume; +StageMorph.prototype.doChangeVolume + = SpriteMorph.prototype.doChangeVolume; + StageMorph.prototype.reportVolume = SpriteMorph.prototype.reportVolume; -- cgit v1.3.1 From a44775e4624f1afd9b83ffa4061152bfde2b829f Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sun, 3 Aug 2014 11:55:46 +0200 Subject: add volume out of bounds check --- objects.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index 317a96a..fda06f6 100644 --- a/objects.js +++ b/objects.js @@ -2637,9 +2637,9 @@ SpriteMorph.prototype.playSound = function (name) { SpriteMorph.prototype.doSetVolume = function (val) { var myself = this; - myself.volume = val; + myself.volume = Math.min(Math.max(0, val), 100); myself.activeSounds.forEach(function (snd) { - snd.volume = Math.min(Math.max(0, myself.volume), 100) / 100; // 'audio' objects + snd.volume = myself.volume / 100; // 'audio' objects }); }; -- cgit v1.3.1 From b700eaa3f35b931445df06ba1ff952a709f82cc5 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sun, 3 Aug 2014 12:41:23 +0200 Subject: add mute functions --- gui.js | 19 +++++++++++++++---- objects.js | 23 +++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) (limited to 'objects.js') 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 () { diff --git a/objects.js b/objects.js index fda06f6..c8147d9 100644 --- a/objects.js +++ b/objects.js @@ -2619,6 +2619,10 @@ SpriteMorph.prototype.playSound = function (name) { sound.volume = this.volume; active = sound.play(); + if (stage.muted === true) { + active.volume = 0; + } + this.activeSounds.push(active); this.activeSounds = this.activeSounds.filter(function (aud) { return !aud.ended && !aud.terminated; @@ -2651,6 +2655,13 @@ SpriteMorph.prototype.reportVolume = function () { return this.volume; } +SpriteMorph.prototype.unmuteAllSounds = function () { + var stage = this.parentThatIsA(StageMorph); + stage.muted = false; + + this.doSetVolume(this.volume); +}; + SpriteMorph.prototype.reportSounds = function () { return this.sounds; }; @@ -4293,6 +4304,7 @@ StageMorph.prototype.init = function (globals) { this.isFastTracked = false; this.cloneCount = 0; this.volume = 100; + this.muted = false; this.timerStart = Date.now(); this.tempo = 60; // bpm @@ -5507,6 +5519,17 @@ StageMorph.prototype.resumeAllActiveSounds = function () { }); }; +StageMorph.prototype.muteAllSounds = function () { + this.muted = true; + + this.activeSounds.forEach(function (audio) { + audio.volume = 0; + }); +}; + +StageMorph.prototype.unmuteAllSounds + = SpriteMorph.prototype.unmuteAllSounds; + StageMorph.prototype.reportSounds = SpriteMorph.prototype.reportSounds; -- cgit v1.3.1 From 8acc6a32d414160b8de71d19457868b769768649 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sun, 3 Aug 2014 15:40:47 +0200 Subject: stay muted after volume change --- objects.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index c8147d9..b385ee9 100644 --- a/objects.js +++ b/objects.js @@ -2640,8 +2640,12 @@ SpriteMorph.prototype.playSound = function (name) { SpriteMorph.prototype.doSetVolume = function (val) { var myself = this; - myself.volume = Math.min(Math.max(0, val), 100); + + if (myself.parentThatIsA(StageMorph).muted === true) { + return; + } + myself.activeSounds.forEach(function (snd) { snd.volume = myself.volume / 100; // 'audio' objects }); -- cgit v1.3.1 From 90e62b4313f300de1da3013a558d51f7d4c883a6 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Mon, 4 Aug 2014 11:10:21 +0200 Subject: allow changing the volume of notes --- objects.js | 5 +++-- threads.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index b385ee9..1a42e0f 100644 --- a/objects.js +++ b/objects.js @@ -6352,12 +6352,13 @@ Note.prototype.setupContext = function () { } Note.prototype.audioContext = new AudioContext(); Note.prototype.gainNode = Note.prototype.audioContext.createGain(); - Note.prototype.gainNode.gain.value = 0.25; // reduce volume by 1/4 }; // Note playing -Note.prototype.play = function () { +Note.prototype.play = function (volume) { + this.gainNode.gain.value = 0.25 * volume / 100; // reduce volume by 1/4 + this.oscillator = this.audioContext.createOscillator(); if (!this.oscillator.start) { this.oscillator.start = this.oscillator.noteOn; diff --git a/threads.js b/threads.js index 3324ac6..56ff45a 100644 --- a/threads.js +++ b/threads.js @@ -2716,10 +2716,11 @@ Process.prototype.doPlayNote = function (pitch, beats) { Process.prototype.doPlayNoteForSecs = function (pitch, secs) { // interpolated + var volume = this.homeContext.receiver.volume; if (!this.context.startTime) { this.context.startTime = Date.now(); this.context.activeNote = new Note(pitch); - this.context.activeNote.play(); + this.context.activeNote.play(volume); } if ((Date.now() - this.context.startTime) >= (secs * 1000)) { if (this.context.activeNote) { -- cgit v1.3.1 From ad400763c1f4cd10675a9e6bc56d1630d8c6cb5d Mon Sep 17 00:00:00 2001 From: Gubolin Date: Tue, 5 Aug 2014 12:01:41 +0200 Subject: mute Notes immediately --- objects.js | 13 ++++++++++--- threads.js | 15 +++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index 1a42e0f..323ccab 100644 --- a/objects.js +++ b/objects.js @@ -6320,8 +6320,9 @@ Sound.prototype.toDataURL = function () { // Note instance creation -function Note(pitch) { +function Note(pitch, volume) { this.pitch = pitch === 0 ? 0 : pitch || 69; + this.volume = volume; this.setupContext(); this.oscillator = null; } @@ -6356,8 +6357,8 @@ Note.prototype.setupContext = function () { // Note playing -Note.prototype.play = function (volume) { - this.gainNode.gain.value = 0.25 * volume / 100; // reduce volume by 1/4 +Note.prototype.play = function () { + this.gainNode.gain.value = 0.25 * this.volume / 100; // reduce volume by 1/4 this.oscillator = this.audioContext.createOscillator(); if (!this.oscillator.start) { @@ -6374,6 +6375,12 @@ Note.prototype.play = function (volume) { this.oscillator.start(0); }; +Note.prototype.setVolume = function (volume) { + this.stop(); + this.volume = volume; + this.play(); +} + Note.prototype.stop = function () { if (this.oscillator) { this.oscillator.stop(0); diff --git a/threads.js b/threads.js index 5347110..354d002 100644 --- a/threads.js +++ b/threads.js @@ -2716,8 +2716,9 @@ Process.prototype.doPlayNote = function (pitch, beats) { Process.prototype.doPlayNoteForSecs = function (pitch, secs) { // interpolated - var volume = this.homeContext.receiver.volume; - var muted = this.homeContext.receiver.parentThatIsA(StageMorph).muted; + var receiver = this.homeContext.receiver; + var volume = receiver.volume; + var muted = receiver.parentThatIsA(StageMorph).muted; if (muted === true) { volume = 0; @@ -2725,16 +2726,22 @@ Process.prototype.doPlayNoteForSecs = function (pitch, secs) { if (!this.context.startTime) { this.context.startTime = Date.now(); - this.context.activeNote = new Note(pitch); - this.context.activeNote.play(volume); + this.context.activeNote = new Note(pitch, volume); + this.context.activeNote.play(); } + if ((Date.now() - this.context.startTime) >= (secs * 1000)) { if (this.context.activeNote) { this.context.activeNote.stop(); this.context.activeNote = null; } return null; + } else if (this.context.activeNote) { + if (this.context.activeNote.volume !== volume) { + this.context.activeNote.setVolume(volume); + } } + this.pushContext('doYield'); this.pushContext(); }; -- cgit v1.3.1 From cd6d755f00b4633e68d63fb2e2b1910ffa03b32c Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sat, 2 Aug 2014 16:28:15 +0200 Subject: Pause bug (fix #440) --- objects.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index 323ccab..e4d0928 100644 --- a/objects.js +++ b/objects.js @@ -5518,9 +5518,16 @@ StageMorph.prototype.pauseAllActiveSounds = function () { }; StageMorph.prototype.resumeAllActiveSounds = function () { + var newSounds = []; // remove Sounds that have been played so they do not resume + this.activeSounds.forEach(function (audio) { - audio.play(); + if (audio.ended === false) { + newSounds.push(audio); + audio.play(); + } }); + + this.activeSounds = newSounds; }; StageMorph.prototype.muteAllSounds = function () { -- cgit v1.3.1 From fc36ac7fea89447682868dc40cc9a818afc51c5c Mon Sep 17 00:00:00 2001 From: Gubolin Date: Wed, 6 Aug 2014 12:24:45 +0200 Subject: fix another strange Note bug --- objects.js | 2 +- threads.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index e4d0928..8923384 100644 --- a/objects.js +++ b/objects.js @@ -4811,7 +4811,7 @@ StageMorph.prototype.fireGreenFlagEvent = function () { StageMorph.prototype.fireStopAllEvent = function () { var ide = this.parentThatIsA(IDE_Morph); - this.threads.resumeAll(this.stage); + //this.threads.resumeAll(this.stage); // leads to a strange Note bug this.keysPressed = {}; this.threads.stopAll(); this.stopAllActiveSounds(); diff --git a/threads.js b/threads.js index 7e87614..fd75e3d 100644 --- a/threads.js +++ b/threads.js @@ -1395,7 +1395,7 @@ Process.prototype.doStopAll = function () { if (this.homeContext.receiver) { stage = this.homeContext.receiver.parentThatIsA(StageMorph); if (stage) { - stage.threads.resumeAll(stage); + //stage.threads.resumeAll(stage); // leads to a strange Note bug stage.keysPressed = {}; stage.threads.stopAll(); stage.stopAllActiveSounds(); -- cgit v1.3.1