Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="lib.html" title='Python Library Reference' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='index' href='genindex.html' title='Index' /> | |
10 | <link rel='last' href='about.html' title='About this document...' /> | |
11 | <link rel='help' href='about.html' title='About this document...' /> | |
12 | <link rel="next" href="module-fl.html" /> | |
13 | <link rel="prev" href="module-al-constants.html" /> | |
14 | <link rel="parent" href="sgi.html" /> | |
15 | <link rel="next" href="player-objects.html" /> | |
16 | <meta name='aesop' content='information' /> | |
17 | <title>20.3 cd -- CD-ROM access on SGI systems</title> | |
18 | </head> | |
19 | <body> | |
20 | <DIV CLASS="navigation"> | |
21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
23 | <tr> | |
24 | <td class='online-navigation'><a rel="prev" title="20.2 AL " | |
25 | href="module-al-constants.html"><img src='../icons/previous.png' | |
26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
27 | <td class='online-navigation'><a rel="parent" title="20. SGI IRIX Specific" | |
28 | href="sgi.html"><img src='../icons/up.png' | |
29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
30 | <td class='online-navigation'><a rel="next" title="20.3.1 Player Objects" | |
31 | href="player-objects.html"><img src='../icons/next.png' | |
32 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
33 | <td align="center" width="100%">Python Library Reference</td> | |
34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
35 | href="contents.html"><img src='../icons/contents.png' | |
36 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
38 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
39 | <td class='online-navigation'><a rel="index" title="Index" | |
40 | href="genindex.html"><img src='../icons/index.png' | |
41 | border='0' height='32' alt='Index' width='32' /></A></td> | |
42 | </tr></table> | |
43 | <div class='online-navigation'> | |
44 | <b class="navlabel">Previous:</b> | |
45 | <a class="sectref" rel="prev" href="module-al-constants.html">20.2 AL </A> | |
46 | <b class="navlabel">Up:</b> | |
47 | <a class="sectref" rel="parent" href="sgi.html">20. SGI IRIX Specific</A> | |
48 | <b class="navlabel">Next:</b> | |
49 | <a class="sectref" rel="next" href="player-objects.html">20.3.1 Player Objects</A> | |
50 | </div> | |
51 | <hr /></div> | |
52 | </DIV> | |
53 | <!--End of Navigation Panel--> | |
54 | ||
55 | <H1><A NAME="SECTION0022300000000000000000"> | |
56 | 20.3 <tt class="module">cd</tt> -- | |
57 | CD-ROM access on SGI systems</A> | |
58 | </H1> | |
59 | ||
60 | <P> | |
61 | <A NAME="module-cd"></A> | |
62 | <p class="availability">Availability: <span | |
63 | class="platform">IRIX</span>.</p> | |
64 | ||
65 | <P> | |
66 | This module provides an interface to the Silicon Graphics CD library. | |
67 | It is available only on Silicon Graphics systems. | |
68 | ||
69 | <P> | |
70 | The way the library works is as follows. A program opens the CD-ROM | |
71 | device with <tt class="function">open()</tt> and creates a parser to parse the data | |
72 | from the CD with <tt class="function">createparser()</tt>. The object returned by | |
73 | <tt class="function">open()</tt> can be used to read data from the CD, but also to get | |
74 | status information for the CD-ROM device, and to get information about | |
75 | the CD, such as the table of contents. Data from the CD is passed to | |
76 | the parser, which parses the frames, and calls any callback | |
77 | functions that have previously been added. | |
78 | ||
79 | <P> | |
80 | An audio CD is divided into <i class="dfn">tracks</i> or <i class="dfn">programs</i> (the terms | |
81 | are used interchangeably). Tracks can be subdivided into | |
82 | <i class="dfn">indices</i>. An audio CD contains a <i class="dfn">table of contents</i> which | |
83 | gives the starts of the tracks on the CD. Index 0 is usually the | |
84 | pause before the start of a track. The start of the track as given by | |
85 | the table of contents is normally the start of index 1. | |
86 | ||
87 | <P> | |
88 | Positions on a CD can be represented in two ways. Either a frame | |
89 | number or a tuple of three values, minutes, seconds and frames. Most | |
90 | functions use the latter representation. Positions can be both | |
91 | relative to the beginning of the CD, and to the beginning of the | |
92 | track. | |
93 | ||
94 | <P> | |
95 | Module <tt class="module">cd</tt> defines the following functions and constants: | |
96 | ||
97 | <P> | |
98 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
99 | <td><nobr><b><tt id='l2h-5067' xml:id='l2h-5067' class="function">createparser</tt></b>(</nobr></td> | |
100 | <td><var></var>)</td></tr></table></dt> | |
101 | <dd> | |
102 | Create and return an opaque parser object. The methods of the parser | |
103 | object are described below. | |
104 | </dl> | |
105 | ||
106 | <P> | |
107 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
108 | <td><nobr><b><tt id='l2h-5068' xml:id='l2h-5068' class="function">msftoframe</tt></b>(</nobr></td> | |
109 | <td><var>minutes, seconds, frames</var>)</td></tr></table></dt> | |
110 | <dd> | |
111 | Converts a <code>(<var>minutes</var>, <var>seconds</var>, <var>frames</var>)</code> triple | |
112 | representing time in absolute time code into the corresponding CD | |
113 | frame number. | |
114 | </dl> | |
115 | ||
116 | <P> | |
117 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
118 | <td><nobr><b><tt id='l2h-5069' xml:id='l2h-5069' class="function">open</tt></b>(</nobr></td> | |
119 | <td><var></var><big>[</big><var>device</var><big>[</big><var>, mode</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt> | |
120 | <dd> | |
121 | Open the CD-ROM device. The return value is an opaque player object; | |
122 | methods of the player object are described below. The device is the | |
123 | name of the SCSI device file, e.g. <code>'/dev/scsi/sc0d4l0'</code>, or | |
124 | <code>None</code>. If omitted or <code>None</code>, the hardware inventory is | |
125 | consulted to locate a CD-ROM drive. The <var>mode</var>, if not omitted, | |
126 | should be the string <code>'r'</code>. | |
127 | </dl> | |
128 | ||
129 | <P> | |
130 | The module defines the following variables: | |
131 | ||
132 | <P> | |
133 | <dl><dt><b><span class="typelabel">exception</span> <tt id='l2h-5070' xml:id='l2h-5070' class="exception">error</tt></b></dt> | |
134 | <dd> | |
135 | Exception raised on various errors. | |
136 | </dd></dl> | |
137 | ||
138 | <P> | |
139 | <dl><dt><b><tt id='l2h-5071' xml:id='l2h-5071'>DATASIZE</tt></b></dt> | |
140 | <dd> | |
141 | The size of one frame's worth of audio data. This is the size of the | |
142 | audio data as passed to the callback of type <code>audio</code>. | |
143 | </dd></dl> | |
144 | ||
145 | <P> | |
146 | <dl><dt><b><tt id='l2h-5072' xml:id='l2h-5072'>BLOCKSIZE</tt></b></dt> | |
147 | <dd> | |
148 | The size of one uninterpreted frame of audio data. | |
149 | </dd></dl> | |
150 | ||
151 | <P> | |
152 | The following variables are states as returned by | |
153 | <tt class="function">getstatus()</tt>: | |
154 | ||
155 | <P> | |
156 | <dl><dt><b><tt id='l2h-5073' xml:id='l2h-5073'>READY</tt></b></dt> | |
157 | <dd> | |
158 | The drive is ready for operation loaded with an audio CD. | |
159 | </dd></dl> | |
160 | ||
161 | <P> | |
162 | <dl><dt><b><tt id='l2h-5074' xml:id='l2h-5074'>NODISC</tt></b></dt> | |
163 | <dd> | |
164 | The drive does not have a CD loaded. | |
165 | </dd></dl> | |
166 | ||
167 | <P> | |
168 | <dl><dt><b><tt id='l2h-5075' xml:id='l2h-5075'>CDROM</tt></b></dt> | |
169 | <dd> | |
170 | The drive is loaded with a CD-ROM. Subsequent play or read operations | |
171 | will return I/O errors. | |
172 | </dd></dl> | |
173 | ||
174 | <P> | |
175 | <dl><dt><b><tt id='l2h-5076' xml:id='l2h-5076'>ERROR</tt></b></dt> | |
176 | <dd> | |
177 | An error occurred while trying to read the disc or its table of | |
178 | contents. | |
179 | </dd></dl> | |
180 | ||
181 | <P> | |
182 | <dl><dt><b><tt id='l2h-5077' xml:id='l2h-5077'>PLAYING</tt></b></dt> | |
183 | <dd> | |
184 | The drive is in CD player mode playing an audio CD through its audio | |
185 | jacks. | |
186 | </dd></dl> | |
187 | ||
188 | <P> | |
189 | <dl><dt><b><tt id='l2h-5078' xml:id='l2h-5078'>PAUSED</tt></b></dt> | |
190 | <dd> | |
191 | The drive is in CD layer mode with play paused. | |
192 | </dd></dl> | |
193 | ||
194 | <P> | |
195 | <dl><dt><b><tt id='l2h-5079' xml:id='l2h-5079'>STILL</tt></b></dt> | |
196 | <dd> | |
197 | The equivalent of <tt class="constant">PAUSED</tt> on older (non 3301) model Toshiba | |
198 | CD-ROM drives. Such drives have never been shipped by SGI. | |
199 | </dd></dl> | |
200 | ||
201 | <P> | |
202 | <dl><dt><b><tt id='l2h-5080' xml:id='l2h-5080'>audio</tt></b></dt> | |
203 | <dd> | |
204 | <dt><b><tt id='l2h-5081' xml:id='l2h-5081'>pnum</tt></b></dt><dd> | |
205 | <dt><b><tt id='l2h-5082' xml:id='l2h-5082'>index</tt></b></dt><dd> | |
206 | <dt><b><tt id='l2h-5083' xml:id='l2h-5083'>ptime</tt></b></dt><dd> | |
207 | <dt><b><tt id='l2h-5084' xml:id='l2h-5084'>atime</tt></b></dt><dd> | |
208 | <dt><b><tt id='l2h-5085' xml:id='l2h-5085'>catalog</tt></b></dt><dd> | |
209 | <dt><b><tt id='l2h-5086' xml:id='l2h-5086'>ident</tt></b></dt><dd> | |
210 | <dt><b><tt id='l2h-5087' xml:id='l2h-5087'>control</tt></b></dt><dd> | |
211 | Integer constants describing the various types of parser callbacks | |
212 | that can be set by the <tt class="method">addcallback()</tt> method of CD parser | |
213 | objects (see below). | |
214 | </dd></dl> | |
215 | ||
216 | <P> | |
217 | ||
218 | <p><br /></p><hr class='online-navigation' /> | |
219 | <div class='online-navigation'> | |
220 | <!--Table of Child-Links--> | |
221 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> | |
222 | ||
223 | <UL CLASS="ChildLinks"> | |
224 | <LI><A href="player-objects.html">20.3.1 Player Objects</a> | |
225 | <LI><A href="cd-parser-objects.html">20.3.2 Parser Objects</a> | |
226 | </ul> | |
227 | <!--End of Table of Child-Links--> | |
228 | </div> | |
229 | ||
230 | <DIV CLASS="navigation"> | |
231 | <div class='online-navigation'> | |
232 | <p></p><hr /> | |
233 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
234 | <tr> | |
235 | <td class='online-navigation'><a rel="prev" title="20.2 AL " | |
236 | href="module-al-constants.html"><img src='../icons/previous.png' | |
237 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
238 | <td class='online-navigation'><a rel="parent" title="20. SGI IRIX Specific" | |
239 | href="sgi.html"><img src='../icons/up.png' | |
240 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
241 | <td class='online-navigation'><a rel="next" title="20.3.1 Player Objects" | |
242 | href="player-objects.html"><img src='../icons/next.png' | |
243 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
244 | <td align="center" width="100%">Python Library Reference</td> | |
245 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
246 | href="contents.html"><img src='../icons/contents.png' | |
247 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
248 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
249 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
250 | <td class='online-navigation'><a rel="index" title="Index" | |
251 | href="genindex.html"><img src='../icons/index.png' | |
252 | border='0' height='32' alt='Index' width='32' /></A></td> | |
253 | </tr></table> | |
254 | <div class='online-navigation'> | |
255 | <b class="navlabel">Previous:</b> | |
256 | <a class="sectref" rel="prev" href="module-al-constants.html">20.2 AL </A> | |
257 | <b class="navlabel">Up:</b> | |
258 | <a class="sectref" rel="parent" href="sgi.html">20. SGI IRIX Specific</A> | |
259 | <b class="navlabel">Next:</b> | |
260 | <a class="sectref" rel="next" href="player-objects.html">20.3.1 Player Objects</A> | |
261 | </div> | |
262 | </div> | |
263 | <hr /> | |
264 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
265 | </DIV> | |
266 | <!--End of Navigation Panel--> | |
267 | <ADDRESS> | |
268 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
269 | </ADDRESS> | |
270 | </BODY> | |
271 | </HTML> |