From: <tr...@ff...> - 2012-02-27 11:47:12
|
Author: jwoithe Date: 2012-02-27 03:47:01 -0800 (Mon, 27 Feb 2012) New Revision: 2042 Modified: trunk/libffado/src/rme/rme_avdevice.cpp trunk/libffado/src/rme/rme_avdevice.h trunk/libffado/support/mixer-qt4/ffado/mixer/rme.py trunk/libffado/support/mixer-qt4/ffado/mixer/rme.ui Log: 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). Modified: trunk/libffado/src/rme/rme_avdevice.cpp =================================================================== --- trunk/libffado/src/rme/rme_avdevice.cpp 2012-02-27 11:14:08 UTC (rev 2041) +++ trunk/libffado/src/rme/rme_avdevice.cpp 2012-02-27 11:47:01 UTC (rev 2042) @@ -802,6 +802,13 @@ return NULL; } +enum FFADODevice::eStreamingState +Device::getStreamingState() { + if (hardware_is_streaming()) + return eSS_Both; + return eSS_Idle; +} + bool Device::startStreamByIndex(int i) { // The RME does not allow separate enabling of the transmit and receive Modified: trunk/libffado/src/rme/rme_avdevice.h =================================================================== --- trunk/libffado/src/rme/rme_avdevice.h 2012-02-27 11:14:08 UTC (rev 2041) +++ trunk/libffado/src/rme/rme_avdevice.h 2012-02-27 11:47:01 UTC (rev 2042) @@ -87,6 +87,7 @@ virtual bool lock(); virtual bool unlock(); + virtual enum FFADODevice::eStreamingState getStreamingState(); virtual bool startStreamByIndex(int i); virtual bool stopStreamByIndex(int i); Modified: trunk/libffado/support/mixer-qt4/ffado/mixer/rme.py =================================================================== --- trunk/libffado/support/mixer-qt4/ffado/mixer/rme.py 2012-02-27 11:14:08 UTC (rev 2041) +++ trunk/libffado/support/mixer-qt4/ffado/mixer/rme.py 2012-02-27 11:47:01 UTC (rev 2042) @@ -28,6 +28,8 @@ from ffado.widgets.matrixmixer import MatrixMixer +from ffado.dbus_util import * + import logging log = logging.getLogger('rme') @@ -133,8 +135,20 @@ log.debug("gain %s[%d] set to %d" % (self.Gains[sender][0], self.Gains[sender][1], a0)) self.hw.setMatrixMixerValue(self.Gains[sender][0], 0, self.Gains[sender][1], a0) + def updateStreamingState(self): + ss = self.streamingstatus.selected() + ss_txt = self.streamingstatus.getEnumLabel(ss) + if ss_txt != 'Idle': + self.is_streaming = True + else: + self.is_streaming = False + if (self.last_streaming_state != self.is_streaming): + self.bandwidth_limit.setEnabled(not(self.is_streaming)); + self.last_streaming_state = self.is_streaming + def status_update(self): # log.debug("timer event") + self.updateStreamingState() clk_mode = ['Master', 'Slave'] src_str = ['None', 'ADAT 1', 'ADAT 2', 'SPDIF', 'Wordclock', 'TCO'] sync_stat = ['No lock', 'Locked', 'Synced'] @@ -188,10 +202,8 @@ layout.addWidget(scrollarea) self.outputmixer.setLayout(layout) - # Is the device streaming? - #self.is_streaming = self.hw.getDiscrete('/Mixer/Info/IsStreaming') - self.is_streaming = 0 - #log.debug("device streaming flag: %d" % (self.is_streaming)) + self.is_streaming = False + self.last_streaming_state = False # Retrieve other device settings as needed and customise the UI # based on these options. @@ -282,6 +294,9 @@ ctrl.setValue(val); QObject.connect(ctrl, SIGNAL('valueChanged(int)'), self.updateGain) + self.updateStreamingState() + #log.debug("device streaming flag: %d" % (self.is_streaming)) + self.update_timer = QTimer(self) QObject.connect(self.update_timer, SIGNAL('timeout()'), self.status_update) self.update_timer.start(1000) Modified: trunk/libffado/support/mixer-qt4/ffado/mixer/rme.ui =================================================================== --- trunk/libffado/support/mixer-qt4/ffado/mixer/rme.ui 2012-02-27 11:14:08 UTC (rev 2041) +++ trunk/libffado/support/mixer-qt4/ffado/mixer/rme.ui 2012-02-27 11:47:01 UTC (rev 2042) @@ -1063,7 +1063,7 @@ </property> <layout class="QVBoxLayout" name="verticalLayout_12"> <item> - <widget class="QComboBox" name="comboBox"> + <widget class="QComboBox" name="bandwidth_limit"> <item> <property name="text"> <string>All channels</string> |