Changeset 2017
- Timestamp:
- 12/20/11 03:41:58 (9 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/support/mixer-qt4/ffado/widgets/matrixmixer.py
r2016 r2017 55 55 56 56 class MixerNode(QtGui.QAbstractSlider): 57 def __init__(self, input, output, value, max, parent):57 def __init__(self, input, output, value, max, muted, parent): 58 58 QtGui.QAbstractSlider.__init__(self, parent) 59 59 #log.debug("MixerNode.__init__( %i, %i, %i, %i, %s )" % (input, output, value, max, str(parent)) ) … … 96 96 self.addAction(action) 97 97 98 # Only show the mute menu item if a value has been supplied 99 self.mute_action = None 100 if (muted != None): 101 action = QtGui.QAction(text, self) 102 action.setSeparator(True) 103 self.addAction(action) 104 self.mute_action = QtGui.QAction("Mute", self) 105 self.mute_action.setCheckable(True) 106 self.mute_action.setChecked(muted) 107 self.connect(self.mute_action, QtCore.SIGNAL("triggered()"), self.mapper, QtCore.SLOT("map()")) 108 self.mapper.setMapping(self.mute_action, "Mute") 109 self.addAction(self.mute_action) 110 98 111 def directValues(self,text): 99 112 #log.debug("MixerNode.directValues( '%s' )" % text) 100 text = text.split(" ")[0].replace(",",".") 101 n = pow(10, (float(text)/20)) * pow(2,14) 102 #log.debug("%g" % n) 103 self.setValue(n) 113 if text == "Mute": 114 log.debug("Mute %d" % self.mute_action.isChecked()) 115 else: 116 text = text.split(" ")[0].replace(",",".") 117 n = pow(10, (float(text)/20)) * pow(2,14) 118 #log.debug("%g" % n) 119 self.setValue(n) 104 120 105 121 def mousePressEvent(self, ev): … … 244 260 self.items.append([]) 245 261 for j in range(cols): 246 node = MixerNode(j, i, self.interface.getValue(i,j), sliderMaxValue, self)262 node = MixerNode(j, i, self.interface.getValue(i,j), sliderMaxValue, None, self) 247 263 self.connect(node, QtCore.SIGNAL("valueChanged"), self.valueChanged) 248 264 layout.addWidget(node, i+1, j+1)