Mercurial > hg > webaudioevaluationtool
comparison core.js @ 770:d2a83474a967
Moved common test options into core.JS
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Mon, 07 Dec 2015 11:18:11 +0000 |
parents | 30adbf6a6d50 |
children | 0796d28701ae |
comparison
equal
deleted
inserted
replaced
769:30adbf6a6d50 | 770:d2a83474a967 |
---|---|
456 createProjectSave(specification.projectReturn); | 456 createProjectSave(specification.projectReturn); |
457 } else { | 457 } else { |
458 this.currentStateMap = this.stateMap[this.stateIndex]; | 458 this.currentStateMap = this.stateMap[this.stateIndex]; |
459 if (this.currentStateMap.type == "audioHolder") { | 459 if (this.currentStateMap.type == "audioHolder") { |
460 console.log('Loading test page'); | 460 console.log('Loading test page'); |
461 loadTest(this.currentStateMap); | 461 interfaceContext.newPage(this.currentStateMap); |
462 this.initialiseInnerState(this.currentStateMap); | 462 this.initialiseInnerState(this.currentStateMap); |
463 } else if (this.currentStateMap.type == "pretest" || this.currentStateMap.type == "posttest") { | 463 } else if (this.currentStateMap.type == "pretest" || this.currentStateMap.type == "posttest") { |
464 if (this.currentStateMap.options.length >= 1) { | 464 if (this.currentStateMap.options.length >= 1) { |
465 popup.initState(this.currentStateMap); | 465 popup.initState(this.currentStateMap); |
466 } else { | 466 } else { |
1998 function Interface(specificationObject) { | 1998 function Interface(specificationObject) { |
1999 // This handles the bindings between the interface and the audioEngineContext; | 1999 // This handles the bindings between the interface and the audioEngineContext; |
2000 this.specification = specificationObject; | 2000 this.specification = specificationObject; |
2001 this.insertPoint = document.getElementById("topLevelBody"); | 2001 this.insertPoint = document.getElementById("topLevelBody"); |
2002 | 2002 |
2003 this.newPage = function(audioHolderObject) | |
2004 { | |
2005 audioEngineContext.newTestPage(); | |
2006 /// CHECK FOR SAMPLE RATE COMPATIBILITY | |
2007 if (audioHolderObject.sampleRate != undefined) { | |
2008 if (Number(audioHolderObject.sampleRate) != audioContext.sampleRate) { | |
2009 var errStr = 'Sample rates do not match! Requested '+Number(audioHolderObject.sampleRate)+', got '+audioContext.sampleRate+'. Please set the sample rate to match before completing this test.'; | |
2010 alert(errStr); | |
2011 return; | |
2012 } | |
2013 } | |
2014 | |
2015 audioEngineContext.loopPlayback = audioHolderObject.loop; | |
2016 // Delete any previous audioObjects associated with the audioEngine | |
2017 audioEngineContext.audioObjects = []; | |
2018 interfaceContext.deleteCommentBoxes(); | |
2019 interfaceContext.deleteCommentQuestions(); | |
2020 loadTest(audioHolderObject); | |
2021 }; | |
2022 | |
2003 // Bounded by interface!! | 2023 // Bounded by interface!! |
2004 // Interface object MUST have an exportXMLDOM method which returns the various DOM levels | 2024 // Interface object MUST have an exportXMLDOM method which returns the various DOM levels |
2005 // For example, APE returns the slider position normalised in a <value> tag. | 2025 // For example, APE returns the slider position normalised in a <value> tag. |
2006 this.interfaceObjects = []; | 2026 this.interfaceObjects = []; |
2007 this.interfaceObject = function(){}; | 2027 this.interfaceObject = function(){}; |