<ul><li><a href="#NAME">NAME</a></li>
<li><a href="#CATEGORY">CATEGORY</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
+<li><a href="#CONSTANTS">CONSTANTS</a></li>
<li><a href="#METHOD">METHOD</a>
-<ul><li><a href="#new_drive">new( $drive )</a></li>
-<li><a href="#status">status</a>
-<ul><li><a href="#returns">returns</a></li>
-</ul>
-</li>
-<li><a href="#play_tracks">play_tracks</a>
-<ul><li><a href="#Returns">Returns</a></li>
-</ul>
-</li>
-<li><a href="#play">play</a>
-<ul><li><a href="#Returns-2">Returns</a></li>
-</ul>
-</li>
-<li><a href="#pause">pause </a>
-<ul><li><a href="#Returns-3">Returns</a></li>
-</ul>
-</li>
-<li><a href="#resume">resume</a>
-<ul><li><a href="#Returns-4">Returns</a></li>
-</ul>
-</li>
-<li><a href="#stop">stop</a>
-<ul><li><a href="#Returns-5">Returns</a></li>
-</ul>
-</li>
-<li><a href="#eject">eject</a>
-<ul><li><a href="#Returns-6">Returns</a></li>
-</ul>
-</li>
+<ul><li><a href="#new">new</a></li>
+<li><a href="#status">status</a></li>
+<li><a href="#play_tracks">play_tracks</a></li>
+<li><a href="#play">play</a></li>
+<li><a href="#pause">pause </a></li>
+<li><a href="#resume">resume</a></li>
+<li><a href="#stop">stop</a></li>
+<li><a href="#eject">eject</a></li>
<li><a href="#id">id</a></li>
<li><a href="#num_tracks">num_tracks</a></li>
<li><a href="#cur_track">cur_track </a></li>
<li><a href="#track">track</a></li>
+<li><a href="#FRAMES_TO_MSF">FRAMES_TO_MSF</a></li>
+<li><a href="#MSF_TO_FRAMES">MSF_TO_FRAMES</a></li>
</ul>
</li>
<li><a href="#SEE_ALSO">SEE ALSO</a>
</div>
<h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
<div id="SYNOPSIS_CONTENT">
-<pre> use SDL;
+<pre> use SDL ':init';
use SDL::CDROM;
use SDL::CD;
{
my $CD = SDL::CD->new( 0 );
- if($CD != NULL)
+ if($CD)
{
...
}
}
- SDL::quit();
+</pre>
+
+</div>
+<h1 id="CONSTANTS">CONSTANTS</h1><p><a href="#TOP" class="toplink">Top</a></p>
+<div id="CONSTANTS_CONTENT">
+<p>The constants are not exported by default. You can export them into your namespace by doing:</p>
+<pre> use SDL::CD ':all';
+
+</pre>
+<p>or access them directly:</p>
+<pre> SDL::CD::CD_TRAYEMPTY;
+
+</pre>
+<p>or by choosing the export tags below:</p>
+<p>Export tag: ':status'</p>
+<pre> CD_TRAYEMPTY
+ CD_STOPPED
+ CD_PLAYING
+ CD_PAUSED
+ CD_ERROR
+
+</pre>
+<p>Export tag: ':defaults'</p>
+<pre> CD_FPS
+ SDL_MAX_TRACKS
</pre>
<div id="METHOD_CONTENT">
</div>
-<h2 id="new_drive">new( $drive )</h2>
-<div id="new_drive_CONTENT">
-<pre> my $CD = SDL::CD->new( $drive )
+<h2 id="new">new</h2>
+<div id="new_CONTENT">
+<pre> my $CD = SDL::CD->new($drive)
</pre>
-<p>Makes a new SDL::CD object. Returns NULL if the drive is busy or inaccessible. </p>
+<p>Makes a new SDL::CD object. Returns <code>undef</code> if the drive is busy or inaccessible. </p>
</div>
<h2 id="status">status</h2>
</pre>
<p>Returns the current status of the CD tray </p>
-
-</div>
-<h3 id="returns">returns</h3>
-<div id="returns_CONTENT">
-<dl>
- <dt>CD_TRAYEMPTY</dt>
- <dt>CD_STOPPED</dt>
- <dt>CD_PLAYING</dt>
- <dt>CD_PAUSED</dt>
- <dt>CD_ERROR = -1 </dt>
-</dl>
-
-
-
+<p>Returns on of the following constants:</p>
+<ul>
+ <li>CD_TRAYEMPTY </li>
+ <li>CD_STOPPED </li>
+ <li>CD_PLAYING </li>
+ <li>CD_PAUSED </li>
+ <li>CD_ERROR</li>
+</ul>
</div>
</pre>
<p>Plays the given SDL::CD starting at track $start_track, for $ntracks tracks. </p>
-<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 beginning of the last track ($start_track+$ntracks), at which to end playing.</p>
-<p>play_tracks() should only be called after calling SDL_CDStatus to get track information about the CD use $CD->status().</p>
+<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
+beginning of the last track ($start_track+$ntracks), at which to end playing.</p>
+<p>play_tracks() should only be called after calling <a href="#status">status</a> to get information about the CD.</p>
<p><strong>Note: Data tracks are ignored.</strong></p>
-
-</div>
-<h3 id="Returns">Returns</h3>
-<div id="Returns_CONTENT">
-<p>0, or -1 if there was an error. </p>
+<p>Returns <code>0</code>, or <code>-1</code> if there was an error. </p>
</div>
<h2 id="play">play</h2>
<div id="play_CONTENT">
-<pre> $CD->play($start, $length );
+<pre> $CD->play($start, $length);
</pre>
<p>Plays the given SDL::CD , starting a frame $start for $length frames. </p>
-
-</div>
-<h3 id="Returns-2">Returns</h3>
-<div id="Returns_CONTENT-2">
-<p>0 on success, -1 on error</p>
+<p>Returns <code>0</code> on success, <code>-1</code> on error</p>
</div>
<h2 id="pause">pause </h2>
</pre>
<p>Pauses play on CD</p>
-
-</div>
-<h3 id="Returns-3">Returns</h3>
-<div id="Returns_CONTENT-3">
-<p>Returns 0 on success, or -1 on an error. </p>
+<p>Returns <code>0</code> on success, or <code>-1</code> on an error. </p>
</div>
<h2 id="resume">resume</h2>
<pre> $CD->resume();
</pre>
-
-</div>
-<h3 id="Returns-4">Returns</h3>
-<div id="Returns_CONTENT-4">
-<p>Returns 0 on success, or -1 on an error. </p>
+<p>Returns <code>0</code> on success, or <code>-1</code> on an error. </p>
</div>
<h2 id="stop">stop</h2>
</pre>
<p>Stops play on the CD. </p>
-
-</div>
-<h3 id="Returns-5">Returns</h3>
-<div id="Returns_CONTENT-5">
-<p>Returns 0 on success, or -1 on an error. </p>
+<p>Returns <code>0</code> on success, or <code>-1</code> on an error. </p>
</div>
<h2 id="eject">eject</h2>
</pre>
<p>Ejects the CD.</p>
-
-</div>
-<h3 id="Returns-6">Returns</h3>
-<div id="Returns_CONTENT-6">
-<p>Returns 0 on success, or -1 on an error. </p>
+<p>Returns <code>0</code> on success, or <code>-1</code> on an error. </p>
</div>
<h2 id="id">id</h2>
</pre>
<p>Retrives track description of track $number in CD. See <a href="SDL-CDTrack.html">SDL::CDTrack</a>.</p>
+</div>
+<h2 id="FRAMES_TO_MSF">FRAMES_TO_MSF</h2>
+<div id="FRAMES_TO_MSF_CONTENT">
+<pre> my ($min, $sec, $fra) = FRAMES_TO_MSF($frames);
+</pre>
+<p>Conversion functions from frames to Minute/Second/Frames</p>
+</div>
+<h2 id="MSF_TO_FRAMES">MSF_TO_FRAMES</h2>
+<div id="MSF_TO_FRAMES_CONTENT">
+<pre> my $frames = MSF_TO_FRAMES($min, $sec, $fra);
+</pre>
</div>
<h1 id="SEE_ALSO">SEE ALSO</h1><p><a href="#TOP" class="toplink">Top</a></p>
<ul><li><a href="#NAME">NAME</a></li>
<li><a href="#CATEGORY">CATEGORY</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
+<li><a href="#CONSTANTS">CONSTANTS</a></li>
<li><a href="#METHOD">METHOD</a>
<ul><li><a href="#id">id</a></li>
<li><a href="#type">type</a></li>
</div>
<h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
<div id="SYNOPSIS_CONTENT">
-<pre> use SDL;
+<pre> use SDL ':init';
use SDL::CDROM;
- use SDL::CD;
+ use SDL::CD ':status';
use SDL::CDTrack;
SDL::init( SDL_INIT_CDROM );
if( $drives > 0 )
{
- my $CD = SDL::CD->new(0); #first drive's CD
-
- if( $CD != NULL)
- {
- if( $CD->status != CD_TRAYEMPTY )
- {
- my $track = SDL::CD->track(0);
- }
- }
-
+ my $CD = SDL::CD->new(0); #first drive's CD
+
+ if($CD)
+ {
+ if( $CD->status != CD_TRAYEMPTY )
+ {
+ my $track = SDL::CD->track(0);
+ }
+ }
}
- SDL::quit();
+</pre>
+</div>
+<h1 id="CONSTANTS">CONSTANTS</h1><p><a href="#TOP" class="toplink">Top</a></p>
+<div id="CONSTANTS_CONTENT">
+<p>The constants are not exported by default. You can export them into your namespace by doing:</p>
+<pre> use SDL::CDTrack ':all';
+</pre>
+<p>or access them directly:</p>
+<pre> SDL::CDTrack::SDL_AUDIO_TRACK;
+</pre>
+<p>or by choosing the export tags below:</p>
+<p>Export tag: ':type'</p>
+<pre> SDL_AUDIO_TRACK
+ SDL_DATA_TRACK
</pre>