Changeset - 54774cba50c9
[Not reviewed]
default
1 2 1
Drew Perttula - 20 years ago 2005-06-17 17:52:56
drewp@bigasterisk.com
revive kcclient and fix subcomposer so kcclient works through refreshes
3 files changed with 16 insertions and 5 deletions:
0 comments (0 inline, 0 general)
bin/kcclient
Show inline comments
 
file renamed from flax/kcclient to bin/kcclient
 
#!/usr/bin/env python
 

	
 
"""send KeyboardComposer a fade request, for use from the shell"""
 

	
 
import sys,xmlrpclib
 
import run_local
 
from light9 import networking
 

	
 
subname = sys.argv[1]
 
level = float(sys.argv[2])
 
fadesecs = 0
 
if len(sys.argv)>3:
 
    fadesecs = float(sys.argv[3])
 

	
 
levelserver = xmlrpclib.ServerProxy("http://localhost:8050")
 
levelserver = xmlrpclib.ServerProxy("http://%s:%s" %
 
                                    (networking.kcServer(),
 
                                     networking.kcPort()))
 

	
 
levelserver.fadesub(subname,level,fadesecs)
 

	
 

	
bin/keyboardcomposer
Show inline comments
 
@@ -9,15 +9,16 @@ from Tix import *
 
import pickle
 

	
 
import run_local
 
from light9.Fadable import Fadable
 
from light9.Submaster import Submasters, sub_maxes
 
from light9.subclient import SubClient
 
from light9 import dmxclient, showconfig
 
from light9 import dmxclient, showconfig, networking
 
from light9.uihelpers import toplevelat
 

	
 

	
 
nudge_keys = {
 
    'up' : list('qwertyuiop'),
 
    'down' : list('asdfghjkl')
 
}
 
nudge_keys['down'].append('semicolon')
 

	
 
@@ -56,13 +57,13 @@ class SubmasterTk(Frame):
 

	
 
class KeyboardComposer(Frame, SubClient):
 
    def __init__(self, root, submasters, current_sub_levels=None):
 
        Frame.__init__(self, root, bg='black')
 
        SubClient.__init__(self)
 
        self.submasters = submasters
 

	
 
        self.name_to_subtk = {}
 
        self.current_sub_levels = {}
 
        if current_sub_levels:
 
            self.current_sub_levels = current_sub_levels
 
        else:
 
            try:
 
                self.current_sub_levels = \
 
@@ -73,13 +74,13 @@ class KeyboardComposer(Frame, SubClient)
 
        self.draw_ui()
 
        self.send_levels_loop()
 
    def draw_ui(self):
 
        self.rows = [] # this holds Tk Frames for each row
 
        self.slider_vars = {} # this holds subname:sub Tk vars
 
        self.slider_table = {} # this holds coords:sub Tk vars
 
        self.name_to_subtk = {} # subname : SubmasterTk instance
 
        self.name_to_subtk.clear() # subname : SubmasterTk instance
 
        self.current_row = 0
 
        
 
        self.make_key_hints()
 
        self.draw_sliders()
 
        self.highlight_row(self.current_row)
 
        self.rows[self.current_row].focus()
 
@@ -258,13 +259,13 @@ if __name__ == "__main__":
 
    tl = toplevelat("Keyboard Composer", existingtoplevel=root)
 

	
 
    kc = KeyboardComposer(tl, s)
 
    kc.pack(fill=BOTH, expand=1)
 

	
 
    ls = LevelServer(kc.name_to_subtk)
 
    reactor.listenTCP(8050, server.Site(ls))
 
    reactor.listenTCP(networking.kcPort(), server.Site(ls))
 

	
 
    root.protocol('WM_DELETE_WINDOW', reactor.stop)
 
    reactor.addSystemEventTrigger('after', 'shutdown', kc.save)
 
    
 
    tksupport.install(root,ms=10)
 
    reactor.run()
light9/networking.py
Show inline comments
 
@@ -15,6 +15,12 @@ def musicUrl():
 
def musicPort():
 
    return 8040
 

	
 
def mpdServer():
 
    """servername, port"""
 
    return 'dash',6600
 

	
 
def kcPort():
 
    return 8050
 

	
 
def kcServer():
 
    return 'dash'
0 comments (0 inline, 0 general)