annotate test_create/test_create.html @ 501:9a8ede168aba Dev_main

New test creator tool. Still WIP, but much more dynamic. Based on XSD and external lists so far easier to modify.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Wed, 10 Feb 2016 12:02:25 +0000
parents db353cc479b8
children 58fd8bcc6620
rev   line source
n@501 1 <html>
n@501 2 <head>
n@501 3 <!-- This defines the test creator tool for the Web Audio Evaluation Toolbox -->
n@501 4 <link rel='stylesheet' type="text/css" href="style.css"/>
n@501 5 <script type="text/javascript">
n@501 6 // Copy of Specifiation node from Core.js
n@501 7 function Specification() {
n@501 8 // Handles the decoding of the project specification XML into a simple JavaScript Object.
n@501 9
n@501 10 this.interface = null;
n@501 11 this.projectReturn = null;
n@501 12 this.randomiseOrder = null;
n@501 13 this.testPages = null;
n@501 14 this.pages = [];
n@501 15 this.metrics = null;
n@501 16 this.interfaces = null;
n@501 17 this.loudness = null;
n@501 18 this.errors = [];
n@501 19 this.schema = null;
n@501 20
n@501 21 this.randomiseOrder = function(input)
n@501 22 {
n@501 23 // This takes an array of information and randomises the order
n@501 24 var N = input.length;
n@501 25
n@501 26 var inputSequence = []; // For safety purposes: keep track of randomisation
n@501 27 for (var counter = 0; counter < N; ++counter)
n@501 28 inputSequence.push(counter) // Fill array
n@501 29 var inputSequenceClone = inputSequence.slice(0);
n@501 30
n@501 31 var holdArr = [];
n@501 32 var outputSequence = [];
n@501 33 for (var n=0; n<N; n++)
n@501 34 {
n@501 35 // First pick a random number
n@501 36 var r = Math.random();
n@501 37 // Multiply and floor by the number of elements left
n@501 38 r = Math.floor(r*input.length);
n@501 39 // Pick out that element and delete from the array
n@501 40 holdArr.push(input.splice(r,1)[0]);
n@501 41 // Do the same with sequence
n@501 42 outputSequence.push(inputSequence.splice(r,1)[0]);
n@501 43 }
n@501 44 console.log(inputSequenceClone.toString()); // print original array to console
n@501 45 console.log(outputSequence.toString()); // print randomised array to console
n@501 46 return holdArr;
n@501 47 };
n@501 48
n@501 49 this.processAttribute = function(attribute,schema)
n@501 50 {
n@501 51 // attribute is the string returned from getAttribute on the XML
n@501 52 // schema is the <xs:attribute> node
n@501 53 if (schema.getAttribute('name') == undefined && schema.getAttribute('ref') != undefined)
n@501 54 {
n@501 55 schema = this.schema.getAllElementsByName(schema.getAttribute('ref'))[0];
n@501 56 }
n@501 57 var defaultOpt = schema.getAttribute('default');
n@501 58 if (attribute == null) {
n@501 59 attribute = defaultOpt;
n@501 60 }
n@501 61 var dataType = schema.getAttribute('type');
n@501 62 if (typeof dataType == "string") { dataType = dataType.substr(3);}
n@501 63 else {dataType = "string";}
n@501 64 if (attribute == null)
n@501 65 {
n@501 66 return attribute;
n@501 67 }
n@501 68 switch(dataType)
n@501 69 {
n@501 70 case "boolean":
n@501 71 if (attribute == 'true'){attribute = true;}else{attribute=false;}
n@501 72 break;
n@501 73 case "negativeInteger":
n@501 74 case "positiveInteger":
n@501 75 case "nonNegativeInteger":
n@501 76 case "nonPositiveInteger":
n@501 77 case "integer":
n@501 78 case "decimal":
n@501 79 case "short":
n@501 80 attribute = Number(attribute);
n@501 81 break;
n@501 82 case "string":
n@501 83 default:
n@501 84 attribute = String(attribute);
n@501 85 break;
n@501 86 }
n@501 87 return attribute;
n@501 88 };
n@501 89
n@501 90 this.decode = function(projectXML) {
n@501 91 this.errors = [];
n@501 92 // projectXML - DOM Parsed document
n@501 93 this.projectXML = projectXML.childNodes[0];
n@501 94 var setupNode = projectXML.getElementsByTagName('setup')[0];
n@501 95 var schemaSetup = this.schema.getAllElementsByName('setup')[0];
n@501 96 // First decode the attributes
n@501 97 var attributes = schemaSetup.getAllElementsByTagName('xs:attribute');
n@501 98 for (var i in attributes)
n@501 99 {
n@501 100 if (isNaN(Number(i)) == true){break;}
n@501 101 var attributeName = attributes[i].getAttribute('name');
n@501 102 var projectAttr = setupNode.getAttribute(attributeName);
n@501 103 projectAttr = this.processAttribute(projectAttr,attributes[i]);
n@501 104 switch(typeof projectAttr)
n@501 105 {
n@501 106 case "number":
n@501 107 case "boolean":
n@501 108 eval('this.'+attributeName+' = '+projectAttr);
n@501 109 break;
n@501 110 case "string":
n@501 111 eval('this.'+attributeName+' = "'+projectAttr+'"');
n@501 112 break;
n@501 113 }
n@501 114
n@501 115 }
n@501 116
n@501 117 this.metrics = new this.metricNode();
n@501 118
n@501 119 this.metrics.decode(this,setupNode.getElementsByTagName('metric')[0]);
n@501 120
n@501 121 // Now process the survey node options
n@501 122 var survey = setupNode.getElementsByTagName('survey');
n@501 123 for (var i in survey) {
n@501 124 if (isNaN(Number(i)) == true){break;}
n@501 125 var location = survey[i].getAttribute('location');
n@501 126 if (location == 'pre' || location == 'before')
n@501 127 {
n@501 128 if (this.preTest != null){this.errors.push("Already a pre/before test survey defined! Ignoring second!!");}
n@501 129 else {
n@501 130 this.preTest = new this.surveyNode();
n@501 131 this.preTest.decode(this,survey[i]);
n@501 132 }
n@501 133 } else if (location == 'post' || location == 'after') {
n@501 134 if (this.postTest != null){this.errors.push("Already a post/after test survey defined! Ignoring second!!");}
n@501 135 else {
n@501 136 this.postTest = new this.surveyNode();
n@501 137 this.postTest.decode(this,survey[i]);
n@501 138 }
n@501 139 }
n@501 140 }
n@501 141
n@501 142 var interfaceNode = setupNode.getElementsByTagName('interface');
n@501 143 if (interfaceNode.length > 1)
n@501 144 {
n@501 145 this.errors.push("Only one <interface> node in the <setup> node allowed! Others except first ingnored!");
n@501 146 }
n@501 147 this.interfaces = new this.interfaceNode();
n@501 148 if (interfaceNode.length != 0)
n@501 149 {
n@501 150 interfaceNode = interfaceNode[0];
n@501 151 this.interfaces.decode(this,interfaceNode,this.schema.getAllElementsByName('interface')[1]);
n@501 152 }
n@501 153
n@501 154 // Page tags
n@501 155 var pageTags = projectXML.getElementsByTagName('page');
n@501 156 var pageSchema = this.schema.getAllElementsByName('page')[0];
n@501 157 for (var i=0; i<pageTags.length; i++)
n@501 158 {
n@501 159 var node = new this.page();
n@501 160 node.decode(this,pageTags[i],pageSchema);
n@501 161 this.pages.push(node);
n@501 162 }
n@501 163 };
n@501 164
n@501 165 this.encode = function()
n@501 166 {
n@501 167 var root = document.implementation.createDocument(null,"waet");
n@501 168
n@501 169 // Build setup node
n@501 170
n@501 171 return root;
n@501 172 };
n@501 173
n@501 174 this.surveyNode = function() {
n@501 175 this.location = null;
n@501 176 this.options = [];
n@501 177 this.schema = specification.schema.getAllElementsByName('survey')[0];
n@501 178
n@501 179 this.OptionNode = function() {
n@501 180 this.type = undefined;
n@501 181 this.schema = specification.schema.getAllElementsByName('surveyentry')[0];
n@501 182 this.id = undefined;
n@501 183 this.mandatory = undefined;
n@501 184 this.statement = undefined;
n@501 185 this.boxsize = undefined;
n@501 186 this.options = [];
n@501 187 this.min = undefined;
n@501 188 this.max = undefined;
n@501 189 this.step = undefined;
n@501 190
n@501 191 this.decode = function(parent,child)
n@501 192 {
n@501 193 var attributeMap = this.schema.getAllElementsByTagName('xs:attribute');
n@501 194 for (var i in attributeMap){
n@501 195 if(isNaN(Number(i)) == true){break;}
n@501 196 var attributeName = attributeMap[i].getAttribute('name') || attributeMap[i].getAttribute('ref');
n@501 197 var projectAttr = child.getAttribute(attributeName);
n@501 198 projectAttr = parent.processAttribute(projectAttr,attributeMap[i]);
n@501 199 switch(typeof projectAttr)
n@501 200 {
n@501 201 case "number":
n@501 202 case "boolean":
n@501 203 eval('this.'+attributeName+' = '+projectAttr);
n@501 204 break;
n@501 205 case "string":
n@501 206 eval('this.'+attributeName+' = "'+projectAttr+'"');
n@501 207 break;
n@501 208 }
n@501 209 }
n@501 210 this.statement = child.getElementsByTagName('statement')[0].textContent;
n@501 211 if (this.type == "checkbox" || this.type == "radio") {
n@501 212 var children = child.getElementsByTagName('option');
n@501 213 if (children.length == null) {
n@501 214 console.log('Malformed' +child.nodeName+ 'entry');
n@501 215 this.statement = 'Malformed' +child.nodeName+ 'entry';
n@501 216 this.type = 'statement';
n@501 217 } else {
n@501 218 this.options = [];
n@501 219 for (var i in children)
n@501 220 {
n@501 221 if (isNaN(Number(i))==true){break;}
n@501 222 this.options.push({
n@501 223 name: children[i].getAttribute('name'),
n@501 224 text: children[i].textContent
n@501 225 });
n@501 226 }
n@501 227 }
n@501 228 }
n@501 229 };
n@501 230
n@501 231 this.exportXML = function(root)
n@501 232 {
n@501 233 var node = root.createElement('surveyelement');
n@501 234 node.setAttribute('type',this.type);
n@501 235 var statement = root.createElement('statement');
n@501 236 statement.textContent = this.statement;
n@501 237 node.appendChild(statement);
n@501 238 switch(this.type)
n@501 239 {
n@501 240 case "statement":
n@501 241 break;
n@501 242 case "question":
n@501 243 node.id = this.id;
n@501 244 node.setAttribute("mandatory",this.mandatory);
n@501 245 node.setAttribute("boxsize",this.boxsize);
n@501 246 break;
n@501 247 case "number":
n@501 248 node.id = this.id;
n@501 249 node.setAttribute("mandatory",this.mandatory);
n@501 250 node.setAttribute("min", this.min);
n@501 251 node.setAttribute("max", this.max);
n@501 252 node.setAttribute("step", this.step);
n@501 253 break;
n@501 254 case "checkbox":
n@501 255 case "radio":
n@501 256 node.id = this.id;
n@501 257 for (var i=0; i<this.options.length; i++)
n@501 258 {
n@501 259 var option = this.options[i];
n@501 260 var optionNode = root.createElement("option");
n@501 261 optionNode.setAttribute("name",option.name);
n@501 262 optionNode.textContent = option.text;
n@501 263 node.appendChild(optionNode);
n@501 264 }
n@501 265 break;
n@501 266 }
n@501 267 return node;
n@501 268 };
n@501 269 };
n@501 270 this.decode = function(parent,xml) {
n@501 271 this.location = xml.getAttribute('location');
n@501 272 if (this.location == 'before'){this.location = 'pre';}
n@501 273 else if (this.location == 'after'){this.location = 'post';}
n@501 274 for (var i in xml.children)
n@501 275 {
n@501 276 if(isNaN(Number(i))==true){break;}
n@501 277 var node = new this.OptionNode();
n@501 278 node.decode(parent,xml.children[i]);
n@501 279 this.options.push(node);
n@501 280 }
n@501 281 };
n@501 282 this.encode = function(root) {
n@501 283 var node = root.createElement('survey');
n@501 284 node.setAttribute('location',this.location);
n@501 285 for (var i=0; i<this.options.length; i++)
n@501 286 {
n@501 287 node.appendChild(this.options[i].exportXML());
n@501 288 }
n@501 289 return node;
n@501 290 };
n@501 291 };
n@501 292
n@501 293 this.interfaceNode = function()
n@501 294 {
n@501 295 this.title = null;
n@501 296 this.name = null;
n@501 297 this.options = [];
n@501 298 this.scales = [];
n@501 299 this.schema = specification.schema.getAllElementsByName('interface')[1];
n@501 300
n@501 301 this.decode = function(parent,xml) {
n@501 302 this.name = xml.getAttribute('name');
n@501 303 var titleNode = xml.getElementsByTagName('title');
n@501 304 if (titleNode.length == 1)
n@501 305 {
n@501 306 this.title = titleNode[0].textContent;
n@501 307 }
n@501 308 var interfaceOptionNodes = xml.getElementsByTagName('interfaceoption');
n@501 309 // Extract interfaceoption node schema
n@501 310 var interfaceOptionNodeSchema = this.schema.getAllElementsByName('interfaceoption')[0];
n@501 311 var attributeMap = interfaceOptionNodeSchema.getAllElementsByTagName('xs:attribute');
n@501 312 for (var i=0; i<interfaceOptionNodes.length; i++)
n@501 313 {
n@501 314 var ioNode = interfaceOptionNodes[i];
n@501 315 var option = {};
n@501 316 for (var j=0; j<attributeMap.length; j++)
n@501 317 {
n@501 318 var attributeName = attributeMap[j].getAttribute('name') || attributeMap[j].getAttribute('ref');
n@501 319 var projectAttr = ioNode.getAttribute(attributeName);
n@501 320 projectAttr = parent.processAttribute(projectAttr,attributeMap[j]);
n@501 321 switch(typeof projectAttr)
n@501 322 {
n@501 323 case "number":
n@501 324 case "boolean":
n@501 325 eval('option.'+attributeName+' = '+projectAttr);
n@501 326 break;
n@501 327 case "string":
n@501 328 eval('option.'+attributeName+' = "'+projectAttr+'"');
n@501 329 break;
n@501 330 }
n@501 331 }
n@501 332 this.options.push(option);
n@501 333 }
n@501 334
n@501 335 // Now the scales nodes
n@501 336 var scaleParent = xml.getElementsByTagName('scales');
n@501 337 if (scaleParent.length == 1) {
n@501 338 scaleParent = scaleParent[0];
n@501 339 for (var i=0; i<scaleParent.children.length; i++) {
n@501 340 var child = scaleParent.children[i];
n@501 341 this.scales.push({
n@501 342 text: child.textContent,
n@501 343 position: Number(child.getAttribute('position'))
n@501 344 });
n@501 345 }
n@501 346 }
n@501 347 };
n@501 348
n@501 349 this.encode = function(root) {
n@501 350
n@501 351 };
n@501 352 };
n@501 353
n@501 354 this.metricNode = function() {
n@501 355 this.enabled = [];
n@501 356 this.decode = function(parent, xml) {
n@501 357 var children = xml.getElementsByTagName('metricenable');
n@501 358 for (var i in children) {
n@501 359 if (isNaN(Number(i)) == true){break;}
n@501 360 this.enabled.push(children[i].textContent);
n@501 361 }
n@501 362 }
n@501 363 this.encode = function(root) {
n@501 364 var node = root.createElement('metric');
n@501 365 for (var i in this.enabled)
n@501 366 {
n@501 367 if (isNaN(Number(i)) == true){break;}
n@501 368 var child = root.createElement('metricenable');
n@501 369 child.textContent = this.enabled[i];
n@501 370 node.appendChild(child);
n@501 371 }
n@501 372 return node;
n@501 373 }
n@501 374 }
n@501 375
n@501 376 this.page = function() {
n@501 377 this.presentedId = undefined;
n@501 378 this.id = undefined;
n@501 379 this.hostURL = undefined;
n@501 380 this.randomiseOrder = undefined;
n@501 381 this.loop = undefined;
n@501 382 this.showElementComments = undefined;
n@501 383 this.outsideReference = null;
n@501 384 this.loudness = null;
n@501 385 this.preTest = null;
n@501 386 this.postTest = null;
n@501 387 this.interfaces = [];
n@501 388 this.commentBoxPrefix = "Comment on track";
n@501 389 this.audioElements = [];
n@501 390 this.commentQuestions = [];
n@501 391 this.schema = specification.schema.getAllElementsByName("page")[0];
n@501 392
n@501 393 this.decode = function(parent,xml)
n@501 394 {
n@501 395 var attributeMap = this.schema.getAllElementsByTagName('xs:attribute');
n@501 396 for (var i=0; i<attributeMap.length; i++)
n@501 397 {
n@501 398 var attributeName = attributeMap[i].getAttribute('name') || attributeMap[i].getAttribute('ref');
n@501 399 var projectAttr = xml.getAttribute(attributeName);
n@501 400 projectAttr = parent.processAttribute(projectAttr,attributeMap[i]);
n@501 401 switch(typeof projectAttr)
n@501 402 {
n@501 403 case "number":
n@501 404 case "boolean":
n@501 405 eval('this.'+attributeName+' = '+projectAttr);
n@501 406 break;
n@501 407 case "string":
n@501 408 eval('this.'+attributeName+' = "'+projectAttr+'"');
n@501 409 break;
n@501 410 }
n@501 411 }
n@501 412
n@501 413 // Get the Comment Box Prefix
n@501 414 var CBP = xml.getElementsByTagName('commentboxprefix');
n@501 415 if (CBP.length != 0) {
n@501 416 this.commentBoxPrefix = CBP[0].textContent;
n@501 417 }
n@501 418
n@501 419 // Now decode the interfaces
n@501 420 var interfaceNode = xml.getElementsByTagName('interface');
n@501 421 for (var i=0; i<interfaceNode.length; i++)
n@501 422 {
n@501 423 var node = new parent.interfaceNode();
n@501 424 node.decode(this,interfaceNode[i],parent.schema.getAllElementsByName('interface')[1]);
n@501 425 this.interfaces.push(node);
n@501 426 }
n@501 427
n@501 428 // Now process the survey node options
n@501 429 var survey = xml.getElementsByTagName('survey');
n@501 430 var surveySchema = parent.schema.getAllElementsByName('survey')[0];
n@501 431 for (var i in survey) {
n@501 432 if (isNaN(Number(i)) == true){break;}
n@501 433 var location = survey[i].getAttribute('location');
n@501 434 if (location == 'pre' || location == 'before')
n@501 435 {
n@501 436 if (this.preTest != null){this.errors.push("Already a pre/before test survey defined! Ignoring second!!");}
n@501 437 else {
n@501 438 this.preTest = new parent.surveyNode();
n@501 439 this.preTest.decode(parent,survey[i],surveySchema);
n@501 440 }
n@501 441 } else if (location == 'post' || location == 'after') {
n@501 442 if (this.postTest != null){this.errors.push("Already a post/after test survey defined! Ignoring second!!");}
n@501 443 else {
n@501 444 this.postTest = new parent.surveyNode();
n@501 445 this.postTest.decode(parent,survey[i],surveySchema);
n@501 446 }
n@501 447 }
n@501 448 }
n@501 449
n@501 450 // Now process the audioelement tags
n@501 451 var audioElements = xml.getElementsByTagName('audioelement');
n@501 452 for (var i=0; i<audioElements.length; i++)
n@501 453 {
n@501 454 var node = new this.audioElementNode();
n@501 455 node.decode(this,audioElements[i]);
n@501 456 this.audioElements.push(node);
n@501 457 }
n@501 458
n@501 459 // Now decode the commentquestions
n@501 460 var commentQuestions = xml.getElementsByTagName('commentquestion');
n@501 461 for (var i=0; i<commentQuestions.length; i++)
n@501 462 {
n@501 463 var node = new this.commentQuestionNode();
n@501 464 node.decode(parent,commentQuestions[i]);
n@501 465 this.commentQuestions.push(node);
n@501 466 }
n@501 467 };
n@501 468
n@501 469 this.encode = function(root)
n@501 470 {
n@501 471 var AHNode = root.createElement("audioHolder");
n@501 472 AHNode.id = this.id;
n@501 473 AHNode.setAttribute("hostURL",this.hostURL);
n@501 474 AHNode.setAttribute("sampleRate",this.sampleRate);
n@501 475 AHNode.setAttribute("randomiseOrder",this.randomiseOrder);
n@501 476 AHNode.setAttribute("repeatCount",this.repeatCount);
n@501 477 AHNode.setAttribute("loop",this.loop);
n@501 478 AHNode.setAttribute("elementComments",this.elementComments);
n@501 479 if(this.loudness != null) {AHNode.setAttribute("loudness",this.loudness);}
n@501 480 if(this.initialPosition != null) {
n@501 481 AHNode.setAttribute("loudness",this.initialPosition*100);
n@501 482 }
n@501 483 for (var i=0; i<this.interfaces.length; i++)
n@501 484 {
n@501 485 AHNode.appendChild(this.interfaces[i].encode(root));
n@501 486 }
n@501 487
n@501 488 for (var i=0; i<this.audioElements.length; i++) {
n@501 489 AHNode.appendChild(this.audioElements[i].encode(root));
n@501 490 }
n@501 491 // Create <CommentQuestion>
n@501 492 for (var i=0; i<this.commentQuestions.length; i++)
n@501 493 {
n@501 494 AHNode.appendChild(this.commentQuestions[i].exportXML(root));
n@501 495 }
n@501 496
n@501 497 // Create <PreTest>
n@501 498 var AHPreTest = root.createElement("PreTest");
n@501 499 for (var i=0; i<this.preTest.options.length; i++)
n@501 500 {
n@501 501 AHPreTest.appendChild(this.preTest.options[i].exportXML(root));
n@501 502 }
n@501 503
n@501 504 var AHPostTest = root.createElement("PostTest");
n@501 505 for (var i=0; i<this.postTest.options.length; i++)
n@501 506 {
n@501 507 AHPostTest.appendChild(this.postTest.options[i].exportXML(root));
n@501 508 }
n@501 509 AHNode.appendChild(AHPreTest);
n@501 510 AHNode.appendChild(AHPostTest);
n@501 511 return AHNode;
n@501 512 };
n@501 513
n@501 514 this.commentQuestionNode = function() {
n@501 515 this.id = null;
n@501 516 this.type = undefined;
n@501 517 this.options = [];
n@501 518 this.statement = undefined;
n@501 519 this.schema = specification.schema.getAllElementsByName('commentquestion')[0];
n@501 520 this.decode = function(parent,xml)
n@501 521 {
n@501 522 this.id = xml.id;
n@501 523 this.type = xml.getAttribute('type');
n@501 524 this.statement = xml.getElementsByTagName('statement')[0].textContent;
n@501 525 var optNodes = xml.getElementsByTagName('option');
n@501 526 for (var i=0; i<optNodes.length; i++)
n@501 527 {
n@501 528 var optNode = optNodes[i];
n@501 529 this.options.push({
n@501 530 name: optNode.getAttribute('name'),
n@501 531 text: optNode.textContent
n@501 532 });
n@501 533 }
n@501 534 };
n@501 535
n@501 536 this.encode = function(root)
n@501 537 {
n@501 538
n@501 539 };
n@501 540 };
n@501 541
n@501 542 this.audioElementNode = function() {
n@501 543 this.url = null;
n@501 544 this.id = null;
n@501 545 this.parent = null;
n@501 546 this.type = null;
n@501 547 this.marker = false;
n@501 548 this.enforce = false;
n@501 549 this.gain = 1.0;
n@501 550 this.schema = specification.schema.getAllElementsByName('audioelement')[0];;
n@501 551 this.parent = null;
n@501 552 this.decode = function(parent,xml)
n@501 553 {
n@501 554 this.parent = parent;
n@501 555 var attributeMap = this.schema.getAllElementsByTagName('xs:attribute');
n@501 556 for (var i=0; i<attributeMap.length; i++)
n@501 557 {
n@501 558 var attributeName = attributeMap[i].getAttribute('name') || attributeMap[i].getAttribute('ref');
n@501 559 var projectAttr = xml.getAttribute(attributeName);
n@501 560 projectAttr = specification.processAttribute(projectAttr,attributeMap[i]);
n@501 561 switch(typeof projectAttr)
n@501 562 {
n@501 563 case "number":
n@501 564 case "boolean":
n@501 565 eval('this.'+attributeName+' = '+projectAttr);
n@501 566 break;
n@501 567 case "string":
n@501 568 eval('this.'+attributeName+' = "'+projectAttr+'"');
n@501 569 break;
n@501 570 }
n@501 571 }
n@501 572
n@501 573 };
n@501 574 this.encode = function(root)
n@501 575 {
n@501 576 var AENode = root.createElement("audioElements");
n@501 577 AENode.id = this.id;
n@501 578 AENode.setAttribute("url",this.url);
n@501 579 AENode.setAttribute("type",this.type);
n@501 580 AENode.setAttribute("gain",linearToDecibel(this.gain));
n@501 581 if (this.marker != false)
n@501 582 {
n@501 583 AENode.setAttribute("marker",this.marker*100);
n@501 584 }
n@501 585 return AENode;
n@501 586 };
n@501 587 };
n@501 588 };
n@501 589 }
n@501 590 </script>
n@501 591 <script type="text/javascript" src="test_core.js"/>
n@501 592 <script type="text/javascript">
n@501 593
n@501 594 </script>
n@501 595 </head>
n@501 596 <body>
n@501 597 <div id="popupHolder"></div>
n@501 598 <div id="blanket"></div>
n@501 599 <div id="content"></div>
n@501 600 </body>
n@501 601 </html>