pods::SDL::CD(3pm)
πΏ NAME πΏ
okay bestie, you're on the pods::SDL::CD(3pm) page β the User Contributed Perl Documentation moment for this absolute icon: SDL::CD -- SDL Bindings for structure SDL_CD. periodt π
π·οΈ CATEGORY π·οΈ
Core, CDROM, Structure
β¨ SYNOPSIS β¨
here's the whole starter-pack vibe in code, no cap:
use SDL;
use SDL::CDROM;
use SDL::CD;
SDL::init(SDL_INIT_CDROM);
my $drives = SDL::CDROM::num_drives;
if( $drives > 0 )
{
my $CD = SDL::CD->new( 0 );
if($CD)
{
...
}
}
π CONSTANTS π
the constants are exported by default, bestie. you can avoid this by doing:
use SDL::CD ();
and access them directly like this:
SDL::CD::CD_TRAYEMPTY;
or by choosing the export tags below π«Ά
π¦ Export tag: ':status' π¦
CD_TRAYEMPTYCD_STOPPEDCD_PLAYINGCD_PAUSEDCD_ERROR
π¦ Export tag: ':defaults' π¦
CD_FPSSDL_MAX_TRACKS
π οΈ METHOD π οΈ
π new π
my $CD = SDL::CD->new($drive)
makes a new SDL::CD object. returns undef if the drive is busy or inaccessible π
π¦ status π¦
my $status = $CD->status();
returns the current status of the CD tray β and it's gonna be one of these constants:
CD_TRAYEMPTYCD_STOPPEDCD_PLAYINGCD_PAUSEDCD_ERROR
πΈ play_tracks πΈ
$CD->play_tracks($start_track, $start_frame, $ntracks, $nframes)
plays the given SDL::CD starting at track $start_track, for $ntracks tracks.
$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.
play_tracks() should only be called after calling status to get information about the CD β no skipping the vibe check, bestie π«Ά
Note: Data tracks are ignored.
returns 0, or -1 if there was an error.
π₯ play π₯
$CD->play($start, $length);
plays the given SDL::CD, starting a frame $start for $length frames.
returns 0 on success, -1 on error.
π pause π
$CD->pause();
pauses play on CD.
returns 0 on success, or -1 on an error.
π resume π
$CD->resume();
returns 0 on success, or -1 on an error. that's the whole note on this one, bestie π
β stop β
$CD->stop();
stops play on the CD.
returns 0 on success, or -1 on an error.
π§ eject π§
$CD->eject();
ejects the CD.
returns 0 on success, or -1 on an error.
π id π
$CD->id();
private drive identifier.
π num_tracks π
$CD->num_tracks();
number of tracks on the CD.
π¦ cur_track π¦
$CD->cur_track();
current track on the CD;
πΈ track πΈ
my $track = $CD->track($number);
retrieves track description of track $number in CD. see SDL::CDTrack.
π FRAMES_TO_MSF π
my ($min, $sec, $fra) = FRAMES_TO_MSF($frames);
conversion functions from frames to Minute/Second/Frames.
β¨ MSF_TO_FRAMES β¨
my $frames = MSF_TO_FRAMES($min, $sec, $fra);
that's the whole note for this one too β just the signature, bestie π
π SEE ALSO π
SDL::CDROMSDL::CDTrack
π AUTHORS π
See "AUTHORS" in SDL.
mwah π β this iconic page is from perl v5.42.0, dated 2024-05-01, and it's the pods::SDL::CD(3pm) manual page. bye bestie! π
π¦ where this page comes from
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms