root/branches/libffado-2.0/support/mixer/mixer_global.py

Revision 1108, 1.8 kB (checked in by ppalmers, 16 years ago)

detect failure in setting clock source, and display error message.

Line 
1 #
2 # Copyright (C) 2008 by Arnold Krille
3 #
4 # This file is part of FFADO
5 # FFADO = Free Firewire (pro-)audio drivers for linux
6 #
7 # FFADO is based upon FreeBoB.
8 #
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 2 of the License, or
12 # (at your option) version 3 of the License.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 #
22
23 from qt import *
24 from mixer_globalui import *
25
26 class GlobalMixer( GlobalMixerUi ):
27         def __init__( self, parent ):
28                 GlobalMixerUi.__init__( self, parent )
29
30         def clockChanged( self, clock ):
31                 #print "updateClockSource( " + str(clock) + " )"
32                 self.clockselect.select( clock )
33                 selected = self.clockselect.selected()
34
35                 if selected != clock:
36                         clockname = self.clockselect.getEnumLabel( clock )
37                         msg = QMessageBox()
38                         msg.question( msg, "Failed to select clock source", \
39                                 "<qt>Could not select %s as clock source.</qt>" % clockname, \
40                                 QMessageBox.Ok )
41                         self.clocksource.setCurrentItem( selected )
42
43         def nicknameChanged( self, name ):
44                 #print "nicknameChanged( %s )" % name
45                 self.nickname.setText( name.latin1() )
46
47         def initValues( self ):
48                 #print "GlobalMixer::initValues()"
49                 for i in range( self.clockselect.count() ):
50                         self.clocksource.insertItem( self.clockselect.getEnumLabel( i ) )
51                 self.clocksource.setCurrentItem( self.clockselect.selected() )
52                 self.txtNickname.setText( self.nickname.text() )
53
Note: See TracBrowser for help on using the browser.