diff core.js @ 969:917676cbdcc8

Fixed bug where 'all played' wasn't checked anymore in loop mode. Now in non-loop mode, 'flagAsPlayed' needs to be called explicitly from ape.js (may want to change)
author Brecht De Man <BrechtDeMan@users.noreply.github.com>
date Wed, 27 May 2015 20:24:17 +0100
parents 16852cf211eb
children dea30ed2b549
line wrap: on
line diff
--- a/core.js	Wed May 27 19:00:20 2015 +0100
+++ b/core.js	Wed May 27 20:24:17 2015 +0100
@@ -521,9 +521,14 @@
 	// When stopeed, the buffer node is deleted and recreated with the stored buffer.
 	this.buffer;
 	
+    this.flagAsPlayed = function() { // to be called explicitly when not in loop mode
+        this.played = true;
+    }
+    
 	this.loopStart = function() {
 		this.outputGain.gain.value = 1.0;
 		this.metric.startListening(audioEngineContext.timer.getTestTime());
+        this.played = true;
 	}
 	
 	this.loopStop = function() {
@@ -546,7 +551,6 @@
 			this.metric.startListening(audioEngineContext.timer.getTestTime());
 		}
 		this.bufferNode.start(startTime);
-		this.played = true;
 	};
 	
 	this.stop = function() {