Provided by: libnet-freedb-perl_0.08-2build2_amd64
NAME
Net::FreeDB - Perl interface to freedb server(s)
SYNOPSIS
use Net::FreeDB; $freedb = Net::FreeDB->new(); $discdata = $freedb->getdiscdata('/dev/cdrom'); my $cddb_file_object = $freedb->read('rock', $discdata->{ID}); print $cddb_file_object->id;
DESCRIPTION
Net::FreeDB was inspired by Net::CDDB. And in-fact was designed as a replacement in-part by Net::CDDB's author Jeremy D. Zawodny. Net::FreeDB allows an oop interface to the freedb server(s) as well as some basic cdrom functionality like determining disc ids, track offsets, etc. METHODS new(HOST => $h, PORT => $p, USER => $u, HOSTNAME => $hn, TIMEOUT => $to) Constructor: Creates a new Net::FreeDB object. Parameters: Set to username or user-string you'd like to be logged as. HOSTNAME: (optional) Set to the hostname you'd like to be known as. TIMEOUT: (optional) Set to the number of seconds to timeout on freedb server. new() creates and returns a new Net::FreeDB object that is connected to either the given host or freedb.freedb.org as default. read($cat, $id) Parameters: read($$) takes 2 parameters, the first being a category name. This can be any string either that you make up yourself or that you believe the disc to be. The second is the disc id. This may be generated for the current cd in your drive by calling getdiscid() NOTE: Using an incorrect category will result in either no return or an incorrect return. Please check the CDDB::File documentation for information on this module. read() requests a freedb record for the given information and returns a CDDB::File object. query($id, $num_trks, $trk_offset1, $trk_offset2, $trk_offset3...) Parameters: query($$$...) takes: 1: a discid 2: the number of tracks 3: first track offset 4: second track offset... etc. Query expects $num_trks number of extra params after the first two. query() returns an array of hashes. The hashes looks like: { GENRE => 'newage', DISCID => 'discid', ARTIST => 'artist', ALBUM => 'title' } NOTE: query() can return 'inexact' matches and/or 'multiple exact' matches. The returned array is the given returned match(es). sites() Parameters: None sites() returns an array reference of urls that can be used as a new HOST. getdiscid($device) Parameters: getdiscid($) takes the device you want to use. Basically this means '/dev/cdrom' or whatever on linux machines but it's an array index in the number of cdrom drives on windows machines starting at 0. (Sorry, I may change this at a later time). So, if you have only 1 cdrom drive then getdiscid(0) would work fine. getdiscid() returns the discid of the current disc in the given drive. NOTE: See BUGS getdiscdata($device) Parameters: getdiscdata($) takes the device you want to use. See getdiscid() for full description. getdiscdata() returns a hash of the given disc data as you would require for a call to query. The returns hash look like: { ID => 'd00b3d10', NUM_TRKS => '3', TRACKS => [ '150', '18082', '29172' ], SECONDS => '2879' } NOTE: A different return type/design may be developed.
BUGS
The current version of getdiscid() and getdiscdata() on the Windows platform takes ANY string in a single cdrom configuration and works fine. That is if you only have 1 cdrom drive; you can pass in ANY string and it will still scan that cdrom drive and return the correct data. If you have more then 1 cdrom drive giving the correct drive number will return in an accurate return.
AUTHOR David Shultz <dshultz@cpan.org> Peter Pentchev <roam@ringlet.net>
CREDITS Jeremy D. Zawodny <jzawodn@users.sourceforge.net> Pete Jordon
<ramtops@users.sourceforge.net>
COPYRIGHT Copyright (c) 2002 David Shultz. Copyright (c) 2005, 2006 Peter Pentchev. All rights
reserved. This program is free software; you can redistribute it and/or modify if under the same terms as Perl itself.