diff options
author | samr7 <samr7@126591fb-c623-4b62-a76d-97a8e4f34109> | 2008-11-24 22:29:29 +0000 |
---|---|---|
committer | samr7 <samr7@126591fb-c623-4b62-a76d-97a8e4f34109> | 2008-11-24 22:29:29 +0000 |
commit | 4aa52837906f909d00095e61b9def7781b83640c (patch) | |
tree | a3771658d10cc6febb64dd2dc6033c5910088a8f | |
parent | 2efde639f7c4dfa52959ce13d2e3cc9b8f3a3070 (diff) | |
download | nohands-4aa52837906f909d00095e61b9def7781b83640c.tar.gz |
Fix status bar messages for audio problems.
Display sound card failure warnings in the config dialog.
git-svn-id: http://nohands.svn.sourceforge.net/svnroot/nohands/trunk@42 126591fb-c623-4b62-a76d-97a8e4f34109
-rwxr-xr-x | data/hfconsole.in | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/data/hfconsole.in b/data/hfconsole.in index 318be38..2867f37 100755 --- a/data/hfconsole.in +++ b/data/hfconsole.in @@ -1352,7 +1352,11 @@ class HfConsole: gobject.source_remove(self.config_skew_timeout) del self.config_skew_timeout def config_skew_notify(self, skewtype, count): - if skewtype == 1: + timeout = 1500 + if skewtype == 0: + msg = 'Sound Card Failure' + timeout = 5000 + elif skewtype == 1: msg = 'Sound Card Overrun/Underrun: %d/sec' % count elif skewtype == 2: if count < 0: @@ -1369,7 +1373,7 @@ class HfConsole: self['ConfigSkewNoticeLabel'].show() self['ConfigSkewNoticeLabel'].set_text(msg) self.config_skew_timeout = gobject.timeout_add( - 1500, self.config_skew_clear, True) + timeout, self.config_skew_clear, True) def config_denoise_changed(self, widget): value = widget.get_active() @@ -1601,6 +1605,8 @@ class HfConsole: 'net.sf.nohands.hfpd.Error.SoundIoSoundCardFailed'): self.soundio_status_msg('Primary Sound Card Failure', 5000) + if self.soundio_skew_monitor: + self.soundio_skew_monitor(0, 0) self.soundio_state_changed(2) def soundio_mute_changed(self, state): @@ -1609,10 +1615,10 @@ class HfConsole: self.setprop_soundio('Mute', but.get_active()) def soundio_status_msg_clear(self): - if hasattr(self, 'soundio_status_timeout'): + if hasattr(self, 'soundio_status_msgid'): self['StatusBar'].remove(self.soundio_status_ctx, - self.soundio_status_msg) - del self.soundio_status_msg + self.soundio_status_msgid) + del self.soundio_status_msgid if hasattr(self, 'soundio_status_timeout'): gobject.source_remove(self.soundio_status_timeout) del self.soundio_status_timeout @@ -1620,7 +1626,7 @@ class HfConsole: del self.soundio_skew_type def soundio_status_msg(self, msg, timeout): self.soundio_status_msg_clear() - self.soundio_status_msg = self['StatusBar'].push( + self.soundio_status_msgid = self['StatusBar'].push( self.soundio_status_ctx, msg); if timeout: |