pods::SDL::CD(3pm)

πŸ“¦ version 2.548, in opensuse-leap 16.0

πŸ’Ώ 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_TRAYEMPTY
  • CD_STOPPED
  • CD_PLAYING
  • CD_PAUSED
  • CD_ERROR

πŸ“¦ Export tag: ':defaults' πŸ“¦

  • CD_FPS
  • SDL_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_TRAYEMPTY
  • CD_STOPPED
  • CD_PLAYING
  • CD_PAUSED
  • CD_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::CDROM
  • SDL::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