Changeset 1644
- Timestamp:
- 08/30/09 15:36:59 (14 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/support/mixer-qt4/ffado/mixer/saffire_dice.py
r1643 r1644 32 32 self.tabs = QtGui.QTabWidget(self) 33 33 self.layout.addWidget(self.tabs) 34 #self.mixerwidget = QtGui.QScrollArea(self)35 #self.mixerwidget.setWidgetResizable(True)36 #self.layout.addWidget(self.mixerwidget)37 34 38 35 def buildMixer(self): … … 40 37 #print self.hw.getText("/Generic/Nickname") 41 38 self.matrix = MatrixMixer(self.hw.servername, self.hw.basepath+"/EAP/MatrixMixer", self) 42 #self.mixerwidget.setWidget(self.matrix)43 39 scrollarea = QtGui.QScrollArea(self.tabs) 44 40 scrollarea.setWidgetResizable(True) trunk/libffado/support/mixer-qt4/ffado/widgets/crossbarrouter.py
r1643 r1644 23 23 24 24 25 class CrossbarState(QtGui.QAbstractButton): 26 def __init__(self, title, parent=None): 27 QtGui.QAbstractButton.__init__(self, parent) 28 self.setText(title) 29 self.setToolTip(title) 30 31 self.setMinimumSize(QtCore.QSize(10, 10)) 32 33 def paintEvent(self, event): 34 p = QtGui.QPainter(self) 35 color = QtGui.QColor(0, 255, 0) 36 if self.isChecked(): 37 color = QtGui.QColor(255, 0, 0) 38 p.fillRect(self.rect(), color) 39 25 40 26 41 class CrossbarRouter(QtGui.QWidget): … … 43 58 print "Available destinations (%i=?%i) %s" % (self.interface.getNbDestinations(), len(self.destinations), str(self.destinations)) 44 59 60 self.innames = [] 61 self.ingroups = {} 62 for ch in self.sources: 63 tmp = ch.split(":")[0] 64 if not tmp in self.ingroups: 65 self.ingroups[tmp] = 0 66 self.innames.append(tmp) 67 self.ingroups[tmp] = self.ingroups[tmp] + 1 68 print self.ingroups 69 self.outnames = [] 70 self.outgroups = {} 71 for ch in self.destinations: 72 tmp = ch.split(":")[0] 73 if not tmp in self.outgroups: 74 self.outgroups[tmp] = 0 75 self.outnames.append(tmp) 76 self.outgroups[tmp] = self.outgroups[tmp] + 1 77 print self.outgroups 78 45 79 self.layout = QtGui.QGridLayout(self) 46 80 self.setLayout(self.layout) 47 81 82 tmp = 1 83 for group in self.innames: 84 lbl = QtGui.QLabel(group, self) 85 self.layout.addWidget(lbl, 0, tmp + self.innames.index(group), 1, self.ingroups[group]) 86 tmp += self.ingroups[group] 87 tmp = 1 88 for group in self.outnames: 89 lbl = QtGui.QLabel(group, self) 90 self.layout.addWidget(lbl, tmp + self.outnames.index(group), 0, self.outgroups[group], 1) 91 tmp += self.outgroups[group] 48 92 #for i in range(len(self.sources)): 49 93 # lbl = QtGui.QLabel(self.sources[i], self) … … 53 97 # self.layout.addWidget(lbl, i+1, 0) 54 98 55 for i in range(0, len(self.sources)):99 for i in range(0, min(600, len(self.sources))): 56 100 print "Checking connections for source %s" % self.sources[i] 57 for j in range(0, len(self.destinations)): 58 if self.interface.canConnect(i, j): 59 checkbox = QtGui.QPushButton("%s->%s" % (self.sources[i], self.destinations[j]), self) 101 for j in range(0, min(600, len(self.destinations))): 102 if self.interface.canConnect(i, j) and self.sources[i].split(":")[0] != self.destinations[j].split(":")[0]: 103 #checkbox = QtGui.QPushButton("%s->%s" % (self.sources[i], self.destinations[j]), self) 104 checkbox = CrossbarState("%s->%s" % (self.sources[i], self.destinations[j]), self) 60 105 checkbox.setCheckable(True) 61 106 checkbox.setChecked(self.interface.getConnectionState(i, j)) 62 self.layout.addWidget(checkbox, j, i)63 #self.layout.addWidget(checkbox, j+1, i+1)107 #self.layout.addWidget(checkbox, j, i) 108 self.layout.addWidget(checkbox, j+1, i+1) 64 109 # 65 110 # vim: sw=4 ts=4 et