summaryrefslogtreecommitdiffstats
path: root/Demo
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-04-15 16:19:23 (GMT)
committerGuido van Rossum <guido@python.org>1992-04-15 16:19:23 (GMT)
commitd5d1912e28d94e7909132cd40ef5639bcf42bbfe (patch)
treef87d650f76e52668112d3f535f62fa31e19425fb /Demo
parentece6efe5d1d6bdded11e1860fd62bb13a63b9f24 (diff)
downloadcpython-d5d1912e28d94e7909132cd40ef5639bcf42bbfe.zip
cpython-d5d1912e28d94e7909132cd40ef5639bcf42bbfe.tar.gz
cpython-d5d1912e28d94e7909132cd40ef5639bcf42bbfe.tar.bz2
New getstatus() return.
Use togglepause() only if playing or paused.
Diffstat (limited to 'Demo')
-rwxr-xr-xDemo/sgi/cd/cdwin.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/Demo/sgi/cd/cdwin.py b/Demo/sgi/cd/cdwin.py
index 8834c1d..1a562c2 100755
--- a/Demo/sgi/cd/cdwin.py
+++ b/Demo/sgi/cd/cdwin.py
@@ -1,6 +1,7 @@
# Window interface to (some of) the CD player's vital audio functions
import cd
+import CD
import stdwin
from stdwinevents import *
import mainloop
@@ -42,7 +43,13 @@ def but1(win):
update(win)
def but2(win):
- win.player.togglepause()
+ state = win.player.getstatus()[0]
+ if state == CD.READY:
+ win.player.play(1, 1)
+ elif state in (CD.PLAYING, CD.PAUSED):
+ win.player.togglepause()
+ else:
+ stdwin.fleep()
update(win)
def but3(win):
@@ -67,13 +74,13 @@ def draw(win):
def drawstatus(win, d):
left, top, right, bottom, v1, v2 = getgeo(win)
- status = win.player.getstatus()
- state = status[0]
+ state, track, curtime, abstime, totaltime, first, last, \
+ scsi_audio, cur_block, dummy = win.player.getstatus()
if 0 <= state < len(statedict):
message = statedict[state]
else:
message = `status`
- message = message + ' track ' + `status[1]` + ' of ' + `status[12]`
+ message = message + ' track ' + `track` + ' of ' + `last`
d.erase((left, top), (right, v1))
box(d, left, top, right, v1, message)