Changeset 2044

Show
Ignore:
Timestamp:
02/27/12 04:34:27 (9 years ago)
Author:
jwoithe
Message:

rme: make the bandwidth limit control do something. This is yet to be extensively tested. This change means that all the FF400 mixer controls are now implemented, although some are yet to be tested and verified as working.

Files:

Legend:

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

    r2040 r2044  
    168168        } 
    169169 
     170        case RME_CTRL_LIMIT_BANDWIDTH: { 
     171            signed int val; 
     172            switch (v) { 
     173              case 0: val = FF_DEV_FLASH_BWLIMIT_SEND_ALL_CHANNELS; break; 
     174              case 1: val = FF_DEV_FLASH_BWLIMIT_NO_ADAT2; break; 
     175              case 2: val = FF_DEV_FLASH_BWLIMIT_ANALOG_SPDIF_ONLY; break; 
     176              case 3: val = FF_DEV_FLASH_BWLIMIT_ANALOG_ONLY; break; 
     177              default: 
     178                val = FF_DEV_FLASH_BWLIMIT_SEND_ALL_CHANNELS; 
     179            } 
     180            if (m_parent.setBandwidthLimit(val) == 0) { 
     181              m_value = v; 
     182            } 
     183            break; 
     184        } 
     185 
    170186        // All RME_CTRL_INFO_* controls are read-only.  Warn on attempts to 
    171187        // set these. 
     
    254270            break; 
    255271        } 
     272        case RME_CTRL_LIMIT_BANDWIDTH: { 
     273            signed int val = m_parent.getBandwidthLimit(); 
     274            switch (val) { 
     275              case FF_DEV_FLASH_BWLIMIT_SEND_ALL_CHANNELS: return 0; 
     276              case FF_DEV_FLASH_BWLIMIT_NO_ADAT2: return 1; 
     277              case FF_DEV_FLASH_BWLIMIT_ANALOG_SPDIF_ONLY: return 2; 
     278              case FF_DEV_FLASH_BWLIMIT_ANALOG_ONLY: return 3; 
     279              default: 
     280                return 0; 
     281            } 
     282            break; 
     283        } 
    256284        case RME_CTRL_INFO_MODEL: 
    257285            return m_parent.getRmeModel(); 
  • trunk/libffado/src/rme/rme_avdevice.cpp

    r2042 r2044  
    203203        new RmeSettingsCtrl(*this, RME_CTRL_SYNC_REF, 0, 
    204204            "Sync_ref", "Preferred sync ref", "")); 
     205    result &= m_ControlContainer->addElement( 
     206        new RmeSettingsCtrl(*this, RME_CTRL_LIMIT_BANDWIDTH, 0, 
     207            "Bandwidth_limit", "Bandwidth limit", "")); 
    205208 
    206209    if (m_rme_model == RME_MODEL_FIREFACE400) { 
  • trunk/libffado/src/rme/rme_avdevice.h

    r2042 r2044  
    142142    signed int getSyncRef(void); 
    143143    signed int setSyncRef(signed int ref); 
     144    signed int getBandwidthLimit(void); 
     145    signed int setBandwidthLimit(signed int limit); 
    144146 
    145147    /* General information functions */ 
  • trunk/libffado/src/rme/rme_avdevice_settings.cpp

    r2040 r2044  
    376376} 
    377377 
    378 
     378signed int 
     379Device::getBandwidthLimit(void) { 
     380  return settings->limit_bandwidth; 
     381
     382signed int 
     383Device::setBandwidthLimit(signed int limit) { 
     384  if (limit < FF_DEV_FLASH_BWLIMIT_SEND_ALL_CHANNELS || 
     385          limit > FF_DEV_FLASH_BWLIMIT_ANALOG_ONLY) 
     386      return -1; 
     387  settings->limit_bandwidth = limit; 
     388  set_hardware_params(); 
     389  return 0; 
     390
     391 
     392
  • trunk/libffado/support/mixer-qt4/ffado/mixer/rme.py

    r2043 r2044  
    133133        log.debug("gain %s[%d] set to %d" % (self.Gains[sender][0], self.Gains[sender][1], a0)) 
    134134        self.hw.setMatrixMixerValue(self.Gains[sender][0], 0, self.Gains[sender][1], a0) 
     135 
     136    def updateBandwidthLimit(self, a0): 
     137        # Account for the "No ADAT-2" item which will not be present on 
     138        # a FF400. 
     139        if (self.model==RME_MODEL_FF400 and a0>0): 
     140            a0 = a0 + 1 
     141        # log.debug("limit update: %d" % (a0)); 
     142        self.hw.setDiscrete('/Control/Bandwidth_limit', a0); 
    135143 
    136144    def updateStreamingState(self): 
     
    244252            self.phones_level_group.setEnabled(False) 
    245253 
     254        # Add the "No ADAT-2" item to the bandwidth limit control if the 
     255        # device is not a FF400.  Set the control to reflect the current 
     256        # device setting and connect an update signal. 
     257        if (self.model != RME_MODEL_FF400): 
     258            self.bandwidth_limit.insertItem(1, "No ADAT-2") 
     259        val = self.hw.getDiscrete('/Control/Bandwidth_limit') 
     260        if (self.model==RME_MODEL_FF400 and val>1): 
     261            val = val - 1 
     262        self.bandwidth_limit.setCurrentIndex(val); 
     263        QObject.connect(self.bandwidth_limit, SIGNAL('currentIndexChanged(int)'), self.updateBandwidthLimit) 
     264 
    246265        # Get current hardware values and connect GUI element signals to  
    247266        # their respective slots