Changeset - 9e6596b7f1a2
[Not reviewed]
default
0 1 0
Drew Perttula - 6 years ago 2019-05-28 08:41:47
drewp@bigasterisk.com
higher res KC slider values
Ignore-this: a7db9d510cd5c518797b91970ea75773
1 file changed with 7 insertions and 8 deletions:
0 comments (0 inline, 0 general)
bin/keyboardcomposer
Show inline comments
 
@@ -51,13 +51,13 @@ class SubScale(tk.Scale, Fadable):
 
        kw.update({
 
            'variable': self.scale_var,
 
            'from': 1,
 
            'to': 0,
 
            'showvalue': 0,
 
            'sliderlength': 15,
 
            'res': 0.01,
 
            'res': 0.001,
 
            'width': 40,
 
            'troughcolor': 'black',
 
            'bg': 'grey40',
 
            'highlightthickness': 1,
 
            'bd': 1,
 
            'highlightcolor': 'red',
 
@@ -131,23 +131,23 @@ class SubmasterBox(tk.Frame):
 

	
 
        # initial position
 
        # stil need? dispatcher.send("send_to_hw", sub=sub.uri, hwCol=col + 1)
 

	
 
    def getVal(self) -> float:
 
        return self._val
 

	
 
    
 
    def setVal(self, newVal: float) -> None:
 
        if self.dead:
 
            return
 
        try:
 
            self.scale.set(newVal)
 
            self.levellabel.config(text=str(newVal))
 
        except Exception:
 
            log.warn("disabling handlers on broken subbox")
 
            self.dead = True
 

	
 
        
 
    def cleanup(self):
 
        self.slider_var.trace_vdelete('w', self._slider_var_trace)
 

	
 
    def slider_changed(self, *args):
 
        self._val = self.scale.get()
 
        self.scale.draw_indicator_colors()
 
@@ -187,17 +187,17 @@ class SubmasterBox(tk.Frame):
 
            if graph.value(setting, L9['sub']) == self.sub:
 
                self.pauseTrace = True  # don't bounce this update back to server
 
                try:
 
                    self.setVal(graph.value(setting, L9['level']).toPython())
 
                finally:
 
                    self.pauseTrace = False
 

	
 
                    
 
    def updateName(self):
 
        if self.scale is None:
 
            return
 

	
 
        
 
        def shortUri(u):
 
            return '.../' + u.split('/')[-1]
 

	
 
        try:
 
            self.namelabel.config(
 
                text=self.graph.label(self.sub) or shortUri(self.sub))
 
@@ -530,15 +530,14 @@ class KeyboardComposer(tk.Frame, SubClie
 

	
 
    def unhighlight_row(self, row):
 
        row = self.rows[row]
 
        row['bg'] = 'black'
 

	
 
    def get_levels(self):
 
        return dict([
 
            (uri, box.getVal()) for uri, box in list(self.subbox.items())
 
        ])
 
        return dict([(uri, box.getVal())
 
                     for uri, box in list(self.subbox.items())])
 

	
 
    def get_output_settings(self, _graph=None):
 
        _graph = _graph or self.graph
 
        outputSettings = []
 
        for setting in _graph.objects(self.session, L9['subSetting']):
 
            effect = _graph.value(setting, L9['sub'])
0 comments (0 inline, 0 general)