Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
67aad284
Commit
67aad284
authored
Apr 15, 1992
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix use of exceptions; new getstatus(); command line argument for trackno.
parent
632d4927
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
Demo/sgi/cd/playcd.py
Demo/sgi/cd/playcd.py
+19
-9
No files found.
Demo/sgi/cd/playcd.py
View file @
67aad284
# Read CD audio data from the SCSI bus and play it back over the
# built-in speaker or audio jack.
import
sys
import
al
import
AL
import
cd
...
...
@@ -15,27 +16,36 @@ callbacks = ['audio', 'pnum', 'index', 'ptime', 'atime', 'catalog', 'ident', 'co
def
callback
(
port
,
type
,
data
):
print
'type'
,
callbacks
[
type
],
'data'
,
`data`
Error
=
'playcd.error'
def
main
():
player
=
cd
.
open
()
parser
=
cd
.
createparser
()
state
,
track
,
min
,
sec
,
frame
,
abs_min
,
abs_sec
,
abs_frame
,
\
total_min
,
total_sec
,
total_frame
,
first
,
last
,
scsi_audio
,
\
cur_block
,
dum1
,
dum2
,
dum3
=
player
.
getstatus
()
print
`
state
,
track
,
min
,
sec
,
frame
,
abs_min
,
abs_sec
,
abs_frame
,
\
total_min
,
total_sec
,
total_frame
,
first
,
last
,
scsi_audio
,
\
cur_block
,
dum1
,
dum2
,
dum3
`
state
,
track
,
(
min
,
sec
,
frame
),
(
abs_min
,
abs_sec
,
abs_frame
),
\
(
total_min
,
total_sec
,
total_frame
),
\
first
,
last
,
scsi_audio
,
\
cur_block
,
(
dum1
,
dum2
,
dum3
)
=
player
.
getstatus
()
print
state
,
track
,
(
min
,
sec
,
frame
),
\
(
abs_min
,
abs_sec
,
abs_frame
),
\
(
total_min
,
total_sec
,
total_frame
),
\
first
,
last
,
scsi_audio
,
\
cur_block
,
(
dum1
,
dum2
,
dum3
)
if
state
<>
CD
.
READY
:
player
.
close
()
raise
'playcd.Error'
,
'CD not ready'
raise
Error
,
'CD not ready'
if
not
scsi_audio
:
player
.
close
()
raise
'playcd.Error'
,
'not an audio-capable CD-ROM player'
raise
Error
,
'not an audio-capable CD-ROM player'
for
i
in
range
(
first
,
last
+
1
):
trackinfo
=
player
.
gettrackinfo
(
i
)
print
`trackinfo`
print
'Track'
,
i
,
trackinfo
if
sys
.
argv
[
1
:]:
print
'Start at track'
,
sys
.
argv
[
1
]
player
.
seektrack
(
eval
(
sys
.
argv
[
1
]))
size
=
player
.
bestreadsize
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment