Commits

Sjoerd Mullender committed f5c4086

Use variables from module cd instead of CD.

Comments (0)

Files changed (5)

Demo/sgi/cd/cdaiff.py

 import readcd
 import aifc
 import AL
-import CD
+import cd
 
 Error = 'cdaiff.Error'
 
 			r.appendstretch(x[0], x[1])
 		except TypeError:
 			r.appendtrack(x)
-	r.setcallback(CD.AUDIO, writeaudio, a)
+	r.setcallback(cd.audio, writeaudio, a)
 	r.play()
 	a.close()
 

Demo/sgi/cd/cdwin.py

 # Window interface to (some of) the CD player's vital audio functions
 
 import cd
-import CD
 import stdwin
 from stdwinevents import *
 import mainloop
 
 def but2(win):
 	state = win.player.getstatus()[0]
-	if state == CD.READY:
+	if state == cd.ready:
 		win.player.play(1, 1)
-	elif state in (CD.PLAYING, CD.PAUSED):
+	elif state in (cd.playing, cd.paused):
 		win.player.togglepause()
 	else:
 		stdwin.fleep()

Demo/sgi/cd/playcd.py

 	print 'Future:', dummy
 
 def main():
-	import sys, readcd, al, AL, CD, cdplayer
+	import sys, readcd, al, AL, cd, cdplayer
 	verbose = 0
 	r = readcd.Readcd()
 	prstatus(r.getstatus())
 		for i in range(8):
 			r.setcallback(i, callback, None)
 		if verbose:
-			r.setcallback(CD.PTIME, tcallback, None)
-			r.setcallback(CD.ATIME, tcallback, None)
+			r.setcallback(cd.ptime, tcallback, None)
+			r.setcallback(cd.atime, tcallback, None)
 		else:
-			r.removecallback(CD.PTIME)
-			r.removecallback(CD.ATIME)
-		r.setcallback(CD.PNUM, prtrack, cdinfo)
-		r.setcallback(CD.AUDIO, playaudio, port)
+			r.removecallback(cd.ptime)
+			r.removecallback(cd.atime)
+		r.setcallback(cd.pnum, prtrack, cdinfo)
+		r.setcallback(cd.audio, playaudio, port)
 
 		data = r.play()
 	except KeyboardInterrupt:

Demo/sgi/cd/recvcd.py

 
 import al, AL
 from socket import *
-from CD import CDDA_DATASIZE
+from cd import DATASIZE
 
 PORT = 50505				# Must match the port in sendcd.py
 
 		port = al.openport('CD Player', 'w', config)
 
 		while 1:
-			data = s.recv(CDDA_DATASIZE)
+			data = s.recv(DATASIZE)
 			if not data:
 				print 'EOF'
 				break

Demo/sgi/cd/sendcd.py

 	print 'socket connected'
 
 	parser = cd.createparser()
-	parser.setcallback(0, audiocallback, port)
-	parser.setcallback(1, pnumcallback, player)
-	parser.setcallback(2, indexcallback, None)
-	## 3 = ptime: too many calls
-	## 4 = atime: too many calls
-	parser.setcallback(5, catalogcallback, None)
-	parser.setcallback(6, identcallback, None)
-	parser.setcallback(7, controlcallback, None)
+	parser.setcallback(cd.audio, audiocallback, port)
+	parser.setcallback(cd.pnum, pnumcallback, player)
+	parser.setcallback(cd.index, indexcallback, None)
+	## cd.ptime: too many calls
+	## cd.atime: too many calls
+	parser.setcallback(cd.catalog, catalogcallback, None)
+	parser.setcallback(cd.ident, identcallback, None)
+	parser.setcallback(cd.control, controlcallback, None)
 
 	if len(args) >= 2:
 		if len(args) >= 3: