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

audiofire: first attempt at disabling the save-settings button when streaming is active. Evidence suggests the hardware does not cope well when this is done with streaming active. This change has not been tested since I don't have an audiofire device; if I've broken the audiofire mixer with this commit please let me know.

Files:

Legend:

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

    r1887 r2129  
    2121# 
    2222 
    23 from PyQt4.QtCore import SIGNAL, SLOT, QObject, Qt 
     23from PyQt4.QtCore import SIGNAL, SLOT, QObject, Qt, QTimer 
    2424from PyQt4.QtGui import QWidget, QHBoxLayout, QVBoxLayout, \ 
    2525                        QGroupBox, QTabWidget, QLabel, \ 
     
    284284        self.SPDIFmodeControls[settings.radioProfessional] = ["/SpdifMode", 1] 
    285285 
     286    def polledUpdate(self): 
     287        ss = self.streamingstatus.selected() 
     288 
     289        # Only alter controls sensitive to the streaming state when the 
     290        # streaming state has changed. 
     291        if (ss != self.streaming_state): 
     292            ss_txt = self.streamingstatus.getEnumLabel(ss) 
     293            # The device doesn't cope very well if "save settings" is done 
     294            # while streaming is active 
     295            settings.btnSaveSettings.setEnabled(ss_txt=='Idle') 
     296 
     297        self.streaming_state = ss 
     298 
    286299    def initValues(self): 
    287300        log.debug("Init values") 
     
    360373            QObject.connect(ctrl,SIGNAL('toggled(bool)'),self.updateSPDIFmodeControl) 
    361374 
     375        self.update_timer = QTimer(self) 
     376        QObject.connect(self.update_timer, SIGNAL('timeout()'), self.polledUpdate) 
     377        self.update_timer.start(1000) 
     378        self.streaming_state = -1 
     379 
    362380# vim: et