Mercurial > code > home > repos > light9
annotate light8/rsn.py @ 121:2f48cb9219ed
now does a little show, with two fades
author | drewp |
---|---|
date | Fri, 13 Jun 2003 14:01:07 +0000 |
parents | c071ada6ae2b |
children | fae7751d9760 |
rev | line source |
---|---|
117 | 1 #!/usr/bin/python |
0 | 2 from __future__ import nested_scopes |
3 | |
51
71489bb71528
- Meet Fader. He is going to grow up and be a crossfader some day
dmcc
parents:
49
diff
changeset
|
4 from Tix import * |
35
3cbe7110d8f7
cleanup imports, fix backwards colors in changing level direction
dmcc
parents:
34
diff
changeset
|
5 from signal import signal, SIGINT |
12
7adc65771676
big restructuring - moved lots of things (including most panels) to other files
drewp
parents:
4
diff
changeset
|
6 from uihelpers import * |
51
71489bb71528
- Meet Fader. He is going to grow up and be a crossfader some day
dmcc
parents:
49
diff
changeset
|
7 from Fader import Fader |
56
2af6698b0566
pulled Lightboard out of rsn.py (and fixed all the dependency problems i could find)
drewp
parents:
54
diff
changeset
|
8 from Lightboard import Lightboard |
2af6698b0566
pulled Lightboard out of rsn.py (and fixed all the dependency problems i could find)
drewp
parents:
54
diff
changeset
|
9 |
0 | 10 if len(sys.argv) >= 2: |
11 DUMMY = 0 | |
102 | 12 print "Light 8.8: This is the real thing, baby" |
0 | 13 window_title = "Light 8.8 (On Air)" |
14 else: | |
15 DUMMY = 1 | |
102 | 16 print "Light 8.8: Dummy mode" |
0 | 17 window_title = "Light 8.8 (Bogus)" |
18 | |
19 root = Tk() | |
20 root.wm_title(window_title) | |
30
e9d2e7754fd9
sideways subs, new x/y buttons (which don't draw right, but they work)
drewp
parents:
29
diff
changeset
|
21 root.wm_geometry('+462+470') |
19 | 22 root.tk_focusFollowsMouse() |
4 | 23 |
102 | 24 |
81
70bd142d72c2
added a SerialPot io object and made the IO code much more elegant (in io.py)
drewp
parents:
69
diff
changeset
|
25 if not DUMMY: |
70bd142d72c2
added a SerialPot io object and made the IO code much more elegant (in io.py)
drewp
parents:
69
diff
changeset
|
26 # this turns the parportdmx from dummy to live |
102 | 27 print "Light 8.8: Preparing DMX interface..." |
81
70bd142d72c2
added a SerialPot io object and made the IO code much more elegant (in io.py)
drewp
parents:
69
diff
changeset
|
28 parportdmx.golive() |
4 | 29 |
102 | 30 print "Light 8.8: And this...is Mr. Lightboard" |
112
afbdae5e1359
dmx light output is now via a separate process which light8 talks to.
drewp
parents:
102
diff
changeset
|
31 mr_lightboard = Lightboard(root,DUMMY) |
101 | 32 # root.tk_setPalette('gray40') |
4 | 33 |
26 | 34 signal(SIGINT, mr_lightboard.quit) |
59
001646cd5349
all mousewheel events everywhere will now pass up the tree to be caught by
drewp
parents:
57
diff
changeset
|
35 |
90
d34a4956417a
rsn has a separate thread that receives rlslider connections from a potserver.py process,
drewp
parents:
81
diff
changeset
|
36 # |
d34a4956417a
rsn has a separate thread that receives rlslider connections from a potserver.py process,
drewp
parents:
81
diff
changeset
|
37 # start net slider server in separate thread |
d34a4956417a
rsn has a separate thread that receives rlslider connections from a potserver.py process,
drewp
parents:
81
diff
changeset
|
38 # |
102 | 39 print "Light 8.8: External input server spawned" |
90
d34a4956417a
rsn has a separate thread that receives rlslider connections from a potserver.py process,
drewp
parents:
81
diff
changeset
|
40 import ExternalInput, thread |
d34a4956417a
rsn has a separate thread that receives rlslider connections from a potserver.py process,
drewp
parents:
81
diff
changeset
|
41 thread.start_new_thread(ExternalInput.start_server,()) |
d34a4956417a
rsn has a separate thread that receives rlslider connections from a potserver.py process,
drewp
parents:
81
diff
changeset
|
42 |
26 | 43 bindkeys(root,'<Escape>', mr_lightboard.quit) |
4 | 44 |
59
001646cd5349
all mousewheel events everywhere will now pass up the tree to be caught by
drewp
parents:
57
diff
changeset
|
45 root.bind_class("all","<ButtonPress-4>",lambda ev: eventtoparent(ev,"<ButtonPress-4>")) |
001646cd5349
all mousewheel events everywhere will now pass up the tree to be caught by
drewp
parents:
57
diff
changeset
|
46 root.bind_class("all","<ButtonPress-5>",lambda ev: eventtoparent(ev,"<ButtonPress-5>")) |
57 | 47 |
102 | 48 print 'Light 8.8: "Uh...Shiny McShine?"' |
4 | 49 root.mainloop() # Receiver switches main |
57 | 50 |
51 #import profile | |
52 #profile.run("root.mainloop()","profile/idlemanysubs") |