示例#1
0
    def buildMixer(self):
        #print self.hw
        #print self.hw.getText("/Generic/Nickname")
        self.mixer = MatrixMixer(self.hw.servername, self.hw.basepath+"/EAP/MatrixMixer", self, "Columns_are_outputs", -1, None, None, False, QTabWidget.North, QTabWidget.Rounded)
        self.tabs.addTab(self.mixer, "Mixer")

        self.router_scrollarea = self.buildRouter(self.hw.servername, self.hw.basepath+"/EAP/Router")
        self.tabs.addTab(self.router_scrollarea, "Crossbar Router")
示例#2
0
    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")

        model = MonitoringModel(self.hw, self)

        widget = QtGui.QWidget()
        uicLoad("ffado/mixer/saffire_dice_monitoring.ui", widget)
        widget.monitoringView.setModel(model)
        widget.monitoringView.setItemDelegate(MonitoringDelegate(self))
        self.tabs.addTab(widget, "Monitoring")

        self.muteInterface = BooleanControl(self.hw, self.hw.basepath+"/EAP/Monitoring/GlobalMute/State")
        widget.btnMute.setChecked(self.muteInterface.selected())
        self.connect(widget.btnMute, QtCore.SIGNAL("toggled(bool)"), self.muteToggle)
        self.dimInterface = BooleanControl(self.hw, self.hw.basepath+"/EAP/Monitoring/GlobalDim/State")
        widget.btnDim.setChecked(self.dimInterface.selected())
        self.connect(widget.btnDim, QtCore.SIGNAL("toggled(bool)"), self.dimToggle)

        self.dimLevelInterface = DiscreteControl(self.hw, self.hw.basepath+"/EAP/Monitoring/GlobalDim/Level")
        widget.dimLevel.setValue(self.dimLevelInterface.getvalue())
        self.connect(widget.dimLevel, QtCore.SIGNAL("valueChanged(int)"), self.dimLevelChanged)
        self.volumeInterface = DiscreteControl(self.hw, self.hw.basepath+"/EAP/Monitoring/GlobalVolume/Level")
        widget.volumeKnob.setValue(self.volumeInterface.getvalue())
        self.connect(widget.volumeKnob, QtCore.SIGNAL("valueChanged(int)"), self.volumeChanged)

        if self.configrom.getModelName() == "SAFFIRE_PRO_24":
            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)
            self.ch2inst = BooleanControl(self.hw, self.hw.basepath + "/EAP/Ch2LineInst")
            widget.chkInst2.setChecked(self.ch2inst.selected())
            self.connect(widget.chkInst2, QtCore.SIGNAL("toggled(bool)"), self.ch2inst.select)
            self.ch3level = BooleanControl(self.hw, self.hw.basepath + "/EAP/Ch3Level")
            widget.chkLevel3.setChecked(self.ch3level.selected())
            self.connect(widget.chkLevel3, QtCore.SIGNAL("toggled(bool)"), self.ch3level.select)
            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)
        else:
            widget.chkInst1.deleteLater()
            widget.chkInst2.deleteLater()
            widget.chkLevel3.deleteLater()
            widget.chkLevel4.deleteLater()
示例#3
0
    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 Mixer")

        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, "Crossbar Router")
