Beispiel #1
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 #2
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 #3
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 #4
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 #5
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 #6
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 #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_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 #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 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 #12
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 #13
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 #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 save():
    tree = DOMNode("processes")
    for i in lb.process.values():
        tree.append(i.to_tree())
    return tree
Beispiel #16
0
def save():
    tree = DOMNode('programs')
    for p in lb.program.values():
        tree.append(p.to_tree())
    return tree
Beispiel #17
0
def save():
    tree = DOMNode('processes')
    for i in lb.process.values():
        tree.append(i.to_tree())
    return tree
Beispiel #18
0
 def send_update(self):
     tree = DOMNode('programs')
     tree.append(self.to_tree())
     lb.sendData(tree)
Beispiel #19
0
def save():
    tree = DOMNode('levelfaders')
    for i in lb.levelfader.values():
        tree.append(i.to_tree())
    return tree
Beispiel #20
0
 def send_update(self):
     tree = DOMNode('levelfaders')
     tree.append(self.to_tree())
     lb.sendData(tree)
Beispiel #21
0
def save():
    tree = DOMNode('cues')
    for i in lb.cue.values():
        tree.append(i.to_tree())
    return tree
Beispiel #22
0
def save():
    tree = DOMNode('crossfaders')
    for i in lb.crossfader.values():
        tree.append(i.to_tree())
    return tree
Beispiel #23
0
def save():
    tree = DOMNode('programs')
    for p in lb.program.values():
        tree.append(p.to_tree())
    return tree
Beispiel #24
0
 def send_update(self):
     tree = DOMNode('processes')
     tree.append(self.to_tree())
     lb.sendData(tree)
Beispiel #25
0
def save():
    tree = DOMNode('crossfaders')
    for i in lb.crossfader.values():
        tree.append(i.to_tree())
    return tree
Beispiel #26
0
def save():
    tree = DOMNode("cues")
    for i in lb.cue.values():
        tree.append(i.to_tree())
    return tree
Beispiel #27
0
 def send_update(self):
     tree = DOMNode('crossfaders')
     tree.append(self.to_tree())
     lb.sendData(tree)
Beispiel #28
0
 def send_update(self):
     tree = DOMNode("processes")
     tree.append(self.to_tree())
     lb.sendData(tree)
Beispiel #29
0
def save():
    tree = DOMNode('procedures')
    for i in lb.procedure.values():
        tree.append(i.to_tree())
    return tree