Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libcd.tex @ 27998:e27f58a50737 legacy-trunk
SF bug #690377: Dud footnote reference in distutils docs
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Fri, 21 Feb 2003 02:47:09 +0000 |
| parents | fdfd1049f36e |
| children | 67f2190e1f6d |
| rev | line source |
|---|---|
| 8918 | 1 \section{\module{cd} --- |
| 10252 | 2 CD-ROM access on SGI systems} |
| 3 | |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8018
diff
changeset
|
4 \declaremodule{builtin}{cd} |
| 10334 | 5 \platform{IRIX} |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8018
diff
changeset
|
6 \modulesynopsis{Interface to the CD-ROM on Silicon Graphics systems.} |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8018
diff
changeset
|
7 |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
8 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
9 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
|
10 It is available only on Silicon Graphics systems. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
11 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
12 The way the library works is as follows. A program opens the CD-ROM |
| 7697 | 13 device with \function{open()} and creates a parser to parse the data |
| 14 from the CD with \function{createparser()}. The object returned by | |
| 15 \function{open()} can be used to read data from the CD, but also to get | |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
16 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
|
17 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
|
18 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
|
19 functions that have previously been added. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
20 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
21 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
|
22 are used interchangeably). Tracks can be subdivided into |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
23 \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
|
24 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
|
25 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
|
26 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
|
27 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
28 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
|
29 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
|
30 functions use the latter representation. Positions can be both |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
31 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
|
32 track. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
33 |
| 7697 | 34 Module \module{cd} defines the following functions and constants: |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
35 |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
36 |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
37 \begin{funcdesc}{createparser}{} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
38 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
|
39 object are described below. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
40 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
41 |
| 7697 | 42 \begin{funcdesc}{msftoframe}{minutes, seconds, frames} |
| 43 Converts a \code{(\var{minutes}, \var{seconds}, \var{frames})} triple | |
| 44 representing time in absolute time code into the corresponding CD | |
| 45 frame number. | |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
46 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
47 |
| 7697 | 48 \begin{funcdesc}{open}{\optional{device\optional{, mode}}} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
49 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
|
50 methods of the player object are described below. The device is the |
| 7697 | 51 name of the SCSI device file, e.g. \code{'/dev/scsi/sc0d4l0'}, or |
| 52 \code{None}. If omitted or \code{None}, the hardware inventory is | |
| 53 consulted to locate a CD-ROM drive. The \var{mode}, if not omited, | |
| 54 should be the string \code{'r'}. | |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
55 \end{funcdesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
56 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
57 The module defines the following variables: |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
58 |
| 7697 | 59 \begin{excdesc}{error} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
60 Exception raised on various errors. |
| 7697 | 61 \end{excdesc} |
|
2602
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}{DATASIZE} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
64 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
|
65 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
|
66 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
67 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
68 \begin{datadesc}{BLOCKSIZE} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
69 The size of one uninterpreted frame of audio data. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
70 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
71 |
| 7697 | 72 The following variables are states as returned by |
| 73 \function{getstatus()}: | |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
74 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
75 \begin{datadesc}{READY} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
76 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
|
77 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
78 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
79 \begin{datadesc}{NODISC} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
80 The drive does not have a CD loaded. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
81 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
82 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
83 \begin{datadesc}{CDROM} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
84 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
|
85 will return I/O errors. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
86 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
87 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
88 \begin{datadesc}{ERROR} |
|
13625
fdfd1049f36e
Rob W. W. Hooft's spelling fixes for the Library Reference. I hope
Thomas Wouters <thomas@python.org>
parents:
10334
diff
changeset
|
89 An error occurred while trying to read the disc or its table of |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
90 contents. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
91 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
92 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
93 \begin{datadesc}{PLAYING} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
94 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
|
95 jacks. |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
96 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
97 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
98 \begin{datadesc}{PAUSED} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
99 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
|
100 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
101 |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
102 \begin{datadesc}{STILL} |
| 7697 | 103 The equivalent of \constant{PAUSED} on older (non 3301) model Toshiba |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
104 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
|
105 \end{datadesc} |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
106 |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
107 \begin{datadesc}{audio} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
108 \dataline{pnum} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
109 \dataline{index} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
110 \dataline{ptime} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
111 \dataline{atime} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
112 \dataline{catalog} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
113 \dataline{ident} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
114 \dataline{control} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
115 Integer constants describing the various types of parser callbacks |
| 7697 | 116 that can be set by the \method{addcallback()} method of CD parser |
|
2619
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
117 objects (see below). |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
118 \end{datadesc} |
|
da47b4146a7c
restructured docs for callback types
Guido van Rossum <guido@python.org>
parents:
2602
diff
changeset
|
119 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
120 |
|
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
121 \subsection{Player Objects} |
|
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
122 \label{player-objects} |
|
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
123 |
| 7697 | 124 Player objects (returned by \function{open()}) have the following |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
125 methods: |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
126 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
127 \begin{methoddesc}[CD player]{allowremoval}{} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
128 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
|
129 eject the caddy if desired. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
130 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
131 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
132 \begin{methoddesc}[CD player]{bestreadsize}{} |
| 7697 | 133 Returns the best value to use for the \var{num_frames} parameter of |
| 134 the \method{readda()} method. Best is defined as the value that | |
| 135 permits a continuous flow of data from the CD-ROM drive. | |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
136 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
137 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
138 \begin{methoddesc}[CD player]{close}{} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
139 Frees the resources associated with the player object. After calling |
| 7697 | 140 \method{close()}, the methods of the object should no longer be used. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
141 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
142 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
143 \begin{methoddesc}[CD player]{eject}{} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
144 Ejects the caddy from the CD-ROM drive. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
145 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
146 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
147 \begin{methoddesc}[CD player]{getstatus}{} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
148 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
|
149 drive. The returned information is a tuple with the following values: |
| 7697 | 150 \var{state}, \var{track}, \var{rtime}, \var{atime}, \var{ttime}, |
| 151 \var{first}, \var{last}, \var{scsi_audio}, \var{cur_block}. | |
| 152 \var{rtime} is the time relative to the start of the current track; | |
| 153 \var{atime} is the time relative to the beginning of the disc; | |
| 154 \var{ttime} is the total time on the disc. For more information on | |
| 155 the meaning of the values, see the man page \manpage{CDgetstatus}{3dm}. | |
| 156 The value of \var{state} is one of the following: \constant{ERROR}, | |
| 157 \constant{NODISC}, \constant{READY}, \constant{PLAYING}, | |
| 158 \constant{PAUSED}, \constant{STILL}, or \constant{CDROM}. | |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
159 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
160 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
161 \begin{methoddesc}[CD player]{gettrackinfo}{track} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
162 Returns information about the specified track. The returned |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
163 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
|
164 the track and the duration of the track. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
165 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
166 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
167 \begin{methoddesc}[CD player]{msftoblock}{min, sec, frame} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
168 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
|
169 absolute time code into the corresponding logical block number for the |
| 7697 | 170 given CD-ROM drive. You should use \function{msftoframe()} rather than |
| 171 \method{msftoblock()} for comparing times. The logical block number | |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
172 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
|
173 drives. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
174 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
175 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
176 \begin{methoddesc}[CD player]{play}{start, play} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
177 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
|
178 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
|
179 audio jacks (if fitted). Play stops at the end of the disc. |
| 7697 | 180 \var{start} is the number of the track at which to start playing the |
| 181 CD; if \var{play} is 0, the CD will be set to an initial paused | |
| 182 state. The method \method{togglepause()} can then be used to commence | |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
183 play. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
184 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
185 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
186 \begin{methoddesc}[CD player]{playabs}{minutes, seconds, frames, play} |
| 7697 | 187 Like \method{play()}, except that the start is given in minutes, |
| 188 seconds, and frames instead of a track number. | |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
189 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
190 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
191 \begin{methoddesc}[CD player]{playtrack}{start, play} |
| 7697 | 192 Like \method{play()}, except that playing stops at the end of the |
| 193 track. | |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
194 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
195 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
196 \begin{methoddesc}[CD player]{playtrackabs}{track, minutes, seconds, frames, play} |
|
13625
fdfd1049f36e
Rob W. W. Hooft's spelling fixes for the Library Reference. I hope
Thomas Wouters <thomas@python.org>
parents:
10334
diff
changeset
|
197 Like \method{play()}, except that playing begins at the specified |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
198 absolute time and ends at the end of the specified track. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
199 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
200 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
201 \begin{methoddesc}[CD player]{preventremoval}{} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
202 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
|
203 from arbitrarily ejecting the caddy. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
204 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
205 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
206 \begin{methoddesc}[CD player]{readda}{num_frames} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
207 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
|
208 CD-ROM drive. The return value is a string representing the audio |
| 7697 | 209 frames. This string can be passed unaltered to the |
| 210 \method{parseframe()} method of the parser object. | |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
211 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
212 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
213 \begin{methoddesc}[CD player]{seek}{minutes, seconds, frames} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
214 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
|
215 digital audio data from a CD-ROM. The pointer is set to an absolute |
| 7697 | 216 time code location specified in \var{minutes}, \var{seconds}, and |
| 217 \var{frames}. The return value is the logical block number to which | |
| 218 the pointer has been set. | |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
219 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
220 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
221 \begin{methoddesc}[CD player]{seekblock}{block} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
222 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
|
223 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
|
224 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
|
225 which the pointer has been set. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
226 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
227 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
228 \begin{methoddesc}[CD player]{seektrack}{track} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
229 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
|
230 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
|
231 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
|
232 pointer has been set. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
233 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
234 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
235 \begin{methoddesc}[CD player]{stop}{} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
236 Stops the current playing operation. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
237 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
238 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
239 \begin{methoddesc}[CD player]{togglepause}{} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
240 Pauses the CD if it is playing, and makes it play if it is paused. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
241 \end{methoddesc} |
|
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
242 |
|
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
243 |
|
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
244 \subsection{Parser Objects} |
|
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
245 \label{cd-parser-objects} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
246 |
| 7697 | 247 Parser objects (returned by \function{createparser()}) have the |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
248 following methods: |
|
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
249 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
250 \begin{methoddesc}[CD parser]{addcallback}{type, func, arg} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
251 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
|
252 different types of data in the digital audio data stream. Constants |
| 7697 | 253 for these types are defined at the \module{cd} module level (see above). |
| 254 The callback is called as follows: \code{\var{func}(\var{arg}, type, | |
| 255 data)}, where \var{arg} is the user supplied argument, \var{type} is | |
| 256 the particular type of callback, and \var{data} is the data returned | |
| 257 for this \var{type} of callback. The type of the data depends on the | |
| 258 \var{type} of callback as follows: | |
| 259 | |
| 8018 | 260 \begin{tableii}{l|p{4in}}{code}{Type}{Value} |
| 7697 | 261 \lineii{audio}{String which can be passed unmodified to |
| 262 \function{al.writesamps()}.} | |
| 263 \lineii{pnum}{Integer giving the program (track) number.} | |
| 264 \lineii{index}{Integer giving the index number.} | |
| 265 \lineii{ptime}{Tuple consisting of the program time in minutes, | |
| 266 seconds, and frames.} | |
| 267 \lineii{atime}{Tuple consisting of the absolute time in minutes, | |
| 268 seconds, and frames.} | |
| 269 \lineii{catalog}{String of 13 characters, giving the catalog number | |
| 270 of the CD.} | |
| 271 \lineii{ident}{String of 12 characters, giving the ISRC | |
|
8009
bf6e920c0e79
When the text of a table cell should be wrapped, used a "p" column.
Fred Drake <fdrake@acm.org>
parents:
7875
diff
changeset
|
272 identification number of the recording. The string consists of two |
|
bf6e920c0e79
When the text of a table cell should be wrapped, used a "p" column.
Fred Drake <fdrake@acm.org>
parents:
7875
diff
changeset
|
273 characters country code, three characters owner code, two characters |
|
bf6e920c0e79
When the text of a table cell should be wrapped, used a "p" column.
Fred Drake <fdrake@acm.org>
parents:
7875
diff
changeset
|
274 giving the year, and five characters giving a serial number.} |
| 7697 | 275 \lineii{control}{Integer giving the control bits from the CD |
| 276 subcode data} | |
| 277 \end{tableii} | |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
278 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
279 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
280 \begin{methoddesc}[CD parser]{deleteparser}{} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
281 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
|
282 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
|
283 when the last reference to the object is removed. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
284 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
285 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
286 \begin{methoddesc}[CD parser]{parseframe}{frame} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
287 Parses one or more frames of digital audio data from a CD such as |
| 7697 | 288 returned by \method{readda()}. It determines which subcodes are |
| 289 present in the data. If these subcodes have changed since the last | |
| 290 frame, then \method{parseframe()} executes a callback of the | |
| 291 appropriate type passing to it the subcode data found in the frame. | |
| 292 Unlike the \C{} function, more than one frame of digital audio data | |
| 293 can be passed to this method. | |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
294 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
295 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
296 \begin{methoddesc}[CD parser]{removecallback}{type} |
| 7697 | 297 Removes the callback for the given \var{type}. |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
298 \end{methoddesc} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
299 |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
300 \begin{methoddesc}[CD parser]{resetparser}{} |
|
2602
bee2aed416d6
New documentation on the CD module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
301 Resets the fields of the parser used for tracking subcodes to an |
| 7697 | 302 initial state. \method{resetparser()} should be called after the disc |
| 303 has been changed. | |
|
7875
8f425f8f4be2
Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents:
7697
diff
changeset
|
304 \end{methoddesc} |
