Show
Ignore:
Timestamp:
08/16/09 06:53:12 (15 years ago)
Author:
jwoithe
Message:

RME: input, output and phones mixer/control elements now control respective device parameters

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/mixer-qt4/mixer_rme.py

    r1616 r1622  
    5656        } 
    5757 
     58        self.Radiobuttons={ 
     59            self.level_in_lo_gain: ['/Control/Input_level', 1], 
     60            self.level_in_p4dBu:   ['/Control/Input_level', 2], 
     61            self.level_in_m10dBV:  ['/Control/Input_level', 3], 
     62 
     63            self.level_out_hi_gain: ['/Control/Output_level', 1], 
     64            self.level_out_p4dBu:   ['/Control/Output_level', 2], 
     65            self.level_out_m10dBV:  ['/Control/Output_level', 3], 
     66 
     67            self.phones_hi_gain: ['/Control/Phones_level', 1], 
     68            self.phones_p4dBu:   ['/Control/Phones_level', 2], 
     69            self.phones_m10dBV:  ['/Control/Phones_level', 3], 
     70        } 
     71 
     72 
    5873        self.Gains={ 
    5974            self.gain_mic1: ['/Control/Gains', 0], 
     
    8398        log.debug("switch %s set to %d" % (self.Switches[sender][0], a0)) 
    8499        self.hw.setDiscrete(self.Switches[sender][0], a0) 
     100 
     101    # Public slot: update generic radiobuttons 
     102    def updateRadiobutton(self, a0): 
     103        sender = self.sender() 
     104        if (a0 != 0): 
     105            # Only change the control state on a button being "checked" 
     106            log.debug("radiobutton group %s set to %d" % (self.Radiobuttons[sender][0], self.Radiobuttons[sender][1])) 
     107            self.hw.setDiscrete(self.Radiobuttons[sender][0], self.Radiobuttons[sender][1]) 
    85108 
    86109    # Public slot: update gains 
     
    160183            QObject.connect(ctrl, SIGNAL('toggled(bool)'), self.updateSwitch) 
    161184 
     185        for ctrl, info in self.Radiobuttons.iteritems(): 
     186            if (not(ctrl.isEnabled())): 
     187                continue; 
     188            # This is a touch wasteful since it means we retrieve the control 
     189            # value once per radio button rather than once per radio button 
     190            # group.  In time we might introduce radiobutton groupings in the 
     191            # self.* datastructures to avoid this, but for the moment this is 
     192            # easy and it works. 
     193            val = self.hw.getDiscrete(info[0]) 
     194            if (val == info[1]): 
     195                val = 1 
     196            else: 
     197                val = 0 
     198            ctrl.setChecked(val) 
     199            log.debug("Radiobutton %s[%d] is %d" % (info[0], info[1], val)) 
     200            QObject.connect(ctrl, SIGNAL('toggled(bool)'), self.updateRadiobutton) 
     201 
    162202        for ctrl, info in self.Gains.iteritems(): 
    163203            if (not(ctrl.isEnabled())): 
  • trunk/libffado/support/mixer-qt4/mixer_rme.ui

    r1616 r1622  
    282282            <layout class="QVBoxLayout" name="verticalLayout_8" > 
    283283             <item> 
    284               <widget class="QRadioButton" name="radioButton_9" > 
     284              <widget class="QRadioButton" name="level_in_lo_gain" > 
    285285               <property name="text" > 
    286286                <string>Lo gain</string> 
     
    289289             </item> 
    290290             <item> 
    291               <widget class="QRadioButton" name="radioButton_10" > 
     291              <widget class="QRadioButton" name="level_in_p4dBu" > 
    292292               <property name="text" > 
    293293                <string>+4 dBu</string> 
     
    296296             </item> 
    297297             <item> 
    298               <widget class="QRadioButton" name="radioButton_11" > 
     298              <widget class="QRadioButton" name="level_in_m10dBV" > 
    299299               <property name="text" > 
    300300                <string>-10 dBV</string> 
     
    565565            <layout class="QVBoxLayout" name="verticalLayout_9" > 
    566566             <item> 
    567               <widget class="QRadioButton" name="radioButton_12" > 
     567              <widget class="QRadioButton" name="level_out_hi_gain" > 
    568568               <property name="text" > 
    569569                <string>Hi gain</string> 
     
    572572             </item> 
    573573             <item> 
    574               <widget class="QRadioButton" name="radioButton_13" > 
     574              <widget class="QRadioButton" name="level_out_p4dBu" > 
    575575               <property name="text" > 
    576576                <string>+4 dBu</string> 
     
    579579             </item> 
    580580             <item> 
    581               <widget class="QRadioButton" name="radioButton_14" > 
     581              <widget class="QRadioButton" name="level_out_m10dBV" > 
    582582               <property name="text" > 
    583583                <string>-10 dBV</string> 
     
    611611            <layout class="QVBoxLayout" name="verticalLayout_10" > 
    612612             <item> 
    613               <widget class="QRadioButton" name="radioButton_15" > 
     613              <widget class="QRadioButton" name="phones_hi_gain" > 
    614614               <property name="text" > 
    615615                <string>Hi gain</string> 
     
    618618             </item> 
    619619             <item> 
    620               <widget class="QRadioButton" name="radioButton_16" > 
     620              <widget class="QRadioButton" name="phones_p4dBu" > 
    621621               <property name="text" > 
    622622                <string>+4 dBU</string> 
     
    625625             </item> 
    626626             <item> 
    627               <widget class="QRadioButton" name="radioButton_17" > 
     627              <widget class="QRadioButton" name="phones_m10dBV" > 
    628628               <property name="text" > 
    629629                <string>-10 dBV</string>