示例#4
0
文件: rme.py 项目: nphilipp/ffado.svn
    def initValues(self):

        # print self.hw.servername
        # print self.hw.basepath
        self.inputmatrix = MatrixMixer(
            self.hw.servername, self.hw.basepath + "/Mixer/InputFaders", self,
            "Columns_are_inputs", 0x8000,
            self.hw.basepath + "/Mixer/InputMutes",
            self.hw.basepath + "/Mixer/InputInverts", True)
        layout = QVBoxLayout()
        layout.addWidget(self.inputmatrix)
        self.mixer.setLayout(layout)

        self.playbackmatrix = MatrixMixer(
            self.hw.servername, self.hw.basepath + "/Mixer/PlaybackFaders",
            self, "Columns_are_inputs", 0x8000,
            self.hw.basepath + "/Mixer/PlaybackMutes",
            self.hw.basepath + "/Mixer/PlaybackInverts", True)
        layout = QVBoxLayout()
        layout.addWidget(self.playbackmatrix)
        self.playbackmixer.setLayout(layout)

        self.outputmatrix = MatrixMixer(
            self.hw.servername, self.hw.basepath + "/Mixer/OutputFaders", self,
            "Columns_are_inputs", 0x8000,
            self.hw.basepath + "/Mixer/OutputMutes", None, True)
        layout = QVBoxLayout()

        # This is a bit of a hack, but it works to ensure this single-row
        # matrix mixer doesn't fill the entire screen but also doesn't end
        # up with a pointless scrollbar.  The matrix mixer's minimum height
        # is 0 according to minimumHeight(), which is probably the
        # fundamental issue here; however, I've already wasted too much time
        # trying to get this to work so if the hack is effective we'll run
        # with it.
        self.outputmatrix.setMinimumHeight(150)
        layout.addWidget(self.outputmatrix, 0, Qt.AlignTop)
        self.outputmixer.setLayout(layout)

        self.is_streaming = False
        self.last_streaming_state = False

        # Disable the "load settings" button if streaming is active.  Its
        # enable state will be kept up to date by updateStreamingState().
        self.control_load.setEnabled(not (self.is_streaming))

        # Also disable other controls which are not yet implemented.
        self.mixer_preset_ffado_default.setEnabled(False)

        # Retrieve other device settings as needed and customise the UI
        # based on these options.
        self.model = self.hw.getDiscrete('/Control/Model')
        log.debug("device model identifier: %d" % (self.model))
        self.tco_present = self.hw.getDiscrete('/Control/TCO_present')
        log.debug("device has TCO: %d" % (self.tco_present))
        #self.sample_rate = self.hw.getDiscrete('/Mixer/Info/SampleRate')
        #log.debug("device sample rate: %d" % (self.sample_rate))

        # Assume the TCO options tab is the second from the left (index 1)
        if (not (self.tco_present)):
            self.disable_hide(self.tco_options)
            self.tabWidget.setTabEnabled(1, False)
            self.tabWidget.removeTab(1)

        # The Fireface-400 only has 2 phantom-capable channels
        if (self.model == RME_MODEL_FF400):
            self.disable_hide(self.phantom_2)
            self.disable_hide(self.phantom_3)
        else:
            self.phantom_0.setText("Mic 7")
            self.phantom_1.setText("Mic 8")
            self.phantom_2.setText("Mic 9")
            self.phantom_3.setText("Mic 10")

        # Instrument options, input jack selection controls and an ADAT2
        # input are applicable only to the FF800
        if (self.model != RME_MODEL_FF800):
            self.instrument_options_group.setEnabled(False)
            self.input_plug_select_group.setEnabled(False)
            self.sync_ref_adat2.setEnabled(False)
            self.sync_check_adat2_label.setEnabled(False)
            self.sync_check_adat2_status.setEnabled(False)
            self.spdif_output_optical.setText("ADAT optical")
            self.spdif_input_optical.setText("ADAT optical")

        if (not (self.tco_present)):
            self.sync_check_tco_label.setEnabled(False)
            self.sync_check_tco_status.setEnabled(False)
            self.sync_ref_tco.setEnabled(False)

        # Only the FF400 has specific channel 3/4 options, input gain
        # controls and switchable phones level
        if (self.model != RME_MODEL_FF400):
            # Hide the upper-level frame (and everything in it) to ensure it
            # requests no vertical space when its contents aren't needed.
            self.disable_hide(self.igains_chan34_opts_frame)
            self.phones_level_group.setEnabled(False)

        # Add the "No ADAT-2" item to the bandwidth limit control if the
        # device is not a FF400.
        if (self.model != RME_MODEL_FF400):
            self.bandwidth_limit.insertItem(1, "No ADAT-2")

        self.getValuesFromFF()
        self.setupSignals()

        # Ensure the limiter checkbox has a signal handler associated with
        # it.  If getValuesFromFF() disabled it because the front input was
        # not selected, setupSignals() would not have configured a handler.
        if (not (self.ch1_instr_limiter.isEnabled())):
            self.ch1_instr_limiter.toggled.connect(self.updateCheckboxes)

        self.updateStreamingState()
        #log.debug("device streaming flag: %d" % (self.is_streaming))

        self.update_timer = QTimer(self)
        self.update_timer.timeout.connect(self.status_update)
        self.update_timer.start(1000)
