# HG changeset patch # User Nicholas Jillings # Date 1429367770 -3600 # Node ID ab56aa2fe06451629ce088cf2a718b3b097f9bea # Parent d7bdfe8bf67ec7989f715e98487ba8eeb928e117 Added Loop diff -r d7bdfe8bf67e -r ab56aa2fe064 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