File: Sdlcdrom.html

package info (click to toggle)
ocamlsdl 0.7.2-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,512 kB
  • ctags: 1,447
  • sloc: ansic: 2,903; sh: 2,610; ml: 2,130; makefile: 211; awk: 13
file content (230 lines) | stat: -rw-r--r-- 11,935 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="Start" href="index.html">
<link rel="previous" href="Sdl.html">
<link rel="next" href="Sdltimer.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Sdl" rel="Chapter" href="Sdl.html">
<link title="Sdlcdrom" rel="Chapter" href="Sdlcdrom.html">
<link title="Sdltimer" rel="Chapter" href="Sdltimer.html">
<link title="Sdljoystick" rel="Chapter" href="Sdljoystick.html">
<link title="Sdlkey" rel="Chapter" href="Sdlkey.html">
<link title="Sdlmouse" rel="Chapter" href="Sdlmouse.html">
<link title="Sdlevent" rel="Chapter" href="Sdlevent.html">
<link title="Sdlvideo" rel="Chapter" href="Sdlvideo.html">
<link title="Sdlwm" rel="Chapter" href="Sdlwm.html">
<link title="Sdlgl" rel="Chapter" href="Sdlgl.html">
<link title="Sdlttf" rel="Chapter" href="Sdlttf.html">
<link title="Sdlloader" rel="Chapter" href="Sdlloader.html">
<link title="Sdlmixer" rel="Chapter" href="Sdlmixer.html"><link title="Types" rel="Section" href="#3_Types">
<link title="General API" rel="Section" href="#3_GeneralAPI">
<link title="CD-ROM drive handling" rel="Section" href="#3_CDROMdrivehandling">
<link title="Playing audio tracks " rel="Section" href="#3_Playingaudiotracks">
<title>OCamlSDL 0.7.2 : Sdlcdrom</title>
</head>
<body>
<div class="navbar"><a href="Sdl.html">Previous</a>
&nbsp;<a href="index.html">Up</a>
&nbsp;<a href="Sdltimer.html">Next</a>
</div>
<center><h1>Module <a href="type_Sdlcdrom.html">Sdlcdrom</a></h1></center>
<br>
<pre><span class="keyword">module</span> Sdlcdrom: <code class="code">sig</code> <a href="Sdlcdrom.html">..</a> <code class="code">end</code></pre>This module provides CD-ROM handling<br>
<hr width="100%">
<pre><span class="keyword">exception</span> <a name="EXCEPTIONSDLcdrom_exception"></a>SDLcdrom_exception <span class="keyword">of</span> <code class="type">string</code></pre>
<div class="info">
Exception used to report errors<br>
</div>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONTrayempty"></a>Trayempty</pre>
<div class="info">
Exception to report that thre's no cd in the drive<br>
</div>
<br>
<a name="3_Types"></a>
<h3>Types</h3><br>
<pre><span class="keyword">type</span> <a name="TYPEcdrom_drive"></a><code class="type"></code>cdrom_drive </pre>
<div class="info">
abstract type for handling cdrom<br>
</div>

<br><code><span class="keyword">type</span> <a name="TYPEcdrom_drive_status"></a><code class="type"></code>cdrom_drive_status = </code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">CD_TRAYEMPTY</span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><code>cdrom drive is empty</code></td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">CD_STOPPED</span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><code>cdrom drive is stopped</code></td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">CD_PLAYING</span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><code>cdrom drive is playing</code></td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">CD_PAUSED</span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><code>cdrom drive is paused</code></td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>

<div class="info">
enumeration of different status cdrom drive<br>
</div>

<br><code><span class="keyword">type</span> <a name="TYPEtrack_type"></a><code class="type"></code>track_type = </code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">TRACK_AUDIO</span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><code>audio track type</code></td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">TRACK_DATA</span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><code>data track type</code></td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>

<div class="info">
the types of CD-ROM track possible<br>
</div>

<br><code><span class="keyword">type</span> <a name="TYPEtrack"></a><code class="type"></code>track = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>id&nbsp;: <code class="type">int</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>kind&nbsp;: <code class="type"><a href="Sdlcdrom.html#TYPEtrack_type">track_type</a></code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>length&nbsp;: <code class="type">int</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>offset&nbsp;: <code class="type">int</code>;</code></td>

</tr></table>
}


<br><code><span class="keyword">type</span> <a name="TYPEcdrom_info"></a><code class="type"></code>cdrom_info = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>num_tracks&nbsp;: <code class="type">int</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>curr_track&nbsp;: <code class="type">int</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>curr_frame&nbsp;: <code class="type">int</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>tracks&nbsp;: <code class="type"><a href="Sdlcdrom.html#TYPEtrack">track</a> array</code>;</code></td>

