# HG changeset patch # User dmcc # Date 2003-06-14 16:19:40 # Node ID 83e2c4ceb79a0ba4feb18df722bfc9c38fe5b10c # Parent 304152488ed7058ff0abd7d32f720211adb81589 KeyboardComposer: let's get it working again KeyboardComposer: let's get it working again TheShow: get_timelines method Timeline: it's late, okay? TimelineDMX: timeline selector, basically copied from that music player thing diff --git a/flax/KeyboardComposer.py b/flax/KeyboardComposer.py --- a/flax/KeyboardComposer.py +++ b/flax/KeyboardComposer.py @@ -189,7 +189,7 @@ class KeyboardComposer(Frame): self.after(10, self.send_frequent_updates) def send_levels(self): levels = self.get_dmx_list() - # dmxclient.outputlevels(levels) + dmxclient.outputlevels(levels) # print "sending levels", levels def send_levels_loop(self): self.send_levels() diff --git a/flax/TheShow.py b/flax/TheShow.py --- a/flax/TheShow.py +++ b/flax/TheShow.py @@ -1,5 +1,3 @@ - - from Timeline import * from Submaster import Submasters, sub_maxes @@ -36,6 +34,9 @@ class Show: "set time of current timeline" self.current_time = time self.current_timeline.set_time(time) + def get_timelines(self): + "Get names of all timelines" + return self.timelines.keys() # this is the default blender linear = LinearBlender() diff --git a/flax/Timeline.py b/flax/Timeline.py --- a/flax/Timeline.py +++ b/flax/Timeline.py @@ -168,7 +168,7 @@ class TimelineTrack: """This makes sure all events are in the right order and have defaults filled in if they have missing frames.""" self.events.sort() - self.fill_in_missing frames() + self.fill_in_missing_frames() def add_event(self, event): """Add a TimedEvent object to this TimelineTrack""" self.events.append(event) @@ -188,7 +188,7 @@ class TimelineTrack: self.events = [e for e in self.events if e.time >= starttime and e.time <= endtime] self._cleaup_events(self.events) - def fill_in_missing frames(self): + def fill_in_missing_frames(self): """Runs through all events and sets TimedEvent with missing frames to the default frame.""" for event in self.events: diff --git a/flax/TimelineDMX.py b/flax/TimelineDMX.py --- a/flax/TimelineDMX.py +++ b/flax/TimelineDMX.py @@ -1,27 +1,34 @@ import sys, time, socket sys.path.append("../light8") +import Tix as tk import Patch, Timeline, dmxclient, xmlrpclib import TheShow Patch.reload_data() -class ShowRunner: - def __init__(self, show): +class ShowRunner(tk.Frame): + def __init__(self, master, show): + tk.Frame.__init__(self, master) + self.master = master + self.show = show self.find_player() + self.build_timeline_list() + def build_timeline_list(self): + self.tl_list = tk.Frame(self) + for tl in self.show.get_timelines(): + b=tk.Button(self.tl_list,text=tl, + anchor='w',pady=1) + b.config(command=lambda tl=tl: self.set_timeline(tl)) + b.pack(side='top',fill='x') + self.tl_list.pack() + def set_timeline(self, tlname): + print "TimelineDMX: set timeline to", tlname + self.show.set_timeline(tlname) def find_player(self): self.player = xmlrpclib.Server("http://localhost:8040") def send_levels(self): - """ - sub = self.show.get_levels() # gets levels of subs - leveldict = sub.get_levels() # gets levels of sub contents - print 'resolved levels', leveldict - - levels = [0] * 68 - for k, v in leveldict.items(): - levels[Patch.get_dmx_channel(k)] = v - """ levels = self.show.calc_active_submaster().get_dmx_list() dmxclient.outputlevels(levels) @@ -38,10 +45,13 @@ class ShowRunner: self.sync_times() self.send_levels() time.sleep(0.01) + self.master.update() except KeyboardInterrupt: sys.exit(0) if __name__ == "__main__": - s = ShowRunner(TheShow.show) + root = tk.Tk() + s = ShowRunner(root, TheShow.show) s.show.set_timeline('strobe test') + s.pack() s.mainloop()