Beispiel #1
0
 def to_tree(self):
     args = ''
     for a in self.args:
         args=args+a+', '
     args=args[:-2]
     p = DOMNode('procedure', {'name':self.name, 'args':args})
     data = self.proc + "\n"
     p.add_data(data)
     return p
Beispiel #2
0
 def to_tree(self):
     args = ''
     for a in self.args:
         args = args + a + ', '
     args = args[:-2]
     p = DOMNode('procedure', {'name': self.name, 'args': args})
     data = self.proc + "\n"
     p.add_data(data)
     return p
Beispiel #3
0
 def change_show(self, newname, clear=0):
     self.datafile = None
     self.undo_bindings()
     self.show = newname
     self.do_bindings()
     if clear:
         for lib in self._libraries:
             lib.reset()
     else:
         tree = DOMNode("show", {"name": self.show})
         for lib in self._libraries:
             tree.append(lib.save())
         for lib in self._libraries:
             lib.load(tree)
     self.write("Now working in show " + self.show + "\n")
Beispiel #4
0
 def change_show(self, newname, clear=0):
     self.datafile=None
     self.undo_bindings()
     self.show = newname
     self.do_bindings()
     if (clear):
         for lib in self._libraries:
             lib.reset()
     else:
         tree = DOMNode('show', {'name':self.show})            
         for lib in self._libraries:
             tree.append (lib.save())
         for lib in self._libraries:                    
             lib.load(tree)
     self.write("Now working in show " + self.show +"\n")
Beispiel #5
0
    def save_show(self, datafile=None):
        if datafile is not None:
            self.datafile = datafile
        else:
            datafile = self.datafile

        tree = DOMNode("show", {"name": self.show})

        for lib in self._libraries:
            tree.append(lib.save())

        writer = TreeWriter()
        writer.write(tree)
        s = writer.get_string()
        f = open(datafile, "w")
        f.write(s)
Beispiel #6
0
 def unknown_starttag (self, name, attrs):
     n = DOMNode(name, attrs)
     if len(self.stack) == 0:
         self.tree = n
     else:
         self.stack[-1].append(n)
     self.stack.append(n)
Beispiel #7
0
    def save_show(self, datafile=None):
        if datafile is not None:
            self.datafile = datafile
        else:
            datafile = self.datafile

        tree = DOMNode('show', {'name':self.show})

        for lib in self._libraries:
            tree.append (lib.save())
            
        writer = TreeWriter()
        writer.write(tree)
        s = writer.get_string()
        f=open(datafile, "w")
        f.write(s)
Beispiel #8
0
def save():
    tree = DOMNode('instruments')
    for name, dict in lb.instrument_group.items():
        if name is None:
            n = tree
        else:
            n = DOMNode('group', {'name': name})
            tree.append(n)
        for i in dict.values():
            n.append(i.to_tree())
    return tree
Beispiel #9
0
    def sendData(self, subtree):
        tree = DOMNode("show", {"name": self.show})
        tree.append(subtree)

        writer = TreeWriter()
        writer.write(tree)
        data = writer.get_string()
        (foo, iterator) = self.client_context.list(0)
        while 1:
            (c, b) = iterator.next_one()
            if not c:
                break
            if b.binding_name[0].id == self.name:
                continue
            client = self.client_context.resolve(b.binding_name)
            try:
                client.receiveData(data)
            except:
                self.client_context.unbind(b.binding_name)
Beispiel #10
0
    def sendData(self, subtree):
        tree = DOMNode('show', {'name':self.show})
        tree.append(subtree)

        writer = TreeWriter()
        writer.write(tree)
        data = writer.get_string()
        (foo,iterator) = self.client_context.list(0)
        while 1:
            (c,b)=iterator.next_one()
            if not c:
                break
            if (b.binding_name[0].id==self.name):
                continue
            client = self.client_context.resolve(b.binding_name)
            try:
                client.receiveData(data)
            except:
                self.client_context.unbind(b.binding_name)
