Device...::Track(3pm)

πŸ’Ώ NAME πŸ’Ώ

ok so Device::Cdio::Track β€” it's the class that handles the track side of Device::Cdio. like, one individual track on your CD. that's the whole vibe. ✨


🌸 SYNOPSIS 🌸

bestie here's the vibe check, copy-paste edition:

use Device::Cdio::Device;
use Device::Cdio::Track;

$device = Device::Cdio::Device->new(-source=>'/dev/cdrom');
$track  = $device->get_last_track();
print "track: %d, last lsn: %d\n", $track->{track}, track->get_last_lsn();

$track = $device->get_first_track();
$format = $rackt->get_format();

(yes, $rackt is right there in the source, i'm not touching it, that's canon πŸ’€)


πŸŽ€ METHODS πŸŽ€

✨ new

new(device, track)->object

makes u a brand new track object. iconic behavior. 🫢

πŸ’– get_audio_channels

get_audio_channels(cdio, track)->int

spits back how many channels the track has: 2 or 4. heads up tho β€” this is not meaningful if the track isn't an audio track, so don't come for it. returns -1 on error, and -2 if the driver literally doesn't support the operation. 😭

πŸ¦‹ get_copy_permit

get_copy_permit(cdio, track)->int

returns the copy protection status on a track. it asks, and i quote the original here: "Is this meaningful not an audio track?" β€” bestie that's the docs' own question, not mine. πŸ™ˆ

🌈 get_format

get_format()->$format

grabs the format of the track, like 'audio', 'mode2', 'mode1'. slay.

πŸ‘‘ get_last_lsn

get_last_lsn()->lsn

returns the ending LSN for a track. if it breaks, $perlcdio::INVALID_LSN comes back at you. no cap. πŸ’…

πŸ“ get_lba

get_lba()->lba

returns the starting LBA for a track. on error? you guessed it: $perlcdio::INVALID_LBA.

🧚 get_lsn

get_lsn()->lsn

returns the starting LSN for a track. on error, $perlcdio::INVALID_LSN shows up. same energy as above tbh.

⭐ get_msf

get_msf()

returns the starting MSF (that's minutes/secs/frames) for the track number. fun fact: track numbers usually start at something greater than 0, usually 1. 🎡

if everything's all good you get a string like mm:ss:ff. if not? you get the string 'error'. that's it. that's the drama. πŸ’€

πŸ’œ get_preemphasis

get_preemphasis()->result

gets the linear preemphasis status on an audio track. and again, the docs say it plainly: this is not meaningful if it's not an audio track? 🀷 keep that in mind.

🌸 get_track_sec_count

  • get_track_sec_count()->int β€” get the number of sectors between this track and the next one. this includes any pregap sectors before the start of the next track. track numbers usually start at something greater than 0, usually 1.

$perlcdio::INVALID_LSN is returned on error. periodt.

πŸ’« is_track_green

is_track_green(cdio, track) -> bool

returns True if we've got XA data (green, mode2 form1) or XA data (green, mode2 form2). that means the track begins like:

sync - header - subheader
12     4      -  8

lowkey iconic layout ngl.

🎢 get_track_isrc

$isrc = $track->get_track_isrc($insert_dashes=0);

returns an empty string, or the International Standard Recording Code. it comes served in 4 hyphen-separated substrings: "CC-XXX-YY-NNNNN"

  • "CC" β€” two-character ISO 3166-1 alpha-2 country code
  • "XXX" β€” a three character alphanumeric registrant code
  • "YY" β€” is the last two digits of the year of registration

(NB not necessarily the date the recording was made)

  • "NNNNN" β€” is a unique 5-digit number identifying the particular sound recording.

🌟 set_track

set_track(track_num)

sets a new track number. simple. clean. done. πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

  • Device::Cdio is the top-level module πŸ’–
  • Device::Cdio::Device is a class device objects πŸŽ€
  • Device::Cdio::ISO9660 for working with ISO9660 systems πŸ¦‹
  • perlcdio is the lower-level interface to libcdio 🌸
  • <http://www.gnu.org/software/libcdio/doxygen/track_8h.html> is documentation via doxygen of "libiso9660" πŸ“š

🌈 AUTHORS 🌈

Rocky Bernstein πŸ‘‘


Copyright (C) 2006, 2012, 2017 Rocky Bernstein <rocky@cpan.org>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see The GNU General Public License <http://www.gnu.org/licenses/#GPL>.

btw that "WITHOUT ANY WARRANTY" bit is not a joke, bestie β€” no warranty, fr fr. πŸ™ˆ

ok that's the whole page!! 🫢 this was perl v5.42.3, dated 2026-08-19, and it's the Device...::Track(3pm) user contributed perl documentation. mwah, go read ur tracks πŸ’‹βœ¨

πŸ“¦ where this page comes from