Changeset 1610

Show
Ignore:
Timestamp:
08/02/09 07:26:58 (14 years ago)
Author:
jwoithe
Message:

RME: initial implementation of ff400 channel 3/4 input options in mixer control tab

Files:

Legend:

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

    r1606 r1610  
    6464        case RME_CTRL_PHANTOM_SW: 
    6565            // Lowest 16 bits are phantom status bits (max 16 channels).  
    66             // High 16 bits are "write enable" bits for the correspoding 
     66            // High 16 bits are "write enable" bits for the corresponding 
    6767            // channel represented in the low 16 bits.  This way changes can 
    6868            // be made to one channel without needing to first read the 
     
    8989                    } 
    9090                } 
     91            } 
     92            break; 
     93        case RME_CTRL_FF400_PAD_SW: 
     94            // Object's "m_info" field is the channel 
     95            if (m_parent.setInputPadOpt(m_info, v)) { 
     96                m_value = (v != 0); 
     97            } 
     98            break; 
     99        case RME_CTRL_FF400_INSTR_SW: 
     100            // Object's "m_info" field is the channel 
     101            if (m_parent.setInputInstrOpt(m_info, v)) { 
     102                m_value = (v != 0); 
    91103            } 
    92104            break; 
     
    124136            return val; 
    125137            break; 
     138        case RME_CTRL_FF400_PAD_SW: 
     139            return m_parent.getInputPadOpt(m_info); 
     140            break; 
     141        case RME_CTRL_FF400_INSTR_SW: 
     142            return m_parent.getInputInstrOpt(m_info); 
     143            break; 
    126144 
    127145        case RME_CTRL_INFO_MODEL: 
  • trunk/libffado/src/rme/fireface_settings_ctrls.h

    r1606 r1610  
    4545#define RME_CTRL_INPUT1_OPTIONS        0x000e 
    4646#define RME_CTRL_INPUT2_OPTIONS        0x000f 
     47#define RME_CTRL_FF400_PAD_SW          0x0010 
     48#define RME_CTRL_FF400_INSTR_SW        0x0011 
    4749 
    4850#define RME_CTRL_INFO_MODEL            0x0100 
  • trunk/libffado/src/rme/rme_avdevice.cpp

    r1606 r1610  
    105105bool 
    106106Device::buildMixer() { 
     107    signed int i; 
    107108    bool result = true; 
    108109 
     
    129130        new RmeSettingsCtrl(*this, RME_CTRL_PHANTOM_SW, 0, 
    130131            "Phantom", "Phantom switches", "")); 
     132    if (m_rme_model == RME_MODEL_FIREFACE400) { 
     133        for (i=3; i<=4; i++) { 
     134            char path[32], desc[64]; 
     135            snprintf(path, sizeof(path), "Chan%d_opt_instr", i); 
     136            snprintf(desc, sizeof(desc), "Chan%d instrument option", i); 
     137            result &= m_ControlContainer->addElement( 
     138                new RmeSettingsCtrl(*this, RME_CTRL_FF400_INSTR_SW, i, 
     139                    path, desc, "")); 
     140            snprintf(path, sizeof(path), "Chan%d_opt_pad", i); 
     141            snprintf(desc, sizeof(desc), "Chan%d pad option", i); 
     142            result &= m_ControlContainer->addElement( 
     143                new RmeSettingsCtrl(*this, RME_CTRL_FF400_PAD_SW, i, 
     144                    path, desc, "")); 
     145        } 
     146    } 
    131147 
    132148    if (!result) { 
  • trunk/libffado/src/rme/rme_avdevice.h

    r1606 r1610  
    9595    signed int getPhantom(unsigned int channel); 
    9696    signed int setPhantom(unsigned int channel, unsigned int status); 
     97    signed int getInputPadOpt(unsigned int channel); 
     98    signed int setInputPadOpt(unsigned int channel, unsigned int status); 
     99    signed int getInputInstrOpt(unsigned int channel); 
     100    signed int setInputInstrOpt(unsigned int channel, unsigned int status); 
    97101 
    98102    /* General information functions */ 
  • trunk/libffado/src/rme/rme_avdevice_settings.cpp

    r1606 r1610  
    5353} 
    5454 
     55signed int  
     56Device::getInputPadOpt(unsigned int channel) { 
     57    if (m_rme_model!=RME_MODEL_FIREFACE400 || channel<3 || channel>4) { 
     58        debugOutput(DEBUG_LEVEL_WARNING, "Channel %d input pad option not supported for model %d\n", channel, m_rme_model); 
     59        return -1; 
     60    } 
     61    return settings.ff400_input_pad[channel-3] != 0; 
     62} 
     63 
     64signed int  
     65Device::setInputPadOpt(unsigned int channel, unsigned int status) { 
     66    if (m_rme_model!=RME_MODEL_FIREFACE400 || channel<3 || channel>4) { 
     67        debugOutput(DEBUG_LEVEL_WARNING, "Channel %d input pad option not supported for model %d\n", channel, m_rme_model); 
     68        return -1; 
     69    } 
     70    settings.ff400_input_pad[channel-3] = (status != 0); 
     71    set_hardware_params(); 
     72    return 0; 
     73} 
     74 
     75signed int  
     76Device::getInputInstrOpt(unsigned int channel) { 
     77    if (m_rme_model!=RME_MODEL_FIREFACE400 || channel<3 || channel>4) { 
     78        debugOutput(DEBUG_LEVEL_WARNING, "Channel %d input instrument option not supported for model %d\n", channel, m_rme_model); 
     79        return -1; 
     80    } 
     81    return settings.ff400_instr_input[channel-3] != 0; 
     82} 
     83 
     84signed int  
     85Device::setInputInstrOpt(unsigned int channel, unsigned int status) { 
     86    if (m_rme_model!=RME_MODEL_FIREFACE400 || channel<3 || channel>4) { 
     87        debugOutput(DEBUG_LEVEL_WARNING, "Channel %d input instrument option not supported for model %d\n", channel, m_rme_model); 
     88        return -1; 
     89    } 
     90    settings.ff400_instr_input[channel-3] = (status != 0); 
     91    set_hardware_params(); 
     92    return 0; 
     93} 
     94                 
    5595 
    5696} 
  • trunk/libffado/support/mixer-qt4/mixer_rme.py

    r1608 r1610  
    4949        } 
    5050 
     51        self.Switches={ 
     52            self.ff400_chan3_opt_instr: ['/Control/Chan3_opt_instr'], 
     53            self.ff400_chan3_opt_pad:   ['/Control/Chan3_opt_pad'], 
     54            self.ff400_chan4_opt_instr: ['/Control/Chan4_opt_instr'], 
     55            self.ff400_chan4_opt_pad:   ['/Control/Chan4_opt_pad'], 
     56        } 
     57 
    5158        # Other mixer variables 
    5259        self.is_streaming = 0 
     
    5562        self.tco_present = 0 
    5663 
    57     # Public slot: update phantom power hardware switch
     64    # Public slot: update phantom power hardware switche
    5865    def updatePhantomSwitch(self, a0): 
    5966        sender = self.sender() 
     
    6370        log.debug("phantom switch %d set to %d" % (self.PhantomSwitches[sender][1], a0)) 
    6471        self.hw.setDiscrete(self.PhantomSwitches[sender][0], val) 
     72 
     73    # Public slot: update generic switches 
     74    def updateSwitch(self, a0): 
     75        sender = self.sender() 
     76        log.debug("switch %s set to %d" % (self.Switches[sender][0], a0)) 
     77        self.hw.setDiscrete(self.Switches[sender][0], a0) 
    6578 
    6679    # Hide and disable a control 
     
    118131                ctrl.setChecked(False) 
    119132            QObject.connect(ctrl, SIGNAL('toggled(bool)'), self.updatePhantomSwitch) 
     133 
     134        for ctrl, info in self.Switches.iteritems(): 
     135            if (not(ctrl.isEnabled())): 
     136                continue 
     137            val = self.hw.getDiscrete(info[0]) 
     138            log.debug("switch %s is %d" % (info[0], val)) 
     139            if val: 
     140                ctrl.setChecked(True) 
     141            else: 
     142                ctrl.setChecked(False) 
     143            QObject.connect(ctrl, SIGNAL('toggled(bool)'), self.updateSwitch) 
  • trunk/libffado/support/mixer-qt4/mixer_rme.ui

    r1608 r1610  
    489489     </layout> 
    490490    </widget> 
    491     <widget class="QGroupBox" name="groupBox_13" > 
     491    <widget class="QGroupBox" name="phones_level_group" > 
    492492     <property name="geometry" > 
    493493      <rect> 
     
    582582      </item> 
    583583      <item row="0" column="2" > 
    584        <widget class="QCheckBox" name="checkBox_9" > 
     584       <widget class="QCheckBox" name="ff400_chan3_opt_instr" > 
    585585        <property name="text" > 
    586586         <string>Instr</string> 
     
    589589      </item> 
    590590      <item row="0" column="3" > 
    591        <widget class="QCheckBox" name="checkBox_11" > 
     591       <widget class="QCheckBox" name="ff400_chan3_opt_pad" > 
    592592        <property name="text" > 
    593593         <string>Pad</string> 
     
    603603      </item> 
    604604      <item row="2" column="3" > 
    605        <widget class="QCheckBox" name="checkBox_12" > 
     605       <widget class="QCheckBox" name="ff400_chan4_opt_pad" > 
    606606        <property name="text" > 
    607607         <string>Pad</string> 
     
    610610      </item> 
    611611      <item row="2" column="2" > 
    612        <widget class="QCheckBox" name="checkBox_10" > 
     612       <widget class="QCheckBox" name="ff400_chan4_opt_instr" > 
    613613        <property name="text" > 
    614614         <string>Instr</string>