diff core.js @ 944:23bf5007b552

Bug #1226: Moved check to audioObjects and audioEngine so available for all interfaces. Also interface pop-up now states all outstanding fragments to listen.
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Sun, 24 May 2015 09:57:35 +0100
parents 759c2ace3c65
children c26cfa1c5fc0
line wrap: on
line diff
--- a/core.js	Sun May 17 21:37:08 2015 +0100
+++ b/core.js	Sun May 24 09:57:35 2015 +0100
@@ -137,6 +137,16 @@
 		this.audioObjects[audioObjectId].constructTrack(url);
 	};
 	
+	this.checkAllPlayed = function() {
+		arr = [];
+		for (var id=0; id<this.audioObjects.length; id++) {
+			if (this.audioObjects[id].played == false) {
+				arr.push(this.audioObjects[id].id);
+			}
+		}
+		return arr;
+	};
+	
 }
 
 function audioObject(id) {
@@ -147,6 +157,8 @@
 	this.url = null; // Hold the URL given for the output back to the results.
 	this.metric = new metricTracker();
 	
+	this.played = false;
+	
 	// Create a buffer and external gain control to allow internal patching of effects and volume leveling.
 	this.bufferNode = undefined;
 	this.outputGain = audioContext.createGain();
@@ -167,6 +179,7 @@
 		this.bufferNode.buffer = this.buffer;
 		this.bufferNode.loop = audioEngineContext.loopPlayback;
 		this.bufferNode.start(startTime);
+		this.played = true;
 	};
 	
 	this.stop = function() {