| 1 | package Audio::File::Wma::Tag; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | ▶ | use base qw( Audio::File::Tag ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 1 | ▶ | use Audio::WMA; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 1 | our $VERSION = '0.02'; | |||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 1 | ▶ | sub init { | ||||||||||||||||||
|
Subroutine
init: called CC=3 SCAR=11.1
Pod
documented
| |||||||||||||||||||||
| 11 | 1 | my $self = shift; | |||||||||||||||||||
| 12 | 1 | ▶ | $self->{wma} = Audio::WMA->new( $self->{filename} ) or return; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 13 | 1 | my $tags = $self->{wma}->tags; | |||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 1 | $self->title( $tags->{TITLE} ); | |||||||||||||||||||
| 16 | 1 | $self->artist( $tags->{AUTHOR} ); | |||||||||||||||||||
| 17 | 1 | ▶ | $self->album( $tags->{ALBUMTITLE} || $tags->{ALBUM} ); | ||||||||||||||||||
|
Condition33%1/3
$tags->{'ALBUMTITLE'} || $tags->{'ALBUM'}
MC/DC0%0/2
$tags->{'ALBUMTITLE'} || $tags->{'ALBUM'}
$tags->{'ALBUMTITLE'}
$tags->{'ALBUM'}
Truth table33%1/3
A || B
A= $tags->{'ALBUMTITLE'}B= $tags->{'ALBUM'}
| |||||||||||||||||||||
| 18 | 1 | $self->comment( $tags->{DESCRIPTION} ); | |||||||||||||||||||
| 19 | 1 | $self->genre( $tags->{GENRE} ); | |||||||||||||||||||
| 20 | # It may be possible to parse the date out of | ||||||||||||||||||||
| 21 | # $obj->info->{creation_date} but I don't know the format: | ||||||||||||||||||||
| 22 | # it does not appear to be epoch seconds. | ||||||||||||||||||||
| 23 | # creation_date_unix also exists, but does not appear to be correct. | ||||||||||||||||||||
| 24 | 1 | $self->year( $tags->{DATE} ); | |||||||||||||||||||
| 25 | 1 | $self->track( $tags->{TRACKNUMBER} ); | |||||||||||||||||||
| 26 | 1 | $self->total( $tags->{TRACKTOTAL} ); | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 1 | return 1; | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 1 | 1; | |||||||||||||||||||