Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

musicbrainz::discid(3pm) [debian man page]

MusicBrainz::DiscID(3pm)				User Contributed Perl Documentation				  MusicBrainz::DiscID(3pm)

NAME
MusicBrainz::DiscID - Perl interface for the MusicBrainz libdiscid library SYNOPSIS
use MusicBrainz::DiscID; my $discid = MusicBrainz::DiscID->new(); if ( $disc->read() == 0 ) { print STDERR "Error: " . $discid->error_msg() . " "; exit(1); } print "DiscID: " . $discid->id() . " "; DESCRIPTION
MusicBrainz::DiscID is a class to calculate a MusicBrainz DiscID from an audio CD in the drive. The coding style is slightly different to the C interface to libdiscid, because it makes use of perl's Object Oriented functionality. MusicBrainz::DiscID::default_device() Returns a device string for the default device for this platform. MusicBrainz::DiscID::new( [$device] ) Construct a new DiscID object. As an optional argument the name of the device to read the ID from may be given. If you donOt specify a device here you can later read the ID with the read method. $discid->error_msg() Return a human-readable error message of the last error that occured. $discid->first_track_num() Return the number of the first track on this disc (usually 1). Returns undef if no ID was yet read. $discid->last_track_num() Return the number of the last track on this disc. $discid->id() Returns the DiscID as a string. Returns undef if no ID was yet read. $discid->last_track_num() Return the number of the last track on this disc. Returns undef if no ID was yet read. $discid->put( $first_track, $sectors, $offset1, $offset2, ... ) This function may be used if the TOC has been read earlier and you want to calculate the disc ID afterwards, without accessing the disc drive. $discid->read( [$device] ) Read the disc ID from the given device. If no device is given the default device of the platform will be used. On error, this function returns false and sets the error message which you can access $discid->error_msg(). $discid->sectors() Return the length of the disc in sectors. Returns undef if no ID was yet read. $discid->submission_url() Returns a submission URL for the DiscID as a string. Returns undef if no ID was yet read. $discid->track_length( $track_num ) Return the length of a track in sectors. $discid->track_offset( $track_num ) Return the sector offset of a track. $discid->webservice_url() Returns a Webservice URL for the DiscID as a string. Returns undef if no ID was yet read. SEE ALSO
<http://musicbrainz.org/doc/libdiscid> AUTHOR
Nicholas J. Humfrey <njh@aelius.com> COPYRIGHT AND LICENSE
Copyright (C) 2009 Nicholas J. Humfrey This program 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. 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. See the GNU General Public License for more details. perl v5.14.2 2011-11-15 MusicBrainz::DiscID(3pm)

Check Out this Related Man Page

FreeDB(3pm)						User Contributed Perl Documentation					       FreeDB(3pm)

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. perl v5.14.2 2011-11-15 FreeDB(3pm)
Man Page