changeset 682:820805ac7326

Bug fix: Randomisation causes system not to load new audio elements when progressing through pages
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Mon, 20 Apr 2015 18:50:06 +0100
parents ab56aa2fe064
children e0abe55f5514
files ape.js apeTool.html
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ape.js	Sat Apr 18 15:36:10 2015 +0100
+++ b/ape.js	Mon Apr 20 18:50:06 2015 +0100
@@ -428,6 +428,7 @@
 	else {randomise = false;}
 	
 	var audioElements = $(textXML).find('audioElements');
+	currentTrackOrder = [];
 	audioElements.each(function(index,element){
 		// Find any blind-repeats
 		// Not implemented yet, but just incase
@@ -437,6 +438,9 @@
 		currentTrackOrder = randomiseOrder(currentTrackOrder);
 	}
 	
+	// Delete any previous audioObjects associated with the audioEngine
+	audioEngineContext.audioObjects = [];
+	
 	// Find all the audioElements from the audioHolder
 	$(currentTrackOrder).each(function(index,element){
 		// Find URL of track
--- a/apeTool.html	Sat Apr 18 15:36:10 2015 +0100
+++ b/apeTool.html	Mon Apr 20 18:50:06 2015 +0100
@@ -33,7 +33,7 @@
 		</script>
 		<!-- Uncomment the following script for automatic loading of projects -->
 		<script>
-			url = 'example_eval/project.xml'; //Project XML document location
+			url = 'example_eval/project2.xml'; //Project XML document location
 			loadProjectSpec(url);
 		</script>