diff options
author | Walter Bender <walter.bender@gmail.com> | 2012-12-04 17:15:27 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2012-12-04 17:15:27 (GMT) |
commit | 6db688266e2e607fc7e627159d6545c6656baf79 (patch) | |
tree | 233a16aae8238a7b6e52b5d0afc8feb9c287376e | |
parent | b2d9d32e97021ab5e91681752cb716c4faafc942 (diff) |
fix mic boost for xo 1.75 (#4288)
-rw-r--r-- | plugins/audio_sensors/audiograb.py | 18 |
1 files changed, 9 insertions, 9 deletions
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) |