# HG changeset patch # User Nicholas Jillings # Date 1434462704 -3600 # Node ID b5cb42422f4a62e128260853db22621008f52647 # Parent 43dc4a1c3adfc335cd47702d440f6360247f02c0# Parent 5d251b4aabd61495da1daf272bbaba0a06e9b519 Merge into main for bug fixes diff -r 43dc4a1c3adf -r b5cb42422f4a ape.js --- a/ape.js Mon Jun 15 19:03:08 2015 +0100 +++ b/ape.js Tue Jun 16 14:51:44 2015 +0100 @@ -176,6 +176,11 @@ feedbackHolder.innerHTML = null; canvas.innerHTML = null; + var playbackHolder = document.createElement('div'); + playbackHolder.style.width = "100%"; + playbackHolder.align = 'center'; + playbackHolder.appendChild(interfaceContext.playhead.object); + feedbackHolder.appendChild(playbackHolder); // Setup question title var interfaceObj = audioHolderObject.interfaces; var commentBoxPrefix = "Comment on track"; @@ -222,30 +227,9 @@ audioEngineContext.loopPlayback = loopPlayback; // Create AudioEngine bindings for playback - if (loopPlayback) { - audioEngineContext.selectedTrack = function(id) { - for (var i=0; i 0) { + var time = this.playbackObject.getCurrentPosition(); + var width = 490; + var pix = Math.floor(time/this.timePerPixel); + this.scrubberHead.style.left = pix+'px'; + if (this.maxTime > 60.0) { + var secs = time%60; + var mins = Math.floor((time-secs)/60); + secs = secs.toString(); + secs = secs.substr(0,2); + mins = mins.toString(); + this.curTimeSpan.textContent = mins+':'+secs; + } else { + time = time.toString(); + this.curTimeSpan.textContent = time.substr(0,4); + } + } + }; + + this.interval = undefined; + + this.start = function() { + if (this.playbackObject != undefined && this.interval == undefined) { + this.interval = setInterval(function(){interfaceContext.playhead.update();},100); + } + }; + this.stop = function() { + clearInterval(this.interval); + this.interval = undefined; + }; + }; }