line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Info.pm 11 2008-04-20 07:23:17Z dave $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
AudioFile::Info::MP3::Info - Perl extension to get info from MP3 files. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 DESCRIPTION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
This is a plugin for AudioFile::Info which uses MP3::ID3Lib to get |
12
|
|
|
|
|
|
|
data about MP files. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
See L for more details. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
package AudioFile::Info::MP3::Info; |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
1066
|
use 5.006; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
51
|
|
21
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
22
|
1
|
|
|
1
|
|
19
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
23
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
73
|
|
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
1
|
|
1364
|
use MP3::Info; |
|
1
|
|
|
|
|
43387
|
|
|
1
|
|
|
|
|
332
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
our $VERSION = sprintf "%d", '$Revision: 11 $ ' =~ /(\d+)/; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my %data = (artist => 'ARTIST', |
30
|
|
|
|
|
|
|
title => 'TITLE', |
31
|
|
|
|
|
|
|
album => 'ALBUM', |
32
|
|
|
|
|
|
|
track => 'TRACKNUM', |
33
|
|
|
|
|
|
|
year => 'YEAR', |
34
|
|
|
|
|
|
|
genre => 'GENRE'); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub new { |
37
|
1
|
|
|
1
|
1
|
16
|
my $class = shift; |
38
|
1
|
|
|
|
|
3
|
my $file = shift; |
39
|
1
|
|
|
|
|
7
|
my $obj = MP3::Info->new($file); |
40
|
|
|
|
|
|
|
|
41
|
1
|
|
|
|
|
2258
|
bless { obj => $obj }, $class; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
0
|
|
0
|
sub DESTROY {} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub AUTOLOAD { |
47
|
6
|
|
|
6
|
|
92
|
my $self = shift; |
48
|
|
|
|
|
|
|
|
49
|
6
|
|
|
|
|
8
|
our $AUTOLOAD; |
50
|
|
|
|
|
|
|
|
51
|
6
|
|
|
|
|
29
|
my ($pkg, $sub) = $AUTOLOAD =~ /(.+)::(\w+)/; |
52
|
|
|
|
|
|
|
|
53
|
6
|
50
|
|
|
|
22
|
die "Invalid attribute $sub" unless exists $data{$sub}; |
54
|
|
|
|
|
|
|
|
55
|
6
|
|
|
|
|
103
|
return $self->{obj}->{$data{$sub}}; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
__END__ |