use of org.fagu.fmv.utils.file.FileFinder.FileFound in project fmv by f-agu.
the class Bootstrap method findMovie.
// ---------------------------------------------------
/**
*/
private MovieFinder findMovie(File saveFile, File... srcFiles) throws IOException {
MovieFinder movieFinder = new MovieFinder(saveFile);
movieFinder.addInfoFile(new VolumeInfoFile());
movieFinder.addListener(new FileFinderListener<Movie>() {
private int count;
/**
* @see org.fagu.fmv.utils.file.FileFinderListener#eventFindPre(org.fagu.fmv.utils.file.FileFinder.FileFound)
*/
@Override
public void eventFindPre(FileFound fileFound) {
System.out.println(count + ": " + fileFound.getFileFound().getName());
++count;
}
/**
* @see org.fagu.fmv.utils.file.FileFinderListener#eventFindPost(FileFound, java.lang.Object)
*/
@Override
public void eventFindPost(FileFound fileFound, FileFinder<Movie>.InfosFile infosFile) {
Movie movie = infosFile.getMain();
MovieMetadatas videoMetadatas = movie.getMetadatas();
// Format format = videoMetadatas.getFormat();
VideoStream videoStream = videoMetadatas.getVideoStream();
Rotation rotate = videoStream.rotate();
// System.out.println(count + ": " + file.getName() + " " + infos); // .getFormat().creationDate()
System.out.println(" " + rotate + ", " + videoStream.handlerName());
}
});
for (File srcFile : srcFiles) {
movieFinder.find(srcFile);
}
return movieFinder;
}
Aggregations