changeset 689:f996a6663907

Track comments can be muted
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Tue, 21 Apr 2015 21:35:23 +0100
parents 8babb8c22d59
children 657d63ab4458
files ape.js example_eval/project.xml
diffstat 2 files changed, 28 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/ape.js	Tue Apr 21 21:32:42 2015 +0100
+++ b/ape.js	Tue Apr 21 21:35:23 2015 +0100
@@ -322,6 +322,12 @@
 		}
 	}
 	
+	var commentShow = textXML.attributes['elementComments'];
+	if (commentShow != undefined) {
+		if (commentShow.value == 'false') {commentShow = false;}
+		else {commentShow = true;}
+	} else {commentShow = true;}
+	
 	var loopPlayback = textXML.attributes['loop'];
 	if (loopPlayback != undefined)
 	{
@@ -449,24 +455,27 @@
 		// Now load each audio sample. First create the new track by passing the full URL
 		var trackURL = hostURL + this.attributes['url'].value;
 		audioEngineContext.newTrack(trackURL);
-		// Create document objects to hold the comment boxes
-		var trackComment = document.createElement('div');
-		trackComment.className = 'comment-div';
-		// Create a string next to each comment asking for a comment
-		var trackString = document.createElement('span');
-		trackString.innerHTML = 'Comment on track '+index;
-		// Create the HTML5 comment box 'textarea'
-		var trackCommentBox = document.createElement('textarea');
-		trackCommentBox.rows = '4';
-		trackCommentBox.cols = '100';
-		trackCommentBox.name = 'trackComment'+index;
-		trackCommentBox.className = 'trackComment';
-		var br = document.createElement('br');
-		// Add to the holder.
-		trackComment.appendChild(trackString);
-		trackComment.appendChild(br);
-		trackComment.appendChild(trackCommentBox);
-		feedbackHolder.appendChild(trackComment);
+		
+		if (commentShow) {
+			// Create document objects to hold the comment boxes
+			var trackComment = document.createElement('div');
+			trackComment.className = 'comment-div';
+			// Create a string next to each comment asking for a comment
+			var trackString = document.createElement('span');
+			trackString.innerHTML = 'Comment on track '+index;
+			// Create the HTML5 comment box 'textarea'
+			var trackCommentBox = document.createElement('textarea');
+			trackCommentBox.rows = '4';
+			trackCommentBox.cols = '100';
+			trackCommentBox.name = 'trackComment'+index;
+			trackCommentBox.className = 'trackComment';
+			var br = document.createElement('br');
+			// Add to the holder.
+			trackComment.appendChild(trackString);
+			trackComment.appendChild(br);
+			trackComment.appendChild(trackCommentBox);
+			feedbackHolder.appendChild(trackComment);
+		}
 		
 		// Create a slider per track
 		
--- a/example_eval/project.xml	Tue Apr 21 21:32:42 2015 +0100
+++ b/example_eval/project.xml	Tue Apr 21 21:35:23 2015 +0100
@@ -18,7 +18,7 @@
 			<metricEnable>elementFlagMoved</metricEnable>
 		</Metric>
 	</setup>
-	<audioHolder id='0' hostURL="example_eval/" sampleRate="44100" randomiseOrder='true' repeatCount='1' loop='true'>
+	<audioHolder id='0' hostURL="example_eval/" sampleRate="44100" randomiseOrder='true' repeatCount='1' loop='true' elementComments='false'>
 		<interface>
 			<title>Example Test Question</title>
 			<scale position="0">Min</scale>