blib/lib/AudioFile/Info/MP4/Info.pm

filter: Statementstmt 60.7% 17 / 28 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 62.5% 5 / 8 Podpod 100% 1 / 1 totaltotal 52.2% 23 / 44 CC 5 SCAR 21.0
CC
5
Cov
50%
AUTOLOAD
20.0
new
6.0
BEGIN
1.0
CRAP 8.2
« lib/AudioFile/Info/Build.pm ↑ Summary
1 #
2 # $Id: $
3 #
4  
5 =head1 NAME
6  
7 AudioFile::Info::MP4::Info - Perl extension to get info from MP4 files.
8  
9 =head1 DESCRIPTION
10  
11 Extracts data from an MP4 file using the CPAN module
12 MP4::Info.
13  
14 See L<AudioFile::Info> for more details.
15  
16 =cut
17  
18 package AudioFile::Info::MP4::Info;
19  
20 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 2 ▶use MP4::Info;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 2 our $VERSION = "0.6";
28  
29 2 my %data = (artist => ['ART', 'ARTIST'],
30 title => ['NAM', 'TITLE'],
31 album => ['ALB', 'ALBUM'],
32 track => ['TRACKNUM', 'TRKN'],
33 year => ['DATE', 'YEAR'],
34 genre => ['GNRE', 'GENRE']);
35  
36 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
37 0 my $class = shift;
38 0 my $file = shift;
39 0 ▶ my $obj = get_mp4tag($file) || die "Couldn't get MP4 info for $file";
Condition0%0/2
get_mp4tag($file) || die("Couldn't get MP4 info for $file")
l!l
00
MC/DC0%0/1
get_mp4tag($file) || die("Couldn't get MP4 info for $file")
get_mp4tag($file)
Truth table0%0/2
A
A= get_mp4tag($file)
Aresult
11
00
40 0 bless { obj => $obj }, $class;
41 }
42  
43 0 ▶sub DESTROY {}
Subroutine DESTROY: not called CC=1 SCAR=0.0
44  
45 0 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: not called CC=4 SCAR=30.0
46 0 our $AUTOLOAD;
47  
48 0 my ($pkg, $sub) = $AUTOLOAD =~ /(.*)::(\w+)/;
49  
50 0 ▶ die "Invalid attribute $sub" unless $data{$sub};
Branch: 1 branch
BranchTrueFalseTotal
unless $data{$sub} 0 0 0
51 0 foreach my $try (@{$data{$sub}}) {
52 0 ▶ return $_[0]->{obj}->{$try} if defined $_[0]->{obj}->{$try};
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[0]{"obj"}{$try} 0 0 0
53 }
54 0 return undef;
55 }
56  
57  
58 2 1;
59 __END__
« lib/AudioFile/Info/Build.pm ↑ Summary