NAME

Net::FreeDB2::Entry - FreeDB/CDDB entry class

SYNOPSIS

See Net::FreeDB2.

DESCRIPTION

The Net::FreeDB2::Entry class contains information on FreeDB/CDDB entries (CDs).

CONSTRUCTOR

new ([OPT_HASH_REF])

Creates a new Net::FreeDB2::Entry object. Calls read () if option fh, fn or array_ref is passed through OPT_HASH_REF. Calls readDev () if option dev is passed.

Options for OPT_HASH_REF may include:

fh

IO::Handle to read from.

fn

File name to read from.

array_ref

ARRAY reference to read from.

dev

Device to readDev () from.

METHODS

read (OPT_HASH_REF)

Reads a FreeDB/CDDB database entry according to the option passed through HASH reference OPT_HASH_REF.

Throws an Error::Simple exception if the named file connot be opened, on syntax errors or if no read option are specified.

Options for OPT_HASH_REF may include:

fh

IO::Handle to read from.

fn

File name to read from.

array_ref

ARRAY reference to read from.

readDev (OPT_HASH_REF)

Reads frame offsets and the disc length using cdparanoia. Throws an Error::Simple exception if the cdparanoia command fails or did not produce any usable output.

Options for OPT_HASH_REF may include:

dev

Device for cdparanoia. If not specified, the cdparanoia default device is tried.

write (OPT_HASH_REF)

Writes a FreeDB/CDDB database entry according to the option passed. Throws an Error::Simple exception if the named file connot be opened or if no write option are specified.

Options for OPT_HASH_REF may include:

fh

IO::Handle to write to.

fn

File name to write to.

array_ref

ARRAY reference to write to.

setFrameOffset (TRACK, VALUE)

Set the frame offset track attribute. TRACK is the track number and VALUE is the value. Both TRACK and VALUE must be positive integers.

getFrameOffset ([TRACK])

Returns the frame offset track attribute(s). TRACK is the track number. If not specified, a list of all frame offsets is returned.

setDiscLength (VALUE)

Set the disc length attribute. VALUE is the value. Must be a positive integer.

getDiscLength ()

Returns the disc length attribute.

setRevision (VALUE)

Set the revision attribute. VALUE is the value.

getRevision ()

Returns the revision attribute.

setClientName (VALUE)

Set the client name. VALUE is the value.

getClientName ()

Returns the client name attribute.

setClientVersion (VALUE)

Set the client version. VALUE is the value.

getClientVersion ()

Returns the client version attribute.

setClientComment (VALUE)

Set the client comment. VALUE is the value.

getClientComment ()

Returns the client comment attribute.

setDiscID (VALUE)

Set the DISCID attribute. VALUE is the value.

getDiscID ()

Returns the DISCID attribute.

mkDiscID ()

Makes the DISCID out of the disc's frame offsets and disc length. Stores it through the setDiscID () method.

mkQuery ()

Makes the FreeDB/CDDB qurey for this disc and returns it. Calls mkDiscID () in the process.

setArtist (VALUE)

Set the artist attribute. VALUE is the value.

getDiscID ()

Returns the artist attribute.

setTitle (VALUE)

Set the title attribute. VALUE is the value.

getTitle ()

Returns the title attribute.

setDyear (VALUE)

Set the DYEAR attribute. VALUE is the value.

getDyear ()

Returns the DYEAR attribute.

setDgenre (VALUE)

Set the DGENRE attribute. VALUE is the value.

getDgenre ()

Returns the DGENRE attribute.

setTtitlen (TRACK, VALUE)

Set the TTITLEN track attribute. TRACK is the track number and VALUE is the value. TRACK must be a positive integer.

getTtitlen ([TRACK])

Returns the TTITLEN track attribute(s). TRACK is the track number. If not specified, a list of all TTITLEN is returned.

setExtd (VALUE)

Set the EXTD attribute. VALUE is the value.

setExtd ()

Returns the EXTD attribute.

setExttn (TRACK, VALUE)

Set the EXTTN track attribute. TRACK is the track number and VALUE is the value. TRACK must be a positive integer.

getExttn ([TRACK])

Returns the EXTTN track attribute(s). TRACK is the track number. If not specified, a list of all EXTTN is returned.

setDbLineLen (VALUE)

Set the database line length attribute. VALUE is the value. Throws an Error::Simple exception if VALUE isn't larger than 10.

getDbLineLen ()

Returns the database line length attribute. If empty, returns my variable $DB_LINE_LEN_DEF.

PRIVATE METHOD. Helper method for write (). Push the specified STRING string, precurred by the PRE string on the ARRAY referenced by ARRAY_REF. A too long a string (longer than getDbLineLen () characters) is chopped up like FreeDB/CDDB requires.

digitSum (NUMBER)

Helper method for mkDiscID (). Calculate the digit sum.

SEE ALSO

Net::FreeDB2::Connection::HTTP, Net::FreeDB2::Match and Net::FreeDB2::Response::Read

BUGS

None known.

HISTORY

First development: September 2002

AUTHOR

Vincenzo Zocca <Vincenzo@Zocca.com>

COPYRIGHT

Copyright 2002, Vincenzo Zocca.

LICENSE

This file is part of the Net::FreeDB2 module hierarchy for Perl by Vincenzo Zocca.

The Net::FreeDB2 module hierarchy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

The Net::FreeDB2 module hierarchy 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. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the Net::FreeDB2 module hierarchy; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA