.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" 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 turned on, 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 .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "FreeDB 3pm" .TH FreeDB 3pm "2014-08-15" "perl v5.20.0" "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" Net::FreeDB \- Perl interface to freedb server(s) .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& use Net::FreeDB; \&$freedb = Net::FreeDB\->new(); \&$discdata = $freedb\->getdiscdata(\*(Aq/dev/cdrom\*(Aq); \&my $cddb_file_object = $freedb\->read(\*(Aqrock\*(Aq, $discdata\->{ID}); \&print $cddb_file_object\->id; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .Vb 6 \& Net::FreeDB was inspired by Net::CDDB. And in\-fact \& was designed as a replacement in\-part by Net::CDDB\*(Aqs \& 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. .Ve .SS "\s-1METHODS\s0" .IX Subsection "METHODS" .ie n .IP "new(\s-1HOST\s0 => $h, \s-1PORT\s0 => $p, \s-1USER\s0 => $u, \s-1HOSTNAME\s0 => $hn, \s-1TIMEOUT\s0 => $to)" 4 .el .IP "new(\s-1HOST\s0 => \f(CW$h\fR, \s-1PORT\s0 => \f(CW$p\fR, \s-1USER\s0 => \f(CW$u\fR, \s-1HOSTNAME\s0 => \f(CW$hn\fR, \s-1TIMEOUT\s0 => \f(CW$to\fR)" 4 .IX Item "new(HOST => $h, PORT => $p, USER => $u, HOSTNAME => $hn, TIMEOUT => $to)" .Vb 2 \& Constructor: \& Creates a new Net::FreeDB object. \& \& Parameters: \& Set to username or user\-string you\*(Aqd like to be logged as. \& \& HOSTNAME: (optional) \& Set to the hostname you\*(Aqd 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. .Ve .ie n .IP "read($cat, $id)" 4 .el .IP "read($cat, \f(CW$id\fR)" 4 .IX Item "read($cat, $id)" .Vb 1 \& 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. .Ve .ie n .IP "query($id, $num_trks, $trk_offset1, $trk_offset2, $trk_offset3...)" 4 .el .IP "query($id, \f(CW$num_trks\fR, \f(CW$trk_offset1\fR, \f(CW$trk_offset2\fR, \f(CW$trk_offset3\fR...)" 4 .IX Item "query($id, $num_trks, $trk_offset1, $trk_offset2, $trk_offset3...)" .Vb 1 \& 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 => \*(Aqnewage\*(Aq, \& DISCID => \*(Aqdiscid\*(Aq, \& ARTIST => \*(Aqartist\*(Aq, \& ALBUM => \*(Aqtitle\*(Aq \& } \& \& NOTE: query() can return \*(Aqinexact\*(Aq matches and/or \*(Aqmultiple exact\*(Aq \& matches. The returned array is the given returned match(es). .Ve .IP "\fIsites()\fR" 4 .IX Item "sites()" .Vb 2 \& Parameters: \& None \& \& sites() returns an array reference of urls that can be used as \& a new HOST. .Ve .IP "getdiscid($device)" 4 .IX Item "getdiscid($device)" .Vb 6 \& Parameters: \& getdiscid($) takes the device you want to use. \& Basically this means \*(Aq/dev/cdrom\*(Aq or whatever on linux machines \& but it\*(Aqs 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 .Ve .IP "getdiscdata($device)" 4 .IX Item "getdiscdata($device)" .Vb 3 \& 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 => \*(Aqd00b3d10\*(Aq, \& NUM_TRKS => \*(Aq3\*(Aq, \& TRACKS => [ \& \*(Aq150\*(Aq, \& \*(Aq18082\*(Aq, \& \*(Aq29172\*(Aq \& ], \& SECONDS => \*(Aq2879\*(Aq \& } \& \& NOTE: A different return type/design may be developed. .Ve .SH "BUGS" .IX Header "BUGS" .Vb 8 \& 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. .Ve .SH "AUTHOR David Shultz Peter Pentchev " .IX Header "AUTHOR David Shultz Peter Pentchev " .SH "CREDITS Jeremy D. Zawodny Pete Jordon " .IX Header "CREDITS Jeremy D. Zawodny Pete Jordon " .SH "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." .IX Header "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."