# HG changeset patch # User Nicholas Jillings # Date 1429367770 -3600 # Node ID 086a10f85fde2b444e5a87e7947d5e4b6082893b # Parent 83198a86b3bc77e6469c1c4a32070712dd18f0ee Added Loop diff -r 83198a86b3bc -r 086a10f85fde ape.js --- a/ape.js Fri Apr 17 10:06:20 2015 +0100 +++ b/ape.js Sat Apr 18 15:36:10 2015 +0100 @@ -322,6 +322,99 @@ } } + var loopPlayback = textXML.attributes['loop']; + if (loopPlayback != undefined) + { + loopPlayback = loopPlayback.value; + if (loopPlayback == 'true') { + loopPlayback = true; + } else { + loopPlayback = false; + } + } else { + loopPlayback = false; + } + audioEngineContext.loopPlayback = loopPlayback; + + // Create AudioEngine bindings for playback + if (loopPlayback) { + audioEngineContext.play = function() { + // Send play command to all playback buffers for synchronised start + // Also start timer callbacks to detect if playback has finished + if (this.status == 0) { + this.timer.startTest(); + // First get current clock + var timer = audioContext.currentTime; + // Add 3 seconds + timer += 3.0; + // Send play to all tracks + for (var i=0; ielementFlagMoved - + Example Test Question Min