# HG changeset patch # User Nicholas Jillings # Date 1449512772 0 # Node ID d07bc42a716c628599f61ff7cbb385585d5cc74d # Parent b1a5d3a0a41fe2baf1673f6131efdbe48601712f Buffers loaded into a pool and picked when needed. diff -r b1a5d3a0a41f -r d07bc42a716c ape.js --- a/ape.js Mon Dec 07 16:11:30 2015 +0100 +++ b/ape.js Mon Dec 07 18:26:12 2015 +0000 @@ -404,6 +404,10 @@ // Create a slider per track audioObject.interfaceDOM = new sliderObject(audioObject); + if (audioObject.state == 1) + { + audioObject.interfaceDOM.enable(); + } // Distribute it randomnly var w = window.innerWidth - (offset+8)*2; diff -r b1a5d3a0a41f -r d07bc42a716c core.js --- a/core.js Mon Dec 07 16:11:30 2015 +0100 +++ b/core.js Mon Dec 07 18:26:12 2015 +0000 @@ -40,6 +40,8 @@ // Create the interface object interfaceContext = new Interface(specification); + // Define window callbacks for interface + window.onresize = function(event){interfaceContext.resizeWindow(event);}; }; function loadProjectSpec(url) { @@ -64,19 +66,6 @@ // Build the specification specification.decode(projectXML); - // Create the audio engine object - audioEngineContext = new AudioEngine(specification); - - testState.stateMap.push(specification.preTest); - - $(specification.audioHolders).each(function(index,elem){ - testState.stateMap.push(elem); - }); - - testState.stateMap.push(specification.postTest); - - - // Detect the interface to use and load the relevant javascripts. var interfaceJS = document.createElement('script'); interfaceJS.setAttribute("type","text/javascript"); @@ -104,8 +93,33 @@ } document.getElementsByTagName("head")[0].appendChild(interfaceJS); - // Define window callbacks for interface - window.onresize = function(event){interfaceContext.resizeWindow(event);}; + // Create the audio engine object + audioEngineContext = new AudioEngine(specification); + + testState.stateMap.push(specification.preTest); + + $(specification.audioHolders).each(function(index,elem){ + testState.stateMap.push(elem); + $(elem.audioElements).each(function(i,audioElem){ + var URL = audioElem.parent.hostURL + audioElem.url; + var buffer = null; + for (var i=0; i