comparison interfaces/mushra.js @ 1183:489910f8d539

Small MUSHRA bug fix. Playback was blocked from ever happening due to play getting called twice.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Mon, 15 Feb 2016 12:52:55 +0000
parents efe50b9d1d14
children a4ad9e55b5b8
comparison
equal deleted inserted replaced
1182:b7bf91ac6d01 1183:489910f8d539
272 this.play.setAttribute("playstate","ready"); 272 this.play.setAttribute("playstate","ready");
273 this.play.onclick = function(event) 273 this.play.onclick = function(event)
274 { 274 {
275 var id = Number(event.currentTarget.value); 275 var id = Number(event.currentTarget.value);
276 //audioEngineContext.metric.sliderPlayed(id); 276 //audioEngineContext.metric.sliderPlayed(id);
277 audioEngineContext.play(id);
278 if (event.currentTarget.getAttribute("playstate") == "ready") 277 if (event.currentTarget.getAttribute("playstate") == "ready")
279 {audioEngineContext.play(id);} 278 {audioEngineContext.play(id);}
280 else if (event.currentTarget.getAttribute("playstate") == "playing") 279 else if (event.currentTarget.getAttribute("playstate") == "playing")
281 {audioEngineContext.stop();} 280 {audioEngineContext.stop();}
282 }; 281 };
301 $(this.holder).addClass('track-slider-playing'); 300 $(this.holder).addClass('track-slider-playing');
302 var outsideReference = document.getElementById('outside-reference'); 301 var outsideReference = document.getElementById('outside-reference');
303 if (outsideReference != null) { 302 if (outsideReference != null) {
304 $(outsideReference).removeClass('track-slider-playing'); 303 $(outsideReference).removeClass('track-slider-playing');
305 } 304 }
305 this.play.textContent = "Stop";
306 }; 306 };
307 this.stopPlayback = function() 307 this.stopPlayback = function()
308 { 308 {
309 // Called when playback has stopped. This gets called even if playback never started! 309 // Called when playback has stopped. This gets called even if playback never started!
310 this.play.setAttribute("playstate","ready"); 310 this.play.setAttribute("playstate","ready");
311 $(this.holder).removeClass('track-slider-playing'); 311 $(this.holder).removeClass('track-slider-playing');
312 this.play.textContent = "Play";
312 }; 313 };
313 this.getValue = function() { 314 this.getValue = function() {
314 return this.slider.value; 315 return this.slider.value;
315 }; 316 };
316 317