# HG changeset patch # User Nicholas Jillings # Date 1450359263 0 # Node ID 46acb0963059b703c6f1abf08a67fabfc8bc1874 # Parent c73996a0fb21282e521d4afd9088afbaf8892d72 MUSHRA fixes. Added some mushra features to match newer APE interfaces and core bindings. diff -r c73996a0fb21 -r 46acb0963059 core.js --- a/core.js Thu Dec 17 13:03:39 2015 +0000 +++ b/core.js Thu Dec 17 13:34:23 2015 +0000 @@ -1114,7 +1114,7 @@ if (this.specification.type != 'outsidereference') { var interfaceXML = this.interfaceDOM.exportXMLDOM(this); if (interfaceXML.length == undefined) { - root.appendChild(); + root.appendChild(interfaceXML); } else { for (var i=0; i 1) + { + console.log("WARNING - This interface only supports one node per page. Using first interface node"); + } var sliderBox = document.getElementById('slider'); feedbackHolder.innerHTML = null; @@ -171,12 +175,11 @@ this.title.style.float = "left"; this.slider.type = "range"; + this.slider.className = "track-slider-range"; this.slider.min = "0"; this.slider.max = "1"; this.slider.step = "0.01"; this.slider.setAttribute('orient','vertical'); - this.slider.style.float = "left"; - this.slider.style.width = "100%"; this.slider.style.height = window.innerHeight-250 + 'px'; this.slider.onchange = function() { @@ -190,21 +193,19 @@ this.play.value = audioObject.id; this.play.style.float = "left"; this.play.style.width = "100%"; - this.play.onclick = function() + this.play.disabled = true; + this.play.onclick = function(event) { - audioEngineContext.play(); - if (audioEngineContext.audioObjectsReady) { - var id = Number(event.srcElement.value); - //audioEngineContext.metric.sliderPlayed(id); - audioEngineContext.play(id); - } + var id = Number(event.srcElement.value); + //audioEngineContext.metric.sliderPlayed(id); + audioEngineContext.play(id); + $(".track-slider").removeClass('track-slider-playing'); + $(event.currentTarget.parentElement).addClass('track-slider-playing'); }; this.enable = function() { - if (this.parent.state == 1) - { - $(this.slider).removeClass('track-slider-disabled'); - } + this.play.disabled = false; + $(this.slider).removeClass('track-slider-disabled'); }; this.exportXMLDOM = function(audioObject) { @@ -216,6 +217,11 @@ this.getValue = function() { return this.slider.value; }; + + if (this.parent.state == 1) + { + this.enable(); + } }