Re: [iPAQ] mixer

From: Sam Watkins <sam.a.t.myinternet.com.au>
Date: Tue Sep 25 2001 - 15:24:35 EDT

There is a program called "setmixer" in debian which I like, so I wrote a
python hack to imitate it approximately. It depends on having the mix lib
which comes with pypaq. This is not to knock the existing mixer, but I like
command-line tools so I can script things (e.g. a little daemon that sounds an
alarm when the power gets too low).

---
#!/usr/bin/env python
import sys
sys.path.append('/usr/local/lib/python2.0')
import mix
n = len(sys.argv)
if n == 1:
	volume=mix.getvolume()
	treble=mix.gettreble()
	bass=mix.getbass()
	print "volume", volume
	print "treble", treble
	print "bass  ", bass
	sys.exit(0)
elif n == 2:
	command = "v"
	value = int(sys.argv[1])
elif n == 3:
	command = sys.argv[1][0]
	value = int(sys.argv[2])
else:
	print "bad syntax"
	sys.exit(1)
if command == "v":
	mix.setvolume(value)
elif command == "t":
	mix.settreble(value)
elif command == "b":
	mix.setbass(value)
else:
	print "bad command"
	sys.exit(1)
Received on Tue Sep 25 11:26:11 2001

This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:44:11 EDT