 | blc2 - Python library and frontend for running theatrical lighting and SFX. Written for the English 2041F fall 2019 theatre production of "The Cenci".
git clone https://benconnors.ca/git-repos/blc2
|
Log | Files | Refs
commit 97628be45e91078bc6ecbb2b9a9e4170dd484b88
parent 1ea9b37468b2cffc6c6c62dd767ab4d3956e54c7
Author: Ben Connors <benconnors@outlook.com>
Date: Thu, 2 Jan 2020 15:04:50 -0500
Updates
Diffstat:
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/interface/chaserview.py b/interface/chaserview.py
@@ -22,6 +22,19 @@ def format_time(n):
return str(n)[0]+postfixes[idx]
+def format_long(n):
+ if n == INFTY:
+ return " ∞s"
+ elif n == 0:
+ return " 0s"
+ elif n < 10000:
+ return "%4s" % n
+ else:
+ n = str(n/1000)[:3]
+ if n[-1] == '.':
+ n = n[:-1]
+ return "%3ss" % n
+
class ChaserView:
def set_dim(self, height, width):
if height < 5 or width < 10:
@@ -113,7 +126,7 @@ class ChaserView:
ft = "-"
fid = "---"
- t = "%s%3s%s|%s:%s:%s" % (ft, fid, '*' if (s.type == CHASERSTEP and s.duration_mode == MANUAL) else ' ', format_time(s.fade_in), format_time(s.duration if s.type != CHASERSTEP else s.length), format_time(s.fade_out))
+ t = "%s%3s%s|%s:%s:%s" % (ft, fid, '*' if (s.type == CHASERSTEP and s.duration_mode == MANUAL) else ' ', format_long(s.fade_in), format_long(s.duration if s.type != CHASERSTEP else s.length), format_long(s.fade_out))
self.win.addstr(n+2, 1, self.fit((self._numformat % (first+n)) + ": " + s.name, w-len(t), pad=True)+t, attrs)
if first > 0:
diff --git a/interface/interface.py b/interface/interface.py
@@ -877,7 +877,7 @@ class Interface:
self.context_scene = Input.parse_context((
("set $channel_range to $value", self.scene_set),
- ("reset $channel_range", self.scene_clear),
+ ("clear $channel_range", self.scene_clear),
("edit $channel_range", self.scene_edit),
("edit $channel_range force", lambda cr: self.scene_edit(cr, True)),
@@ -911,8 +911,8 @@ class Interface:
("rename $quoted_string", self.primitive_rename),
("filename $quoted_string", self.audio_filename),
- ("fade in $time", self.audio_fade),
- ("fade out $time", lambda t: self.audio_fade(t, True)),
+ ("set fade in $time", self.audio_fade),
+ ("set fade out $time", lambda t: self.audio_fade(t, True)),
("pager page", self.page),
("pager clear", self.page_clear),
@@ -960,10 +960,7 @@ class Interface:
("delete", self.chaser_delete),
("delete $num", self.chaser_delete),
- ("add", lambda: self.chaser_new(-1, "")),
- ("add from $num", lambda s: self.chaser_new(-1, "", s)),
- ("add from new scene $quoted_string", lambda s: self.chaser_new_new(-1, "", s, Scene)),
- ("add from new audio $quoted_string", lambda s: self.chaser_new_new(-1, "", s, Audio)),
+ ("add $num", lambda s: self.chaser_new(-1, "", s)),
("rename $quoted_string", self.chaser_rename_self),