Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cddb::file(3pm) [debian man page]

CDDB::File(3pm) 					User Contributed Perl Documentation					   CDDB::File(3pm)

NAME
CDDB::File - Parse a CDDB/freedb data file SYNOPSIS
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; } DESCRIPTION
This module provides an interface for extracting data from CDDB-format data files, as used by freedb. It does not read data from your CD, or submit information to freedb. METHODS
new my $disc = CDDB::File->new("rock/f4109511"); This will create a new object representing the data in the file name specified. id / all_ids my $discid = $disc->id; my @discid = $disc->all_ids; Due to how freedb works, one CD 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. title / artist The title and artist of this CD. For eponymous CDs these will be identical, even if the data file leaves the artist field blank. year The (4-digit) year of release. genre The genre of this CD. This is the genre as stored in the data file itself, which is not related to the 11 main freedb genres. extd The "extended data" for the CD. This is used for storing miscellaneous information which has no better storage place, and can be of any length. length The run time of the CD in seconds. track_count The number of tracks on the CD. revision Each time information regarding the CD is updated this revision number is incremented. This returns the revision number of this version. processed_by / submitted_via The software which submitted this information to freedb and which processed it at the other end. tracks foreach my $track ($disc->tracks) { print $track->number, $track->title, $track->artist; print $track->length, $track->extd; } 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. Tracks may also contain an 'artist' field. If this is not set the artist method will return the artist of the CD. SEE ALSO
http://www.freedb.org/ AUTHOR
Tony Bowden BUGS and QUERIES Please direct all correspondence regarding this module to: bug-CDDB-File@rt.cpan.org COPYRIGHT
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. perl v5.10.1 2005-10-04 CDDB::File(3pm)

Check Out this Related Man Page

MP3::Tag::CDDB_File(3pm)				User Contributed Perl Documentation				  MP3::Tag::CDDB_File(3pm)

NAME
MP3::Tag::CDDB_File - Module for parsing CDDB files. SYNOPSIS
my $db = MP3::Tag::CDDB_File->new($filename, $track); # Name of audio file my $db = MP3::Tag::CDDB_File->new_from($record, $track); # Contents of CDDB ($title, $artist, $album, $year, $comment, $track) = $db->parse(); see MP3::Tag DESCRIPTION
MP3::Tag::CDDB_File is designed to be called from the MP3::Tag module. It parses the content of CDDB file. The file is found in the same directory as audio file; the list of possible file names is taken from the field "cddb_files" if set by MP3::Tag config() method. parse() ($title, $artist, $album, $year, $comment, $track) = $db->parse($what); parse_filename() extracts information about artist, title, track number, album and year from the CDDB record. $what is optional; it maybe title, track, artist, album, year, genre or comment. If $what is defined parse() will return only this element. Additionally, $what can take values "artist_collection" (returns the value of artist in the disk-info field DTITLE, but only if author is specified in the track-info field TTITLE), "title_track" (returns the title specifically from track-info field - the "track" may fall back to the info from disk-info field), "comment_collection" (processed EXTD comment), "comment_track" (processed EXTT comment). The returned year and genre is taken from DYEAR, DGENRE, EXTT, EXTD fields; recognized prefixes in the two last fields are YEAR, ID3Y, ID3G. The declarations of this form are stripped from the returned comment. An alternative syntax "Recorded"/"Recorded on"/"Recorded in"/ is also supported; the format of the date recognized by ID3v2::year(), or just a date field without a prefix. title() $title = $db->title(); Returns the title, obtained from the 'Tracktitle' entry of the file. artist() $artist = $db->artist(); Returns the artist name, obtained from the 'Performer' or 'Albumperformer' entries (the first which is present) of the file. track() $track = $db->track(); Returns the track number, stored during object creation, or queried from the parent. year() $year = $db->year(); Returns the year, obtained from the 'Year' entry of the file. (Often not present.) album() $album = $db->album(); Returns the album name, obtained from the 'Albumtitle' entry of the file. comment() $comment = $db->comment(); Returns the 'Trackcomment' entry of the file. (Often not present.) genre() $genre = $db->genre($filename); perl v5.14.2 2009-04-15 MP3::Tag::CDDB_File(3pm)
Man Page