diff --git a/flax/kcclient b/bin/kcclient rename from flax/kcclient rename to bin/kcclient --- a/flax/kcclient +++ b/bin/kcclient @@ -3,6 +3,8 @@ """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]) @@ -10,7 +12,9 @@ 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) diff --git a/bin/keyboardcomposer b/bin/keyboardcomposer --- a/bin/keyboardcomposer +++ b/bin/keyboardcomposer @@ -12,9 +12,10 @@ 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') @@ -59,7 +60,7 @@ class KeyboardComposer(Frame, SubClient) 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 @@ -76,7 +77,7 @@ class KeyboardComposer(Frame, SubClient) 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() @@ -261,7 +262,7 @@ if __name__ == "__main__": 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) diff --git a/light9/networking.py b/light9/networking.py --- a/light9/networking.py +++ b/light9/networking.py @@ -18,3 +18,9 @@ def musicPort(): def mpdServer(): """servername, port""" return 'dash',6600 + +def kcPort(): + return 8050 + +def kcServer(): + return 'dash'