Mercurial > hg > webaudioevaluationtool
diff core.js @ 762:01c026742e1e
MUSHRA: Checks enabled. MUSHRA & APE: Warning if check not supported. Core: checkMoved and checkPlayed now in interface and available to all interfaces.
author | Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Thu, 17 Dec 2015 17:09:40 +0000 |
parents | 801e1977ab55 |
children | 43801b3d6131 |
line wrap: on
line diff
--- a/core.js Thu Dec 17 16:48:08 2015 +0000 +++ b/core.js Thu Dec 17 17:09:40 2015 +0000 @@ -2819,4 +2819,64 @@ alert(str_start); } }; + this.checkAllMoved = function() + { + var str = "You have not moved "; + var failed = []; + for (var i in audioEngineContext.audioObjects) + { + if(audioEngineContext.audioObjects[i].metric.wasMoved == false) + { + failed.push(audioEngineContext.audioObjects[i].id); + } + } + if (failed.length == 0) + { + return true; + } else if (failed.length == 1) + { + str += 'track '+failed[0]; + } else { + str += 'tracks '; + for (var i=0; i<failed.length-1; i++) + { + str += failed[i]+', '; + } + str += 'and '+failed[i]; + } + str +='.'; + alert(str); + console.log(str); + return false; + }; + this.checkAllPlayed = function() + { + var str = "You have not played "; + var failed = []; + for (var i in audioEngineContext.audioObjects) + { + if(audioEngineContext.audioObjects[i].metric.wasListenedTo == false) + { + failed.push(audioEngineContext.audioObjects[i].id); + } + } + if (failed.length == 0) + { + return true; + } else if (failed.length == 1) + { + str += 'track '+failed[0]; + } else { + str += 'tracks '; + for (var i=0; i<failed.length-1; i++) + { + str += failed[i]+', '; + } + str += 'and '+failed[i]; + } + str +='.'; + alert(str); + console.log(str); + return false; + }; } \ No newline at end of file