diff ape.js @ 104:6d5701b775c2

Merge 'default' and 'Dev_main' branch
author Brecht De Man <b.deman@qmul.ac.uk>
date Sun, 17 May 2015 18:40:56 +0100
parents 2dde0209be3d 1c869162371b
children f2c05f147dd2
line wrap: on
line diff
--- a/ape.js	Sun May 17 16:45:09 2015 +0100
+++ b/ape.js	Sun May 17 18:40:56 2015 +0100
@@ -389,11 +389,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;
 			}
@@ -402,13 +400,12 @@
 		audioEngineContext.selectedTrack = function(id) {
 			for (var i=0; i<this.audioObjects.length; i++)
 			{
-				if (id == i) {
-					this.audioObjects[i].outputGain.gain.value = 1.0;
-					this.audioObjects[i].play(audioContext.currentTime+0.01);
-				} else {
-					this.audioObjects[i].outputGain.gain.value = 0.0;
-					this.audioObjects[i].stop();
-				}
+				this.audioObjects[i].outputGain.gain.value = 0.0;
+				this.audioObjects[i].stop();
+			}
+			if (this.status == 1) {
+				this.audioObjects[id].outputGain.gain.value = 1.0;
+				this.audioObjects[id].play(audioContext.currentTime+0.01);
 			}
 		};
 	}