Mercurial > hg > webaudioevaluationtool
comparison ape.js @ 210:7658d51a9ccb Dev_main
Fix for Bug #1273
author | Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Tue, 16 Jun 2015 14:34:50 +0100 |
parents | 538322113524 |
children | 5d251b4aabd6 |
comparison
equal
deleted
inserted
replaced
209:538322113524 | 210:7658d51a9ccb |
---|---|
300 // Start the test on first click, that way timings are more accurate. | 300 // Start the test on first click, that way timings are more accurate. |
301 audioEngineContext.play(); | 301 audioEngineContext.play(); |
302 if (audioEngineContext.audioObjectsReady) { | 302 if (audioEngineContext.audioObjectsReady) { |
303 // Cannot continue to issue play command until audioObjects reported as ready! | 303 // Cannot continue to issue play command until audioObjects reported as ready! |
304 // Get the track ID from the object ID | 304 // Get the track ID from the object ID |
305 var id = Number(event.srcElement.attributes['trackIndex'].value); | 305 var element; |
306 if (event.srcElement.nodeName == "SPAN") { | |
307 element = event.srcElement.parentNode; | |
308 } else { | |
309 element = event.srcElement; | |
310 } | |
311 var id = Number(element.attributes['trackIndex'].value); | |
306 //audioEngineContext.metric.sliderPlayed(id); | 312 //audioEngineContext.metric.sliderPlayed(id); |
307 audioEngineContext.play(id); | 313 audioEngineContext.play(id); |
308 // Currently playing track red, rest green | 314 // Currently playing track red, rest green |
309 | 315 |
310 //document.getElementById('track-slider-'+index).style.backgroundColor = "#FF0000"; | 316 //document.getElementById('track-slider-'+index).style.backgroundColor = "#FF0000"; |
311 $('.track-slider').removeClass('track-slider-playing'); | 317 $('.track-slider').removeClass('track-slider-playing'); |
312 $(event.srcElement).addClass('track-slider-playing'); | 318 $(element).addClass('track-slider-playing'); |
313 $('.comment-div').removeClass('comment-box-playing'); | 319 $('.comment-div').removeClass('comment-box-playing'); |
314 $('#comment-div-'+id).addClass('comment-box-playing'); | 320 $('#comment-div-'+id).addClass('comment-box-playing'); |
315 } | 321 } |
316 }; | 322 }; |
317 | 323 |