changeset 998:355631b936d3

Fixed Bug 1205: Stop/start button now has full control in non-loop mode.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Fri, 01 May 2015 16:18:25 +0100
parents e736301ff2e1
children ffeef0ac7a5f
files ape.js
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/ape.js	Fri May 01 16:14:08 2015 +0100
+++ b/ape.js	Fri May 01 16:18:25 2015 +0100
@@ -388,11 +388,9 @@
 		audioEngineContext.stop = function() {
 			// Send stop and reset command to all playback buffers
 			if (this.status == 1) {
-				if (this.loopPlayback) {
-					for (var i=0; i<this.audioObjects.length; i++)
-					{
-						this.audioObjects[i].stop();
-					}
+				for (var i=0; i<this.audioObjects.length; i++)
+				{
+					this.audioObjects[i].stop();
 				}
 				this.status = 0;
 			}
@@ -404,8 +402,10 @@
 				this.audioObjects[i].outputGain.gain.value = 0.0;
 				this.audioObjects[i].stop();
 			}
-			this.audioObjects[id].outputGain.gain.value = 1.0;
-			this.audioObjects[id].play(audioContext.currentTime+0.01);
+			if (this.status == 1) {
+				this.audioObjects[id].outputGain.gain.value = 1.0;
+				this.audioObjects[id].play(audioContext.currentTime+0.01);
+			}
 		};
 	}