1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
--- pacpl.orig 2008-08-16 21:31:57.000000000 -0600
+++ pacpl 2009-02-15 09:21:16.000000000 -0700
@@ -25,18 +25,6 @@
use File::Find;
use File::Spec::Functions qw(rel2abs);
-# Tagging modules
-use Ogg::Vorbis::Header;
-use MP3::Tag;
-use Audio::FLAC::Header;
-use MP4::Info;
-use Audio::WMA;
-use Audio::Musepack;
-use Audio::APETags;
-
-# CDDB module
-use CDDB_get qw(get_cddb);
-
# non-encoder/decoder related options
my
(
@@ -202,8 +190,8 @@
# load po file and store in %lang hash
sub load_lang {
-
- my $po = "$po_dir/$ENV{LANG}.po";
+ my $lang = $ENV{LANG} || 'en_US';
+ my $po = "$po_dir/$lang.po";
$po =~ s/\.UTF-8//i if $po =~ /UTF-8/i;
$po =~ s/\.utf8//i if $po =~ /utf8/i;
$po =~ s/_\w+// if not -e $po;
@@ -1541,6 +1529,17 @@
# load codecs.conf file
load_codecs() if -e $codecs_conf;
+# Now that %run is populated, verify tagging modules
+for my $format (keys %run){
+ if(defined $run{$format}{TAGS}{MODULE}){
+ eval "require $run{$format}{TAGS}{MODULE}";
+ @{$run{$format}{TAGS}}{qw(READ WRITE)} = (0,0) if $@;
+ }
+}
+
+eval "require CDDB_get";
+$nocddb = 1 if $@;
+
my $out_name = $outfile;
my $out_dir = $outdir;
@@ -2177,7 +2176,7 @@
}
case 'wma' {
- my $wma_tag = Audio::WMA->new($in_file)->tags();
+ my $wma_tag = $tag_module->new($in_file)->tags();
$tag_name{title} = $wma_tag->{TITLE} if $wma_tag->{TITLE};
$tag_name{track} = $wma_tag->{TRACKNUMBER} if $wma_tag->{TRACKNUMBER};
@@ -2198,12 +2197,13 @@
sub write_tags {
my ($out_file, $out_format) = @_;
+ my $tag_module = $run{$out_format}{TAGS}{MODULE};
my $tag_m;
switch ($out_format) {
case 'mp3' {
- $tag_m = MP3::Tag->new("$out_file");
+ $tag_m = $tag_module->new("$out_file");
# ID3v2 Tags
unless(exists($tag_m->{ID3v2})) { $tag_m->new_tag("ID3v2"); }
@@ -2236,7 +2236,7 @@
}
case 'ogg' {
- $tag_m = Ogg::Vorbis::Header->new("$out_file");
+ $tag_m = $tag_module->new("$out_file");
# this prevents duplicate tags =)
$tag_m->clear_comments();
@@ -2257,7 +2257,7 @@
}
case /fla|flac/ {
- $tag_m = Audio::FLAC::Header->new("$out_file");
+ $tag_m = $tag_module->new("$out_file");
my $tag_i = $tag_m->tags();
$tag_i->{TITLE} = "$tag_name{title}" if $tag_name{title};
@@ -2446,7 +2446,7 @@
$ripconfig{DEVICE} = $device;
$ripconfig{CDDB_INPUT} = $config{CDDB_INPUT};
- %cd = get_cddb(\%ripconfig);
+ %cd = CDDB_get::get_cddb(\%ripconfig);
if (not $cd{title}) {
pnotice("no_cddb","",2);
|