Beispiel #11
0
 def add_clicked(self, widget, data=None):
     tree = self.editTree.get_widget("instrumentTree")
     menu = self.editTree.get_widget("driverMenu")
     name = menu.get_children()[0].get()
     info = lb.instrument_module_info[name]
     dnode = DOMNode(tag=info.module, attrs={'name': 'Unnamed'})
     if info.container:
         node = tree.insert_node(None, None, ['Unnamed'], is_leaf=FALSE)
     else:
         node = tree.insert_node(None, None, ['Unnamed'], is_leaf=TRUE)
     tree.node_set_row_data(node, (dnode, info))
Beispiel #12
0
    def to_tree(self):
        dict = {}
        for arg in self.arglist:
            dict[arg.name] = arg.value

        dict['name'] = self.name
        dict['driver'] = self.driver
        dict['core'] = self.corename

        instrument = DOMNode(self.module, dict)
        return instrument
Beispiel #13
0
 def to_tree(self):
     cue = DOMNode("cue", {"name": self.name})
     for name, lvl in self.parent:
         lvl = lb.value_to_string("level", [lvl])
         parent = DOMNode("parent", {"level": lvl})
         parent.add_data(name)
         cue.append(parent)
     for name, idict in self.instrument.items():
         dict = idict.copy()
         dict["name"] = name
         instrument = DOMNode("instrument", dict)
         cue.append(instrument)
     return cue
Beispiel #14
0
 def ok_clicked(self, widget, data=None):
     w = self.editTree.get_widget("editInstruments")
     tree = self.editTree.get_widget ("instrumentTree")
     self.update_attrs_from_window()
     delroot = save()
     delroot.tag = 'instruments-deleted'
     domroot = DOMNode('instruments')
     for treenode in tree.base_nodes():
         domroot.append(self.make_dom_tree(tree, treenode))
     domtree = DOMNode('show')
     domtree.append(domroot)
     deltree = DOMNode('show')
     deltree.append(delroot)
     for mod in lb.instrument_module_info.values():
         mod.load(deltree)
     for mod in lb.instrument_module_info.values():
         mod.load(domtree)            
     lb.sendData(delroot)        
     lb.sendData(domroot)
     w.destroy()
Beispiel #15
0
 def to_tree(self):
     instrument = DOMNode(self.module, {'name': self.name})
     subs = {}
     for a, i in self.subinstrument.items():
         if type(i) != type([]):
             i = [i]
         for x in i:
             if subs.has_key(x):
                 subs[x] = subs[x] + ', ' + a
             else:
                 subs[x] = a
     for i, a in subs.items():
         n = i.to_tree()
         n.attrs['attributes'] = a
         instrument.append(n)
     return instrument
Beispiel #16
0
def save():
    tree = DOMNode('instruments')
    for name, dict in lb.instrument_group.items():
        if name is None:
            n = tree
        else:
            n = DOMNode('group', {'name': name})
            tree.append(n)
        for i in dict.values():
            n.append(i.to_tree())
    return tree
Beispiel #17
0
def save():
    tree = DOMNode('programs')
    for p in lb.program.values():
        tree.append(p.to_tree())
    return tree
Beispiel #18
0
def save():
    tree = DOMNode('crossfaders')
    for i in lb.crossfader.values():
        tree.append(i.to_tree())
    return tree
Beispiel #19
0
def save():
    tree = DOMNode('programs')
    for p in lb.program.values():
        tree.append(p.to_tree())
    return tree
Beispiel #20
0
 def send_update(self):
     tree = DOMNode('programs')
     tree.append(self.to_tree())
     lb.sendData(tree)
Beispiel #21
0
 def send_update(self):
     tree = DOMNode('processes')
     tree.append(self.to_tree())
     lb.sendData(tree)
Beispiel #22
0
def save():
    tree = DOMNode("cues")
    for i in lb.cue.values():
        tree.append(i.to_tree())
    return tree
Beispiel #23
0
 def to_tree(self):
     cue = DOMNode('cue', {'name': self.name})
     for name, lvl in self.parent:
         lvl = lb.value_to_string('level', [lvl])
         parent = DOMNode('parent', {'level': lvl})
         parent.add_data(name)
         cue.append(parent)
     for name, idict in self.instrument.items():
         dict = idict.copy()
         dict['name'] = name
         instrument = DOMNode('instrument', dict)
         cue.append(instrument)
     return cue
