From: <tr...@ff...> - 2010-02-02 22:31:19
|
Author: arnonym Date: 2010-02-02 14:31:11 -0800 (Tue, 02 Feb 2010) New Revision: 1796 Added: trunk/libffado/support/mixer-qt4/ffado/mixer/generic_dice_eap.py Modified: trunk/libffado/support/mixer-qt4/ffado/mixer/saffire_dice.py trunk/libffado/support/mixer-qt4/ffado/mixer/saffire_dice_monitoring.ui trunk/libffado/support/mixer-qt4/ffado/widgets/crossbarrouter.py Log: Re-factor the generic-dice parts of the mixer into its own gui. For devices that have a dice EAP but are not focusrite, using 'mixer = "Generic_Dice_EAP"' in the configuration should give a nice mixer and router. Copied: trunk/libffado/support/mixer-qt4/ffado/mixer/generic_dice_eap.py (from rev 1794, trunk/libffado/support/mixer-qt4/ffado/mixer/saffire_dice.py) =================================================================== --- trunk/libffado/support/mixer-qt4/ffado/mixer/generic_dice_eap.py (rev 0) +++ trunk/libffado/support/mixer-qt4/ffado/mixer/generic_dice_eap.py 2010-02-02 22:31:11 UTC (rev 1796) @@ -0,0 +1,57 @@ +# +# Copyright (C) 2009-2010 by Arnold Krille +# +# This file is part of FFADO +# FFADO = Free Firewire (pro-)audio drivers for linux +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +from PyQt4 import QtGui, QtCore, Qt +import dbus + +from ffado.widgets.matrixmixer import MatrixMixer +from ffado.widgets.crossbarrouter import * + +from ffado.config import * + +class Generic_Dice_EAP(QtGui.QWidget): + def __init__(self, parent=None): + QtGui.QWidget.__init__(self, parent) + self.layout = QtGui.QGridLayout(self) + self.setLayout(self.layout) + self.tabs = QtGui.QTabWidget(self) + self.layout.addWidget(self.tabs) + + def buildMixer(self): + #print self.hw + #print self.hw.getText("/Generic/Nickname") + self.matrix = MatrixMixer(self.hw.servername, self.hw.basepath+"/EAP/MatrixMixer", self) + scrollarea = QtGui.QScrollArea(self.tabs) + scrollarea.setWidgetResizable(True) + scrollarea.setWidget(self.matrix) + self.tabs.addTab(scrollarea, "Matrix") + + self.router = CrossbarRouter(self.hw.servername, self.hw.basepath+"/EAP/Router", self) + scrollarea = QtGui.QScrollArea(self.tabs) + scrollarea.setWidgetResizable(True) + scrollarea.setWidget(self.router) + self.tabs.addTab(scrollarea, "Routing") + + + #def getDisplayTitle(self): + # return "Saffire PRO40/PRO24 Mixer" + +# +# vim: et ts=4 sw=4 Modified: trunk/libffado/support/mixer-qt4/ffado/mixer/saffire_dice.py =================================================================== --- trunk/libffado/support/mixer-qt4/ffado/mixer/saffire_dice.py 2010-02-02 22:29:11 UTC (rev 1795) +++ trunk/libffado/support/mixer-qt4/ffado/mixer/saffire_dice.py 2010-02-02 22:31:11 UTC (rev 1796) @@ -1,5 +1,5 @@ # -# Copyright (C) 2009 by Arnold Krille +# Copyright (C) 2009-2010 by Arnold Krille # # This file is part of FFADO # FFADO = Free Firewire (pro-)audio drivers for linux @@ -23,6 +23,7 @@ from ffado.widgets.matrixmixer import MatrixMixer from ffado.widgets.crossbarrouter import * +from ffado.mixer.generic_dice_eap import * from ffado.config import * @@ -196,29 +197,15 @@ self.emit(QtCore.SIGNAL("commitData(QWidget*)"), editor) self.emit(QtCore.SIGNAL("closeEditor(QWidget*)"), editor) -class Saffire_Dice(QtGui.QWidget): +class Saffire_Dice(Generic_Dice_EAP): def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) - self.layout = QtGui.QGridLayout(self) - self.setLayout(self.layout) - self.tabs = QtGui.QTabWidget(self) - self.layout.addWidget(self.tabs) + Generic_Dice_EAP.__init__(self, parent) def buildMixer(self): #print self.hw #print self.hw.getText("/Generic/Nickname") - self.matrix = MatrixMixer(self.hw.servername, self.hw.basepath+"/EAP/MatrixMixer", self) - scrollarea = QtGui.QScrollArea(self.tabs) - scrollarea.setWidgetResizable(True) - scrollarea.setWidget(self.matrix) - self.tabs.addTab(scrollarea, "Matrix") + Generic_Dice_EAP.buildMixer(self) - self.router = CrossbarRouter(self.hw.servername, self.hw.basepath+"/EAP/Router", self) - scrollarea = QtGui.QScrollArea(self.tabs) - scrollarea.setWidgetResizable(True) - scrollarea.setWidget(self.router) - self.tabs.addTab(scrollarea, "Routing") - model = MonitoringModel(self.hw, self) widget = QtGui.QWidget() @@ -242,6 +229,7 @@ self.connect(widget.volumeKnob, QtCore.SIGNAL("valueChanged(int)"), self.volumeChanged) if self.configrom.getModelName() == "SAFFIRE_PRO_24": + widget.stacked.setCurrentWidget(widget.pagePro24) self.ch1inst = BooleanControl(self.hw, self.hw.basepath + "/EAP/Ch1LineInst") widget.chkInst1.setChecked(self.ch1inst.selected()) self.connect(widget.chkInst1, QtCore.SIGNAL("toggled(bool)"), self.ch1inst.select) @@ -254,13 +242,16 @@ self.ch4level = BooleanControl(self.hw, self.hw.basepath + "/EAP/Ch4Level") widget.chkLevel4.setChecked(self.ch4level.selected()) self.connect(widget.chkLevel4, QtCore.SIGNAL("toggled(bool)"), self.ch4level.select) - widget.chkSpdif.deleteLater() - widget.btnPad.deleteLater() + #widget.chkSpdif.deleteLater() + #widget.btnPad.deleteLater() + elif self.configrom.getModelName() == "SAFFIRE_PRO_40": + widget.stacked.setCurrentWidget(widget.pagePro40) + #widget.chkInst1.deleteLater() + #widget.chkInst2.deleteLater() + #widget.chkLevel3.deleteLater() + #widget.chkLevel4.deleteLater() else: - widget.chkInst1.deleteLater() - widget.chkInst2.deleteLater() - widget.chkLevel3.deleteLater() - widget.chkLevel4.deleteLater() + self.stacked.deleteLater() def muteToggle(self, mute): Modified: trunk/libffado/support/mixer-qt4/ffado/mixer/saffire_dice_monitoring.ui =================================================================== --- trunk/libffado/support/mixer-qt4/ffado/mixer/saffire_dice_monitoring.ui 2010-02-02 22:29:11 UTC (rev 1795) +++ trunk/libffado/support/mixer-qt4/ffado/mixer/saffire_dice_monitoring.ui 2010-02-02 22:31:11 UTC (rev 1796) @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>599</width> - <height>657</height> + <height>406</height> </rect> </property> <property name="windowTitle"> @@ -27,44 +27,102 @@ </sizepolicy> </property> </widget> - <widget class="QWidget" name="layoutWidget"> + <widget class="QWidget" name=""> <layout class="QGridLayout" name="gridLayout"> - <item row="3" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Dim Level:</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="buddy"> - <cstring>dimLevel</cstring> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QSpinBox" name="dimLevel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="suffix"> - <string> dB</string> - </property> - <property name="minimum"> - <number>-127</number> - </property> - <property name="maximum"> + <item row="0" column="0" rowspan="2" colspan="2"> + <widget class="QStackedWidget" name="stacked"> + <property name="currentIndex"> <number>0</number> </property> + <widget class="QWidget" name="pagePro24"> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="0" column="0"> + <widget class="QCheckBox" name="chkInst1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Ch 1 Instrument</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QCheckBox" name="chkLevel4"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Ch 4 High Level</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QCheckBox" name="chkInst2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Ch 2 Instrument</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QCheckBox" name="chkLevel3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Ch 3 High Level</string> + </property> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="pagePro40"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QCheckBox" name="chkSpdif"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Use ADAT-Out as S/PDIF</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnPad"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Pad Output</string> + </property> + </widget> + </item> + </layout> + </widget> </widget> </item> - <item row="0" column="2" rowspan="6"> + <item row="0" column="2" rowspan="5"> <widget class="QGroupBox" name="groupBox"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> @@ -117,7 +175,42 @@ </layout> </widget> </item> - <item row="4" column="0" colspan="2"> + <item row="2" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Dim Level:</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="buddy"> + <cstring>dimLevel</cstring> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QSpinBox" name="dimLevel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="suffix"> + <string> dB</string> + </property> + <property name="minimum"> + <number>-127</number> + </property> + <property name="maximum"> + <number>0</number> + </property> + </widget> + </item> + <item row="3" column="0" colspan="2"> <widget class="QPushButton" name="btnDim"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> @@ -139,7 +232,7 @@ </property> </widget> </item> - <item row="5" column="0" colspan="2"> + <item row="4" column="0" colspan="2"> <widget class="QPushButton" name="btnMute"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> @@ -161,84 +254,6 @@ </property> </widget> </item> - <item row="0" column="0"> - <widget class="QCheckBox" name="chkInst1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Ch 1 Instrument</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QCheckBox" name="chkLevel3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Ch 3 High Level</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QCheckBox" name="chkInst2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Ch 2 Instrument</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QCheckBox" name="chkLevel4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Ch 4 High Level</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QCheckBox" name="chkSpdif"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Use ADAT-Out as S/PDIF</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QPushButton" name="btnPad"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Pad Output</string> - </property> - </widget> - </item> </layout> </widget> </widget> Modified: trunk/libffado/support/mixer-qt4/ffado/widgets/crossbarrouter.py =================================================================== --- trunk/libffado/support/mixer-qt4/ffado/widgets/crossbarrouter.py 2010-02-02 22:29:11 UTC (rev 1795) +++ trunk/libffado/support/mixer-qt4/ffado/widgets/crossbarrouter.py 2010-02-02 22:31:11 UTC (rev 1796) @@ -70,6 +70,7 @@ self.setLayout(self.layout) self.lbl = QtGui.QLabel(self.outname, self) + self.lbl.setToolTip("The name of the destination that is to be controlled here.") self.layout.addWidget(self.lbl, 0, 0) self.vu = VuMeter(self.interface, outname, parent=self) @@ -78,6 +79,7 @@ sources = self.interface.getSourceNames() self.combo = QtGui.QComboBox(self) + self.combo.setToolTip("<qt>Select the source for this destination.<br>Each destination can only receive sound from one source at a time. But one source can send sound to multiple destinations.</qt>") self.layout.addWidget(self.combo, 1, 0, 1, 2) self.combo.addItem("Disconnected") self.combo.addItems(sources) |