Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey 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)
commitcbfb9b46ffb17e1c82b1b6fe7effd0845da98bfa (patch)
treebf133a1652fc52cec882d51225f641ba71892c85
parent97cff47447920644600d88cf7abd0c3fc13aca8e (diff)
Change only volumes for "Capture" channels and let user change others
-rw-r--r--glive.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/glive.py b/glive.py
index 51c3c0e..99d6b7a 100644
--- a/glive.py
+++ b/glive.py
@@ -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