Mercurial > code > home > repos > light9
view flax/MusicTime.py @ 168:f8b5cb5fbeed
- CueFader is hopefully done:
- CueFader is hopefully done:
- The TimedGoButton accepts a wheel to change the times. You can also
enter times directly.
- TimedGoButton really has a default starting time of 2 now. (there was
a variable attached to the wrong widget before)
- We send DMX levels with dmxclient now.
- Autoload Times is a new option.
- We load times from the next cue if Autoload Times is true.
- Time predictions in the LabelledScale are slightly better. You still
can change the time of an active fade.
- Cue cache and DMX level computing now have their own functions, which
get called at (hopefully) All The Right Times.
- There are even some docs now!
- Cues: sub_level parsing is better, will only throw out one line if
it encounters problems (instead of the rest of the cue)
- CueList: lots of 0 vs. None bugs fixed.
- TkCueList: stores a reference to the controlling fader so it can alert
it about changed cues.
- CueEditron: You can edit sub_levels now.
- cuelist1 was edited, checking it in for consistency's sake
author | dmcc |
---|---|
date | Wed, 09 Jul 2003 03:59:40 +0000 |
parents | 45b12307c695 |
children | 3905d3c92aaa |
line wrap: on
line source
import Tkinter as tk import xmlrpclib, socket, time class MusicTime: def __init__(self, server, port): self.player = xmlrpclib.Server("http://%s:%d" % (server, port)) def get_music_time(self): playtime = None while not playtime: try: playtime = self.player.gettime() except socket.error, e: print "Server error %s, waiting" % e time.sleep(2) return playtime class MusicTimeTk(tk.Frame, MusicTime): def __init__(self, master, server, port): tk.Frame.__init__(self) MusicTime.__init__(self, server, port) self.timevar = tk.DoubleVar() self.timelabel = tk.Label(self, textvariable=self.timevar, bd=2, relief='raised', width=10, padx=2, pady=2, anchor='w') self.timelabel.pack(expand=1, fill='both') def print_time(evt, *args): self.update_time() print self.timevar.get(), evt.keysym self.timelabel.bind('<KeyPress>', print_time) self.timelabel.bind('<1>', print_time) self.timelabel.focus() self.update_time() def update_time(self): self.timevar.set(self.get_music_time()) self.after(100, self.update_time) if __name__ == "__main__": from optik import OptionParser parser = OptionParser() parser.add_option("-s", "--server", default='dash') parser.add_option("-p", "--port", default=8040, type='int') options, args = parser.parse_args() root = tk.Tk() root.title("Time") MusicTimeTk(root, options.server, options.port).pack(expand=1, fill='both') try: tk.mainloop() except KeyboardInterrupt: root.destroy()