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.
Creates a new Net::FreeDB object.
Set to username or user-string you'd like to be logged as.
Set to the hostname you'd like to be known as.
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($$) 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()
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
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).
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($) 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 => [
SECONDS => '2879'
NOTE: A different return type/design may be developed.
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