| AudioFile-Info-MP3-Info documentation | Contained in the AudioFile-Info-MP3-Info distribution. |
AudioFile::Info::MP3::Info - Perl extension to get info from MP3 files.
This is a plugin for AudioFile::Info which uses MP3::ID3Lib to get data about MP files.
See AudioFile::Info for more details.
Creates a new object of class AudioFile::Info::MP3::Info. Usually called by AudioFile::Info::new.
Dave Cross, <dave@dave.org.uk>
Copyright 2003 by Dave Cross
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| AudioFile-Info-MP3-Info documentation | Contained in the AudioFile-Info-MP3-Info distribution. |
# # $Id: Info.pm 11 2008-04-20 07:23:17Z dave $ #
package AudioFile::Info::MP3::Info; use 5.006; use strict; use warnings; use Carp; use MP3::Info; our $VERSION = sprintf "%d", '$Revision: 11 $ ' =~ /(\d+)/; my %data = (artist => 'ARTIST', title => 'TITLE', album => 'ALBUM', track => 'TRACKNUM', year => 'YEAR', genre => 'GENRE'); sub new { my $class = shift; my $file = shift; my $obj = MP3::Info->new($file); bless { obj => $obj }, $class; } sub DESTROY {} sub AUTOLOAD { my $self = shift; our $AUTOLOAD; my ($pkg, $sub) = $AUTOLOAD =~ /(.+)::(\w+)/; die "Invalid attribute $sub" unless exists $data{$sub}; return $self->{obj}->{$data{$sub}}; } 1; __END__