summaryrefslogtreecommitdiff
path: root/interface
diff options
context:
space:
mode:
authorBen Connors <benconnors@outlook.com>2019-10-31 14:33:47 -0400
committerBen Connors <benconnors@outlook.com>2019-10-31 14:33:47 -0400
commit1f037f48e5badab2b758c4b9bd0541c5ccda7b3f (patch)
treeea5e88d86cf0ab8d316892de5253b4caee6541b6 /interface
parent51e723e688a4bdead12bb56d5e6dc59c5d5aef88 (diff)
Fix up the rendering mode
- Fix bug in chaser code leading to incorrect advance - Only known bug is cursor is in the wrong spot during render
Diffstat (limited to 'interface')
-rw-r--r--interface/audioview.py1
-rwxr-xr-xinterface/channelbank.py1
-rwxr-xr-xinterface/chaserview.py1
-rw-r--r--interface/dialog.py1
-rw-r--r--interface/interface.py12
-rwxr-xr-xinterface/pager.py1
6 files changed, 14 insertions, 3 deletions
diff --git a/interface/audioview.py b/interface/audioview.py
index ebfe228..2d450e5 100644
--- a/interface/audioview.py
+++ b/interface/audioview.py
@@ -93,6 +93,7 @@ class AudioView:
def __init__(self, y, x, height, width):
with CURSES_LOCK:
self.win = curses.newwin(height, width, y, x)
+ self.win.leaveok(True)
self.win.keypad(True)
self._lock = threading.RLock()
diff --git a/interface/channelbank.py b/interface/channelbank.py
index 6562a9c..47d6482 100755
--- a/interface/channelbank.py
+++ b/interface/channelbank.py
@@ -96,6 +96,7 @@ class ChannelView:
self.root = root
with CURSES_LOCK:
self.win = root.subpad(self.height, self.width, self.y, self.x)
+ self.win.leaveok(True)
self._refresh_value()
self._refresh_channel()
diff --git a/interface/chaserview.py b/interface/chaserview.py
index 6a80241..7a6a8db 100755
--- a/interface/chaserview.py
+++ b/interface/chaserview.py
@@ -147,6 +147,7 @@ class ChaserView:
def __init__(self, y, x, height, width):
with CURSES_LOCK:
self.win = curses.newwin(height, width, y, x)
+ self.win.leaveok(True)
self.win.keypad(True)
self._lock = threading.RLock()
self._height = height
diff --git a/interface/dialog.py b/interface/dialog.py
index 18ecb34..68de590 100644
--- a/interface/dialog.py
+++ b/interface/dialog.py
@@ -33,6 +33,7 @@ def askyesnocancel(stdscr, msg, title="Confirm", resize=None):
raise ValueError("Not enough room")
win = curses.newwin(thisheight, thiswidth, posy, posx)
+ win.leaveok(True)
win.border()
win.addstr(0, (thiswidth // 2) - (len(title) // 2), title)
win.keypad(True)
diff --git a/interface/interface.py b/interface/interface.py
index f9c868e..5be5196 100644
--- a/interface/interface.py
+++ b/interface/interface.py
@@ -529,13 +529,17 @@ class Interface:
def _render_callback(self, t, values):
if not self.rendering:
return
- with self.w_lock:
+ with self.w_lock, CURSES_LOCK:
+ syx = self.input.win.getyx()
+
self.channel_bank.set_values(values)
self.channel_bank.title = "LIVE: %7.2fs" % t
for d, cv in zip(self.renderer._data, self.chaser_views):
cv.selected = d.steps[-1].index if d.steps else None
+ self.input.win.move(*syx)
+
def base_run(self):
if not self.chaser_views:
return "No chasers loaded"
@@ -573,8 +577,10 @@ class Interface:
return "No such chaser loaded"
n = n[0]
if n >= len(self.chaser_views) or n < 0:
- return "Index out of range"
- self.renderer.advance((n, p))
+ return "Chaser index out of range"
+ if p is not None and (p < 1 or p > len(self.chaser_views[n].chaser.steps)):
+ return "Step index out of range"
+ self.renderer.advance((n, (p-1) if p is not None else p))
def __init__(self, path, output):
## Have to do most of the actual initialization in the main method, as curses isn't
diff --git a/interface/pager.py b/interface/pager.py
index 2203e52..901c431 100755
--- a/interface/pager.py
+++ b/interface/pager.py
@@ -134,6 +134,7 @@ class Pager:
def __init__(self, y, x, height, width):
with CURSES_LOCK:
self.win = curses.newwin(height, width, y, x)
+ self.win.leaveok(True)
self.win.keypad(True)
self._lock = threading.RLock()
self._height = height