diff --git a/light9/curvecalc/curvecalc.glade b/light9/curvecalc/curvecalc.glade --- a/light9/curvecalc/curvecalc.glade +++ b/light9/curvecalc/curvecalc.glade @@ -691,7 +691,7 @@ Mousewheel zoom; C-p play/pause music at mouse Over a curve: C to collapse; R to rebuild canvas widget -Curve point bindings: B1 drag point; C-B1 curve add point; S-B1 sketch points; 1..5 add point at time; B1 drag select points +Curve point bindings: B1 drag point; C-B1 curve add point; S-B1 sketch points; 1..5 add point at time cursor; B1 drag select points Available in functions: nsin/ncos period=amp=1; within(a,b) bef(x) aft(x) compare to time; smoove(x) cubic smoothstep; chan(name); curvename(t) eval curve diff --git a/light9/curvecalc/curveview.py b/light9/curvecalc/curveview.py --- a/light9/curvecalc/curveview.py +++ b/light9/curvecalc/curveview.py @@ -111,14 +111,7 @@ class Curveview(object): # print ev.state # self.bind("",curs) # self.bind("",lambda ev: curs(0)) - - if 0: - for x in range(1, 6): - def add_kb_marker_point(evt, x=x): - self.add_point((self.current_time(), (x - 1) / 4.0)) - - self.bind("" % x, add_kb_marker_point) - + # this binds on c-a-b1, etc if 0: self.regionzoom = RegionZoom(self, self.world_from_screen, @@ -148,6 +141,7 @@ class Curveview(object): """ if hasattr(self, 'widget'): self.widget.destroy() + self._time = -999 print "rebuilding canvas" self.timelineLine = self.curveGroup = None @@ -190,16 +184,16 @@ class Curveview(object): print " %s on %s" % (event, w) def onFocusIn(self, *args): - print "focusin", args self.widget.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("red")) def onFocusOut(self, widget=None, event=None): - #if event: - # import pdb;pdb.set_trace() - print "focusout now", event.get_state() if event else 0 + self.widget.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("gray30")) - def onKeyPress(self, *args): - print "canvas key", args + def onKeyPress(self, widget, event): + print "canvas key", event + if event.string in '12345': + x = int(event.string) + self.add_point((self.current_time(), (x - 1) / 4.0)) def onExpose(self, *args): if self.culled: @@ -228,6 +222,9 @@ class Curveview(object): else: self.select_press(event) + # this stops some other handler that wants to unfocus + return True + def playPause(self): """ user has pressed ctrl-p over a curve view, possibly this diff --git a/readme b/readme --- a/readme +++ b/readme @@ -1,6 +1,25 @@ -on dash: +Mini instructions: + +% buildout2.7 + +% export LIGHT9_SHOW=path/to/light9/show/dance2011 + +Edit $LIGHT9_SHOW/config.n3 to set :musicRoot and the values under sh:netHome + +% bin/dmxserver --dummy +(leave that shell) -dash(pts/35):/my/dl/modified/mpd% src/mpd --no-daemon --verbose +% bin/ascoltami2 +(leave that shell) + +Browse to http://localhost:8040/ to see the music player. + +% bin/curvecalc --reload http://light9.bigasterisk.com/show/dance2011/song16 +(gui opens) + +See bin/listsongs for a way to make zsh autocomplete on the last +argument to bin/curvecalc + --------------------------------