Show
Ignore:
Timestamp:
02/27/12 03:47:01 (12 years ago)
Author:
jwoithe
Message:

rme: implement getStreamingState() so the generic mixer streaming state widgets work. Monitor the streaming state within the mixer; disable selected controls when streaming is active (presently only the non-functional bandwidth limit control).

Files:

Legend:

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

    r2040 r2042  
    2828 
    2929from ffado.widgets.matrixmixer import MatrixMixer 
     30 
     31from ffado.dbus_util import * 
    3032 
    3133import logging 
     
    134136        self.hw.setMatrixMixerValue(self.Gains[sender][0], 0, self.Gains[sender][1], a0) 
    135137 
     138    def updateStreamingState(self): 
     139        ss = self.streamingstatus.selected() 
     140        ss_txt = self.streamingstatus.getEnumLabel(ss) 
     141        if ss_txt != 'Idle': 
     142            self.is_streaming = True 
     143        else: 
     144            self.is_streaming = False 
     145        if (self.last_streaming_state != self.is_streaming): 
     146            self.bandwidth_limit.setEnabled(not(self.is_streaming)); 
     147        self.last_streaming_state = self.is_streaming 
     148 
    136149    def status_update(self): 
    137150        # log.debug("timer event") 
     151        self.updateStreamingState() 
    138152        clk_mode = ['Master', 'Slave'] 
    139153        src_str = ['None', 'ADAT 1', 'ADAT 2', 'SPDIF', 'Wordclock', 'TCO'] 
     
    189203        self.outputmixer.setLayout(layout) 
    190204 
    191         # Is the device streaming? 
    192         #self.is_streaming = self.hw.getDiscrete('/Mixer/Info/IsStreaming') 
    193         self.is_streaming = 0 
    194         #log.debug("device streaming flag: %d" % (self.is_streaming)) 
     205        self.is_streaming = False 
     206        self.last_streaming_state = False 
    195207 
    196208        # Retrieve other device settings as needed and customise the UI 
     
    283295            QObject.connect(ctrl, SIGNAL('valueChanged(int)'), self.updateGain) 
    284296 
     297        self.updateStreamingState() 
     298        #log.debug("device streaming flag: %d" % (self.is_streaming)) 
     299 
    285300        self.update_timer = QTimer(self) 
    286301        QObject.connect(self.update_timer, SIGNAL('timeout()'), self.status_update) 
  • trunk/libffado/support/mixer-qt4/ffado/mixer/rme.ui

    r2040 r2042  
    10641064            <layout class="QVBoxLayout" name="verticalLayout_12"> 
    10651065             <item> 
    1066               <widget class="QComboBox" name="comboBox"> 
     1066              <widget class="QComboBox" name="bandwidth_limit"> 
    10671067               <item> 
    10681068                <property name="text">