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