diff interfaces/AB.js @ 1096:9820063ea96a

Bug #1652 and Feature #1650 fixes. You can specify the track labels through page attribute 'label' ('default', 'none', 'number', 'letter', 'capital'). Updated examples to match schema
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Thu, 10 Mar 2016 16:16:16 +0000
parents c07b9e2312ba
children ba6b9e1aaef5
line wrap: on
line diff
--- a/interfaces/AB.js	Thu Mar 10 15:33:39 2016 +0000
+++ b/interfaces/AB.js	Thu Mar 10 16:16:16 2016 +0000
@@ -308,7 +308,22 @@
 			console.log("WARNING - AB cannot have fixed reference");
 		}
 		var audioObject = audioEngineContext.newTrack(element);
-		var node = new this.comparatorBox(audioObject,index,String.fromCharCode(65 + index));
+        var label;
+        switch(audioObject.specification.parent.label) {
+            case "none":
+                label = "";
+                break;
+            case "number":
+                label = ""+index;
+                break;
+            case "letter":
+                label = String.fromCharCode(97 + index);
+                break;
+            default:
+                label = String.fromCharCode(65 + index);
+                break;
+        }
+		var node = new this.comparatorBox(audioObject,index,label);
 		audioObject.bindInterface(node);
 		this.comparators.push(node);
 		this.boxHolders.appendChild(node.box);