changeset 387:5995d8fe96eb Dev_main

APE Multi-interface can be named. Audio Element <file> node fixed.
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Tue, 08 Dec 2015 15:04:59 +0000
parents 4cfd32ff1334
children 2bbf813c0e61 3b97ee830b48
files ape.js core.js example_eval/project.xml
diffstat 3 files changed, 9 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/ape.js	Tue Dec 08 12:29:59 2015 +0000
+++ b/ape.js	Tue Dec 08 15:04:59 2015 +0000
@@ -7,8 +7,6 @@
 // Once this is loaded and parsed, begin execution
 loadInterface();
 
-var clicking = -1;
-
 function loadInterface() {
 	
 	// Get the dimensions of the screen available to the page
@@ -310,7 +308,7 @@
 		// Create the slider box to hold the slider elements
 		var canvas = document.createElement('div');
 		if (interfaceObj[k].name != undefined)
-			canvas.id = 'slider-'+name;
+			canvas.id = 'slider-'+interfaceObj[k].name;
 		else
 			canvas.id = 'slider-'+k;
 		canvas.className = 'slider';
--- a/core.js	Tue Dec 08 12:29:59 2015 +0000
+++ b/core.js	Tue Dec 08 15:04:59 2015 +0000
@@ -1070,10 +1070,10 @@
 		root.id = this.specification.id;
 		root.setAttribute('url',this.url);
 		var file = document.createElement('file');
-		file.setAttribute('sampleRate',this.buffer.sampleRate);
-		file.setAttribute('channels',this.buffer.numberOfChannels);
-		file.setAttribute('sampleCount',this.buffer.length);
-		file.setAttribute('duration',this.buffer.duration);
+		file.setAttribute('sampleRate',this.buffer.buffer.sampleRate);
+		file.setAttribute('channels',this.buffer.buffer.numberOfChannels);
+		file.setAttribute('sampleCount',this.buffer.buffer.length);
+		file.setAttribute('duration',this.buffer.buffer.duration);
 		root.appendChild(file);
 		if (this.specification.type != 'outsidereference') {
 			var interfaceXML = this.interfaceDOM.exportXMLDOM(this);
@@ -1510,7 +1510,6 @@
 		}
 		
 		this.commonInterface = new function() {
-			this.name = undefined;
 			this.OptionNode = function(child) {
 				this.type = child.nodeName;
 				if (this.type == 'option')
@@ -1544,10 +1543,6 @@
 			};
 			this.options = [];
 			if (commonInterfaceNode != undefined) {
-				var name = commonInterfaceNode.getAttribute("name");
-				if (name != undefined) {
-					this.name = name;
-				}
 				var child = commonInterfaceNode.firstElementChild;
 				while (child != undefined) {
 					this.options.push(new this.OptionNode(child));
@@ -1928,11 +1923,14 @@
 			this.title = undefined;
 			this.options = [];
 			this.scale = [];
+			this.name = undefined;
 			this.decode = function(DOM)
 			{
 				var title = DOM.getElementsByTagName('title');
 				if (title.length == 0) {this.title = null;}
 				else {this.title = title[0].textContent;}
+				var name = DOM.getAttribute("name");
+				if (name != undefined) {this.name = name;}
 				this.options = parent.commonInterface.options;
 				var scale = DOM.getElementsByTagName('scale');
 				this.scale = [];
--- a/example_eval/project.xml	Tue Dec 08 12:29:59 2015 +0000
+++ b/example_eval/project.xml	Tue Dec 08 15:04:59 2015 +0000
@@ -62,7 +62,7 @@
 		</PostTest>
 	</audioHolder>
     <audioHolder id='test-1' hostURL="example_eval/" randomiseOrder='true' repeatCount='0' loop='false' elementComments='true'>
-        <interface>
+        <interface name="preference">
             <title>Example Test Question</title>
             <scale position="0">Min</scale>
             <scale position="100">Max</scale>