Mercurial > hg > webaudioevaluationtool
changeset 756:46acb0963059
MUSHRA fixes. Added some mushra features to match newer APE interfaces and core bindings.
author | Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Thu, 17 Dec 2015 13:34:23 +0000 |
parents | c73996a0fb21 |
children | 8512c2dbac19 |
files | core.js mushra.css mushra.js |
diffstat | 3 files changed, 34 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- 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<interfaceXML.length; i++) { @@ -2755,7 +2755,7 @@ for (var i = 0; i<audioEngineContext.audioObjects.length; i++) { var object = audioEngineContext.audioObjects[i]; - var time = object.buffer.duration; + var time = object.buffer.buffer.duration; var metric = object.metric; var passed = false; for (var j=0; j<metric.listenTracker.length; j++) @@ -2779,7 +2779,7 @@ } if (check_pass == false) { - var str_start = "You have not listened to fragments "; + var str_start = "You have not completely listened to fragments "; for (var i=0; i<error_obj.length; i++) { str_start += error_obj[i];
--- a/mushra.css Thu Dec 17 13:03:39 2015 +0000 +++ b/mushra.css Thu Dec 17 13:34:23 2015 +0000 @@ -45,11 +45,22 @@ padding:2px; } +div.track-slider-playing { + background-color: #FFDDDD; +} + +input.track-slider-range { + width: 100%; + margin-left: 0px; + margin-right: 0px; + padding-left: 0px; + padding-top: 0px; +} + input[type=range][orient=vertical] { writing-mode: bt-lr; /* IE */ -webkit-appearance: slider-vertical; /* WebKit */ width: 8px; - height: 175px; padding: 0 5px; } \ No newline at end of file
--- a/mushra.js Thu Dec 17 13:03:39 2015 +0000 +++ b/mushra.js Thu Dec 17 13:34:23 2015 +0000 @@ -99,6 +99,10 @@ var feedbackHolder = document.getElementById('feedbackHolder'); var interfaceObj = audioHolderObject.interfaces; + if (interfaceObj.length > 1) + { + console.log("WARNING - This interface only supports one <interface> 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(); + } }