| 1 | package Music::Tag::Auto; | ||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use strict; use warnings; use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 2 | our $VERSION = '.4101'; | |||||||||||||||||||||||||||
| 5 | 2 | ▶ | use base qw(Music::Tag::Generic); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | # Copyright © 2006 Edward Allen III. Some rights reserved. | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | # | ||||||||||||||||||||||||||||
| 10 | # You may distribute under the terms of either the GNU General Public | ||||||||||||||||||||||||||||
| 11 | # License or the Artistic License, as specified in the README file. | ||||||||||||||||||||||||||||
| 12 | # | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 2 | ▶ | sub default_options { | ||||||||||||||||||||||||||
|
Subroutine
default_options: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 15 | { | ||||||||||||||||||||||||||||
| 16 | 2 | autoplugin => { | |||||||||||||||||||||||||||
| 17 | mp3 => "MP3", | ||||||||||||||||||||||||||||
| 18 | m4a => "M4A", | ||||||||||||||||||||||||||||
| 19 | m4p => "M4A", | ||||||||||||||||||||||||||||
| 20 | mp4 => "M4A", | ||||||||||||||||||||||||||||
| 21 | m4b => "M4A", | ||||||||||||||||||||||||||||
| 22 | '3gp' => "M4A", | ||||||||||||||||||||||||||||
| 23 | ogg => "OGG", | ||||||||||||||||||||||||||||
| 24 | flac => "FLAC" | ||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 2 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=8 SCAR=21.0
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 2 | my $class = shift; | |||||||||||||||||||||||||||
| 31 | 2 | my $parent = shift; | |||||||||||||||||||||||||||
| 32 | 2 | ▶ | my $options = shift || {}; | ||||||||||||||||||||||||||
|
Condition50%1/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||||||||||||||||
| 33 | 2 | my $self = {}; | |||||||||||||||||||||||||||
| 34 | 2 | bless $self, $class; | |||||||||||||||||||||||||||
| 35 | 2 | $self->info($parent); | |||||||||||||||||||||||||||
| 36 | 2 | $self->options($options); | |||||||||||||||||||||||||||
| 37 | 2 | my $plugin = ""; | |||||||||||||||||||||||||||
| 38 | 2 | ▶ | if ( $self->info->get_data('filename') =~ /\.([^\.]*)$/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 39 | 2 | ▶ | if (exists $self->options->{autoplugin}->{lc($1)}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 40 | 1 | $plugin = $self->options->{autoplugin}->{lc($1)}; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | 2 | ▶ | if (($plugin) && ($self->info->available_plugins($plugin))) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$plugin and $self->info->available_plugins($plugin)
MC/DC50%1/2
$plugin and $self->info->available_plugins($plugin)
$plugin
$self->info->available_plugins($plugin)
Truth table66%2/3
A and B
A= $pluginB= $self->info->available_plugins($plugin)
| |||||||||||||||||||||||||||||
| 44 | 1 | ▶ | unless ( $plugin =~ /::/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 45 | 1 | $plugin = "Music::Tag::" . $plugin; | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | 1 | $self->status(1, "Auto loading plugin: $plugin"); | |||||||||||||||||||||||||||
| 48 | 1 | my $type = lc($plugin); | |||||||||||||||||||||||||||
| 49 | 1 | $type =~ s/^.*:://; | |||||||||||||||||||||||||||
| 50 | 1 | $self->status(2, "Adding filetype: $plugin"); | |||||||||||||||||||||||||||
| 51 | 1 | $self->info->set_data('filetype',$type); | |||||||||||||||||||||||||||
| 52 | 1 | ▶ | if($self->info->_has_module($plugin)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 53 | 1 | return $plugin->new( $self->info, $self->options ); | |||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | else { | ||||||||||||||||||||||||||||
| 57 | 1 | $self->error("Sorry, I can't find a plugin for ", $self->info->get_data('filename')); | |||||||||||||||||||||||||||
| 58 | 1 | return undef; | |||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 2 | 1; | |||||||||||||||||||||||||||
| 63 | __END__ | ||||||||||||||||||||||||||||