File Coverage

blib/lib/Audio/File/Flac/Tag.pm
Criterion Covered Total %
statement 24 24 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 31 32 96.8


line stmt bran cond sub pod time code
1             package Audio::File::Flac::Tag;
2              
3 1     1   6 use strict;
  1         3  
  1         33  
4 1     1   6 use warnings;
  1         2  
  1         26  
5 1     1   5 use base qw( Audio::File::Tag );
  1         2  
  1         759  
6             use Audio::FLAC::Header
7              
8 1     1   972 our $VERSION = '0.03';
  1         17101  
  1         209  
9              
10             sub init {
11 1     1 1 2 my $self = shift;
12 1 50       12 $self->{flac} = Audio::FLAC::Header->new( $self->{filename} ) or return;
13 1         644 my $flactag = $self->{flac}->tags();
14              
15 1         16 $self->title( $flactag->{TITLE} );
16 1         9 $self->artist( $flactag->{ARTIST} );
17 1         7 $self->album( $flactag->{ALBUM} );
18 1         8 $self->comment( $flactag->{DESCRIPTION} );
19 1         8 $self->genre( $flactag->{GENRE} );
20 1         8 $self->year( $flactag->{DATE} );
21 1         11 $self->track( $flactag->{TRACKNUMBER} );
22 1         7 $self->total( $flactag->{TRACKTOTAL} );
23              
24 1         9 return 1;
25             }
26              
27             1;