Changeset 22439


Ignore:
Timestamp:
2010-07-19T16:01:02+12:00 (12 years ago)
Author:
davidb
Message:

Initial work on supporting jSongMiner

Location:
gs2-extensions/music-ir/trunk/perllib/plugins
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/music-ir/trunk/perllib/plugins/MusicIRPlugin.pm

    r22430 r22439  
    2929use BasePlugin;
    3030use jAudioExtractor;
     31use jSongMinerExtractor;
    3132
    3233use strict;
     
    3738
    3839sub BEGIN {
    39     @MusicIRPlugin::ISA = ('BasePlugin', 'jAudioExtractor');
     40    @MusicIRPlugin::ISA = ('BasePlugin', 'jAudioExtractor', 'jSongMinerExtractor');
    4041}
    4142
     
    4445      { 'name' => "compute_mir_features",
    4546    'desc' => "{BasePlugin.compute_mir_features}",
     47    'type' => "enum",
     48    'list' => [{'name' => "true",  'desc' => "{common.true}"},
     49           {'name' => "false", 'desc' => "{common.false}"}],
     50    'deft' => "false",
     51    'reqd' => "no" },
     52      { 'name' => "retrieve_mir_metadata",
     53    'desc' => "{BasePlugin.retrieve_mir_metadata}",
    4654    'type' => "enum",
    4755    'list' => [{'name' => "true",  'desc' => "{common.true}"},
     
    7381
    7482   
    75     my $jac_self = new jAudioExtractor($pluginlist, $inputargs, $hashArgOptLists);
     83    my $jae_self = new jAudioExtractor($pluginlist, $inputargs, $hashArgOptLists,1);
     84    my $jsme_self = new jSongMinerExtractor($pluginlist, $inputargs, $hashArgOptLists,1);
    7685    my $base_self = new BasePlugin($pluginlist, $inputargs, $hashArgOptLists);
    7786
    78     my $self = BasePlugin::merge_inheritance($jac_self,$base_self);
     87    my $self = BasePlugin::merge_inheritance($jae_self,$jsme_self,$base_self);
    7988
    8089    return bless $self, $class;
     
    93102    $self->SUPER::begin(@_);
    94103    $self->jAudioExtractor::begin(@_);
     104    $self->jSongMinerExtractor::begin(@_);
    95105}
    96106
     
    122132    }
    123133
     134   
    124135    #we have no text - adds dummy text and NoText metadata
    125136    $self->add_dummy_text($doc_obj, $doc_obj->get_top_section());
     
    129140}
    130141
     142sub post_process_doc_obj {
     143    my $self = shift (@_); 
     144    my ($pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_;
     145
     146    my $outhandle = $self->{'outhandle'};
     147    my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file);
     148
     149    if ($self->{'retrieve_mir_metadata'} eq "true") {
     150    my $top_section = $doc_obj->get_top_section();
     151    my $id3_titles = $doc_obj->get_metadata($top_section,"ID3.Title");
     152
     153    my $id3_title = shift @$id3_titles || "Unknown";
     154
     155    my $id3_artists = $doc_obj->get_metadata($top_section,"ID3.Artist");
     156    my $id3_artist = shift @$id3_artists || "Unkown";
     157
     158    my $metadata_txt_filename = $self->retrieve_metadata($filename_full_path,$id3_title,$id3_artist);
     159    }
     160
     161
     162    return 1;
     163}
     164
    131165
    1321661;
  • gs2-extensions/music-ir/trunk/perllib/plugins/jAudioExtractor.pm

    r22436 r22439  
    11###########################################################################
    22#
    3 # jAudioExtractor - helper plugin that does office document conversion
    4 #                       using jodconverter combined with MIR
     3# jAudioExtractor - helper plugin that computers audio features for
     4#                        music information retrieval use, using jAudio
    55#
    66# A component of the Greenstone digital library software
Note: See TracChangeset for help on using the changeset viewer.