Changeset - 6b5e079b3dbe
[Not reviewed]
default
0 5 0
Drew Perttula - 9 years ago 2016-06-07 08:16:22
drewp@bigasterisk.com
timeline hover goes to vidref
Ignore-this: 2ef2fa1b7bdff1bd2755689889385ea2
5 files changed with 25 insertions and 1 deletions:
0 comments (0 inline, 0 general)
bin/vidref
Show inline comments
 
@@ -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)
 

	
light9/vidref/main.py
Show inline comments
 
@@ -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
light9/vidref/musictime.py
Show inline comments
 
@@ -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)
 

	
light9/web/timeline-elements.html
Show inline comments
 
<link rel="import" href="/lib/polymer/polymer.html">
 
<link rel="import" href="light9-timeline-audio.html">
 
<link rel="import" href="/lib/iron-resizable-behavior/iron-resizable-behavior.html">
 
<link rel="import" href="/lib/iron-ajax/iron-ajax.html">
 
<link rel="import" href="rdfdb-synced-graph.html">
 
<link rel="import" href="light9-music.html">
 

	
 
@@ -42,6 +43,7 @@
 
      <label><input type="checkbox"> follow player song choice</label>
 
    </div>
 
    <div>[[debug]]</div>
 
    <iron-ajax id="vidrefTime" url="/vidref/time" method="PUT" content-type="application/json"></iron-ajax>
 
    <light9-timeline-audio id="audio"
 
                           graph="{{graph}}"
 
                           show="{{show}}"
light9/web/timeline.coffee
Show inline comments
 
@@ -77,6 +77,12 @@ Polymer
 

	
 
        @$.dia.setMouse(@viewState.mouse.pos())
 

	
 
        now = Date.now()
 
        if (!@$.vidrefLastSent? || @$.vidrefLastSent < now - 200) && !@songPlaying
 
          @$.vidrefTime.body = {t: @latestMouseTime(), source: 'timeline'}
 
          @$.vidrefTime.generateRequest()
 
          @$.vidrefLastSent = now
 

	
 
  latestMouseTime: ->
 
    @zoomInX.invert(@viewState.mouse.pos().e(1))
 

	
0 comments (0 inline, 0 general)