pods::SDL::CD(3pm)
okay bestie, welcome to the pods::SDL::CD(3pm) page β yes, that's User Contributed Perl Documentation, and it's all about SDL::CD. it's filed under Core, CDROM, Structure, and it's giving "CD tray but make it Perl." πΏβ¨
πΈ NAME πΈ
SDL::CD β SDL Bindings for structure SDL_CD. that's the whole name, no cap. π
π CATEGORY π
Core, CDROM, Structure β all three, periodt. π
β¨ SYNOPSIS β¨
like, here's the whole vibe check in code:
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 π
okay so the constants are exported by default. you can avoid this by doing:
use SDL::CD ();
and access them directly:
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 πΏ
methods incoming, bestie. signatures are copied exactly, because we do not mess with code. π«Ά
π new π
my $CD = SDL::CD->new($drive)
Makes a new SDL::CD object. Returns undef if the drive is busy or inaccessible. rude of the drive, honestly. π
π status π
my $status = $CD->status();
Returns the current status of the CD tray.
Returns one of the following 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.
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. signature plus return tea, that's the whole original vibe here. π
π 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);
signature only on this one, bestie. π
π SEE ALSO π
SDL::CDROMSDL::CDTrack
π AUTHORS π
See "AUTHORS" in SDL.
and that's the whole manual, bestie. this iconic page is pods::SDL::CD(3pm), from perl v5.42.3, dated 2026-08-19. now go make that CD tray behave. mwah ππΏβ¨
π¦ where this page comes from
- ubuntu stonking: libsdl-perl 2.548-6build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms