# HG changeset patch # User Nicholas Jillings # Date 1434013618 -3600 # Node ID b7f262db988650a703a8f8df2f2181ed779f48e6 # Parent ce1f952a36f39ee17a9ed6792f0f466049e80c51 Feature #1246: Scrubber bar included. Not interactive yet diff -r ce1f952a36f3 -r b7f262db9886 core.js --- a/core.js Thu Jun 11 09:45:52 2015 +0100 +++ b/core.js Thu Jun 11 10:06:58 2015 +0100 @@ -688,7 +688,11 @@ } } if (this.status== 1) { - if (id == undefined) {id = -1;} + if (id == undefined) { + id = -1; + } else { + interfaceContext.playhead.setTimePerPixel(this.audioObjects[id]); + } if (this.loopPlayback) { for (var i=0; i 0) { + var time = this.playbackObject.getCurrentPosition(); var width = 490; - var pix = Math.floor(width*time); + var pix = Math.floor(time/this.timePerPixel); this.scrubberHead.style.left = pix+'px'; if (this.maxTime > 60.0) { var secs = time%60; @@ -1730,6 +1740,18 @@ } } }; + + 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; + }; }; } diff -r ce1f952a36f3 -r b7f262db9886 example_eval/project.xml --- a/example_eval/project.xml Thu Jun 11 09:45:52 2015 +0100 +++ b/example_eval/project.xml Thu Jun 11 10:06:58 2015 +0100 @@ -35,7 +35,7 @@ elementListenTracker - + Example Test Question Min