From: <tr...@ff...> - 2012-01-30 13:02:21
|
Author: jwoithe Date: 2012-01-30 05:02:09 -0800 (Mon, 30 Jan 2012) New Revision: 2021 Modified: trunk/libffado/src/rme/fireface_hw.cpp trunk/libffado/src/rme/rme_avdevice.cpp trunk/libffado/src/rme/rme_avdevice_settings.cpp trunk/libffado/support/mixer-qt4/ffado/mixer/rme.py trunk/libffado/support/mixer-qt4/ffado/widgets/matrixmixer.py Log: matrixmixer: complete initial implementation of optional mute functionality. A graphical indication of mute state (beyond the toggled menu item) is still needed. matrixmixer: implement optional phase inversion interface. Again, a graphical indication of this state is still required. rme: make use of the mute/invert functionality of the matrix mixer. Currently this is only connected for the input faders. Modified: trunk/libffado/src/rme/fireface_hw.cpp =================================================================== --- trunk/libffado/src/rme/fireface_hw.cpp 2012-01-19 18:09:35 UTC (rev 2020) +++ trunk/libffado/src/rme/fireface_hw.cpp 2012-01-30 13:02:09 UTC (rev 2021) @@ -858,7 +858,7 @@ RME_FF400_MAX_CHANNELS:RME_FF800_MAX_CHANNELS; if (src_channel>n_channels || dest_channel>n_channels) return -1; - if (val<0 || val>0x10000) + if (abs(val)>0x10000) return -1; if (m_rme_model == RME_MODEL_FIREFACE400) { Modified: trunk/libffado/src/rme/rme_avdevice.cpp =================================================================== --- trunk/libffado/src/rme/rme_avdevice.cpp 2012-01-19 18:09:35 UTC (rev 2020) +++ trunk/libffado/src/rme/rme_avdevice.cpp 2012-01-30 13:02:09 UTC (rev 2021) @@ -199,15 +199,15 @@ result &= m_MixerContainer->addElement( new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_OUTPUT_FADER, "OutputFaders")); result &= m_MixerContainer->addElement( - new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_INPUT_FADER, "InputMutes")); + new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_INPUT_MUTE, "InputMutes")); result &= m_MixerContainer->addElement( - new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_PLAYBACK_FADER, "PlaybackMutes")); + new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_PLAYBACK_MUTE, "PlaybackMutes")); result &= m_MixerContainer->addElement( - new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_OUTPUT_FADER, "OutputMutes")); + new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_OUTPUT_MUTE, "OutputMutes")); result &= m_MixerContainer->addElement( - new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_INPUT_FADER, "InputInverts")); + new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_INPUT_INVERT, "InputInverts")); result &= m_MixerContainer->addElement( - new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_PLAYBACK_FADER, "PlaybackInverts")); + new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_PLAYBACK_INVERT, "PlaybackInverts")); if (!result) { debugWarning("One or more device control/mixer elements could not be created\n"); Modified: trunk/libffado/src/rme/rme_avdevice_settings.cpp =================================================================== --- trunk/libffado/src/rme/rme_avdevice_settings.cpp 2012-01-19 18:09:35 UTC (rev 2020) +++ trunk/libffado/src/rme/rme_avdevice_settings.cpp 2012-01-30 13:02:09 UTC (rev 2021) @@ -242,6 +242,7 @@ val = -val; } +fprintf(stderr, "val=%d\n", val); return set_hardware_mixergain(ctype, src_channel, dest_channel, val); } @@ -279,6 +280,12 @@ else mixerflags = settings->playback_mixerflags; +// FIXME: When switching inversion modes, the hardware seems to a channel to +// full volume for about 1/10 sec. Attempt to avoid this by temporarily +// muting the channel. This doesn't seem to work though. +// if (flagmask & FF_SWPARAM_MF_INVERTED) +// set_hardware_mixergain(ctype, src_channel, dest_channel, 0); + if (val == 0) mixerflags[idx] &= ~flagmask; else Modified: trunk/libffado/support/mixer-qt4/ffado/mixer/rme.py =================================================================== --- trunk/libffado/support/mixer-qt4/ffado/mixer/rme.py 2012-01-19 18:09:35 UTC (rev 2020) +++ trunk/libffado/support/mixer-qt4/ffado/mixer/rme.py 2012-01-30 13:02:09 UTC (rev 2021) @@ -125,7 +125,7 @@ # print self.hw.servername # print self.hw.basepath - self.inputmatrix = MatrixMixer(self.hw.servername, self.hw.basepath+"/Mixer/InputFaders", self, 0x8000) + self.inputmatrix = MatrixMixer(self.hw.servername, self.hw.basepath+"/Mixer/InputFaders", self, 0x8000, self.hw.basepath+"/Mixer/InputMutes", self.hw.basepath+"/Mixer/InputInverts") layout = QtGui.QVBoxLayout() scrollarea = QtGui.QScrollArea() scrollarea.setWidgetResizable(True) Modified: trunk/libffado/support/mixer-qt4/ffado/widgets/matrixmixer.py =================================================================== --- trunk/libffado/support/mixer-qt4/ffado/widgets/matrixmixer.py 2012-01-19 18:09:35 UTC (rev 2020) +++ trunk/libffado/support/mixer-qt4/ffado/widgets/matrixmixer.py 2012-01-30 13:02:09 UTC (rev 2021) @@ -54,7 +54,7 @@ (1-f)*lc.blue() + f*hc.blue() ) class MixerNode(QtGui.QAbstractSlider): - def __init__(self, input, output, value, max, muted, parent): + def __init__(self, input, output, value, max, muted, inverted, parent): QtGui.QAbstractSlider.__init__(self, parent) #log.debug("MixerNode.__init__( %i, %i, %i, %i, %s )" % (input, output, value, max, str(parent)) ) @@ -108,10 +108,28 @@ self.mapper.setMapping(self.mute_action, "Mute") self.addAction(self.mute_action) + # Similarly, only show a phase inversion menu item if in use + self.inv_action = None + if (inverted != None): + if (muted == None): + action = QtGui.QAction(text, self) + action.setSeparator(True) + self.addAction(action) + self.inv_action = QtGui.QAction("Invert", self) + self.inv_action.setCheckable(True) + self.inv_action.setChecked(inverted) + self.connect(self.inv_action, QtCore.SIGNAL("triggered()"), self.mapper, QtCore.SLOT("map()")) + self.mapper.setMapping(self.inv_action, "Invert") + self.addAction(self.inv_action) + def directValues(self,text): #log.debug("MixerNode.directValues( '%s' )" % text) if text == "Mute": - log.debug("Mute %d" % self.mute_action.isChecked()) + #log.debug("Mute %d" % self.mute_action.isChecked()) + self.parent().mutes_interface.setValue(self.output, self.input, self.mute_action.isChecked()) + elif text == "Invert": + log.debug("Invert %d" % self.inv_action.isChecked()) + self.parent().inverts_interface.setValue(self.output, self.input, self.inv_action.isChecked()) else: text = text.split(" ")[0].replace(",",".") n = pow(10, (float(text)/20)) * pow(2,14) @@ -216,7 +234,7 @@ class MatrixMixer(QtGui.QWidget): - def __init__(self, servername, basepath, parent=None, sliderMaxValue=-1, mutespath=None): + def __init__(self, servername, basepath, parent=None, sliderMaxValue=-1, mutespath=None, invertspath=None): QtGui.QWidget.__init__(self, parent) self.bus = dbus.SessionBus() self.dev = self.bus.get_object(servername, basepath) @@ -228,6 +246,12 @@ self.mutes_dev = self.bus.get_object(servername, mutespath) self.mutes_interface = dbus.Interface(self.mutes_dev, dbus_interface="org.ffado.Control.Element.MatrixMixer") + self.inverts_dev = None + self.inverts_interface = None + if (invertspath != None): + self.inverts_dev = self.bus.get_object(servername, invertspath) + self.inverts_interface = dbus.Interface(self.inverts_dev, dbus_interface="org.ffado.Control.Element.MatrixMixer") + #palette = self.palette() #palette.setColor(QtGui.QPalette.Window, palette.color(QtGui.QPalette.Window).darker()); #self.setPalette(palette) @@ -259,7 +283,13 @@ for i in range(rows): self.items.append([]) for j in range(cols): - node = MixerNode(j, i, self.interface.getValue(i,j), sliderMaxValue, None, self) + mute_value = None + if (self.mutes_interface != None): + mute_value = self.mutes_interface.getValue(i,j) + inv_value = None + if (self.inverts_interface != None): + inv_value = self.inverts_interface.getValue(i,j) + node = MixerNode(j, i, self.interface.getValue(i,j), sliderMaxValue, mute_value, inv_value, self) self.connect(node, QtCore.SIGNAL("valueChanged"), self.valueChanged) layout.addWidget(node, i+1, j+1) self.items[i].append(node) |