Changeset 1656 for trunk

Show
Ignore:
Timestamp:
09/05/09 05:56:05 (15 years ago)
Author:
arnonym
Message:

Allow to deactivate the peaks.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/mixer-qt4/ffado/widgets/crossbarrouter.py

    r1654 r1656  
    153153        self.interface = dbus.Interface(self.dev, dbus_interface="org.ffado.Control.Element.CrossbarRouter") 
    154154 
     155        print self.interface.getDestinations() 
     156 
    155157        destinations = self.interface.getDestinationNames() 
    156158        self.outgroups = [] 
     
    160162                self.outgroups.append(tmp) 
    161163 
    162         self.layout = QtGui.QGridLayout(self) 
    163         self.setLayout(self.layout) 
     164        self.biglayout = QtGui.QVBoxLayout(self) 
     165        self.setLayout(self.biglayout) 
     166 
     167        self.toplayout = QtGui.QHBoxLayout() 
     168        self.biglayout.addLayout(self.toplayout) 
     169 
     170        btn = QtGui.QPushButton("Switch VU", self) 
     171        btn.setCheckable(True) 
     172        btn.setChecked(True) 
     173        self.connect(btn, QtCore.SIGNAL("toggled(bool)"), self.runVu) 
     174        self.toplayout.addWidget(btn) 
     175 
     176        self.layout = QtGui.QGridLayout() 
     177        self.biglayout.addLayout(self.layout) 
    164178 
    165179        self.switchers = {} 
    166180        for out in destinations: 
    167181            btn = OutputSwitcher(self.interface, out, self) 
    168             self.layout.addWidget(btn, int(out.split(":")[-1]), self.outgroups.index(out.split(":")[0])) 
     182            self.layout.addWidget(btn, int(out.split(":")[-1]) + 1, self.outgroups.index(out.split(":")[0])) 
    169183            self.switchers[self.interface.getDestinationIndex(out)] = btn 
    170184 
     
    172186        self.timer.setInterval(200) 
    173187        self.connect(self.timer, QtCore.SIGNAL("timeout()"), self.updateLevels) 
    174         self.timer.start() 
     188        self.runVu(True) 
     189 
     190    def runVu(self, run=True): 
     191        if run: 
     192            self.timer.start() 
     193        else: 
     194            self.timer.stop() 
     195            for sw in self.switchers: 
     196                self.switchers[sw].peakValue(0) 
    175197 
    176198    def updateLevels(self):