Beispiel #24
0
def save():
    tree = DOMNode('cues')
    for i in lb.cue.values():
        tree.append(i.to_tree())
    return tree
Beispiel #25
0
 def to_tree(self):
     xf = DOMNode('crossfader', {'name': self.name, 'core': self.corename})
     return xf
Beispiel #26
0
 def send_update(self):
     tree = DOMNode('crossfaders')
     tree.append(self.to_tree())
     lb.sendData(tree)
Beispiel #27
0
 def ok_clicked(self, widget, data=None):
     w = self.editTree.get_widget("editInstruments")
     tree = self.editTree.get_widget("instrumentTree")
     self.update_attrs_from_window()
     delroot = save()
     delroot.tag = 'instruments-deleted'
     domroot = DOMNode('instruments')
     for treenode in tree.base_nodes():
         domroot.append(self.make_dom_tree(tree, treenode))
     domtree = DOMNode('show')
     domtree.append(domroot)
     deltree = DOMNode('show')
     deltree.append(delroot)
     for mod in lb.instrument_module_info.values():
         mod.load(deltree)
     for mod in lb.instrument_module_info.values():
         mod.load(domtree)
     lb.sendData(delroot)
     lb.sendData(domroot)
     w.destroy()
Beispiel #28
0
def save():
    tree = DOMNode("processes")
    for i in lb.process.values():
        tree.append(i.to_tree())
    return tree
Beispiel #29
0
 def add_group_clicked(self, widget, data=None):
     tree = self.editTree.get_widget("instrumentTree")
     info = group_info
     dnode = DOMNode(tag='group', attrs={'name': 'Unnamed'})
     node = tree.insert_node(None, None, ['Unnamed'], is_leaf=FALSE)
     tree.node_set_row_data(node, (dnode, info))
Beispiel #30
0
def save():
    tree = DOMNode('processes')
    for i in lb.process.values():
        tree.append(i.to_tree())
    return tree
Beispiel #31
0
 def send_update(self):
     tree = DOMNode('levelfaders')
     tree.append(self.to_tree())
     lb.sendData(tree)
Beispiel #32
0
 def to_tree(self):
     dict = self.args.copy()
     dict['name'] = self.name
     dict['procedure'] = self.procedure
     p = DOMNode('process', dict)
     return p
Beispiel #33
0
def save():
    tree = DOMNode('levelfaders')
    for i in lb.levelfader.values():
        tree.append(i.to_tree())
    return tree
Beispiel #34
0
def save():
    tree = DOMNode('procedures')
    for i in lb.procedure.values():
        tree.append(i.to_tree())
    return tree
Beispiel #35
0
 def to_tree(self):
     program = DOMNode('program', {'name':self.name})
     init = DOMNode('init')
     program.append(init)
     for act in self.init_step.actions:
         action = DOMNode(act.kind, act.args)
         init.append(action)
     for stp in self.actions:
         step = DOMNode('step', {'name':stp.name})
         program.append(step)
         for act in stp.actions:
             action = DOMNode(act.kind, act.args)
             step.append(action)
     return program
Beispiel #36
0
 def to_tree(self):
     instrument = DOMNode(self.module, {'name':self.name,
                                        'red':self.red_name,
                                        'green':self.green_name,
                                        'blue':self.blue_name})
     return instrument
Beispiel #37
0
 def to_tree(self):
     program = DOMNode('program', {'name': self.name})
     init = DOMNode('init')
     program.append(init)
     for act in self.init_step.actions:
         action = DOMNode(act.kind, act.args)
         init.append(action)
     for stp in self.actions:
         step = DOMNode('step', {'name': stp.name})
         program.append(step)
         for act in stp.actions:
             action = DOMNode(act.kind, act.args)
             step.append(action)
     return program
Beispiel #38
0
 def send_update(self):
     tree = DOMNode("processes")
     tree.append(self.to_tree())
     lb.sendData(tree)
Beispiel #39
0
def save():
    tree = DOMNode('crossfaders')
    for i in lb.crossfader.values():
        tree.append(i.to_tree())
    return tree