Changeset - 2072a0dd7b19
[Not reviewed]
default
0 4 0
drewp@bigasterisk.com - 20 years ago 2005-04-17 02:24:29
drewp@bigasterisk.com
factor out LIGHT9_SHOW
4 files changed with 14 insertions and 17 deletions:
0 comments (0 inline, 0 general)
bin/curvecalc
Show inline comments
 
@@ -14,7 +14,7 @@ import twisted
 
from twisted.web.xmlrpc import Proxy
 

	
 
import run_local
 
from light9 import Submaster, dmxclient, networking
 
from light9 import Submaster, dmxclient, networking, showconfig
 
from light9.TLUtility import make_attributes_from_args
 
from light9.zoomcontrol import Zoomcontrol
 
from light9.curve import Curve, Curveview, Curveset, Curvesetview
 
@@ -241,18 +241,15 @@ ssv.pack(side='top', fill='x')
 
song = sys.argv[1]
 
root.title("Curemaster 2000MX - %s" % song)
 

	
 
musicfilename = os.path.join(os.getenv("LIGHT9_SHOW"),'music',
 
                             "%s.wav" % song)
 
musicfilename = showconfig.songFilename(song)
 
maxtime = wavelength(musicfilename)
 
dispatcher.send("max time",maxtime=maxtime)
 
dispatcher.connect(lambda: maxtime, "get max time",weak=0)
 
curveset.load(basename=os.path.join(os.getenv("LIGHT9_SHOW"),"curves",song))
 
curveset.load(basename=os.path.join(showconfig.curvesDir(),song))
 

	
 
subterms = []
 
subterm_adder(root, curveset, subterms, root, ssv).pack(side='top',fill='x')
 
for line in file(os.path.join(os.getenv("LIGHT9_SHOW"),
 
                              "subterms",
 
                              song)):
 
for line in file(showconfig.subtermsForSong()):
 
    subname,expr = line.strip().split(" ",1)
 

	
 
    term = add_one_subterm(subname, curveset, subterms, root, ssv, expr)
 
@@ -264,8 +261,7 @@ out = Output(subterms)
 

	
 
def savekey(*args):
 
    print "saving",song
 
    savesubterms(os.path.join(os.getenv("LIGHT9_SHOW"),"subterms",song),
 
                 subterms)
 
    savesubterms(showconfig.subtermsForSong(song),subterms)
 
    curveset.save(basename="curves/"+song)
 
    print "saved"
 

	
light9/Patch.py
Show inline comments
 
@@ -30,7 +30,7 @@ def reload_data():
 
    global patch, reverse_patch
 

	
 
    loc = {}
 
    execfile(os.path.join(os.getenv("LIGHT9_SHOW"),"patchdata.py"), loc)
 
    execfile(showconfig.patchData(), loc)
 
    
 
    loadedpatch = loc['patch']
 
    patch = {}
light9/Submaster.py
Show inline comments
 
from __future__ import division
 
import os
 
from light9.TLUtility import dict_scale, dict_max
 
from light9 import Patch
 
from light9 import Patch, showconfig
 

	
 
class Submaster:
 
    "Contain a dictionary of levels, but you didn't need to know that"
 
@@ -18,8 +18,7 @@ class Submaster:
 
            return
 
        try:
 
            self.levels.clear()
 
            subfile = file(os.path.join(os.getenv("LIGHT9_SHOW"),
 
                                        "subs",self.name))
 
            subfile = file(showconfig.subFile(self.name))
 
            for line in subfile.readlines():
 
                if not line.strip(): # if line is only whitespace
 
                    continue # "did i say newspace?"
 
@@ -38,8 +37,7 @@ class Submaster:
 
            print "not saving temporary sub named",self.name
 
            return
 

	
 
        subfile = file(os.path.join(os.getenv("LIGHT9_SHOW"),
 
                                    "subs",self.name), 'w')
 
        subfile = file(showconfig.subFile(self.name), 'w')
 
        names = self.levels.keys()
 
        names.sort()
 
        for name in names:
 
@@ -131,7 +129,7 @@ class Submasters:
 
    def __init__(self):
 
        self.submasters = {}
 

	
 
        files = os.listdir(os.path.join(os.getenv("LIGHT9_SHOW"),'subs'))
 
        files = os.listdir(showconfig.subsDir())
 

	
 
        for filename in files:
 
            # we don't want these files
light9/networking.py
Show inline comments
 
@@ -10,4 +10,7 @@ def dmxServerPort():
 
    return 8030
 
    
 
def musicUrl():
 
    return "http://localhost:8040"
 
    return "http://localhost:%s" % musicPort()
 

	
 
def musicPort():
 
    return 8040
0 comments (0 inline, 0 general)