Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libcd.tex @ 4566:6403c94de50d legacy-trunk
Added safeguard against failure in __del__.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 27 Nov 1996 19:39:58 +0000 |
| parents | da47b4146a7c |
| children | 3468ea8645ca |
| rev | line source |
|---|---|
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
1 \section{Built-in Module \sectcode{cd}} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
2 \bimodindex{cd} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
3 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
4 This module provides an interface to the Silicon Graphics CD library. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
5 It is available only on Silicon Graphics systems. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
6 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
7 The way the library works is as follows. A program opens the CD-ROM |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
8 device with \code{cd.open()} and creates a parser to parse the data |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
9 from the CD with \code{cd.createparser()}. The object returned by |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
10 \code{cd.open()} can be used to read data from the CD, but also to get |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
11 status information for the CD-ROM device, and to get information about |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
12 the CD, such as the table of contents. Data from the CD is passed to |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
13 the parser, which parses the frames, and calls any callback |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
14 functions that have previously been added. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
15 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
16 An audio CD is divided into \dfn{tracks} or \dfn{programs} (the terms |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
17 are used interchangeably). Tracks can be subdivided into |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
18 \dfn{indices}. An audio CD contains a \dfn{table of contents} which |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
19 gives the starts of the tracks on the CD. Index 0 is usually the |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
20 pause before the start of a track. The start of the track as given by |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
21 the table of contents is normally the start of index 1. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
22 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
23 Positions on a CD can be represented in two ways. Either a frame |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
24 number or a tuple of three values, minutes, seconds and frames. Most |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
25 functions use the latter representation. Positions can be both |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
26 relative to the beginning of the CD, and to the beginning of the |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
27 track. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
28 |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
29 Module \code{cd} defines the following functions and constants: |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
30 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
31 \renewcommand{\indexsubitem}{(in module cd)} |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
32 |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
33 \begin{funcdesc}{createparser}{} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
34 Create and return an opaque parser object. The methods of the parser |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
35 object are described below. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
36 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
37 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
38 \begin{funcdesc}{msftoframe}{min\, sec\, frame} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
39 Converts a \code{(minutes, seconds, frames)} triple representing time |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
40 in absolute time code into the corresponding CD frame number. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
41 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
42 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
43 \begin{funcdesc}{open}{\optional{device\optional{\, mode}}} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
44 Open the CD-ROM device. The return value is an opaque player object; |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
45 methods of the player object are described below. The device is the |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
46 name of the SCSI device file, e.g. /dev/scsi/sc0d4l0, or \code{None}. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
47 If omited or \code{None}, the hardware inventory is consulted to |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
48 locate a CD-ROM drive. The \code{mode}, if not omited, should be the |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
49 string 'r'. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
50 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
51 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
52 The module defines the following variables: |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
53 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
54 \begin{datadesc}{error} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
55 Exception raised on various errors. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
56 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
57 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
58 \begin{datadesc}{DATASIZE} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
59 The size of one frame's worth of audio data. This is the size of the |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
60 audio data as passed to the callback of type \code{audio}. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
61 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
62 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
63 \begin{datadesc}{BLOCKSIZE} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
64 The size of one uninterpreted frame of audio data. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
65 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
66 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
67 The following variables are states as returned by \code{getstatus}: |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
68 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
69 \begin{datadesc}{READY} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
70 The drive is ready for operation loaded with an audio CD. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
71 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
72 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
73 \begin{datadesc}{NODISC} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
74 The drive does not have a CD loaded. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
75 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
76 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
77 \begin{datadesc}{CDROM} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
78 The drive is loaded with a CD-ROM. Subsequent play or read operations |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
79 will return I/O errors. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
80 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
81 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
82 \begin{datadesc}{ERROR} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
83 An error aoocurred while trying to read the disc or its table of |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
84 contents. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
85 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
86 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
87 \begin{datadesc}{PLAYING} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
88 The drive is in CD player mode playing an audio CD through its audio |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
89 jacks. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
90 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
91 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
92 \begin{datadesc}{PAUSED} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
93 The drive is in CD layer mode with play paused. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
94 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
95 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
96 \begin{datadesc}{STILL} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
97 The equivalent of \code{PAUSED} on older (non 3301) model Toshiba |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
98 CD-ROM drives. Such drives have never been shipped by SGI. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
99 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
100 |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
101 \begin{datadesc}{audio} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
102 \dataline{pnum} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
103 \dataline{index} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
104 \dataline{ptime} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
105 \dataline{atime} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
106 \dataline{catalog} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
107 \dataline{ident} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
108 \dataline{control} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
109 Integer constants describing the various types of parser callbacks |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
110 that can be set by the \code{addcallback()} method of CD parser |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
111 objects (see below). |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
112 \end{datadesc} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
113 |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
114 Player objects (returned by \code{cd.open()}) have the following |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
115 methods: |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
116 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
117 \renewcommand{\indexsubitem}{(CD player object method)} |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
118 |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
119 \begin{funcdesc}{allowremoval}{} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
120 Unlocks the eject button on the CD-ROM drive permitting the user to |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
121 eject the caddy if desired. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
122 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
123 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
124 \begin{funcdesc}{bestreadsize}{} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
125 Returns the best value to use for the \code{num_frames} parameter of |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
126 the \code{readda} method. Best is defined as the value that permits a |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
127 continuous flow of data from the CD-ROM drive. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
128 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
129 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
130 \begin{funcdesc}{close}{} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
131 Frees the resources associated with the player object. After calling |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
132 \code{close}, the methods of the object should no longer be used. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
133 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
134 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
135 \begin{funcdesc}{eject}{} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
136 Ejects the caddy from the CD-ROM drive. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
137 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
138 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
139 \begin{funcdesc}{getstatus}{} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
140 Returns information pertaining to the current state of the CD-ROM |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
141 drive. The returned information is a tuple with the following values: |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
142 \code{state}, \code{track}, \code{rtime}, \code{atime}, \code{ttime}, |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
143 \code{first}, \code{last}, \code{scsi_audio}, \code{cur_block}. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
144 \code{rtime} is the time relative to the start of the current track; |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
145 \code{atime} is the time relative to the beginning of the disc; |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
146 \code{ttime} is the total time on the disc. For more information on |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
147 the meaning of the values, see the manual for CDgetstatus. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
148 The value of \code{state} is one of the following: \code{cd.ERROR}, |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
149 \code{cd.NODISC}, \code{cd.READY}, \code{cd.PLAYING}, |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
150 \code{cd.PAUSED}, \code{cd.STILL}, or \code{cd.CDROM}. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
151 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
152 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
153 \begin{funcdesc}{gettrackinfo}{track} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
154 Returns information about the specified track. The returned |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
155 information is a tuple consisting of two elements, the start time of |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
156 the track and the duration of the track. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
157 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
158 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
159 \begin{funcdesc}{msftoblock}{min\, sec\, frame} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
160 Converts a minutes, seconds, frames triple representing a time in |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
161 absolute time code into the corresponding logical block number for the |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
162 given CD-ROM drive. You should use \code{cd.msftoframe()} rather than |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
163 \code{msftoblock()} for comparing times. The logical block number |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
164 differs from the frame number by an offset required by certain CD-ROM |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
165 drives. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
166 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
167 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
168 \begin{funcdesc}{play}{start\, play} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
169 Starts playback of an audio CD in the CD-ROM drive at the specified |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
170 track. The audio output appears on the CD-ROM drive's headphone and |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
171 audio jacks (if fitted). Play stops at the end of the disc. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
172 \code{start} is the number of the track at which to start playing the |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
173 CD; if \code{play} is 0, the CD will be set to an initial paused |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
174 state. The method \code{togglepause()} can then be used to commence |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
175 play. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
176 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
177 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
178 \begin{funcdesc}{playabs}{min\, sec\, frame\, play} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
179 Like \code{play()}, except that the start is given in minutes, |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
180 seconds, frames instead of a track number. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
181 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
182 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
183 \begin{funcdesc}{playtrack}{start\, play} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
184 Like \code{play()}, except that playing stops at the end of the track. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
185 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
186 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
187 \begin{funcdesc}{playtrackabs}{track\, min\, sec\, frame\, play} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
188 Like \code{play()}, except that playing begins at the spcified |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
189 absolute time and ends at the end of the specified track. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
190 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
191 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
192 \begin{funcdesc}{preventremoval}{} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
193 Locks the eject button on the CD-ROM drive thus preventing the user |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
194 from arbitrarily ejecting the caddy. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
195 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
196 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
197 \begin{funcdesc}{readda}{num_frames} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
198 Reads the specified number of frames from an audio CD mounted in the |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
199 CD-ROM drive. The return value is a string representing the audio |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
200 frames. This string can be passed unaltered to the \code{parseframe} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
201 method of the parser object. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
202 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
203 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
204 \begin{funcdesc}{seek}{min\, sec\, frame} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
205 Sets the pointer that indicates the starting point of the next read of |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
206 digital audio data from a CD-ROM. The pointer is set to an absolute |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
207 time code location specified in minutes, seconds, and frames. The |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
208 return value is the logical block number to which the pointer has been |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
209 set. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
210 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
211 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
212 \begin{funcdesc}{seekblock}{block} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
213 Sets the pointer that indicates the starting point of the next read of |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
214 digital audio data from a CD-ROM. The pointer is set to the specified |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
215 logical block number. The return value is the logical block number to |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
216 which the pointer has been set. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
217 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
218 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
219 \begin{funcdesc}{seektrack}{track} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
220 Sets the pointer that indicates the starting point of the next read of |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
221 digital audio data from a CD-ROM. The pointer is set to the specified |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
222 track. The return value is the logical block number to which the |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
223 pointer has been set. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
224 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
225 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
226 \begin{funcdesc}{stop}{} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
227 Stops the current playing operation. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
228 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
229 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
230 \begin{funcdesc}{togglepause}{} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
231 Pauses the CD if it is playing, and makes it play if it is paused. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
232 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
233 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
234 Parser objects (returned by \code{cd.createparser()}) have the |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
235 following methods: |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
236 |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
237 \renewcommand{\indexsubitem}{(CD parser object method)} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
238 |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
239 \begin{funcdesc}{addcallback}{type\, func\, arg} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
240 Adds a callback for the parser. The parser has callbacks for eight |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
241 different types of data in the digital audio data stream. Constants |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
242 for these types are defined at the \code{cd} module level (see above). |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
243 The callback is called as follows: \code{func(arg, type, data)}, where |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
244 \code{arg} is the user supplied argument, \code{type} is the |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
245 particular type of callback, and \code{data} is the data returned for |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
246 this \code{type} of callback. The type of the data depends on the |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
247 \code{type} of callback as follows: |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
248 \begin{description} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
249 \item[\code{cd.audio}: ] |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
250 The argument is a string which can be passed unmodified to |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
251 \code{al.writesamps()}. |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
252 \item[\code{cd.pnum}: ] |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
253 The argument is an integer giving the program (track) number. |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
254 \item[\code{cd.index}: ] |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
255 The argument is an integer giving the index number. |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
256 \item[\code{cd.ptime}: ] |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
257 The argument is a tuple consisting of the program time in minutes, |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
258 seconds, and frames. |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
259 \item[\code{cd.atime}: ] |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
260 The argument is a tuple consisting of the absolute time in minutes, |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
261 seconds, and frames. |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
262 \item[\code{cd.catalog}: ] |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
263 The argument is a string of 13 characters, giving the catalog number |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
264 of the CD. |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
265 \item[\code{cd.ident}: ] |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
266 The argument is a string of 12 characters, giving the ISRC |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
267 identification number of the recording. The string consists of two |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
268 characters country code, three characters owner code, two characters |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
269 giving the year, and five characters giving a serial number. |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
270 \item[\code{cd.control}: ] |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
271 The argument is an integer giving the control bits from the CD subcode |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
272 data. |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
273 \end{description} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
274 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
275 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
276 \begin{funcdesc}{deleteparser}{} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
277 Deletes the parser and frees the memory it was using. The object |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
278 should not be used after this call. This call is done automatically |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
279 when the last reference to the object is removed. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
280 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
281 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
282 \begin{funcdesc}{parseframe}{frame} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
283 Parses one or more frames of digital audio data from a CD such as |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
284 returned by \code{readda}. It determines which subcodes are present |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
285 in the data. If these subcodes have changed since the last frame, |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
286 then \code{parseframe} executes a callback of the appropriate type |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
287 passing to it the subcode data found in the frame. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
288 Unlike the C function, more than one frame of digital audio data can |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
289 be passed to this method. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
290 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
291 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
292 \begin{funcdesc}{removecallback}{type} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
293 Removes the callback for the given \code{type}. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
294 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
295 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
296 \begin{funcdesc}{resetparser}{} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
297 Resets the fields of the parser used for tracking subcodes to an |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
298 initial state. \code{resetparser} should be called after the disc has |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
299 been changed. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
300 \end{funcdesc} |
