changeset 1640:01a66735e0e7

Merge
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Thu, 28 May 2015 19:27:39 +0100
parents d5d7dfdbf335 (current diff) 4bf502a0756b (diff)
children f3c7351233fa 4245465f825f
files ape.js core.js example_eval/project.xml
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ape.js	Thu May 28 18:58:45 2015 +0100
+++ b/ape.js	Thu May 28 19:27:39 2015 +0100
@@ -368,6 +368,7 @@
 			if (this.status == 1) {
 				this.audioObjects[id].outputGain.gain.value = 1.0;
 				this.audioObjects[id].play(audioContext.currentTime+0.01);
+                this.audioObjects[id].flagAsPlayed(); 
 			}
 		};
 	}
--- a/core.js	Thu May 28 18:58:45 2015 +0100
+++ b/core.js	Thu May 28 19:27:39 2015 +0100
@@ -529,9 +529,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() {
@@ -554,7 +559,6 @@
 			this.metric.startListening(audioEngineContext.timer.getTestTime());
 		}
 		this.bufferNode.start(startTime);
-		this.played = true;
 	};
 	
 	this.stop = function() {