Mercurial > code > home > repos > light9
annotate light8/Patch.py @ 167:79bc84310e80
changes from tonight's rehearsal:
changes from tonight's rehearsal:
- CueFader is closer to actually running the show, computes DMX levels
to send.
- KeyboardComposer is not a dummy. Use DMXDUMMY=1 to disable it.
- Submaster: subs can now be "temporary" -- i.e. they shouldn't be saved
or loaded. to save a temporary sub, make a copy of it with a proper name
since the computed name will be ugly.
Also, get_normalized_copy() and crossfade() methods added.
linear_fade helper (shouldn't be in Submaster, probably) added too.
- dmxchanedit: longer labels
- cuelist1 now has some bogus data in it and some crap removed
- dmxclient: now listens to the $DMXHOST and $DMXDUMMY env variables.
- patchdata: now up to date with this year's show
- danshow subs song{01..19}: removed. maybe we'll re-add them in an
archive directory.
author | dmcc |
---|---|
date | Tue, 08 Jul 2003 16:19:55 +0000 |
parents | f2eb20a52555 |
children |
rev | line source |
---|---|
85
174b35926067
converts subs from dicts to tab-sep-values and back again
drewp
parents:
42
diff
changeset
|
1 def resolve_name(channelname): |
174b35926067
converts subs from dicts to tab-sep-values and back again
drewp
parents:
42
diff
changeset
|
2 "Ensure that we're talking about the primary name of the light." |
174b35926067
converts subs from dicts to tab-sep-values and back again
drewp
parents:
42
diff
changeset
|
3 return get_channel_name(get_dmx_channel(channelname)) |
174b35926067
converts subs from dicts to tab-sep-values and back again
drewp
parents:
42
diff
changeset
|
4 |
174b35926067
converts subs from dicts to tab-sep-values and back again
drewp
parents:
42
diff
changeset
|
5 def get_all_channels(): |
174b35926067
converts subs from dicts to tab-sep-values and back again
drewp
parents:
42
diff
changeset
|
6 """returns primary names for all channels (sorted)""" |
174b35926067
converts subs from dicts to tab-sep-values and back again
drewp
parents:
42
diff
changeset
|
7 prinames = reverse_patch.values()[:] |
174b35926067
converts subs from dicts to tab-sep-values and back again
drewp
parents:
42
diff
changeset
|
8 prinames.sort() |
174b35926067
converts subs from dicts to tab-sep-values and back again
drewp
parents:
42
diff
changeset
|
9 return prinames |
174b35926067
converts subs from dicts to tab-sep-values and back again
drewp
parents:
42
diff
changeset
|
10 |
0 | 11 def get_dmx_channel(name): |
12 if name in patch: | |
13 return patch[name] | |
14 | |
15 try: | |
16 i = int(name) | |
17 return i | |
18 except ValueError: | |
42
5e4fb4ac2d18
corrected Patch's error behavior and subediting's catching behavior
drewp
parents:
4
diff
changeset
|
19 raise ValueError("Invalid channel name: %s" % name) |
0 | 20 |
21 def get_channel_name(dmxnum): | |
22 try: | |
23 return reverse_patch[dmxnum] | |
24 except KeyError: | |
25 return str(dmxnum) | |
26 | |
129 | 27 def reload_data(): |
0 | 28 global patch, reverse_patch |
129 | 29 import patchdata |
0 | 30 |
129 | 31 reload(patchdata) |
32 loadedpatch = patchdata.patch | |
0 | 33 patch = {} |
34 reverse_patch = {} | |
35 for k, v in loadedpatch.items(): | |
129 | 36 if type(k) is tuple: |
0 | 37 for name in k: |
38 patch[name] = v | |
39 reverse_patch[v] = k[0] | |
40 else: | |
41 patch[k] = v | |
42 reverse_patch[v] = k | |
129 | 43 |
44 # importing patch will load initial data | |
45 reload_data() | |
46 |