示例#5
0
    def initValues(self):

        # print self.hw.servername
        # print self.hw.basepath
        self.inputmatrix = MatrixMixer(
            self.hw.servername, self.hw.basepath + "/Mixer/InputFaders", self,
            0x8000, self.hw.basepath + "/Mixer/InputMutes",
            self.hw.basepath + "/Mixer/InputInverts", True)
        layout = QtGui.QVBoxLayout()
        scrollarea = QtGui.QScrollArea()
        scrollarea.setWidgetResizable(True)
        scrollarea.setWidget(self.inputmatrix)
        layout.addWidget(scrollarea)
        self.mixer.setLayout(layout)

        self.playbackmatrix = MatrixMixer(
            self.hw.servername, self.hw.basepath + "/Mixer/PlaybackFaders",
            self, 0x8000, self.hw.basepath + "/Mixer/PlaybackMutes",
            self.hw.basepath + "/Mixer/PlaybackInverts", True)
        layout = QtGui.QVBoxLayout()
        scrollarea = QtGui.QScrollArea()
        scrollarea.setWidgetResizable(True)
        scrollarea.setWidget(self.playbackmatrix)
        layout.addWidget(scrollarea)
        self.playbackmixer.setLayout(layout)

        self.outputmatrix = MatrixMixer(
            self.hw.servername, self.hw.basepath + "/Mixer/OutputFaders", self,
            0x8000, self.hw.basepath + "/Mixer/OutputMutes", None, True)
        layout = QtGui.QVBoxLayout()
        scrollarea = QtGui.QScrollArea()
        scrollarea.setWidget(self.outputmatrix)
        scrollarea.setWidgetResizable(True)

        # This is a bit of a hack, but it works to ensure this single-row
        # matrix mixer doesn't fill the entire screen but also doesn't end
        # up with a pointless scrollbar.  The matrix mixer's minimum height
        # is 0 according to minimumHeight(), which is probably the
        # fundamental issue here; however, I've already wasted too much time
        # trying to get this to work so if the hack is effective we'll run
        # with it.
        scrollarea.setMinimumHeight(150)
        layout.addWidget(scrollarea, 0, Qt.AlignTop)
        self.outputmixer.setLayout(layout)

        self.is_streaming = False
        self.last_streaming_state = False

        # Retrieve other device settings as needed and customise the UI
        # based on these options.
        self.model = self.hw.getDiscrete('/Control/Model')
        log.debug("device model identifier: %d" % (self.model))
        self.tco_present = self.hw.getDiscrete('/Control/TCO_present')
        log.debug("device has TCO: %d" % (self.tco_present))
        #self.sample_rate = self.hw.getDiscrete('/Mixer/Info/SampleRate')
        #log.debug("device sample rate: %d" % (self.sample_rate))

        # The Fireface-400 only has 2 phantom-capable channels
        if (self.model == RME_MODEL_FF400):
            self.disable_hide(self.phantom_2)
            self.disable_hide(self.phantom_3)
        else:
            self.phantom_0.setText("Mic 7")
            self.phantom_1.setText("Mic 8")
            self.phantom_2.setText("Mic 9")
            self.phantom_3.setText("Mic 10")

        # Instrument options, input jack selection controls and an ADAT2
        # input are applicable only to the FF800
        if (self.model != RME_MODEL_FF800):
            self.instrument_options_group.setEnabled(False)
            self.input_plug_select_group.setEnabled(False)
            self.sync_ref_adat2.setEnabled(False)
            self.sync_check_adat2_label.setEnabled(False)
            self.sync_check_adat2_status.setEnabled(False)

        for ctrl, info in self.Combos.iteritems():
            if (not (ctrl.isEnabled())):
                continue
            val = self.hw.getDiscrete(info[0])
            log.debug("combo %s is %d" % (info[0], val))
            ctrl.setCurrentIndex(val)
            QObject.connect(ctrl, SIGNAL('currentIndexChanged(int)'),
                            self.updateCombo)

        if (not (self.tco_present)):
            self.sync_check_tco_label.setEnabled(False)
            self.sync_check_tco_status.setEnabled(False)
            self.sync_ref_tco.setEnabled(False)

        # Only the FF400 has specific channel 3/4 options, input gain
        # controls and switchable phones level
        if (self.model != RME_MODEL_FF400):
            self.disable_hide(self.input_gains_group)
            self.disable_hide(self.channel_3_4_options_group)
            self.phones_level_group.setEnabled(False)

        # Add the "No ADAT-2" item to the bandwidth limit control if the
        # device is not a FF400.  Set the control to reflect the current
        # device setting and connect an update signal.
        if (self.model != RME_MODEL_FF400):
            self.bandwidth_limit.insertItem(1, "No ADAT-2")
        val = self.hw.getDiscrete('/Control/Bandwidth_limit')
        if (self.model == RME_MODEL_FF400 and val > 1):
            val = val - 1
        self.bandwidth_limit.setCurrentIndex(val)
        QObject.connect(self.bandwidth_limit,
                        SIGNAL('currentIndexChanged(int)'),
                        self.updateBandwidthLimit)

        # Get current hardware values and connect GUI element signals to
        # their respective slots
        for ctrl, info in self.PhantomSwitches.iteritems():
            if (not (ctrl.isEnabled())):
                continue
            val = (self.hw.getDiscrete(info[0]) >> info[1]) & 0x01
            log.debug("phantom switch %d is %d" % (info[1], val))
            if val:
                ctrl.setChecked(True)
            else:
                ctrl.setChecked(False)
            QObject.connect(ctrl, SIGNAL('toggled(bool)'),
                            self.updatePhantomSwitch)

        for ctrl, info in self.Switches.iteritems():
            if (not (ctrl.isEnabled())):
                continue
            val = self.hw.getDiscrete(info[0])
            log.debug("switch %s is %d" % (info[0], val))
            if val:
                ctrl.setChecked(True)
            else:
                ctrl.setChecked(False)
            QObject.connect(ctrl, SIGNAL('toggled(bool)'), self.updateSwitch)

        for ctrl, info in self.Radiobuttons.iteritems():
            if (not (ctrl.isEnabled())):
                continue
            # This is a touch wasteful since it means we retrieve the control
            # value once per radio button rather than once per radio button
            # group.  In time we might introduce radiobutton groupings in the
            # self.* datastructures to avoid this, but for the moment this is
            # easy and it works.
            val = self.hw.getDiscrete(info[0])
            if (val == info[1]):
                val = 1
            else:
                val = 0
            ctrl.setChecked(val)
            log.debug("Radiobutton %s[%d] is %d" % (info[0], info[1], val))
            QObject.connect(ctrl, SIGNAL('toggled(bool)'),
                            self.updateRadiobutton)

        for ctrl, info in self.Checkboxes.iteritems():
            if (not (ctrl.isEnabled())):
                continue
            # This is a touch wasteful since it means we retrieve the control
            # value once per checkbox button rather than once per checkbox
            # group.  In time we might introduce checkbox groupings in the
            # self.* datastructures to avoid this, but for the moment this is
            # easy and it works.
            val = self.hw.getDiscrete(info[0])
            if (val & info[1]):
                val = 1
            else:
                val = 0
            ctrl.setChecked(val)
            log.debug("Checkbox %s[%d] is %d" % (info[0], info[1], val))
            QObject.connect(ctrl, SIGNAL('toggled(bool)'),
                            self.updateCheckboxes)

        for ctrl, info in self.Gains.iteritems():
            if (not (ctrl.isEnabled())):
                continue
            val = self.hw.getMatrixMixerValue(info[0], 0, info[1])
            log.debug("gain %s[%d] is %d" % (info[0], info[1], val))
            ctrl.setValue(val)
            QObject.connect(ctrl, SIGNAL('valueChanged(int)'), self.updateGain)

        self.updateStreamingState()
        #log.debug("device streaming flag: %d" % (self.is_streaming))

        self.update_timer = QTimer(self)
        QObject.connect(self.update_timer, SIGNAL('timeout()'),
                        self.status_update)
        self.update_timer.start(1000)