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 than0, usually1.
$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 π
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
- ubuntu stonking: libdevice-cdio-perl 2.0.0-2build8 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms