Mercurial > hg > webaudioevaluationtool
comparison ape.js @ 135:d769f1623203
Hacky test wait indicator!!
author | Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Thu, 28 May 2015 18:58:45 +0100 |
parents | 2e8500c4df02 |
children | c849dcbe71aa |
comparison
equal
deleted
inserted
replaced
133:2e8500c4df02 | 135:d769f1623203 |
---|---|
20 var height = window.innerHeight; | 20 var height = window.innerHeight; |
21 | 21 |
22 // The injection point into the HTML page | 22 // The injection point into the HTML page |
23 var insertPoint = document.getElementById("topLevelBody"); | 23 var insertPoint = document.getElementById("topLevelBody"); |
24 var testContent = document.createElement('div'); | 24 var testContent = document.createElement('div'); |
25 | |
25 testContent.id = 'testContent'; | 26 testContent.id = 'testContent'; |
26 | 27 |
27 | 28 |
28 // Decode parts of the xmlDoc that are needed | 29 // Decode parts of the xmlDoc that are needed |
29 // xmlDoc MUST already be parsed by jQuery! | 30 // xmlDoc MUST already be parsed by jQuery! |
262 insertPoint.appendChild(testContent); | 263 insertPoint.appendChild(testContent); |
263 | 264 |
264 // Load the full interface | 265 // Load the full interface |
265 testState.initialise(); | 266 testState.initialise(); |
266 testState.advanceState(); | 267 testState.advanceState(); |
268 | |
269 testWaitIndicator(); | |
267 } | 270 } |
268 | 271 |
269 function loadTest(textXML) | 272 function loadTest(textXML) |
270 { | 273 { |
271 | 274 |
441 | 444 |
442 // Onclick, switch playback to that track | 445 // Onclick, switch playback to that track |
443 trackSliderObj.onclick = function() { | 446 trackSliderObj.onclick = function() { |
444 // Start the test on first click, that way timings are more accurate. | 447 // Start the test on first click, that way timings are more accurate. |
445 audioEngineContext.play(); | 448 audioEngineContext.play(); |
446 // Get the track ID from the object ID | 449 if (audioEngineContext.audioObjectsReady) { |
447 var id = Number(this.id.substr(13,2)); // Maximum theoretical tracks is 99! | 450 // Cannot continue to issue play command until audioObjects reported as ready! |
448 //audioEngineContext.metric.sliderPlayed(id); | 451 // Get the track ID from the object ID |
449 audioEngineContext.selectedTrack(id); | 452 var id = Number(this.id.substr(13,2)); // Maximum theoretical tracks is 99! |
450 // Currently playing track red, rest green | 453 //audioEngineContext.metric.sliderPlayed(id); |
451 document.getElementById('track-slider-'+index).style.backgroundColor = "#FF0000"; | 454 audioEngineContext.selectedTrack(id); |
452 for (var i = 0; i<$(currentTrackOrder).length; i++) | 455 // Currently playing track red, rest green |
453 { | 456 document.getElementById('track-slider-'+index).style.backgroundColor = "#FF0000"; |
454 if (i!=index) // Make all other sliders green | 457 for (var i = 0; i<$(currentTrackOrder).length; i++) |
455 { | 458 { |
456 document.getElementById('track-slider-'+i).style.backgroundColor = "rgb(100,200,100)"; | 459 if (i!=index) // Make all other sliders green |
457 } | 460 { |
458 | 461 document.getElementById('track-slider-'+i).style.backgroundColor = "rgb(100,200,100)"; |
459 } | 462 } |
463 | |
464 } | |
465 } | |
460 }; | 466 }; |
461 | 467 |
462 canvas.appendChild(trackSliderObj); | 468 canvas.appendChild(trackSliderObj); |
463 | 469 |
464 }); | 470 }); |