summaryrefslogtreecommitdiff
path: root/interface/interface.py
diff options
context:
space:
mode:
Diffstat (limited to 'interface/interface.py')
-rw-r--r--interface/interface.py37
1 files changed, 32 insertions, 5 deletions
diff --git a/interface/interface.py b/interface/interface.py
index da83a19..48f3d24 100644
--- a/interface/interface.py
+++ b/interface/interface.py
@@ -10,7 +10,7 @@ from blc2.functions.audio import Audio
from blc2.functions.scene import Scene
from blc2.functions.chaser import Chaser
from blc2.functions.chaserstep import ChaserStep
-from blc2.constants import SCENE, CHASER, AUDIO, MANUAL, INHERIT
+from blc2.constants import SCENE, CHASER, AUDIO, MANUAL, INHERIT, INFTY
from blc2.topology import Fixture
@@ -510,7 +510,7 @@ class Interface:
s = ChaserStep(c, index=index, name=name, function=f)
self.current_cv.set_chaser(c, s.index)
- self.chaser_edit(s.index+1)
+ #self.chaser_edit(s.index+1)
def chaser_new_new(self, index, name, fname, type_):
with self.w_lock:
@@ -632,10 +632,10 @@ class Interface:
self.base_run()
def run_exit(self):
- with self.w_lock:
- self.rendering = False
- self.renderer.stop()
+ self.rendering = False
+ self.renderer.stop()
+ with self.w_lock:
self.channel_bank.title = "Channels"
self.channel_bank.highlight = False
self.channel_bank.set_scope(())
@@ -643,6 +643,7 @@ class Interface:
if self.chaser_stack:
for i, c in zip(self.chaser_stack.pop(-1), self.chaser_views):
c.selected = i
+ self.current_cv.highlight = True
if self.current_cv.selected is not None:
s = self.current_cv.chaser.steps[self.current_cv.selected]
if s.function is not None and s.function.type in (SCENE, AUDIO,):
@@ -676,6 +677,24 @@ class Interface:
"Output is %sOK: %s" % ("" if self.output.ok else "NOT ", self.output.status),
), True)
+ def chaser_info(self, n):
+ with self.w_lock:
+ if n is None:
+ n = self.current_cv.selected
+ if n is None:
+ return "No step selected"
+ else:
+ n -= 1
+ if n < 0 or n >= len(self.current_cv.chaser.steps):
+ return "Invalid step"
+ f = self.current_cv.chaser.steps[n]
+ self.pager.display_many((
+ f.name,
+ "- Fade in: %7.3f" % (f.fade_in/1000),
+ "- Duration: " + (("%7.3f" % (f.duration/1000)) if f.duration != INFTY else "infty"),
+ "- Fade out: %7.3f" % (f.fade_out/1000),
+ ))
+
def __init__(self, path, output):
## Have to do most of the actual initialization in the main method, as curses isn't
## ready yet.
@@ -757,6 +776,11 @@ class Interface:
("append $quoted_string from new scene $quoted_string", lambda n, s: self.chaser_new_new(-1, n, s, Scene)),
("append $quoted_string from new audio $quoted_string", lambda n, s: self.chaser_new_new(-1, n, s, Audio)),
+ ("append", lambda: self.chaser_new(-1, "")),
+ ("append from $num", lambda s: self.chaser_new(-1, "", s)),
+ ("append from new scene $quoted_string", lambda s: self.chaser_new_new(-1, "", s, Scene)),
+ ("append from new audio $quoted_string", lambda s: self.chaser_new_new(-1, "", s, Audio)),
+
("new $num $quoted_string", self.chaser_new),
("new $num $quoted_string from $num", self.chaser_new),
("new $num $quoted_string from new scene $quoted_string", lambda i, n, s: self.chaser_new_new(i, n, s, Scene)),
@@ -777,6 +801,9 @@ class Interface:
("list chasers", lambda: self.list_functions(CHASER)),
("list audio", lambda: self.list_functions(AUDIO)),
+ ("info", lambda: self.chaser_info(None)),
+ ("info $num", self.chaser_info),
+
("trailer", self.chaser_run),
("pager page", self.page),