Changeset 2016

Show
Ignore:
Timestamp:
12/19/11 04:17:30 (9 years ago)
Author:
jwoithe
Message:

rme: refine mute hardware mute controls. Add mute support for mixer outputs. Create dbus mixer objects to control channel muting and inversion.
matrixmixer: prepare infrastructure to allow channel muting to be controlled if enabled by the caller.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/rme/fireface_def.h

    r2008 r2016  
    468468    unsigned char input_mixerflags[FF_MATRIXMIXER_SIZE]; 
    469469    unsigned char playback_mixerflags[FF_MATRIXMIXER_SIZE]; 
     470    unsigned char output_mixerflags[FF_MATRIXMIXER_SIZE]; 
    470471} FF_software_settings_t; 
    471472 
     
    519520#define FF_SWPARAM_MF_NORMAL    0x00 
    520521#define FF_SWPARAM_MF_MUTED     0x01 
    521 #define FF_SWPARAM_MF_INVERTED  0x02 
     522#define FF_SWPARAM_MF_INVERTED  0x02    // Inputs/playbacks only 
     523#define FF_SWPARAM_MF_REC       0x04    // Outputs only 
    522524 
    523525// Indices into the amp_gains array 
  • trunk/libffado/src/rme/fireface_hw.cpp

    r2008 r2016  
    760760        } 
    761761 
    762         set_hardware_channel_mute(0); 
     762        set_hardware_channel_mute(-1, 0); 
    763763 
    764764    } else 
     
    791791        } 
    792792 
    793         set_hardware_channel_mute(1); 
     793        set_hardware_channel_mute(-1, 1); 
    794794 
    795795    } else 
     
    898898 
    899899signed int 
    900 Device::set_hardware_channel_mute(signed int mute) { 
    901 // Explicitly mute (mute!=0) or unmute (mute=0) all channels. 
    902 // TODO: fill the details in to allow individual channels to be muted as  
    903 // required. 
     900Device::set_hardware_channel_mute(signed int chan, signed int mute) { 
     901 
     902// Mute hardware channels as instructed.  This mute probably relates to the 
     903// sampled input channels as delivered to the PC.  If "chan" is -1 the 
     904// supplied "mute" status is applied to all channels.  This is the only 
     905// supported "chan" value for now.  Down the track, if there's a need, 
     906// this could be extended to allow individual channel control. 
    904907    quadlet_t buf[28]; 
    905908    signed int i; 
     
    908911 
    909912    i = 0; 
    910     while (i<n_channels && i<28) { 
    911         buf[i++] = (mute!=0); 
    912     } 
     913    if (chan < 0) { 
     914        while (i<n_channels && i<28) { 
     915            buf[i++] = (mute!=0); 
     916        } 
     917    } else { 
     918      return 0; 
     919    } 
     920 
    913921    while (i < 28) { 
    914922        buf[i++] = 0x00000001; 
    915923    } 
     924 
    916925    // Write 28 quadlets even for FF400 
    917926    return writeBlock(RME_FF_CHANNEL_MUTE_MASK, buf, 28); 
  • trunk/libffado/src/rme/fireface_settings_ctrls.cpp

    r2011 r2016  
    329329          return m_parent.setMixerGain(RME_FF_MM_OUTPUT, col, row, val); 
    330330          break; 
     331 
     332        case RME_MATRIXCTRL_INPUT_MUTE: 
     333          return m_parent.setMixerFlags(RME_FF_MM_INPUT, col, row, FF_SWPARAM_MF_MUTED, val!=0); 
     334          break; 
     335        case RME_MATRIXCTRL_PLAYBACK_MUTE: 
     336          return m_parent.setMixerFlags(RME_FF_MM_PLAYBACK, col, row, FF_SWPARAM_MF_MUTED, val!=0); 
     337          break; 
     338        case RME_MATRIXCTRL_OUTPUT_MUTE: 
     339          return m_parent.setMixerFlags(RME_FF_MM_OUTPUT, col, row, FF_SWPARAM_MF_MUTED, val!=0); 
     340          break; 
     341        case RME_MATRIXCTRL_INPUT_INVERT: 
     342          return m_parent.setMixerFlags(RME_FF_MM_INPUT, col, row, FF_SWPARAM_MF_INVERTED, val!=0); 
     343          break; 
     344        case RME_MATRIXCTRL_PLAYBACK_INVERT: 
     345          return m_parent.setMixerFlags(RME_FF_MM_PLAYBACK, col, row, FF_SWPARAM_MF_INVERTED, val!=0); 
     346          break; 
     347 
    331348    } 
    332349 
     
    350367            val = m_parent.getMixerGain(RME_FF_MM_OUTPUT, col, row); 
    351368            break; 
     369 
     370        case RME_MATRIXCTRL_INPUT_MUTE: 
     371          return m_parent.getMixerFlags(RME_FF_MM_INPUT, col, row, FF_SWPARAM_MF_MUTED) != 0; 
     372          break; 
     373        case RME_MATRIXCTRL_PLAYBACK_MUTE: 
     374          return m_parent.getMixerFlags(RME_FF_MM_PLAYBACK, col, row, FF_SWPARAM_MF_MUTED) != 0; 
     375          break; 
     376        case RME_MATRIXCTRL_OUTPUT_MUTE: 
     377          return m_parent.getMixerFlags(RME_FF_MM_OUTPUT, col, row, FF_SWPARAM_MF_MUTED) != 0; 
     378          break; 
     379        case RME_MATRIXCTRL_INPUT_INVERT: 
     380          return m_parent.getMixerFlags(RME_FF_MM_INPUT, col, row, FF_SWPARAM_MF_INVERTED) != 0; 
     381          break; 
     382        case RME_MATRIXCTRL_PLAYBACK_INVERT: 
     383          return m_parent.getMixerFlags(RME_FF_MM_PLAYBACK, col, row, FF_SWPARAM_MF_INVERTED) != 0; 
     384          break; 
    352385    } 
    353386 
  • trunk/libffado/src/rme/fireface_settings_ctrls.h

    r2003 r2016  
    5858#define RME_MATRIXCTRL_PLAYBACK_FADER  0x0003 
    5959#define RME_MATRIXCTRL_OUTPUT_FADER    0x0004 
     60#define RME_MATRIXCTRL_INPUT_MUTE      0x0005 
     61#define RME_MATRIXCTRL_PLAYBACK_MUTE   0x0006 
     62#define RME_MATRIXCTRL_OUTPUT_MUTE     0x0007 
     63#define RME_MATRIXCTRL_INPUT_INVERT    0x0008 
     64#define RME_MATRIXCTRL_PLAYBACK_INVERT 0x0009 
     65 
    6066 
    6167class Device; 
  • trunk/libffado/src/rme/rme_avdevice.cpp

    r2005 r2016  
    199199    result &= m_MixerContainer->addElement( 
    200200        new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_OUTPUT_FADER, "OutputFaders")); 
     201    result &= m_MixerContainer->addElement( 
     202        new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_INPUT_FADER, "InputMutes")); 
     203    result &= m_MixerContainer->addElement( 
     204        new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_PLAYBACK_FADER, "PlaybackMutes")); 
     205    result &= m_MixerContainer->addElement( 
     206        new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_OUTPUT_FADER, "OutputMutes")); 
     207    result &= m_MixerContainer->addElement( 
     208        new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_INPUT_FADER, "InputInverts")); 
     209    result &= m_MixerContainer->addElement( 
     210        new RmeSettingsMatrixCtrl(*this, RME_MATRIXCTRL_PLAYBACK_FADER, "PlaybackInverts")); 
    201211 
    202212    if (!result) { 
  • trunk/libffado/src/rme/rme_avdevice.h

    r2008 r2016  
    197197        unsigned int src_channel, unsigned int dest_channel, signed int val); 
    198198 
    199     signed int set_hardware_channel_mute(signed int mute); 
     199    signed int set_hardware_channel_mute(signed int chan, signed int mute); 
    200200    signed int set_hardware_output_rec(signed int rec); 
    201201 
  • trunk/libffado/src/rme/rme_avdevice_settings.cpp

    r2008 r2016  
    205205    unsigned char *mixerflags = NULL; 
    206206    signed int idx = getMixerGainIndex(src_channel, dest_channel); 
     207 
    207208    switch (ctype) { 
    208209        case RME_FF_MM_INPUT: 
     
    216217        case RME_FF_MM_OUTPUT: 
    217218            settings->output_faders[src_channel] = val; 
     219            mixerflags = settings->output_mixerflags; 
    218220            break; 
    219221    } 
     
    222224    // set it to zero.  Note that this is different to the hardware 
    223225    // mute control dealt with by set_hardware_channel_mute(); the 
    224     // latter deals with muting the output channels
     226    // latter deals with a muting separate from the mixer
    225227    if (mixerflags!=NULL && (mixerflags[idx] & FF_SWPARAM_MF_MUTED)!=0) { 
    226228        val = 0; 
     
    250252    unsigned char *mixerflags = NULL; 
    251253    signed int idx = getMixerGainIndex(src_channel, dest_channel); 
    252     if (ctype == RME_FF_MM_OUTPUT) 
    253         return 0; 
     254    if (ctype == RME_FF_MM_OUTPUT) { 
     255        mixerflags = settings->output_mixerflags; 
     256        idx = src_channel; 
     257    } else 
    254258    if (ctype == RME_FF_MM_INPUT) 
    255259        mixerflags = settings->input_mixerflags; 
     
    267271    unsigned char *mixerflags = NULL; 
    268272    signed int idx = getMixerGainIndex(src_channel, dest_channel); 
    269     if (ctype == RME_FF_MM_OUTPUT) 
    270         return 0; 
     273    if (ctype == RME_FF_MM_OUTPUT) { 
     274        mixerflags = settings->output_mixerflags; 
     275        idx = src_channel; 
     276    } else  
    271277    if (ctype == RME_FF_MM_INPUT) 
    272278        mixerflags = settings->input_mixerflags; 
  • trunk/libffado/support/mixer-qt4/ffado/widgets/matrixmixer.py

    r2015 r2016  
    201201 
    202202class MatrixMixer(QtGui.QWidget): 
    203     def __init__(self, servername, basepath, parent=None, sliderMaxValue=-1): 
     203    def __init__(self, servername, basepath, parent=None, sliderMaxValue=-1, mutespath=None): 
    204204        QtGui.QWidget.__init__(self, parent) 
    205205        self.bus = dbus.SessionBus() 
    206206        self.dev = self.bus.get_object(servername, basepath) 
    207207        self.interface = dbus.Interface(self.dev, dbus_interface="org.ffado.Control.Element.MatrixMixer") 
     208 
     209        self.mutes_dev = None 
     210        self.mutes_interface = None 
     211        if (mutespath != None): 
     212            self.mutes_dev = self.bus.get_object(servername, mutespath) 
     213            self.mutes_interface = dbus.Interface(self.mutes_dev, dbus_interface="org.ffado.Control.Element.MatrixMixer") 
    208214 
    209215        #palette = self.palette()