Changeset - 430014be95ce
[Not reviewed]
default
0 3 0
Drew Perttula - 18 years ago 2007-06-15 18:06:46
drewp@bigasterisk.com
fix KC dummy mode
3 files changed with 14 insertions and 6 deletions:
0 comments (0 inline, 0 general)
bin/keyboardcomposer
Show inline comments
 
@@ -23,6 +23,10 @@ nudge_keys = {
 
    'down' : list('asdfghjk')
 
}
 

	
 
class DummySliders:
 
    def valueOut(self, name, value):
 
        pass
 

	
 
class SubScale(Scale, Fadable):
 
    def __init__(self, master, *args, **kw):
 
        self.scale_var = kw.get('variable') or DoubleVar()
 
@@ -114,10 +118,7 @@ class KeyboardComposer(Frame, SubClient)
 
        if hw_sliders:
 
            self.sliders = Sliders(self.hw_slider_moved)
 
        else:
 
            class dummy:
 
                def valueOut(self, name, value):
 
                    pass
 
            self.sliders = dummy()
 
            self.sliders = DummySliders()
 

	
 
    def make_key_hints(self):
 
        keyhintrow = Frame(self)
 
@@ -231,6 +232,9 @@ class KeyboardComposer(Frame, SubClient)
 
            col = (col + 1) % 8
 

	
 
    def send_to_hw(self, subName, hwNum):
 
        if isinstance(self.sliders, DummySliders):
 
            return
 
            
 
        v = round(127 * self.slider_vars[subName].get())
 
        chan = "slider%s" % hwNum
 
        
light9/networking.py
Show inline comments
 
@@ -12,14 +12,14 @@ def dmxServerPort():
 
    return 8030
 
    
 
def musicUrl():
 
    return "http://localhost:%s" % musicPort()
 
    return "http://score:%s" % musicPort()
 

	
 
def musicPort():
 
    return 8040
 

	
 
def mpdServer():
 
    """servername, port"""
 
    return os.getenv('LIGHT9_MPD_SERVER', 'dash'),6600
 
    return os.getenv('LIGHT9_MPD_SERVER', 'score'),6600
 

	
 
def kcPort():
 
    return 8050
light9/showconfig.py
Show inline comments
 
@@ -9,6 +9,8 @@ def getGraph():
 
    global _config
 
    configPath = path.join(root(), 'config.n3')
 
    
 
    # file patch.n3 mtime is not currently being checked
 
    
 
    now = time.time()
 
    diskMtime = path.getmtime(configPath)
 
    if diskMtime <= _config[1]:
 
@@ -22,6 +24,8 @@ def getGraph():
 

	
 
    graph = Graph()
 
    graph.parse(configPath, format='n3')
 
    graph.parse(path.join(root(), "patch.n3"), format="n3")
 
    
 
    _config = (graph, diskMtime, len(graph))
 
    return graph
 

	
0 comments (0 inline, 0 general)