- Timestamp:
- 2012-10-02T05:41:18+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/audioDB/trunk/src/perllib/plugins/AudioDBPlugin.pm
r24399 r26275 90 90 push(@{$hashArgOptLists->{"ArgList"}},@{$arguments}); 91 91 push(@{$hashArgOptLists->{"OptList"}},$options); 92 93 92 94 93 my $ffte_self = new FFTExtractor($pluginlist, $inputargs, $hashArgOptLists,1); 94 95 my $jsme_self = undef; 96 eval("require MusicIRPlugin"); 97 if ($@) { 98 # Useful debugging statement below if there is a syntax error in the plugin 99 # and you expecting jSongMinerExtractor to be found 100 # print STDERR "$@\n"; 101 } 102 else { 103 print STDERR "Dynamically loading jSongMinerExtractor\n"; 104 push(@AudioDBPlugin::ISA,"MusicIRPlugin"); 105 $jsme_self = new MusicIRPlugin($pluginlist, $inputargs, $hashArgOptLists); 106 } 107 95 108 my $base_self = new BasePlugin($pluginlist, $inputargs, $hashArgOptLists); 96 109 97 my $self = BasePlugin::merge_inheritance($ffte_self,$base_self); 110 my $self = BasePlugin::merge_inheritance($ffte_self,$jsme_self,$base_self); 111 112 $self->{'jSongMinerExtractor-found'} = (defined $jsme_self) ? 1 : 0; 98 113 99 114 return bless $self, $class; … … 181 196 } 182 197 183 #we have no text - adds dummy text and NoText metadata 184 $self->add_dummy_text($doc_obj, $doc_obj->get_top_section()); 198 199 if ($self->{'jSongMinerExtractor-found'}) { 200 # calling this version of process has the side effect of setting dummy text 201 $self->MusicIRPlugin::process($pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli); 202 } 203 else { 204 #we have no text - adds dummy text and NoText metadata 205 $self->add_dummy_text($doc_obj, $doc_obj->get_top_section()); 206 } 185 207 186 208 return 1; … … 189 211 190 212 213 sub post_process_doc_obj { 214 my $self = shift (@_); 215 my ($pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_; 216 217 my $outhandle = $self->{'outhandle'}; 218 my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file); 219 220 # Opportunity to use jAudioMinerExtractor if dynamically and loaded 221 # 222 if ($self->{'retrieve_mir_metadata'} eq "true") { 223 my $top_section = $doc_obj->get_top_section(); 224 225 my $id3_titles = $doc_obj->get_metadata($top_section,"ex.ID3.Title"); 226 # my $id3_title = shift @$id3_titles || "Unknown"; 227 my $id3_title = shift @$id3_titles || undef; 228 229 my $id3_artists = $doc_obj->get_metadata($top_section,"ex.ID3.Artist"); 230 # my $id3_artist = shift @$id3_artists || "Unknown"; 231 my $id3_artist = shift @$id3_artists || undef; 232 233 my ($metadata_acexml_filename,$metadata_txt_filename) 234 = $self->retrieve_metadata($filename_full_path,$id3_title,$id3_artist); 235 236 if (-e $metadata_txt_filename) { 237 $self->parse_txt_metadata($doc_obj,$metadata_txt_filename); 238 } 239 240 $doc_obj->associate_file($metadata_acexml_filename, "jsongminer.xml", 241 "text/xml", $top_section); 242 } 243 244 245 return 1; 246 } 247 248 191 249 1; 192 250
Note:
See TracChangeset
for help on using the changeset viewer.