diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-04-28 04:27:20 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-04-28 04:27:20 (GMT) |
commit | cbfb9b46ffb17e1c82b1b6fe7effd0845da98bfa (patch) | |
tree | bf133a1652fc52cec882d51225f641ba71892c85 /glive.py | |
parent | 97cff47447920644600d88cf7abd0c3fc13aca8e (diff) |
Change only volumes for "Capture" channels and let user change others
Diffstat (limited to 'glive.py')
-rw-r--r-- | glive.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -407,10 +407,13 @@ class Glive: alsasrc.set_state(gst.STATE_PAUSED) for i in alsasrc.list_tracks(): if i.props.flags & gst.interfaces.MIXER_TRACK_INPUT \ - and not re.search('boost', i.label, flags=re.IGNORECASE): + and re.search('capture', i.label, flags=re.IGNORECASE): alsasrc.set_record(i, True) - alsasrc.set_volume(i, \ - tuple([i.props.max_volume] * i.props.num_channels)) + volume = i.props.min_volume \ + + int((i.props.max_volume - i.props.min_volume) \ + / 100. * 90.) + alsasrc.set_volume(i, tuple([volume] * i.props.num_channels)) + logger.debug('Set volume %s to %s' % (volume, i.label)) alsasrc.set_state(gst.STATE_NULL) del alsasrc |