# HG changeset patch # User Drew Perttula # Date 2016-06-07 08:16:22 # Node ID 6b5e079b3dbe7824a9a3ce1dc19d86eecaea8207 # Parent e32eee8497665074377620183226896782259c97 timeline hover goes to vidref Ignore-this: 2ef2fa1b7bdff1bd2755689889385ea2 diff --git a/bin/vidref b/bin/vidref --- a/bin/vidref +++ b/bin/vidref @@ -50,6 +50,16 @@ class Snapshot(cyclone.web.RequestHandle class SnapshotPic(cyclone.web.StaticFileHandler): pass + +class Time(cyclone.web.RequestHandler): + def put(self): + body = json.loads(self.request.body) + t = body['t'] + source = body['source'] + self.settings.gui.incomingTime(t, source) + self.set_status(202) + + graph = SyncedGraph(networking.rdfdb.url, "vidref") gui = Gui(graph) @@ -60,6 +70,7 @@ reactor.listenTCP(port, cyclone.web.Appl {'path': 'light9/vidref', 'default_filename': 'vidref.html'}), (r'/snapshot', Snapshot), (r'/snapshot/(.*)', SnapshotPic, {"path": snapshotDir()}), + (r'/time', Time), ], debug=True, gui=gui)) log.info("serving on %s" % port) diff --git a/light9/vidref/main.py b/light9/vidref/main.py --- a/light9/vidref/main.py +++ b/light9/vidref/main.py @@ -106,3 +106,6 @@ class Gui(object): it back to music player""" if not self.ignoreScaleChanges: self.musicTime.sendTime(scaleRange.get_value()) + + def incomingTime(self, t, source): + self.musicTime.lastHoverTime = t diff --git a/light9/vidref/musictime.py b/light9/vidref/musictime.py --- a/light9/vidref/musictime.py +++ b/light9/vidref/musictime.py @@ -27,6 +27,7 @@ class MusicTime(object): self.musicResource = restkit.Resource(networking.musicPlayer.url) self.position = {} + # driven by our pollCurvecalcTime and also by Gui.incomingTime self.lastHoverTime = None # None means "no recent value" self.pollMusicTime() self.pollCurvecalcTime() @@ -106,7 +107,8 @@ class MusicTime(object): reactor.callLater(self.hoverPeriod, self.pollCurvecalcTime) def eb(err): - log.warn("talking to curveCalc: %s", err.getErrorMessage()) + if self.lastHoverTime: + log.warn("talking to curveCalc: %s", err.getErrorMessage()) self.lastHoverTime = None reactor.callLater(2, self.pollCurvecalcTime) diff --git a/light9/web/timeline-elements.html b/light9/web/timeline-elements.html --- a/light9/web/timeline-elements.html +++ b/light9/web/timeline-elements.html @@ -1,6 +1,7 @@ + @@ -42,6 +43,7 @@
[[debug]]
+ @zoomInX.invert(@viewState.mouse.pos().e(1))