comparison ape.js @ 110:94b91d63e286

Possible fix for Bug #1238. audioObject metric collection now controlled by the audioObjects themselves for timer information. Lastclicked and sliderPlayed functions no longer used.
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Sun, 24 May 2015 11:33:04 +0100
parents b260edc72d1c
children 4d8846186db4
comparison
equal deleted inserted replaced
109:b260edc72d1c 110:94b91d63e286
261 261
262 } 262 }
263 263
264 function loadTest(id) 264 function loadTest(id)
265 { 265 {
266
267 // Reset audioEngineContext.Metric globals for new test
268 audioEngineContext.metric.lastClicked = -1;
269 audioEngineContext.metric.data = -1;
270
266 // Used to load a specific test page 271 // Used to load a specific test page
267 var textXML = testXMLSetups[id]; 272 var textXML = testXMLSetups[id];
268 273
269 var feedbackHolder = document.getElementById('feedbackHolder'); 274 var feedbackHolder = document.getElementById('feedbackHolder');
270 var canvas = document.getElementById('slider'); 275 var canvas = document.getElementById('slider');
331 } 336 }
332 } else { 337 } else {
333 loopPlayback = false; 338 loopPlayback = false;
334 } 339 }
335 audioEngineContext.loopPlayback = loopPlayback; 340 audioEngineContext.loopPlayback = loopPlayback;
336 341 loopPlayback = false;
337 // Create AudioEngine bindings for playback 342 // Create AudioEngine bindings for playback
338 if (loopPlayback) { 343 if (loopPlayback) {
339 audioEngineContext.play = function() { 344 audioEngineContext.play = function() {
340 // Send play command to all playback buffers for synchronised start 345 // Send play command to all playback buffers for synchronised start
341 // Also start timer callbacks to detect if playback has finished 346 // Also start timer callbacks to detect if playback has finished
489 trackSliderObj.onclick = function() { 494 trackSliderObj.onclick = function() {
490 // Start the test on first click, that way timings are more accurate. 495 // Start the test on first click, that way timings are more accurate.
491 audioEngineContext.play(); 496 audioEngineContext.play();
492 // Get the track ID from the object ID 497 // Get the track ID from the object ID
493 var id = Number(this.id.substr(13,2)); // Maximum theoretical tracks is 99! 498 var id = Number(this.id.substr(13,2)); // Maximum theoretical tracks is 99!
494 audioEngineContext.metric.sliderPlayed(id); 499 //audioEngineContext.metric.sliderPlayed(id);
495 audioEngineContext.selectedTrack(id); 500 audioEngineContext.selectedTrack(id);
496 // Currently playing track red, rest green 501 // Currently playing track red, rest green
497 document.getElementById('track-slider-'+index).style.backgroundColor = "#FF0000"; 502 document.getElementById('track-slider-'+index).style.backgroundColor = "#FF0000";
498 for (var i = 0; i<$(currentTrackOrder).length; i++) 503 for (var i = 0; i<$(currentTrackOrder).length; i++)
499 { 504 {