Mercurial > code > home > repos > light9
changeset 720:8169d88d4eb4
fix 1..5 keys. add more readme
Ignore-this: a5491a5e6de3facfda724a8b7d730ef8
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Wed, 13 Jun 2012 06:07:27 +0000 |
parents | e2dd0992a195 |
children | 8fddef28d7b9 |
files | light9/curvecalc/curvecalc.glade light9/curvecalc/curveview.py readme |
diffstat | 3 files changed, 33 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/curvecalc/curvecalc.glade Wed Jun 13 05:35:04 2012 +0000 +++ b/light9/curvecalc/curvecalc.glade Wed Jun 13 06:07:27 2012 +0000 @@ -691,7 +691,7 @@ <object class="GtkTextBuffer" id="help"> <property name="text">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</property> </object> <object class="GtkImage" id="image2">
--- a/light9/curvecalc/curveview.py Wed Jun 13 05:35:04 2012 +0000 +++ b/light9/curvecalc/curveview.py Wed Jun 13 06:07:27 2012 +0000 @@ -111,14 +111,7 @@ # print ev.state # self.bind("<KeyPress>",curs) # self.bind("<KeyRelease-Control_L>",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("<Key-%s>" % 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 @@ """ if hasattr(self, 'widget'): self.widget.destroy() + self._time = -999 print "rebuilding canvas" self.timelineLine = self.curveGroup = None @@ -190,16 +184,16 @@ 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 @@ 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
--- a/readme Wed Jun 13 05:35:04 2012 +0000 +++ b/readme Wed Jun 13 06:07:27 2012 +0000 @@ -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 + --------------------------------