示例#1
0
 def __init__(self,
              parent,
              label,
              init,
              rate,
              name,
              colour,
              tooltip,
              stack=False,
              output=True):
     self.type = "toggle"
     self.name = name
     self.rate = rate
     self.output = output
     if label != '':
         if stack:
             self.label = Label(parent,
                                label,
                                colour=colour[0],
                                size=(210, 20))
         else:
             self.label = Label(parent,
                                label,
                                colour=colour[0],
                                size=(100, 20))
         self.label.SetToolTip(CECTooltip(TT_TOGGLE))
     self.toggle = Toggle(parent,
                          init,
                          outFunction=self.onToggle,
                          colour=colour[1])
     if tooltip != '':
         self.toggle.SetToolTip(CECTooltip(tooltip))
示例#2
0
class CECToggle:
    def __init__(self, parent, label, init, rate, name, colour, tooltip, stack=False, output=True):
        self.type = "toggle"
        self.name = name
        self.rate = rate
        self.output = output
        if label != '':
            if stack:
                self.label = Label(parent, label, colour=colour[0], size=(210, 20))
            else:
                self.label = Label(parent, label, colour=colour[0], size=(100, 20))
            self.label.SetToolTip(CECTooltip(TT_TOGGLE))
        self.toggle = Toggle(parent, init, outFunction=self.onToggle, colour=colour[1])
        if tooltip != '':
            self.toggle.SetToolTip(CECTooltip(tooltip))

    def getName(self):
        return self.name

    def getValue(self):
        return self.toggle.getValue()
    
    def setValue(self, state, dump=None):
        self.toggle.setValue(state)

    def onToggle(self, value):
        if CeciliaLib.getVar("currentModule") != None and self.output:
            getattr(CeciliaLib.getVar("currentModule"), self.name)(value)
示例#3
0
class CECToggle:
    def __init__(self, parent, label, init, rate, name, colour, tooltip, stack=False, output=True):
        self.type = "toggle"
        self.name = name
        self.rate = rate
        self.output = output
        if label != '':
            if stack:
                self.label = Label(parent, label, colour=colour[0], size=(210, 20))
            else:
                self.label = Label(parent, label, colour=colour[0], size=(100, 20))
            self.label.SetToolTip(CECTooltip(TT_TOGGLE))
        self.toggle = Toggle(parent, init, outFunction=self.onToggle, colour=colour[1])
        if tooltip != '':
            self.toggle.SetToolTip(CECTooltip(tooltip))

    def getName(self):
        return self.name

    def getValue(self):
        return self.toggle.getValue()
    
    def setValue(self, state, dump=None):
        self.toggle.setValue(state)

    def onToggle(self, value):
        if CeciliaLib.getVar("currentModule") != None and self.output:
            getattr(CeciliaLib.getVar("currentModule"), self.name)(value)
class SamplerToggle:
    def __init__(self, parent, init, name):
        self.name = name+'startpoint'
        self.rate = 'i'
        self.value = init
        self.toggle = Toggle(parent, init, outFunction=self.onToggle)

    def onToggle(self,val):
        self.value = val

    def getName(self):
        return self.name

    def getRate(self):
        return self.rate

    def getValue(self):
        return self.value
    
    def setValue(self, value):
        self.value = value
        self.toggle.setValue(self.value)

    def getCeciliaText(self):
        orchtext = ''
        scotext = ''
        if self.rate == 'k':
            orchtext += 'instr Cecilia_%s\n' % self.name
            orchtext += 'gk%s chnget "%s_value"\n' % (self.name, self.name)
            orchtext += 'endin\n\n'
            
            scotext += 'i "Cecilia_%s" 0 %f\n' % (self.name, CeciliaLib.getTotalTime())
        return orchtext, scotext
 def __init__(self, parent, label, init, name, colour, rate, tooltip):
     self.name = name
     self.label = Label(parent, label, colour=colour[0])
     self.rate = rate
     self.toggle = Toggle(parent, init, outFunction=self.onToggle, colour=colour[1])
     if tooltip != '':
         self.toggle.SetToolTip(CECTooltip(tooltip))
class CECToggle:
    def __init__(self, parent, label, init, name, colour, rate, tooltip):
        self.name = name
        self.label = Label(parent, label, colour=colour[0])
        self.rate = rate
        self.toggle = Toggle(parent, init, outFunction=self.onToggle, colour=colour[1])
        if tooltip != '':
            self.toggle.SetToolTip(CECTooltip(tooltip))

    def getName(self):
        return self.name

    def getRate(self):
        return self.rate

    def getValue(self):
        return self.toggle.getValue()
    
    def setValue(self, state, dump=None):
        self.toggle.setValue(state)

    def onToggle(self, value):
        if self.rate == 'k':
            CeciliaLib.getCsound().setChannel("%s_value" % self.name, value)

    def getCeciliaText(self):
        orchtext = ''
        scotext = ''
        if self.rate == 'k':
            orchtext += 'instr Cecilia_%s\n' % self.name
            orchtext += 'gk%s chnget "%s_value"\n' % (self.name, self.name)
            orchtext += 'endin\n\n'
            
            scotext += 'i "Cecilia_%s" 0 %f\n' % (self.name, CeciliaLib.getTotalTime())
        return orchtext, scotext
示例#7
0
class SamplerToggle:
    def __init__(self, parent, init, name):
        self.name = name+'startpoint'
        self.value = init
        self.toggle = Toggle(parent, init, outFunction=self.onToggle)

    def onToggle(self,val):
        self.value = val

    def getName(self):
        return self.name

    def getValue(self):
        return self.value
    
    def setValue(self, value):
        self.value = value
        self.toggle.setValue(self.value)
示例#8
0
class SamplerToggle:
    def __init__(self, parent, init, name):
        self.name = name+'startpoint'
        self.value = init
        self.toggle = Toggle(parent, init, outFunction=self.onToggle)

    def onToggle(self,val):
        self.value = val

    def getName(self):
        return self.name

    def getValue(self):
        return self.value
    
    def setValue(self, value):
        self.value = value
        self.toggle.setValue(self.value)
示例#9
0
 def __init__(self, parent, label, init, rate, name, colour, tooltip, stack=False, output=True):
     self.type = "toggle"
     self.name = name
     self.rate = rate
     self.output = output
     if label != '':
         if stack:
             self.label = Label(parent, label, colour=colour[0], size=(210, 20))
         else:
             self.label = Label(parent, label, colour=colour[0], size=(100, 20))
         self.label.SetToolTip(CECTooltip(TT_TOGGLE))
     self.toggle = Toggle(parent, init, outFunction=self.onToggle, colour=colour[1])
     if tooltip != '':
         self.toggle.SetToolTip(CECTooltip(tooltip))
示例#10
0
 def __init__(self, parent, init, name):
     self.name = name+'startpoint'
     self.value = init
     self.toggle = Toggle(parent, init, outFunction=self.onToggle)
示例#11
0
 def __init__(self, parent, init, name):
     self.name = name+'startpoint'
     self.value = init
     self.toggle = Toggle(parent, init, outFunction=self.onToggle)