.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "CDDB::File 3pm" .TH CDDB::File 3pm "2018-06-25" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" CDDB::File \- Parse a CDDB/freedb data file .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& my $disc = CDDB::File\->new("rock/f4109511"); \& \& print $disc\->id, $disc\->all_ids; \& print $disc\->artist, $disc\->title; \& print $disc\->year, $disc\->genre, $disc\->extd; \& print $disc\->length, $disc\->track_count; \& \& print $disc\->revision, $disc\->submitted_via, $disc\->processed_by; \& \& foreach my $track ($disc\->tracks) { \& print $track\->number, $track\->title, $track\->artist; \& print $track\->length, $track\->extd; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides an interface for extracting data from CDDB-format data files, as used by freedb. .PP It does not read data from your \s-1CD,\s0 or submit information to freedb. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" .Vb 1 \& my $disc = CDDB::File\->new("rock/f4109511"); .Ve .PP This will create a new object representing the data in the file name specified. .SS "id / all_ids" .IX Subsection "id / all_ids" .Vb 2 \& my $discid = $disc\->id; \& my @discid = $disc\->all_ids; .Ve .PP Due to how freedb works, one \s-1CD\s0 may have several IDs associated with it. 'id' will return the first of these (not necessarily related to the filename from which this was read), whilst 'all_ids' will return all of them. .SS "title / artist" .IX Subsection "title / artist" The title and artist of this \s-1CD.\s0 For eponymous CDs these will be identical, even if the data file leaves the artist field blank. .SS "year" .IX Subsection "year" The (4\-digit) year of release. .SS "genre" .IX Subsection "genre" The genre of this \s-1CD.\s0 This is the genre as stored in the data file itself, which is not related to the 11 main freedb genres. .SS "extd" .IX Subsection "extd" The \*(L"extended data\*(R" for the \s-1CD.\s0 This is used for storing miscellaneous information which has no better storage place, and can be of any length. .SS "length" .IX Subsection "length" The run time of the \s-1CD\s0 in seconds. .SS "track_count" .IX Subsection "track_count" The number of tracks on the \s-1CD.\s0 .SS "revision" .IX Subsection "revision" Each time information regarding the \s-1CD\s0 is updated this revision number is incremented. This returns the revision number of this version. .SS "processed_by / submitted_via" .IX Subsection "processed_by / submitted_via" The software which submitted this information to freedb and which processed it at the other end. .SS "tracks" .IX Subsection "tracks" .Vb 4 \& foreach my $track ($disc\->tracks) { \& print $track\->number, $track\->title, $track\->artist; \& print $track\->length, $track\->extd; \& } .Ve .PP Returns a list of Track objects, each of which knows its number (numering from 1), title, length (in seconds), offset, and may also have extended track data. .PP Tracks may also contain an 'artist' field. If this is not set the artist method will return the artist of the \s-1CD.\s0 .SH "SEE ALSO" .IX Header "SEE ALSO" http://www.freedb.org/ .SH "AUTHOR" .IX Header "AUTHOR" Tony Bowden .SH "BUGS and QUERIES" .IX Header "BUGS and QUERIES" Please direct all correspondence regarding this module to: bug\-CDDB\-File@rt.cpan.org .SH "COPYRIGHT" .IX Header "COPYRIGHT" .Vb 1 \& Copyright (C) 2001\-2005 Tony Bowden. All rights reserved. \& \& This program is free software; you can redistribute it and/or modify it under \& the terms of the GNU General Public License; either version 2 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. .Ve