summaryrefslogtreecommitdiffstats
path: root/Demo/sgi/cd
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-04-22 13:39:10 (GMT)
committerGuido van Rossum <guido@python.org>1992-04-22 13:39:10 (GMT)
commitd9feb59b328e8dee91c27fe5cca0aa15992210ee (patch)
treecd36874d29570515241efacb9b1b00318100b978 /Demo/sgi/cd
parentf94e30932163851ca8375c373e07e6b68e416bc0 (diff)
downloadcpython-d9feb59b328e8dee91c27fe5cca0aa15992210ee.zip
cpython-d9feb59b328e8dee91c27fe5cca0aa15992210ee.tar.gz
cpython-d9feb59b328e8dee91c27fe5cca0aa15992210ee.tar.bz2
Adopted new readcd interface; caught interrupts
Diffstat (limited to 'Demo/sgi/cd')
-rwxr-xr-xDemo/sgi/cd/cdaiff.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/Demo/sgi/cd/cdaiff.py b/Demo/sgi/cd/cdaiff.py
index 83463a7..b3b9bb0 100755
--- a/Demo/sgi/cd/cdaiff.py
+++ b/Demo/sgi/cd/cdaiff.py
@@ -24,15 +24,21 @@ def main():
a.sampwidth = AL.SAMPLE_16
a.nchannels = AL.STEREO
a.samprate = AL.RATE_44100
+ r = readcd.Readcd().init()
l = []
for arg in sys.argv[2:]:
- l.append(eval(arg))
- print l
- r = readcd.Readcd().init()
- r.set(l)
+ x = eval(arg)
+ try:
+ l = len(x)
+ r.appendstretch(x[0], x[1])
+ except TypeError:
+ r.appendtrack(x)
r.setcallback(CD.AUDIO, writeaudio, a)
r.setcallback(CD.PTIME, ptimecallback, None)
- r.play()
+ try:
+ r.play()
+ except KeyboardInterrupt:
+ pass
a.destroy()
main()