Changeset 26276 for gs2-extensions/music-ir-src
- Timestamp:
- 2012-10-02T05:43:31+13:00 (12 years ago)
- Location:
- gs2-extensions/music-ir-src/trunk/perllib/plugins
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/music-ir-src/trunk/perllib/plugins/MusicIRPlugin.pm
r24433 r26276 107 107 108 108 109 # do plugin specific processing of doc_obj 110 sub process {109 110 sub process_features { 111 111 my $self = shift (@_); 112 my ($ pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_;112 my ($base_dir, $file, $doc_obj) = @_; 113 113 114 114 my $outhandle = $self->{'outhandle'}; … … 132 132 } 133 133 134 } 135 136 # do plugin specific processing of doc_obj 137 sub process { 138 my $self = shift (@_); 139 my ($pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_; 140 141 my $top_section = $doc_obj->get_top_section(); 142 143 $self->process_features($base_dir,$file,$doc_obj); 134 144 135 145 #we have no text - adds dummy text and NoText metadata 136 146 $self->add_dummy_text($doc_obj, $doc_obj->get_top_section()); 137 147 148 my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file); 138 149 $doc_obj->associate_file($filename_full_path, "audio.mp3", "audio/mpeg", $top_section); 139 150 … … 151 162 if ($self->{'retrieve_mir_metadata'} eq "true") { 152 163 my $top_section = $doc_obj->get_top_section(); 164 153 165 my $id3_titles = $doc_obj->get_metadata($top_section,"ex.ID3.Title"); 154 155 my $id3_title = shift @$id3_titles || "Unknown";166 # my $id3_title = shift @$id3_titles || "Unknown"; 167 my $id3_title = shift @$id3_titles || undef; 156 168 157 169 my $id3_artists = $doc_obj->get_metadata($top_section,"ex.ID3.Artist"); 158 my $id3_artist = shift @$id3_artists || "Unkown"; 170 # my $id3_artist = shift @$id3_artists || "Unknown"; 171 my $id3_artist = shift @$id3_artists || undef; 159 172 160 173 my ($metadata_acexml_filename,$metadata_txt_filename) -
gs2-extensions/music-ir-src/trunk/perllib/plugins/jAudioExtractor.pm
r22439 r26276 102 102 my $music_ir_home = $ENV{'GEXT_MUSICIR'}; 103 103 104 $self->{'ace_xml_output_directory'} = &util::filename_cat($gsdl_home,"tmp"); # Set the directory to save the the ACE XML output files in 104 my $ace_xml_output_directory = &util::filename_cat($gsdl_home,"tmp"); # Set the directory to save the the ACE XML output files in 105 if (!util::dir_exists($ace_xml_output_directory)) { 106 util::mk_dir($ace_xml_output_directory); 107 } 108 $self->{'ace_xml_output_directory'} = $ace_xml_output_directory; 109 105 110 $self->{'jmir_directory'} = &util::filename_cat($music_ir_home,"lib","java"); # Set the directory holding the jMIR .jar files 111 106 112 107 113 … … 137 143 138 144 # Set the input file name in the file tag in the temporary file 145 if ($^O eq "cygwin") { 146 $input_music_file_path = `cygpath -m "$input_music_file_path"`; 147 $input_music_file_path=~ s/\s+$//; 148 } 139 149 $batch_file_contents =~ s/<file><\/file>/<file>$input_music_file_path<\/file>/; 140 150 141 151 # Set the feature vales save path in the temporary file 152 if ($^O eq "cygwin") { 153 $feature_descriptions_file_path = `cygpath -m "$feature_descriptions_file_path"`; 154 $feature_descriptions_file_path=~ s/\s+$//; 155 } 156 142 157 $batch_file_contents =~ s/<destination><\/destination>/<destination>$feature_descriptions_file_path<\/destination>/; 143 158 144 159 # Set the feature vales save path in the temporary file 160 if ($^O eq "cygwin") { 161 $feature_values_file_path = `cygpath -m "$feature_values_file_path"`; 162 $feature_values_file_path=~ s/\s+$//; 163 } 145 164 $batch_file_contents =~ s/<destination><\/destination>/<destination>$feature_values_file_path<\/destination>/; 146 165 … … 228 247 229 248 # Input and Output files to use are stored in the batch_file 230 my $jaudio_cmd = "java -Xmx1024M -jar jAudio.jar $convert_options -b \"$batch_file_path\""; 249 my $batch_file_path_os = $batch_file_path; 250 251 if ($^O eq "cygwin") { 252 $batch_file_path_os = `cygpath -w "$batch_file_path"`; 253 $batch_file_path_os =~ s/\s+$//; 254 } 255 256 my $jaudio_cmd = "java -Xmx1024M -jar jAudio.jar $convert_options -b \"$batch_file_path_os\""; 231 257 232 258 # Test the execution path -
gs2-extensions/music-ir-src/trunk/perllib/plugins/jSongMinerExtractor.pm
r24432 r26276 176 176 elsif (chdir($jmir_directory)) { 177 177 178 my $source_file_path_os = $source_file_path; 179 if ($^O eq "cygwin") { 180 $source_file_path_os = `cygpath -w "$source_file_path"`; 181 $source_file_path_os =~ s/\s+$//; 182 } 183 my $target_txt_file_path_os = $target_txt_file_path; 184 if ($^O eq "cygwin") { 185 $target_txt_file_path_os = `cygpath -w "$target_txt_file_path"`; 186 $target_txt_file_path_os =~ s/\s+$//; 187 } 188 my $target_acexml_file_path_os = $target_acexml_file_path; 189 if ($^O eq "cygwin") { 190 $target_acexml_file_path_os = `cygpath -w "$target_acexml_file_path"`; 191 $target_acexml_file_path_os =~ s/\s+$//; 192 } 178 193 179 194 my $jsongminer_cmd = "java -Xmx1024M -jar jSongMiner.jar $convert_options"; 180 $jsongminer_cmd .= " -title \"$id3_title\"" ;181 $jsongminer_cmd .= " -artist \"$id3_artist\"" ;182 $jsongminer_cmd .= " -audio \"$source_file_path \"";183 $jsongminer_cmd .= " -savetxtfile \"$target_txt_file_path \"";184 $jsongminer_cmd .= " -saveacexmlfile \"$target_acexml_file_path \"";195 $jsongminer_cmd .= " -title \"$id3_title\"" if defined $id3_title; 196 $jsongminer_cmd .= " -artist \"$id3_artist\"" if defined $id3_artist; 197 $jsongminer_cmd .= " -audio \"$source_file_path_os\""; 198 $jsongminer_cmd .= " -savetxtfile \"$target_txt_file_path_os\""; 199 $jsongminer_cmd .= " -saveacexmlfile \"$target_acexml_file_path_os\""; 185 200 186 201 if ($verbosity>2) { -
gs2-extensions/music-ir-src/trunk/perllib/plugins/jSongMinerMetadata.pm
r22439 r26276 228 228 229 229 # Input and Output files to use are stored in the batch_file 230 my $jaudio_cmd = "java -Xmx1024M -jar jAudio.jar $convert_options -b \"$batch_file_path\""; 230 my $batch_file_path_os = $batch_file_path; 231 232 if ($^O eq "cygwin") { 233 $batch_file_path_os = `cygpath -w "$batch_file_path"`; 234 $batch_file_path_os =~ s/\s+$//; 235 } 236 237 my $jaudio_cmd = "java -Xmx1024M -jar jAudio.jar $convert_options -b \"$batch_file_path_os\""; 231 238 232 239 # Test the execution path
Note:
See TracChangeset
for help on using the changeset viewer.