From 6db688266e2e607fc7e627159d6545c6656baf79 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Tue, 04 Dec 2012 17:15:27 +0000 Subject: fix mic boost for xo 1.75 (#4288) --- diff --git a/plugins/audio_sensors/audiograb.py b/plugins/audio_sensors/audiograb.py index 6072c61..37efa53 100644 --- a/plugins/audio_sensors/audiograb.py +++ b/plugins/audio_sensors/audiograb.py @@ -154,6 +154,7 @@ class AudioGrab(): 'dc input bias', 'v_refout']) self._mic_boost_control = self._find_control(['mic boost', + 'mic1 boost', 'mic boost (+20db)', 'internal mic boost', 'analog mic boost']) @@ -525,18 +526,17 @@ class AudioGrab(): if self._labels_available: if self._mic_boost_control is None: return - # If there is a flag property, use set_mute - if self._mic_boost_control not in self._mixer.list_tracks() or \ + # If there is a volume, use set volume + if hasattr(self._mic_boost_control, 'min_volume'): + if mic_boost: + self._set_volume(self._mic_boost_control, 'boost', 100) + else: + self._set_volume(self._mic_boost_control, 'boost', 0) + # Else if there is a flag property, use set_mute + elif self._mic_boost_control not in self._mixer.list_tracks() or \ hasattr(self._mic_boost_control.props, 'flags'): self._set_mute( self._mic_boost_control, 'Mic Boost', not mic_boost) - # Otherwise, set volume to max or min value - elif mic_boost: - self._mixer.set_volume(self._mic_boost_control, - self._mic_boost_control.max_volume) - else: - self._mixer.set_volume(self._mic_boost_control, - self._mic_boost_control.min_volume) else: self.amixer_set('Mic Boost (+20dB)', mic_boost) -- cgit v0.9.1