Changeset 2021

Show
Ignore:
Timestamp:
01/30/12 05:02:09 (9 years ago)
Author:
jwoithe
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/rme/fireface_hw.cpp

    r2016 r2021  
    859859    if (src_channel>n_channels || dest_channel>n_channels) 
    860860        return -1; 
    861     if (val<0 || val>0x10000) 
     861    if (abs(val)>0x10000) 
    862862        return -1; 
    863863 
  • trunk/libffado/src/rme/rme_avdevice.cpp

    r2016 r2021  
    200200        new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_OUTPUT_FADER, "OutputFaders")); 
    201201    result &= m_MixerContainer->addElement( 
    202         new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_INPUT_FADER, "InputMutes")); 
     202        new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_INPUT_MUTE, "InputMutes")); 
    203203    result &= m_MixerContainer->addElement( 
    204         new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_PLAYBACK_FADER, "PlaybackMutes")); 
     204        new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_PLAYBACK_MUTE, "PlaybackMutes")); 
    205205    result &= m_MixerContainer->addElement( 
    206         new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_OUTPUT_FADER, "OutputMutes")); 
     206        new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_OUTPUT_MUTE, "OutputMutes")); 
    207207    result &= m_MixerContainer->addElement( 
    208         new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_INPUT_FADER, "InputInverts")); 
     208        new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_INPUT_INVERT, "InputInverts")); 
    209209    result &= m_MixerContainer->addElement( 
    210         new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_PLAYBACK_FADER, "PlaybackInverts")); 
     210        new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_PLAYBACK_INVERT, "PlaybackInverts")); 
    211211 
    212212    if (!result) { 
  • trunk/libffado/src/rme/rme_avdevice_settings.cpp

    r2016 r2021  
    243243    } 
    244244 
     245fprintf(stderr, "val=%d\n", val); 
    245246    return set_hardware_mixergain(ctype, src_channel, dest_channel, val); 
    246247} 
     
    280281        mixerflags = settings->playback_mixerflags; 
    281282 
     283// FIXME: When switching inversion modes, the hardware seems to a channel to 
     284// full volume for about 1/10 sec.  Attempt to avoid this by temporarily 
     285// muting the channel.  This doesn't seem to work though. 
     286//    if (flagmask & FF_SWPARAM_MF_INVERTED)  
     287//        set_hardware_mixergain(ctype, src_channel, dest_channel, 0); 
     288 
    282289    if (val == 0) 
    283290        mixerflags[idx] &= ~flagmask; 
  • trunk/libffado/support/mixer-qt4/ffado/mixer/rme.py

    r2011 r2021  
    126126        # print self.hw.servername 
    127127        # print self.hw.basepath 
    128         self.inputmatrix = MatrixMixer(self.hw.servername, self.hw.basepath+"/Mixer/InputFaders", self, 0x8000
     128        self.inputmatrix = MatrixMixer(self.hw.servername, self.hw.basepath+"/Mixer/InputFaders", self, 0x8000, self.hw.basepath+"/Mixer/InputMutes", self.hw.basepath+"/Mixer/InputInverts"
    129129        layout = QtGui.QVBoxLayout() 
    130130        scrollarea = QtGui.QScrollArea() 
  • trunk/libffado/support/mixer-qt4/ffado/widgets/matrixmixer.py

    r2017 r2021  
    5555 
    5656class MixerNode(QtGui.QAbstractSlider): 
    57     def __init__(self, input, output, value, max, muted, parent): 
     57    def __init__(self, input, output, value, max, muted, inverted, parent): 
    5858        QtGui.QAbstractSlider.__init__(self, parent) 
    5959        #log.debug("MixerNode.__init__( %i, %i, %i, %i, %s )" % (input, output, value, max, str(parent)) ) 
     
    109109            self.addAction(self.mute_action) 
    110110 
     111        # Similarly, only show a phase inversion menu item if in use 
     112        self.inv_action = None 
     113        if (inverted != None): 
     114            if (muted == None): 
     115                action = QtGui.QAction(text, self) 
     116                action.setSeparator(True) 
     117                self.addAction(action) 
     118            self.inv_action = QtGui.QAction("Invert", self) 
     119            self.inv_action.setCheckable(True) 
     120            self.inv_action.setChecked(inverted) 
     121            self.connect(self.inv_action, QtCore.SIGNAL("triggered()"), self.mapper, QtCore.SLOT("map()")) 
     122            self.mapper.setMapping(self.inv_action, "Invert") 
     123            self.addAction(self.inv_action) 
     124 
    111125    def directValues(self,text): 
    112126        #log.debug("MixerNode.directValues( '%s' )" % text) 
    113127        if text == "Mute": 
    114             log.debug("Mute %d" % self.mute_action.isChecked()) 
     128            #log.debug("Mute %d" % self.mute_action.isChecked()) 
     129            self.parent().mutes_interface.setValue(self.output, self.input, self.mute_action.isChecked()) 
     130        elif text == "Invert": 
     131            log.debug("Invert %d" % self.inv_action.isChecked()) 
     132            self.parent().inverts_interface.setValue(self.output, self.input, self.inv_action.isChecked()) 
    115133        else: 
    116134            text = text.split(" ")[0].replace(",",".") 
     
    217235 
    218236class MatrixMixer(QtGui.QWidget): 
    219     def __init__(self, servername, basepath, parent=None, sliderMaxValue=-1, mutespath=None): 
     237    def __init__(self, servername, basepath, parent=None, sliderMaxValue=-1, mutespath=None, invertspath=None): 
    220238        QtGui.QWidget.__init__(self, parent) 
    221239        self.bus = dbus.SessionBus() 
     
    228246            self.mutes_dev = self.bus.get_object(servername, mutespath) 
    229247            self.mutes_interface = dbus.Interface(self.mutes_dev, dbus_interface="org.ffado.Control.Element.MatrixMixer") 
     248 
     249        self.inverts_dev = None 
     250        self.inverts_interface = None 
     251        if (invertspath != None): 
     252            self.inverts_dev = self.bus.get_object(servername, invertspath) 
     253            self.inverts_interface = dbus.Interface(self.inverts_dev, dbus_interface="org.ffado.Control.Element.MatrixMixer") 
    230254 
    231255        #palette = self.palette() 
     
    260284            self.items.append([]) 
    261285            for j in range(cols): 
    262                 node = MixerNode(j, i, self.interface.getValue(i,j), sliderMaxValue, None, self) 
     286                mute_value = None 
     287                if (self.mutes_interface != None): 
     288                    mute_value = self.mutes_interface.getValue(i,j) 
     289                inv_value = None 
     290                if (self.inverts_interface != None): 
     291                    inv_value = self.inverts_interface.getValue(i,j) 
     292                node = MixerNode(j, i, self.interface.getValue(i,j), sliderMaxValue, mute_value, inv_value, self) 
    263293                self.connect(node, QtCore.SIGNAL("valueChanged"), self.valueChanged) 
    264294                layout.addWidget(node, i+1, j+1)