summaryrefslogtreecommitdiff
path: root/interface
diff options
context:
space:
mode:
Diffstat (limited to 'interface')
-rw-r--r--interface/__main__.py4
-rwxr-xr-xinterface/chaserview.py8
-rw-r--r--interface/interface.py16
3 files changed, 22 insertions, 6 deletions
diff --git a/interface/__main__.py b/interface/__main__.py
index b2f45fe..878b263 100644
--- a/interface/__main__.py
+++ b/interface/__main__.py
@@ -4,9 +4,9 @@ import sys
from .interface import Interface
from .ola import OLAOutput
-from .dummy import DummyOutput
+#from .dummy import DummyOutput
if len(sys.argv) > 2:
raise ValueError("Usage: %s [workspace file]" % sys.argv[0])
-Interface(sys.argv[1] if len(sys.argv) == 2 else None, DummyOutput()).main()
+Interface(sys.argv[1] if len(sys.argv) == 2 else None, OLAOutput()).main()
diff --git a/interface/chaserview.py b/interface/chaserview.py
index 2c94240..011d2bd 100755
--- a/interface/chaserview.py
+++ b/interface/chaserview.py
@@ -83,9 +83,11 @@ class ChaserView:
self.win.addstr(1, 1, self.fit(("%d: "% c.id) + c.name + " (%s)" % ("Join" if c.type == JOIN else c.advance_mode), w, True), curses.A_REVERSE if self._highlight else 0)
maxsteps = self._height - 4
+ first = 0
if maxsteps < len(c.steps):
if self._selected is None:
- steps = c.steps[:maxsteps]
+ first = 0
+ last = maxsteps
else:
last = min(self._selected + (maxsteps // 2), len(c.steps))
first = last - maxsteps
@@ -111,11 +113,11 @@ 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), 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_time(s.fade_in), format_time(s.duration if s.type != CHASERSTEP else s.length), format_time(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:
- self.win.addch(3, self._width//2, '⯅')
+ self.win.addch(2, self._width//2, '⯅')
if last < len(c.steps):
self.win.addch(self._height-1, self._width//2, '⯆')
diff --git a/interface/interface.py b/interface/interface.py
index 500728c..832663e 100644
--- a/interface/interface.py
+++ b/interface/interface.py
@@ -563,7 +563,7 @@ class Interface:
if fid not in self.w.functions:
return "No such function"
f = self.w.functions[fid]
- if f.type not in (SCENE, AUDIO, CHASER):
+ if f.type not in (SCENE, AUDIO, CHASER, JOIN):
return "Invalid function"
s.function = f
@@ -725,6 +725,17 @@ class Interface:
self.current_cv.chaser.advance_mode = mode
self.current_cv.set_chaser(self.current_cv.chaser, self.current_cv.selected)
+ def base_copy(self, num, name=None):
+ with self.w_lock:
+ ## TODO: Implement this in BLC
+ if num not in self.w.functions:
+ return "No such function"
+ f = self.w.functions[num]
+ if f.type != SCENE:
+ return "Can only close scenes"
+ f2 = Scene(self.w, name=name, values=f.values)
+ self.handle_enter(f2.id)
+
def __init__(self, path, output):
## Have to do most of the actual initialization in the main method, as curses isn't
## ready yet.
@@ -775,6 +786,9 @@ class Interface:
("list audio", lambda: self.list_functions(AUDIO)),
("list joins", lambda: self.list_functions(JOIN)),
+ ("copy $num", self.base_copy),
+ ("copy $num $quoted_string", self.base_copy),
+
("currentstatus", self.current_status),
("pager page", self.page),