Commit f1bb3349 authored by Sjoerd Mullender's avatar Sjoerd Mullender

Use variables from module cd instead of CD.

parent d8953cb8
......@@ -2,7 +2,7 @@ import sys
import readcd
import aifc
import AL
import CD
import cd
Error = 'cdaiff.Error'
......@@ -26,7 +26,7 @@ def main():
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()
......
# Window interface to (some of) the CD player's vital audio functions
import cd
import CD
import stdwin
from stdwinevents import *
import mainloop
......@@ -44,9 +43,9 @@ def but1(win):
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()
......
......@@ -50,7 +50,7 @@ def prstatus(status):
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())
......@@ -84,13 +84,13 @@ def main():
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:
......
......@@ -3,7 +3,7 @@
import al, AL
from socket import *
from CD import CDDA_DATASIZE
from cd import DATASIZE
PORT = 50505 # Must match the port in sendcd.py
......@@ -23,7 +23,7 @@ def main():
port = al.openport('CD Player', 'w', config)
while 1:
data = s.recv(CDDA_DATASIZE)
data = s.recv(DATASIZE)
if not data:
print 'EOF'
break
......
......@@ -51,14 +51,14 @@ def main():
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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment