3 <h3 id="TOP">Index</h3>
5 <ul><li><a href="#NAME">NAME</a></li>
6 <li><a href="#CATEGORY">CATEGORY</a></li>
7 <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
8 <li><a href="#CONSTANTS">CONSTANTS</a></li>
9 <li><a href="#METHOD">METHOD</a>
10 <ul><li><a href="#new">new</a></li>
11 <li><a href="#status">status</a></li>
12 <li><a href="#play_tracks">play_tracks</a></li>
13 <li><a href="#play">play</a></li>
14 <li><a href="#pause">pause </a></li>
15 <li><a href="#resume">resume</a></li>
16 <li><a href="#stop">stop</a></li>
17 <li><a href="#eject">eject</a></li>
18 <li><a href="#id">id</a></li>
19 <li><a href="#num_tracks">num_tracks</a></li>
20 <li><a href="#cur_track">cur_track </a></li>
21 <li><a href="#track">track</a></li>
22 <li><a href="#FRAMES_TO_MSF">FRAMES_TO_MSF</a></li>
23 <li><a href="#MSF_TO_FRAMES">MSF_TO_FRAMES</a></li>
26 <li><a href="#SEE_ALSO">SEE ALSO</a>
31 <h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
32 <div id="NAME_CONTENT">
33 <p>SDL::CD -- SDL Bindings for structure SDL_CD</p>
36 <h1 id="CATEGORY">CATEGORY</h1><p><a href="#TOP" class="toplink">Top</a></p>
37 <div id="CATEGORY_CONTENT">
38 <p>Core, CDROM, Structure</p>
41 <h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
42 <div id="SYNOPSIS_CONTENT">
47 SDL::init(SDL_INIT_CDROM);
49 my $drives = SDL::CDROM::num_drives;
53 my $CD = SDL::CD->new( 0 );
65 <h1 id="CONSTANTS">CONSTANTS</h1><p><a href="#TOP" class="toplink">Top</a></p>
66 <div id="CONSTANTS_CONTENT">
67 <p>The constants are exported by default. You can avoid this by doing:</p>
71 <p>and access them directly:</p>
72 <pre> SDL::CD::CD_TRAYEMPTY;
75 <p>or by choosing the export tags below:</p>
76 <p>Export tag: ':status'</p>
84 <p>Export tag: ':defaults'</p>
91 <h1 id="METHOD">METHOD</h1><p><a href="#TOP" class="toplink">Top</a></p>
92 <div id="METHOD_CONTENT">
96 <div id="new_CONTENT">
97 <pre> my $CD = SDL::CD->new($drive)
100 <p>Makes a new SDL::CD object. Returns <code>undef</code> if the drive is busy or inaccessible. </p>
103 <h2 id="status">status</h2>
104 <div id="status_CONTENT">
105 <pre> my $status = $CD->status();
108 <p>Returns the current status of the CD tray </p>
109 <p>Returns on of the following constants:</p>
111 <li>CD_TRAYEMPTY </li>
120 <h2 id="play_tracks">play_tracks</h2>
121 <div id="play_tracks_CONTENT">
122 <pre> $CD->play_tracks($start_track, $start_frame, $ntracks, $nframes)
125 <p>Plays the given SDL::CD starting at track $start_track, for $ntracks tracks. </p>
126 <p>$start_frame is the frame offset, from the beginning of the $start_track, at which to start. $nframes is the frame offset, from the
127 beginning of the last track ($start_track+$ntracks), at which to end playing.</p>
128 <p>play_tracks() should only be called after calling <a href="#status">status</a> to get information about the CD.</p>
129 <p><strong>Note: Data tracks are ignored.</strong></p>
130 <p>Returns <code>0</code>, or <code>-1</code> if there was an error. </p>
133 <h2 id="play">play</h2>
134 <div id="play_CONTENT">
135 <pre> $CD->play($start, $length);
138 <p>Plays the given SDL::CD , starting a frame $start for $length frames. </p>
139 <p>Returns <code>0</code> on success, <code>-1</code> on error</p>
142 <h2 id="pause">pause </h2>
143 <div id="pause_CONTENT">
144 <pre> $CD->pause();
147 <p>Pauses play on CD</p>
148 <p>Returns <code>0</code> on success, or <code>-1</code> on an error. </p>
151 <h2 id="resume">resume</h2>
152 <div id="resume_CONTENT">
153 <pre> $CD->resume();
156 <p>Returns <code>0</code> on success, or <code>-1</code> on an error. </p>
159 <h2 id="stop">stop</h2>
160 <div id="stop_CONTENT">
161 <pre> $CD->stop();
164 <p>Stops play on the CD. </p>
165 <p>Returns <code>0</code> on success, or <code>-1</code> on an error. </p>
168 <h2 id="eject">eject</h2>
169 <div id="eject_CONTENT">
170 <pre> $CD->eject();
173 <p>Ejects the CD.</p>
174 <p>Returns <code>0</code> on success, or <code>-1</code> on an error. </p>
178 <div id="id_CONTENT">
182 <p>Private drive identifier</p>
185 <h2 id="num_tracks">num_tracks</h2>
186 <div id="num_tracks_CONTENT">
187 <pre> $CD->num_tracks();
190 <p>Number of tracks on the CD</p>
193 <h2 id="cur_track">cur_track </h2>
194 <div id="cur_track_CONTENT">
195 <pre> $CD->cur_track();
198 <p>Current track on the CD;</p>
201 <h2 id="track">track</h2>
202 <div id="track_CONTENT">
203 <pre> my $track = $CD->track($number);
206 <p>Retrives track description of track $number in CD. See <a href="SDL-CDTrack.html">SDL::CDTrack</a>.</p>
209 <h2 id="FRAMES_TO_MSF">FRAMES_TO_MSF</h2>
210 <div id="FRAMES_TO_MSF_CONTENT">
211 <pre> my ($min, $sec, $fra) = FRAMES_TO_MSF($frames);
214 <p>Conversion functions from frames to Minute/Second/Frames</p>
217 <h2 id="MSF_TO_FRAMES">MSF_TO_FRAMES</h2>
218 <div id="MSF_TO_FRAMES_CONTENT">
219 <pre> my $frames = MSF_TO_FRAMES($min, $sec, $fra);
224 <h1 id="SEE_ALSO">SEE ALSO</h1><p><a href="#TOP" class="toplink">Top</a></p>
225 <div id="SEE_ALSO_CONTENT">
226 <p><a href="SDL-CDROM.html">SDL::CDROM</a>, <a href="SDL-CDTrack.html">SDL::CDTrack</a></p>