Changeset 2110 for trunk/libffado

Show
Ignore:
Timestamp:
04/02/12 05:28:04 (12 years ago)
Author:
jwoithe
Message:

Patch from Philippe Carriere. refreshPanels is the 'orthogonal' function to updatePanels; it permits the reconfiguration and redrawing of the current mixer panels under user request. This may be useful when some hardware settings have been changed that ffado-mixer is unaware of but which can affect the options offered by the mixer.

Files:

Legend:

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

    r1803 r2110  
    7777        self.connect(self.updateaction, SIGNAL("triggered()"), self.manager.updatePanels) 
    7878        editmenu.addAction(self.updateaction) 
     79        refreshaction = QAction("Refresh Current Panels", self) 
     80        self.connect(refreshaction, SIGNAL("triggered()"), self.manager.refreshPanels) 
     81        editmenu.addAction(refreshaction) 
    7982 
    8083        helpmenu = self.menuBar().addMenu( "Help" ) 
  • trunk/libffado/support/mixer-qt4/ffado/panelmanager.py

    r2109 r2110  
    388388        self.displayPanels() 
    389389 
     390    def refreshPanels(self): 
     391        log.debug("PanelManager::refreshPanels()") 
     392        nbDevices = self.devmgr.getNbDevices() 
     393        #self.statusBar().showMessage("Reconfiguring the mixer panels...") 
     394 
     395        # list of panels present 
     396        guids_with_tabs = self.panels.keys() 
     397 
     398        # build list of guids on the bus now 
     399        guid_indexes = {} 
     400        for idx in range(nbDevices): 
     401            path = self.devmgr.getDeviceName(idx) 
     402            cfgrom = ConfigRomInterface(FFADO_DBUS_SERVER, FFADO_DBUS_BASEPATH+'/DeviceManager/'+path) 
     403            guid = cfgrom.getGUID() 
     404            guid_indexes[guid] = idx 
     405 
     406        # remove/create the widget 
     407        for guid in guids_with_tabs: 
     408            self.removePanel(guid) 
     409            idx = guid_indexes[guid] 
     410            self.addPanel(idx) 
     411 
     412        self.displayPanels() 
     413 
    390414# vim: et