</tr></table>
}


<br>
<a name="3_GeneralAPI"></a>
<h3>General API</h3><br>
<br>
An SDLcdrom_exception is raised on errors<br>
<pre><span class="keyword">val</span> <a name="VALget_num_drives"></a>get_num_drives : <code class="type">unit -> int</code></pre><div class="info">
<code class="code">get_num_drives</code> returns the number of CD-ROM drives on the system<br>
</div>
<pre><span class="keyword">val</span> <a name="VALdrive_name"></a>drive_name : <code class="type">int -> string</code></pre><div class="info">
<code class="code">drive_name drive</code> returns a human-readable, system-dependent identifier 
  for the CD-ROM. 
  <code class="code">drive</code> is the index of the drive. Drive indices start to 0 and end 
  at <code class="code">get_num_drives()-1</code>.<br>
</div>
<br>
<a name="3_CDROMdrivehandling"></a>
<h3>CD-ROM drive handling</h3><br>
<pre><span class="keyword">val</span> <a name="VALcd_open"></a>cd_open : <code class="type">int -> <a href="Sdlcdrom.html#TYPEcdrom_drive">cdrom_drive</a></code></pre><div class="info">
<code class="code">cd_open drive</code> open a CD-ROM drive for access<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcd_close"></a>cd_close : <code class="type"><a href="Sdlcdrom.html#TYPEcdrom_drive">cdrom_drive</a> -> unit</code></pre><div class="info">
Closes the handle for the cdrom_drive<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcd_status"></a>cd_status : <code class="type"><a href="Sdlcdrom.html#TYPEcdrom_drive">cdrom_drive</a> -> <a href="Sdlcdrom.html#TYPEcdrom_drive_status">cdrom_drive_status</a></code></pre><div class="info">
<b>Returns</b> the current status of the given drive.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcd_info"></a>cd_info : <code class="type"><a href="Sdlcdrom.html#TYPEcdrom_drive">cdrom_drive</a> -> <a href="Sdlcdrom.html#TYPEcdrom_info">cdrom_info</a></code></pre><div class="info">
<b>Raises</b> <code>Trayempty</code> if there's no cd in the drive<br>
<b>Returns</b> the table of contents of the CD and current play position<br>
</div>
<br>
<a name="3_Playingaudiotracks"></a>
<h3>Playing audio tracks </h3><br>
<pre><span class="keyword">val</span> <a name="VALmsf_of_frames"></a>msf_of_frames : <code class="type">int -> int * int * int</code></pre><pre><span class="keyword">val</span> <a name="VALframes_of_msf"></a>frames_of_msf : <code class="type">int * int * int -> int</code></pre><pre><span class="keyword">val</span> <a name="VALcd_play_tracks"></a>cd_play_tracks : <code class="type"><a href="Sdlcdrom.html#TYPEcdrom_drive">cdrom_drive</a> -><br>       start_track:int -><br>       start_frame:int -> num_tracks:int -> num_frames:int -> unit</code></pre><div class="info">
<code class="code">cd_play_tracks cdrom_drive start_track start_frame num_tracks num_frames</code> 
  play the given CD with these parameters<br>
<b>Raises</b> <code>Trayempty</code> if there's no cd in the drive<br>
</div>
<br><div class="info"><code class="code">start_track</code> : the starting track</div>
<div class="info"><code class="code">start_frame</code> : the starting frame</div>
<div class="info"><code class="code">num_tracks</code> : the number of tracks to play</div>
<div class="info"><code class="code">num_frames</code> : the number of frames to play</div>
<pre><span class="keyword">val</span> <a name="VALcd_play_track"></a>cd_play_track : <code class="type"><a href="Sdlcdrom.html#TYPEcdrom_drive">cdrom_drive</a> -> <a href="Sdlcdrom.html#TYPEtrack">track</a> -> unit</code></pre><div class="info">
Play the track n on the given cdrom_drive<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcd_pause"></a>cd_pause : <code class="type"><a href="Sdlcdrom.html#TYPEcdrom_drive">cdrom_drive</a> -> unit</code></pre><div class="info">
Pause play<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcd_resume"></a>cd_resume : <code class="type"><a href="Sdlcdrom.html#TYPEcdrom_drive">cdrom_drive</a> -> unit</code></pre><div class="info">
Resume play<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcd_stop"></a>cd_stop : <code class="type"><a href="Sdlcdrom.html#TYPEcdrom_drive">cdrom_drive</a> -> unit</code></pre><div class="info">
Stop play<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcd_eject"></a>cd_eject : <code class="type"><a href="Sdlcdrom.html#TYPEcdrom_drive">cdrom_drive</a> -> unit</code></pre><div class="info">
Eject CD-ROM<br>
</div>
</body></html>